From 88f2859f47098c2f4d8908229b7356890728f033 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 15 May 2020 01:24:12 +0300 Subject: [PATCH 1/4] Disable tabs that don't have settings that can be changed --- src/views/settings/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/settings/index.vue b/src/views/settings/index.vue index ff1b3435..a9fe87e5 100644 --- a/src/views/settings/index.vue +++ b/src/views/settings/index.vue @@ -33,7 +33,7 @@ @@ -227,6 +227,11 @@ export default { : { value: `${searchObj.label} in ${searchObj.groupLabel}`, group: searchObj.groupKey, key: searchObj.key } }) cb(results) + }, + settingsCantBeChanged(settings) { + const existingSettings = settings.filter(setting => + this.$store.state.settings.description.findIndex(el => el.key === setting) !== -1) + return existingSettings.length === 0 } } } From 342222d45ca8cdee3bd665c1003b1e5b92205882 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 15 May 2020 02:48:46 +0300 Subject: [PATCH 2/4] Check if settings without keys exists in description.exs --- src/views/settings/components/tabs.js | 2 +- src/views/settings/index.vue | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/views/settings/components/tabs.js b/src/views/settings/components/tabs.js index f9b41621..5c170353 100644 --- a/src/views/settings/components/tabs.js +++ b/src/views/settings/components/tabs.js @@ -65,7 +65,7 @@ export const tabs = { }, 'relays': { label: 'settings.relays', - settings: [] + settings: ['relays'] }, 'web-push': { label: 'settings.webPush', diff --git a/src/views/settings/index.vue b/src/views/settings/index.vue index a9fe87e5..db623184 100644 --- a/src/views/settings/index.vue +++ b/src/views/settings/index.vue @@ -229,8 +229,17 @@ export default { cb(results) }, settingsCantBeChanged(settings) { - const existingSettings = settings.filter(setting => - this.$store.state.settings.description.findIndex(el => el.key === setting) !== -1) + const existingSettings = settings.filter(setting => { + if ([':esshd', ':cors_plug', ':http_signatures', ':quack', ':logger', ':swoosh', ':mime'].includes(setting)) { + return this.$store.state.settings.description.findIndex(el => el.group === setting) !== -1 + } else if (setting === 'Pleroma.Web.Auth.Authenticator' || setting === ':admin_token') { + return this.$store.state.settings.description.findIndex(el => el.children[0].key === setting) !== -1 + } else if (setting === 'relays') { + return [setting] + } else { + return this.$store.state.settings.description.findIndex(el => el.key === setting) !== -1 + } + }) return existingSettings.length === 0 } } From 094ec8956b6adbef6188da702edacd46a5592a69 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 15 May 2020 22:22:20 +0300 Subject: [PATCH 3/4] Do not render dividers and labels if a setting is not in description --- src/views/settings/components/ActivityPub.vue | 2 +- src/views/settings/components/Authentication.vue | 6 +++--- src/views/settings/components/Captcha.vue | 2 +- src/views/settings/components/Frontend.vue | 14 +++++++------- src/views/settings/components/Http.vue | 8 ++++---- src/views/settings/components/Instance.vue | 12 ++++++------ src/views/settings/components/Logger.vue | 6 +++--- src/views/settings/components/MRF.vue | 14 +++++++------- src/views/settings/components/Mailer.vue | 4 ++-- src/views/settings/components/Metadata.vue | 2 +- src/views/settings/components/Upload.vue | 8 ++++---- 11 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/views/settings/components/ActivityPub.vue b/src/views/settings/components/ActivityPub.vue index 4e5ab1b8..67dee024 100644 --- a/src/views/settings/components/ActivityPub.vue +++ b/src/views/settings/components/ActivityPub.vue @@ -3,7 +3,7 @@ - + diff --git a/src/views/settings/components/Authentication.vue b/src/views/settings/components/Authentication.vue index 69e5f143..9b055aad 100644 --- a/src/views/settings/components/Authentication.vue +++ b/src/views/settings/components/Authentication.vue @@ -3,15 +3,15 @@ - + - + - + diff --git a/src/views/settings/components/Captcha.vue b/src/views/settings/components/Captcha.vue index 5e91074a..97f067a6 100644 --- a/src/views/settings/components/Captcha.vue +++ b/src/views/settings/components/Captcha.vue @@ -3,7 +3,7 @@ - + diff --git a/src/views/settings/components/Frontend.vue b/src/views/settings/components/Frontend.vue index 2af44656..69f7a4b6 100644 --- a/src/views/settings/components/Frontend.vue +++ b/src/views/settings/components/Frontend.vue @@ -6,27 +6,27 @@ - + - + {{ $t('settings.assets') }} - + - + {{ $t('settings.emoji') }} - + - + - + {{ $t('settings.markup') }} diff --git a/src/views/settings/components/Http.vue b/src/views/settings/components/Http.vue index 39042b61..c9145d24 100644 --- a/src/views/settings/components/Http.vue +++ b/src/views/settings/components/Http.vue @@ -4,20 +4,20 @@ - + {{ $t('settings.corsPlug') }} - + - + - + diff --git a/src/views/settings/components/Instance.vue b/src/views/settings/components/Instance.vue index 02abe655..3156c33f 100644 --- a/src/views/settings/components/Instance.vue +++ b/src/views/settings/components/Instance.vue @@ -3,27 +3,27 @@ - + - + - + - + - + - + diff --git a/src/views/settings/components/Logger.vue b/src/views/settings/components/Logger.vue index b9fb891e..dc62d153 100644 --- a/src/views/settings/components/Logger.vue +++ b/src/views/settings/components/Logger.vue @@ -3,15 +3,15 @@ - + - + - + diff --git a/src/views/settings/components/MRF.vue b/src/views/settings/components/MRF.vue index 94d3762e..977d1582 100644 --- a/src/views/settings/components/MRF.vue +++ b/src/views/settings/components/MRF.vue @@ -3,15 +3,15 @@ - + - + - + @@ -21,19 +21,19 @@ - + - + - + - + diff --git a/src/views/settings/components/Mailer.vue b/src/views/settings/components/Mailer.vue index 0a438693..c62568a9 100644 --- a/src/views/settings/components/Mailer.vue +++ b/src/views/settings/components/Mailer.vue @@ -3,11 +3,11 @@ - + - + diff --git a/src/views/settings/components/Metadata.vue b/src/views/settings/components/Metadata.vue index b4aef7c8..f0ef71c4 100644 --- a/src/views/settings/components/Metadata.vue +++ b/src/views/settings/components/Metadata.vue @@ -3,7 +3,7 @@ - + diff --git a/src/views/settings/components/Upload.vue b/src/views/settings/components/Upload.vue index b557fb5a..97860d75 100644 --- a/src/views/settings/components/Upload.vue +++ b/src/views/settings/components/Upload.vue @@ -4,20 +4,20 @@ - + Pleroma.Uploaders.Local - + - + - + From 8e53f52ccf07a3ba966d4f0bbf6d043f8ca89caf Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sat, 16 May 2020 01:26:19 +0300 Subject: [PATCH 4/4] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19b74ca0..2ed53c05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Statuses count changes when an instance is selected and shows the amount of statuses from an originating instance - Add a dialog window with a confirmation when a remove button is clicked on the Settings page +- Disable tab on the Settings page if there are no settings on this tab that can be changed in Admin FE ### Fixed