Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Filter only editable relations that are visible to current user (ref: toolbox child layers) #148

Merged
merged 3 commits into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading