Skip to content

Commit

Permalink
πŸ› Filter only editable relations that are visible to current user (re…
Browse files Browse the repository at this point in the history
…f: toolbox child layers) (#148)

* πŸ› Fix editable relation check for child layers in toolbox

* code format

* 🎨 Clean code - https://github.com/g3w-suite/g3w-client-plugin-editing/pull/148/files/d9443f9b310bec1578cbfaa23a1121daea7e0e1a

---------

Co-authored-by: Raruto <Raruto@users.noreply.github.com>
(cherry picked from commit 72249c1)
  • Loading branch information
volterra79 authored and github-actions[bot] committed Feb 24, 2025
1 parent d981942 commit ca128fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions toolboxes/toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ export class ToolBox extends G3WObject {
const is_table = Layer.LayerTypes.TABLE === layer.getType();
const isMultiGeometry = geometryType && Geometry.isMultiGeometry(geometryType);
const iconGeometry = is_vector && (is_point ? 'Point' : is_line ? 'Line' : 'Polygon');
//@since 3.9.0 Check if layer has relation layers editable
//@since 3.9.0 Check if layer has "relation layers" that are editable
const editable_relations = layer.getRelations().getArray()
.filter(relation => {
const l = CatalogLayersStoresRegistry.getLayerById(getRelationId({ layerId: layer.getId(), relation }));
return l.isEditable();
})
.map(r => r);
.filter(relation => {
const l = CatalogLayersStoresRegistry.getLayerById(getRelationId({ layerId: layer.getId(), relation }));
return l && l.isEditable();
});

this._start = false;

/** constraint loading features to a filter set */
Expand Down

0 comments on commit ca128fc

Please sign in to comment.