Skip to content
Snippets Groups Projects
Commit 342222d4 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Check if settings without keys exists in description.exs

parent 88f2859f
No related branches found
No related tags found
1 merge request!130Disable tab if its settings are not on the whitelist
This commit is part of merge request !130. Comments created here will be created in the context of that merge request.
......@@ -65,7 +65,7 @@ export const tabs = {
},
'relays': {
label: 'settings.relays',
settings: []
settings: ['relays']
},
'web-push': {
label: 'settings.webPush',
......
......@@ -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
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment