mirror of https://github.com/portainer/portainer
fix(edge/templates): get correct default value for selectType env vars EE-6796 (#11294)
parent
e919da3771
commit
ebcc98d5c5
|
@ -81,7 +81,15 @@ function Item({
|
|||
}
|
||||
|
||||
export function getDefaultValues(definitions: Array<TemplateEnv>): Value {
|
||||
return Object.fromEntries(definitions.map((v) => [v.name, v.default || '']));
|
||||
return Object.fromEntries(
|
||||
definitions.map((v) => {
|
||||
if (v.select) {
|
||||
return [v.name, v.select.find((v) => v.default)?.value || ''];
|
||||
}
|
||||
|
||||
return [v.name, v.default || ''];
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
export function envVarsFieldsetValidation(): SchemaOf<Value> {
|
||||
|
|
Loading…
Reference in New Issue