From 3f82738d86b59108b5b9310912f0ba3ff00399e4 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sat, 11 Jul 2020 03:28:53 +0300 Subject: [PATCH] Render editable keyword input for settings that have type ['list', 'tuple'] --- src/views/settings/components/Inputs.vue | 4 +++- .../components/inputComponents/EditableKeywordInput.vue | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index 7545b5aa..ef4bf246 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -254,7 +254,8 @@ export default { } }, keywordData() { - if (this.settingParent.length > 0) { + if (this.settingParent.length > 0 || + (Array.isArray(this.setting.type) && this.setting.type.includes('tuple') && this.setting.type.includes('list'))) { return Array.isArray(this.data[this.setting.key]) ? this.data[this.setting.key] : [] } return Array.isArray(this.data) ? this.data : [] @@ -286,6 +287,7 @@ export default { return type === 'map' || (Array.isArray(type) && type.includes('keyword') && type.includes('integer')) || (Array.isArray(type) && type.includes('keyword') && type.includes('string')) || + (Array.isArray(type) && type.includes('tuple') && type.includes('list')) || (Array.isArray(type) && type.includes('keyword') && type.findIndex(el => el.includes('list') && el.includes('string')) !== -1) }, getFormattedDescription(desc) { diff --git a/src/views/settings/components/inputComponents/EditableKeywordInput.vue b/src/views/settings/components/inputComponents/EditableKeywordInput.vue index d0d88fff..ff641756 100644 --- a/src/views/settings/components/inputComponents/EditableKeywordInput.vue +++ b/src/views/settings/components/inputComponents/EditableKeywordInput.vue @@ -64,7 +64,10 @@ export default { return Array.isArray(this.setting.type) && this.setting.type.includes('keyword') && this.setting.type.includes('integer') }, editableKeywordWithString() { - return Array.isArray(this.setting.type) && this.setting.type.includes('keyword') && this.setting.type.includes('string') + return Array.isArray(this.setting.type) && ( + (this.setting.type.includes('keyword') && this.setting.type.includes('string')) || + (this.setting.type.includes('tuple') && this.setting.type.includes('list')) + ) }, isDesktop() { return this.$store.state.app.device === 'desktop'