Skip to content

Commit

Permalink
Tab visibility due expression value (#612)
Browse files Browse the repository at this point in the history
* Close formstructure of layer. This prevent to has the same structure for multiple layer features

* Comment

* Refactor. Pass already cloned and reactive tab objects items of tabs array

(cherry picked from commit e580c1e)
  • Loading branch information
volterra79 authored and github-actions[bot] committed Apr 15, 2024
1 parent 0757adc commit af18d33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/GlobalTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
},
async created() {
this.unwatch = [];
for (const tab of this.tabs) {
this.tabs.forEach((tab , i) => {
if (tab.visibility_expression) {
if (tab.visible === undefined) {
this.$set(tab, 'visible', 0);
Expand Down Expand Up @@ -212,7 +212,8 @@
}
}
this.ids.push(`tab_${getUniqueDomId()}`);
}
});

this.root_tabs = [];
if (!this.group){
const nodes = [];
Expand Down
3 changes: 2 additions & 1 deletion src/components/QueryResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@
return this.relationsAttributesSubset(elements).length;
},
getLayerFormStructure(layer) {
return layer.formStructure.structure;
//need to clone structure objects in deep and set reactive with Vue.observable
return layer.formStructure.structure.map(n => Vue.observable(structuredClone(n)));
},
isAttributeOrTab(layer, item) {
const isField = item.field_name !== undefined;
Expand Down

0 comments on commit af18d33

Please sign in to comment.