Bläddra i källkod

feat: Add support for hidden attributes to form item types (#20956)

tags/1.5.0
croatialu 4 månader sedan
förälder
incheckning
8ac3bd1768
Inget konto är kopplat till bidragsgivarens mejladress
2 ändrade filer med 13 tillägg och 0 borttagningar
  1. 3
    0
      web/types/app.ts
  2. 10
    0
      web/utils/model-config.ts

+ 3
- 0
web/types/app.ts Visa fil

variable: string variable: string
required: boolean required: boolean
max_length: number max_length: number
hide: boolean
} }


export type SelectTypeFormItem = { export type SelectTypeFormItem = {
variable: string variable: string
required: boolean required: boolean
options: string[] options: string[]
hide: boolean
} }


export type ParagraphTypeFormItem = { export type ParagraphTypeFormItem = {
label: string label: string
variable: string variable: string
required: boolean required: boolean
hide: boolean
} }
/** /**
* User Input Form Item * User Input Form Item

+ 10
- 0
web/utils/model-config.ts Visa fil

max_length: content.max_length, max_length: content.max_length,
options: [], options: [],
is_context_var, is_context_var,
hide: content.hide,
}) })
} }
else if (type === 'number') { else if (type === 'number') {
required: content.required, required: content.required,
type, type,
options: [], options: [],
hide: content.hide,
}) })
} }
else if (type === 'select') { else if (type === 'select') {
type: 'select', type: 'select',
options: content.options, options: content.options,
is_context_var, is_context_var,
hide: content.hide,
}) })
} }
else if (type === 'file') { else if (type === 'file') {
allowed_file_upload_methods: content.allowed_file_upload_methods, allowed_file_upload_methods: content.allowed_file_upload_methods,
number_limits: 1, number_limits: 1,
}, },
hide: content.hide,
}) })
} }
else if (type === 'file-list') { else if (type === 'file-list') {
allowed_file_upload_methods: content.allowed_file_upload_methods, allowed_file_upload_methods: content.allowed_file_upload_methods,
number_limits: content.max_length, number_limits: content.max_length,
}, },
hide: content.hide,
}) })
} }
else { else {
icon: content.icon, icon: content.icon,
icon_background: content.icon_background, icon_background: content.icon_background,
is_context_var, is_context_var,
hide: content.hide,
}) })
} }
}) })
required: item.required !== false, // default true required: item.required !== false, // default true
max_length: item.max_length, max_length: item.max_length,
default: '', default: '',
hide: item.hide,
}, },
} as any) } as any)
return return
variable: item.key, variable: item.key,
required: item.required !== false, // default true required: item.required !== false, // default true
default: '', default: '',
hide: item.hide,
}, },
} as any) } as any)
} }
required: item.required !== false, // default true required: item.required !== false, // default true
options: item.options, options: item.options,
default: '', default: '',
hide: item.hide,
}, },
} as any) } as any)
} }
required: item.required, required: item.required,
icon: item.icon, icon: item.icon,
icon_background: item.icon_background, icon_background: item.icon_background,
hide: item.hide,
}, },
} as any) } as any)
} }

Laddar…
Avbryt
Spara