@geogirafe/lib-geoportal 1.1.0-dev.2334445027 → 1.1.0-dev.2334458755

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import FeatureToGridDataById from '../../../tools/featuretogriddatabyid.js';
2
2
  import { TabulatorFull as Tabulator } from 'tabulator-tables';
3
3
  import { getUid } from 'ol/util.js';
4
4
  import ColumnAliasHelper from '../../../tools/utils/aliases.js';
5
+ import { linkify } from '../../../tools/utils/utils.js';
5
6
  const geometryColumns = new Set(['geom', 'the_geom', 'geometry']);
6
7
  export default class SelectionTabulatorManager {
7
8
  featureToGridData;
@@ -140,10 +141,13 @@ export default class SelectionTabulatorManager {
140
141
  const columns = entry.columns;
141
142
  const notOlProperties = entry.notOlProperties;
142
143
  for (const [_, row] of Object.entries(notOlProperties)) {
143
- for (const [key, _] of Object.entries(row)) {
144
+ for (const [key, value] of Object.entries(row)) {
144
145
  if (!columns.includes(key)) {
145
146
  delete row[key];
146
147
  }
148
+ else if (typeof value === 'string') {
149
+ row[key] = linkify(value);
150
+ }
147
151
  }
148
152
  }
149
153
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geomapfish.dev"
7
7
  },
8
- "version": "1.1.0-dev.2334445027",
8
+ "version": "1.1.0-dev.2334458755",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.1.0-dev.2334445027", "build":"2334445027", "date":"18/02/2026"}
1
+ {"version":"1.1.0-dev.2334458755", "build":"2334458755", "date":"18/02/2026"}
@@ -168,7 +168,7 @@ export const applyFeaturesToSelection = (features, state) => {
168
168
  state.selection.highlightedFeatures = [];
169
169
  }
170
170
  };
171
- const urlRegExp = /(https?:\/\/[^"<]*?(?=\s|$|<\/[^a]>))/gi;
171
+ const urlRegExp = /(https?:\/\/[^"'<]*?(?=\s|$|<\/[^a]>))/gi;
172
172
  const telRegExp = /((\b(0041|0)|\B\+41)(\s?\(0\))?(\s)?[1-9]{2}(\s)?\d{3}(\s)?\d{2}(\s)?\d{2}\b)/gi;
173
173
  const mailRegExp = /(^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$)/gi; //NOSONAR(typescript:S5843) As this is the official Regular Expression, we will not mess around with it
174
174
  export const linkify = (str) => {
@@ -69,6 +69,11 @@ it('should return already wrapped link unchanged', () => {
69
69
  const linkifiedLink = linkify(alreadyWrappedLink);
70
70
  expect(linkifiedLink).toEqual(alreadyWrappedLink);
71
71
  });
72
+ it('should return already wrapped link using single quotation mark instead of quotation mark unchanged', () => {
73
+ const alreadyWrappedLink = "<a href='https://intercapi.vd.ch/territoire/intercapi/faces?type=grundstueck_grundbuch_auszug&bfs=5890&n1=210' target='_blank'>Cliquer ici</a>";
74
+ const linkifiedLink = linkify(alreadyWrappedLink);
75
+ expect(linkifiedLink).toEqual(alreadyWrappedLink);
76
+ });
72
77
  it('should return phone number with country code wrapped in Anchor-Element', () => {
73
78
  const phoneNumber = '+41 61 267 99 53';
74
79
  const linkifiedPhoneNumber = linkify(phoneNumber);