@geogirafe/lib-geoportal 1.3.0-dev.3060317043 → 1.3.0-dev.3079206142

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.
@@ -254,7 +254,7 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
254
254
  }
255
255
  }
256
256
  canDelete() {
257
- return this.getFeatureId() !== null && !!this.layer?.hasPermission('DELETE');
257
+ return this.getFeatureId() !== null;
258
258
  }
259
259
  async onSelectFeature(selectedFeatures) {
260
260
  if (this.featureIsModified() && !(await this.confirmDiscardChanges())) {
@@ -43,7 +43,6 @@ export default class EditFormComponent extends GirafeHTMLElement {
43
43
  * including loose equality (==) to handle numbers represented as strings.
44
44
  */
45
45
  private fuzzyCompareForValueListEntry;
46
- getFeatureId(): string | null;
47
46
  protected connectedCallback(): void;
48
47
  }
49
48
  export {};
@@ -150,7 +150,8 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
150
150
  return rawFormValue === 'true';
151
151
  }
152
152
  else if (property.isValueListProperty) {
153
- return rawFormValue === this.emptySelectOption ? null : rawFormValue;
153
+ // Use loose equality because the dropdown value is always a string but the value in the value list could be a number
154
+ return property.valueListEntries?.find((entry) => entry.value == rawFormValue)?.value ?? null;
154
155
  }
155
156
  return rawFormValue === '' ? null : rawFormValue;
156
157
  }
@@ -229,6 +230,9 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
229
230
  }
230
231
  getCurrentValue(property) {
231
232
  const value = this.feature?.getProperties()[property.name] ?? null;
233
+ if (property.isPrimaryKey) {
234
+ return this.feature?.getId() ?? null;
235
+ }
232
236
  if (['datetime', 'date-time'].includes(property.format ?? '')) {
233
237
  return DateUtils.fromApiToLocalDateTime(value, 'seconds');
234
238
  }
@@ -248,13 +252,6 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
248
252
  fuzzyCompareForValueListEntry(property, value) {
249
253
  return property.valueListEntries?.find((entry) => entry.title == value || entry.value == value)?.value ?? null;
250
254
  }
251
- getFeatureId() {
252
- if (this.featureSchema?.pkPropertyName) {
253
- const featureId = this.feature?.getId();
254
- return this.isNullOrUndefinedOrBlank(featureId) ? null : `${featureId}`;
255
- }
256
- return null;
257
- }
258
255
  connectedCallback() {
259
256
  super.connectedCallback();
260
257
  this.schemaValidator = new OgcApiFeaturesSchemaValidator(this.context);
@@ -264,6 +261,3 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
264
261
  __decorate([
265
262
  UsedInTemplateOnly()
266
263
  ], EditFormComponent.prototype, "getInputType", null);
267
- __decorate([
268
- UsedInTemplateOnly()
269
- ], EditFormComponent.prototype, "getFeatureId", null);
@@ -21,5 +21,9 @@ export declare class OapifLayer {
21
21
  * Validity decides if this layer can be used for editing
22
22
  */
23
23
  get valid(): boolean;
24
+ /**
25
+ * If permissions are undefined, this means the server hasn't specified which CRUD operations are allowed.
26
+ * In this case, all operations are assumed to be allowed.
27
+ */
24
28
  hasPermission(permission: EditingPermission): boolean;
25
29
  }
@@ -30,7 +30,11 @@ export class OapifLayer {
30
30
  get valid() {
31
31
  return !!this.storageCrs && !!this.schema && !!this.geometryType && !!this.geometryLayout;
32
32
  }
33
+ /**
34
+ * If permissions are undefined, this means the server hasn't specified which CRUD operations are allowed.
35
+ * In this case, all operations are assumed to be allowed.
36
+ */
33
37
  hasPermission(permission) {
34
- return this.permissions?.includes(permission) ?? false;
38
+ return this.permissions === undefined ? true : (this.permissions.includes(permission) ?? false);
35
39
  }
36
40
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geogirafe.org"
7
7
  },
8
- "version": "1.3.0-dev.3060317043",
8
+ "version": "1.3.0-dev.3079206142",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.3.0-dev.3060317043", "build":"3060317043", "date":"12/11/2026"}
1
+ {"version":"1.3.0-dev.3079206142", "build":"3079206142", "date":"17/11/2026"}