diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js index 04416777..c7dca1b6 100644 --- a/src/store/modules/normalizers.js +++ b/src/store/modules/normalizers.js @@ -271,19 +271,21 @@ const wrapValues = (settings, currentState) => { export const formSearchObject = description => { const parseNestedSettings = (description, label, key) => description.reduce((acc, setting) => { const searchArray = _.compact([setting.key, setting.label, setting.description]).map(el => el.toLowerCase()) + const resultObject = { label: setting.label, key: setting.key || setting.group, groupKey: key, groupLabel: label, search: searchArray } if (setting.children) { - const updatedAcc = [...acc, { label: setting.label, key: setting.key, groupKey: key, groupLabel: label, search: searchArray }] - return [...updatedAcc, ...parseNestedSettings(setting.children, setting.label, setting.key)] + const updatedAcc = [...acc, resultObject] + return [...updatedAcc, ...parseNestedSettings(setting.children, label, key)] } - return [...acc, { label: setting.label, key: setting.key, groupKey: key, groupLabel: label, search: searchArray }] + return [...acc, resultObject] }, []) return description.reduce((acc, setting) => { const searchArray = _.compact([setting.key, setting.label, setting.description]).map(el => el.toLowerCase()) + const resultObject = { label: setting.label, key: setting.key || setting.group, groupKey: setting.key || setting.group, groupLabel: setting.label, search: searchArray } if (setting.children) { - const updatedAcc = [...acc, { label: setting.label, key: setting.key, groupKey: setting.key, groupLabel: setting.label, search: searchArray }] - return [...updatedAcc, ...parseNestedSettings(setting.children, setting.label, setting.key)] + const updatedAcc = [...acc, resultObject] + return [...updatedAcc, ...parseNestedSettings(setting.children, setting.label, setting.key || setting.group)] } - return [...acc, { label: setting.label, key: setting.key, groupKey: setting.key, groupLabel: setting.label, search: searchArray }] + return [...acc, resultObject] }, []) } diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index 615aa126..981270cf 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -5,7 +5,7 @@ :label-width="customLabelWidth" :class="labelClass" :style="`margin-left:${margin}px;margin-bottom:0`" - :data-search="setting.key"> + :data-search="setting.key || setting.group"> {{ setting.label }} @@ -37,13 +37,13 @@ v-if="setting.type === 'string' || (setting.type.includes('string') && setting.type.includes('atom'))" :value="inputValue" :placeholder="setting.suggestions ? setting.suggestions[0] : null" - :data-search="setting.key" + :data-search="setting.key || setting.group" class="input" @input="update($event, settingGroup.group, settingGroup.key, settingParent, setting.key, setting.type, nested)"/> @@ -69,7 +69,7 @@ @@ -88,7 +88,7 @@ v-if="setting.type === 'atom'" :value="inputValue" :placeholder="setting.suggestions[0] ? setting.suggestions[0].substr(1) : ''" - :data-search="setting.key" + :data-search="setting.key || setting.group" class="input" @input="update($event, settingGroup.group, settingGroup.key, settingParent, setting.key, setting.type, nested)"> diff --git a/src/views/settings/components/Setting.vue b/src/views/settings/components/Setting.vue index d676da29..9794cc63 100644 --- a/src/views/settings/components/Setting.vue +++ b/src/views/settings/components/Setting.vue @@ -1,6 +1,6 @@