mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
fix(app/mustache): reuse mustache variables in templates [EE-3689] (#7286)
This commit is contained in:
parent
95f4db4f48
commit
1a8fe82821
1 changed files with 9 additions and 6 deletions
|
@ -38,12 +38,15 @@ export function intersectVariables(
|
|||
) {
|
||||
const oldVariablesWithLabel = oldVariables.filter((v) => !!v.label);
|
||||
|
||||
return [
|
||||
...oldVariablesWithLabel,
|
||||
...newVariables.filter(
|
||||
(v) => !oldVariablesWithLabel.find(({ name }) => name === v.name)
|
||||
),
|
||||
];
|
||||
return _.uniqBy(
|
||||
[
|
||||
...oldVariablesWithLabel,
|
||||
...newVariables.filter(
|
||||
(v) => !oldVariablesWithLabel.find(({ name }) => name === v.name)
|
||||
),
|
||||
],
|
||||
'name'
|
||||
);
|
||||
}
|
||||
|
||||
export function renderTemplate(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue