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,25 +110,13 @@ export function formatYunoHostArgument (arg) {
|
|||
}
|
||||
},
|
||||
{
|
||||
types: ['select'],
|
||||
name: 'SelectItem',
|
||||
props: ['id:name', 'choices']
|
||||
},
|
||||
{
|
||||
types: ['user', 'domain'],
|
||||
types: ['select', 'user', 'domain'],
|
||||
name: 'SelectItem',
|
||||
props: ['id:name', 'choices'],
|
||||
callback: function () {
|
||||
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
|
||||
}
|
||||
if ((arg.type === 'domain') || (arg.type === 'user')) {
|
||||
field.link = { name: arg.type + '-list', text: i18n.t(`manage_${arg.type}s`) }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -170,15 +170,6 @@ export default {
|
|||
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
|
||||
|
||||
domains: state => state.domains,
|
||||
|
|
Loading…
Reference in a new issue