From 208431dd009e4b4148caecfe0b2be4738813298d Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 18 Sep 2020 02:48:30 +0300 Subject: [PATCH] Add Terms of Services on Other tab --- src/lang/en.js | 3 ++- src/store/modules/settings.js | 13 +++++++++++-- src/views/settings/components/Instance.vue | 2 +- src/views/settings/components/Other.vue | 19 ++++++++++++++++++- .../inputComponents/EditorInput.vue | 12 ++++++++---- 5 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/lang/en.js b/src/lang/en.js index f1ef9c8a..7adc0f83 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -439,7 +439,8 @@ export default { changeImage: 'Change image', uploadImage: 'Upload image', remove: 'Remove', - instancePanel: 'Instance Panel Document' + instancePanel: 'Instance Panel Document', + termsOfServices: 'Terms of Service' }, invites: { inviteTokens: 'Invite tokens', diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index eac8a161..311e2aa0 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -66,6 +66,9 @@ const settings = { state.settings = newSettings state.db = newDbSettings }, + SET_TERMS_OF_SERVICES: (state, data) => { + state.termsOfServices = data + }, TOGGLE_TABS: (state, status) => { state.configDisabled = status }, @@ -85,7 +88,13 @@ const settings = { actions: { async FetchInstanceDocument({ commit, getters }, name) { const { data } = await getInstanceDocument(name, getters.authHost, getters.token) - commit('SET_INSTANCE_PANEL', data) + console.log(data) + if (name === 'instance-panel') { + commit('SET_INSTANCE_PANEL', data) + } else { + console.log(name) + commit('SET_TERMS_OF_SERVICES', data) + } }, async FetchSettings({ commit, getters }) { commit('SET_LOADING', true) @@ -107,7 +116,7 @@ const settings = { }, async RemoveInstanceDocument({ dispatch, getters }, name) { await deleteInstanceDocument(name, getters.authHost, getters.token) - await dispatch('FetchInstanceDocument', 'instance-panel') + await dispatch('FetchInstanceDocument', name) }, async RemoveSetting({ commit, getters }, configs) { await removeSettings(configs, getters.authHost, getters.token) diff --git a/src/views/settings/components/Instance.vue b/src/views/settings/components/Instance.vue index 2e897c55..fa014e99 100644 --- a/src/views/settings/components/Instance.vue +++ b/src/views/settings/components/Instance.vue @@ -3,7 +3,7 @@ - + diff --git a/src/views/settings/components/Other.vue b/src/views/settings/components/Other.vue index cc8fb841..fb0b2293 100644 --- a/src/views/settings/components/Other.vue +++ b/src/views/settings/components/Other.vue @@ -1,5 +1,6 @@