mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
args: reflect pydantic change of name
to id
This commit is contained in:
parent
2d5649ea6d
commit
1fe4320bde
1 changed files with 9 additions and 9 deletions
|
@ -84,8 +84,8 @@ export function evaluateExpression (expression, forms) {
|
|||
if (expression === '"false"') return false
|
||||
|
||||
const context = Object.values(forms).reduce((ctx, args) => {
|
||||
Object.entries(args).forEach(([name, value]) => {
|
||||
ctx[name] = isObjectLiteral(value) && 'file' in value ? value.content : value
|
||||
Object.entries(args).forEach(([id, value]) => {
|
||||
ctx[id] = isObjectLiteral(value) && 'file' in value ? value.content : value
|
||||
})
|
||||
return ctx
|
||||
}, {})
|
||||
|
@ -136,7 +136,7 @@ export function formatYunoHostArgument (arg) {
|
|||
}
|
||||
}
|
||||
|
||||
const defaultProps = ['id:name', 'placeholder:example']
|
||||
const defaultProps = ['id', 'placeholder:example']
|
||||
const components = [
|
||||
{
|
||||
types: ['string', 'path'],
|
||||
|
@ -177,7 +177,7 @@ export function formatYunoHostArgument (arg) {
|
|||
{
|
||||
types: ['select', 'user', 'domain', 'app', 'group'],
|
||||
name: 'SelectItem',
|
||||
props: ['id:name', 'choices'],
|
||||
props: ['id', 'choices'],
|
||||
callback: function () {
|
||||
if (arg.type !== 'select') {
|
||||
field.props.link = { name: arg.type + '-list', text: i18n.t(`manage_${arg.type}s`) }
|
||||
|
@ -226,7 +226,7 @@ export function formatYunoHostArgument (arg) {
|
|||
{
|
||||
types: ['boolean'],
|
||||
name: 'CheckboxItem',
|
||||
props: ['id:name', 'choices'],
|
||||
props: ['id', 'choices'],
|
||||
callback: function () {
|
||||
if (value !== null && value !== undefined) {
|
||||
value = ['1', 'yes', 'y', 'true'].includes(String(value).toLowerCase())
|
||||
|
@ -352,10 +352,10 @@ export function formatYunoHostArguments (args, forms) {
|
|||
|
||||
for (const arg of args) {
|
||||
const { value, field, validation, error } = formatYunoHostArgument(arg)
|
||||
fields[arg.name] = field
|
||||
form[arg.name] = value
|
||||
if (validation) validations[arg.name] = validation
|
||||
errors[arg.name] = error
|
||||
fields[arg.id] = field
|
||||
form[arg.id] = value
|
||||
if (validation) validations[arg.id] = validation
|
||||
errors[arg.id] = error
|
||||
|
||||
if ('visible' in arg && ![false, '"false"'].includes(arg.visible)) {
|
||||
addEvaluationGetter('visible', field, arg.visible, forms)
|
||||
|
|
Loading…
Add table
Reference in a new issue