Disable tabs that don't have settings that can be changed

This commit is contained in:
Angelina Filippova 2020-05-15 01:24:12 +03:00
parent 9c28eddec1
commit 88f2859f47

View file

@ -33,7 +33,7 @@
<el-tab-pane
v-for="(value, componentName) in tabs"
:label="$t(value.label)"
:disabled="configDisabled"
:disabled="configDisabled || settingsCantBeChanged(value.settings)"
:key="componentName"
:name="componentName"
lazy>
@ -227,6 +227,11 @@ export default {
: { value: `${searchObj.label} in ${searchObj.groupLabel}`, group: searchObj.groupKey, key: searchObj.key }
})
cb(results)
},
settingsCantBeChanged(settings) {
const existingSettings = settings.filter(setting =>
this.$store.state.settings.description.findIndex(el => el.key === setting) !== -1)
return existingSettings.length === 0
}
}
}