From 383397f68567ebcb1f9715008b41e6c9c7366121 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sun, 17 Nov 2019 22:37:22 +0900 Subject: [PATCH] Render MRF tab using data from API --- src/views/settings/components/Inputs.vue | 18 +- src/views/settings/components/MRF.vue | 378 +++++++++------------- src/views/settings/components/Setting.vue | 11 +- src/views/settings/components/Upload.vue | 2 +- 4 files changed, 176 insertions(+), 233 deletions(-) diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index 0e1bbc77..ed3b540c 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -67,6 +67,14 @@ @input="updateSetting($event, settingGroup.key, setting.key)"> +
+
+ : + + +
+ +
: @@ -233,7 +241,6 @@ export default { }, methods: { addRowToEditableKeyword() { - console.log(this.settingGroup.key, this.setting.key) const updatedValue = this.editableKeywordData(this.data).reduce((acc, el, i) => { return { ...acc, [el[0]]: el[1] } }, {}) @@ -247,15 +254,17 @@ export default { console.log(updatedValue) this.updateSetting(updatedValue, this.settingGroup.key, this.setting.key) }, + editableKeywordWithInput(key) { + return key === ':replace' + }, editableKeywordWithInteger(type) { return Array.isArray(type) ? type.includes('keyword') && type.includes('integer') : false }, editableKeywordWithSelect(type) { - return Array.isArray(type) - ? type.includes('keyword') && type.findIndex(el => el.includes('list') && el.includes('string')) !== -1 - : false + return type === 'map' || + (Array.isArray(type) && type.includes('keyword') && type.findIndex(el => el.includes('list') && el.includes('string')) !== -1) }, editableKeywordData(data) { return Object.keys(data).map(key => [key, data[key]]) @@ -296,6 +305,7 @@ export default { (type.includes('list') && type.includes('atom')) || (type.includes('list') && type.includes('module')) || (type.includes('module') && type.includes('atom')) || + (type.includes('regex') && type.includes('string')) || this.setting.key === ':args' ) }, diff --git a/src/views/settings/components/MRF.vue b/src/views/settings/components/MRF.vue index 3d3c9c07..2a7b351e 100644 --- a/src/views/settings/components/MRF.vue +++ b/src/views/settings/components/MRF.vue @@ -1,141 +1,33 @@