mirror of https://github.com/portainer/portainer
fix(app/mustache): reuse mustache variables in templates [EE-3689] (#7286)
parent
95f4db4f48
commit
1a8fe82821
|
@ -38,12 +38,15 @@ export function intersectVariables(
|
||||||
) {
|
) {
|
||||||
const oldVariablesWithLabel = oldVariables.filter((v) => !!v.label);
|
const oldVariablesWithLabel = oldVariables.filter((v) => !!v.label);
|
||||||
|
|
||||||
return [
|
return _.uniqBy(
|
||||||
|
[
|
||||||
...oldVariablesWithLabel,
|
...oldVariablesWithLabel,
|
||||||
...newVariables.filter(
|
...newVariables.filter(
|
||||||
(v) => !oldVariablesWithLabel.find(({ name }) => name === v.name)
|
(v) => !oldVariablesWithLabel.find(({ name }) => name === v.name)
|
||||||
),
|
),
|
||||||
];
|
],
|
||||||
|
'name'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function renderTemplate(
|
export function renderTemplate(
|
||||||
|
|
Loading…
Reference in New Issue