From 242f26fa67e6fbfcf1f924c968057c44d29fbd06 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 5 Dec 2019 20:11:41 +0900 Subject: [PATCH] Extract special inputs for AutoLinker into a separate tab --- src/views/settings/components/Inputs.vue | 27 ++----- .../inputComponents/AutoLinkerInput.vue | 70 +++++++++++++++++++ 2 files changed, 75 insertions(+), 22 deletions(-) create mode 100644 src/views/settings/components/inputComponents/AutoLinkerInput.vue diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index 280e4827..83ca7345 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -148,13 +148,8 @@ class="value-input" @input="updateSetting($event, settingGroup.group, settingGroup.key, setting.key)"/> -
- - -
-
- - +
+
@@ -192,11 +187,13 @@ import AceEditor from 'vue2-ace-editor' import 'brace/mode/elixir' import 'default-passive-events' +import AutoLinkerInput from './inputComponents/AutoLinkerInput' export default { name: 'Inputs', components: { - editor: AceEditor + editor: AceEditor, + AutoLinkerInput }, props: { customLabelWidth: { @@ -328,18 +325,6 @@ export default { }, {}) this.updateSetting({ ...updatedValue, '': { url: '', mime_type: '' }}, this.settingGroup.group, 'assets', 'mascots') }, - autoLinkerBooleanValue(key) { - const value = this.data[this.setting.key] - return typeof value === 'string' || typeof value === 'number' - }, - autoLinkerIntegerValue(key) { - const value = this.data[this.setting.key] - return value || 0 - }, - autoLinkerStringValue(key) { - const value = this.data[this.setting.key] - return value || '' - }, deleteEditableKeywordRow(index) { const filteredValues = this.editableKeywordData(this.data).filter((el, i) => index !== i) const updatedValue = filteredValues.reduce((acc, el, i) => { @@ -413,8 +398,6 @@ export default { this.updateSetting(valueToSend, this.settingGroup.group, 'rate_limit', input) } }, - processAutoLinker(value, tab, inputName, childName) { - }, processNestedData(value, group, key, parentInput, parentType, childInput, childType) { const valueExists = value => value[group] && value[group][key] && value[group][key][parentInput] const updatedValueForState = valueExists(this.settings) diff --git a/src/views/settings/components/inputComponents/AutoLinkerInput.vue b/src/views/settings/components/inputComponents/AutoLinkerInput.vue new file mode 100644 index 00000000..0a305f9b --- /dev/null +++ b/src/views/settings/components/inputComponents/AutoLinkerInput.vue @@ -0,0 +1,70 @@ + + + + +