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
|
if (expression === '"false"') return false
|
||||||
|
|
||||||
const context = Object.values(forms).reduce((ctx, args) => {
|
const context = Object.values(forms).reduce((ctx, args) => {
|
||||||
Object.entries(args).forEach(([name, value]) => {
|
Object.entries(args).forEach(([id, value]) => {
|
||||||
ctx[name] = isObjectLiteral(value) && 'file' in value ? value.content : value
|
ctx[id] = isObjectLiteral(value) && 'file' in value ? value.content : value
|
||||||
})
|
})
|
||||||
return ctx
|
return ctx
|
||||||
}, {})
|
}, {})
|
||||||
|
@ -136,7 +136,7 @@ export function formatYunoHostArgument (arg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultProps = ['id:name', 'placeholder:example']
|
const defaultProps = ['id', 'placeholder:example']
|
||||||
const components = [
|
const components = [
|
||||||
{
|
{
|
||||||
types: ['string', 'path'],
|
types: ['string', 'path'],
|
||||||
|
@ -177,7 +177,7 @@ export function formatYunoHostArgument (arg) {
|
||||||
{
|
{
|
||||||
types: ['select', 'user', 'domain', 'app', 'group'],
|
types: ['select', 'user', 'domain', 'app', 'group'],
|
||||||
name: 'SelectItem',
|
name: 'SelectItem',
|
||||||
props: ['id:name', 'choices'],
|
props: ['id', 'choices'],
|
||||||
callback: function () {
|
callback: function () {
|
||||||
if (arg.type !== 'select') {
|
if (arg.type !== 'select') {
|
||||||
field.props.link = { name: arg.type + '-list', text: i18n.t(`manage_${arg.type}s`) }
|
field.props.link = { name: arg.type + '-list', text: i18n.t(`manage_${arg.type}s`) }
|
||||||
|
@ -226,7 +226,7 @@ export function formatYunoHostArgument (arg) {
|
||||||
{
|
{
|
||||||
types: ['boolean'],
|
types: ['boolean'],
|
||||||
name: 'CheckboxItem',
|
name: 'CheckboxItem',
|
||||||
props: ['id:name', 'choices'],
|
props: ['id', 'choices'],
|
||||||
callback: function () {
|
callback: function () {
|
||||||
if (value !== null && value !== undefined) {
|
if (value !== null && value !== undefined) {
|
||||||
value = ['1', 'yes', 'y', 'true'].includes(String(value).toLowerCase())
|
value = ['1', 'yes', 'y', 'true'].includes(String(value).toLowerCase())
|
||||||
|
@ -352,10 +352,10 @@ export function formatYunoHostArguments (args, forms) {
|
||||||
|
|
||||||
for (const arg of args) {
|
for (const arg of args) {
|
||||||
const { value, field, validation, error } = formatYunoHostArgument(arg)
|
const { value, field, validation, error } = formatYunoHostArgument(arg)
|
||||||
fields[arg.name] = field
|
fields[arg.id] = field
|
||||||
form[arg.name] = value
|
form[arg.id] = value
|
||||||
if (validation) validations[arg.name] = validation
|
if (validation) validations[arg.id] = validation
|
||||||
errors[arg.name] = error
|
errors[arg.id] = error
|
||||||
|
|
||||||
if ('visible' in arg && ![false, '"false"'].includes(arg.visible)) {
|
if ('visible' in arg && ![false, '"false"'].includes(arg.visible)) {
|
||||||
addEvaluationGetter('visible', field, arg.visible, forms)
|
addEvaluationGetter('visible', field, arg.visible, forms)
|
||||||
|
|
Loading…
Add table
Reference in a new issue