From 58beed0de51a390e0d788f83d99e401c5f2673a8 Mon Sep 17 00:00:00 2001 From: flisowna Date: Mon, 27 Feb 2023 22:33:40 +0100 Subject: [PATCH] make urls clickable in popups and text selectable --- packages/nc-gui/components/smartsheet/Map.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Map.vue b/packages/nc-gui/components/smartsheet/Map.vue index 6f3574587f..150cb6dbd4 100644 --- a/packages/nc-gui/components/smartsheet/Map.vue +++ b/packages/nc-gui/components/smartsheet/Map.vue @@ -196,11 +196,17 @@ watch([formattedData, mapMetaData, markersClusterGroupRef], () => { const listItems = Object.entries(row.row) .filter(([key, val]) => val !== null) .map(([key, val]) => { - const prettyVal = typeof val === 'object' || Array.isArray(val) ? JSON.stringify(val) : val + let prettyVal = val + if (val !== null && (typeof val === 'object' || Array.isArray(val))) { + prettyVal = JSON.stringify(val) + } else if (typeof val === 'string' && (val.startsWith('http://') || val.startsWith('https://'))) { + prettyVal = `${val}` + } return `
  • ${key}:
    ${prettyVal}
  • ` }) .join('') - const popupContent = `` + + const popupContent = `` const [lat, long] = primaryGeoDataValue.split(';').map(parseFloat) @@ -276,4 +282,7 @@ const count = computed(() => paginationData.value.totalRows) max-height: 255px; overflow: scroll; } +.selectable { + user-select: text; +}