Commit a8037483 authored by Angelina Filippova's avatar Angelina Filippova

Add mailer tab, fix rendering and processing emails mailer settings

parent 961bf8ae
......@@ -45,13 +45,15 @@ const settings = {
state.settings = newSettings
},
UPDATE_SETTINGS: (state, { group, key, input, value, type }) => {
const updatedSetting = state.updatedSettings[group]
? { [key]: { ...state.updatedSettings[group][key], ...{ [input]: [type, value] }}}
: { [key]: { [input]: [type, value] }}
const updatedSetting = !state.updatedSettings[group] || (key === 'Pleroma.Emails.Mailer' && input === ':adapter')
? { [key]: { [input]: [type, value] }}
: { [key]: { ...state.updatedSettings[group][key], ...{ [input]: [type, value] }}}
state.updatedSettings[group] = { ...state.updatedSettings[group], ...updatedSetting }
},
UPDATE_STATE: (state, { group, key, input, value }) => {
const updatedState = { [key]: { ...state.settings[group][key], ...{ [input]: value }}}
const updatedState = key === 'Pleroma.Emails.Mailer' && input === ':adapter'
? { [key]: { [input]: value }}
: { [key]: { ...state.settings[group][key], ...{ [input]: value }}}
state.settings[group] = { ...state.settings[group], ...updatedState }
}
},
......
......@@ -11,9 +11,8 @@
:data="data"/>
</div>
<div
v-for="setting in settingGroup.children.filter(setting => setting.group && setting.group.includes(setting.key))"
v-for="setting in emailAdapterChildren"
:key="setting.key">
<div class="line"/>
<inputs
:setting-group="settingGroup"
:setting="setting"
......@@ -76,6 +75,10 @@ export default {
}
},
computed: {
emailAdapterChildren() {
const adapter = this.$store.state.settings.settings[':pleroma']['Pleroma.Emails.Mailer'][':adapter']
return this.settingGroup.children.filter(child => child.group && child.group.includes(adapter))
},
loading() {
return this.$store.state.settings.loading
}
......
......@@ -41,6 +41,9 @@
<el-tab-pane :label="$t('settings.logger')" lazy>
<logger/>
</el-tab-pane>
<el-tab-pane :label="$t('settings.mailer')" lazy>
<mailer/>
</el-tab-pane>
<!--
<el-tab-pane :label="$t('settings.jobQueue')" lazy>
<job-queue/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment