Fix shortening MRF policies on the new tab

This commit is contained in:
Angelina Filippova 2020-07-21 13:29:54 +03:00
parent d7eaf61a95
commit 94e07f1ead
2 changed files with 3 additions and 11 deletions

View file

@ -276,7 +276,7 @@ export default {
':parsers',
':providers',
':method',
':rewrite_policy',
':policies',
'Pleroma.Web.Auth.Authenticator'
].includes(this.setting.key) ||
(this.settingGroup.key === 'Pleroma.Emails.Mailer' && this.setting.key === ':adapter')

View file

@ -56,7 +56,7 @@ export default {
inputValue() {
if (this.setting.key === 'Pleroma.Web.Auth.Authenticator') {
return this.data.value
} else if (this.setting.key === ':rewrite_policy') {
} else if (this.setting.key === ':policies') {
return typeof this.data[this.setting.key] === 'string'
? [this.data[this.setting.key]]
: this.data[this.setting.key]
@ -71,7 +71,7 @@ export default {
methods: {
options(suggestions) {
const prefixes = {
':rewrite_policy': 'Pleroma.Web.ActivityPub.MRF.',
':policies': 'Pleroma.Web.ActivityPub.MRF.',
'Pleroma.Web.Auth.Authenticator': 'Pleroma.Web.Auth.',
':method': 'Pleroma.Captcha.',
':adapter': 'Swoosh.Adapters.',
@ -100,14 +100,6 @@ export default {
this.setting.key === ':args'
)
},
rewritePolicyOptions(suggestions) {
return suggestions.map(element => {
const label = element.split('Pleroma.Web.ActivityPub.MRF.')[1]
? element.split('Pleroma.Web.ActivityPub.MRF.')[1]
: element
return { value: element, label }
})
},
updateSetting(value, group, key, input, type) {
const updatedValue = getBooleanValue(value)
this.$store.dispatch('UpdateSettings', { group, key, input, value: updatedValue, type })