mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
configpanels: logic regarding dynamic-choices questions such as domain, user, should be handled by the core
This commit is contained in:
parent
00a8482762
commit
101be80d7e
2 changed files with 4 additions and 25 deletions
|
@ -110,24 +110,12 @@ export function formatYunoHostArgument (arg) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
types: ['select'],
|
types: ['select', 'user', 'domain'],
|
||||||
name: 'SelectItem',
|
|
||||||
props: ['id:name', 'choices']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
types: ['user', 'domain'],
|
|
||||||
name: 'SelectItem',
|
name: 'SelectItem',
|
||||||
props: ['id:name', 'choices'],
|
props: ['id:name', 'choices'],
|
||||||
callback: function () {
|
callback: function () {
|
||||||
|
if ((arg.type === 'domain') || (arg.type === 'user')) {
|
||||||
field.link = { name: arg.type + '-list', text: i18n.t(`manage_${arg.type}s`) }
|
field.link = { name: arg.type + '-list', text: i18n.t(`manage_${arg.type}s`) }
|
||||||
field.props.choices = store.getters[arg.type + 'sAsChoices']
|
|
||||||
if (value) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (arg.type === 'domain') {
|
|
||||||
value = store.getters.mainDomain
|
|
||||||
} else {
|
|
||||||
value = field.props.choices.length ? field.props.choices[0].value : null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -170,15 +170,6 @@ export default {
|
||||||
return []
|
return []
|
||||||
},
|
},
|
||||||
|
|
||||||
usersAsChoices: state => {
|
|
||||||
if (state.users) {
|
|
||||||
return Object.values(state.users).map(({ username, fullname, mail }) => {
|
|
||||||
return { text: `${fullname} (${mail})`, value: username }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return []
|
|
||||||
},
|
|
||||||
|
|
||||||
user: state => name => state.users_details[name], // not cached
|
user: state => name => state.users_details[name], // not cached
|
||||||
|
|
||||||
domains: state => state.domains,
|
domains: state => state.domains,
|
||||||
|
|
Loading…
Reference in a new issue