Skip to content

Commit

Permalink
Fix [Nuclio][NodeSelector] Deploy button is hodden on click to "Rever…
Browse files Browse the repository at this point in the history
…t to default" (#1572)
  • Loading branch information
illia-prokopchuk authored Aug 21, 2024
1 parent f6056c2 commit bf5864c
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,11 @@ such restriction.
*/
function handleRevertToDefaultsClick() {
DialogsService.confirm($i18next.t('functions:REVERT_NODE_SELECTORS_TO_DEFAULTS_CONFIRM', {lng: lng}),
$i18next.t('functions:YES_REVERT_CONFIRM', {lng: lng}),
$i18next.t('common:CANCEL', {lng: lng})).then(function () {
setNodeSelectorsDefaultValue();
});
$i18next.t('functions:YES_REVERT_CONFIRM', {lng: lng}))
.then(function () {
setNodeSelectorsDefaultValue();
$rootScope.$broadcast('igzWatchWindowResize::resize');
});
}

/**
Expand Down Expand Up @@ -559,15 +560,14 @@ such restriction.
* Checks whether the `Revert to defaults` button must be hidden
*/
function checkNodeSelectorsIdentity() {
const nodeSelectors = lodash.map(ctrl.nodeSelectors, function (selector) {
return {
key: selector.name,
value: selector.value
}
});
var nodeSelectors = lodash.reduce(ctrl.nodeSelectors, function (acc, nodeSelector) {
acc[nodeSelector.name] = nodeSelector.value;

return acc;
}, {});

ctrl.revertToDefaultsBtnIsHidden = lodash.isEqual(
lodash.get(ConfigService,'nuclio.defaultFunctionConfig.attributes.spec.nodeSelector', []), nodeSelectors);
lodash.get(ConfigService,'nuclio.defaultFunctionConfig.attributes.spec.nodeSelector', {}), nodeSelectors);
}

/**
Expand Down Expand Up @@ -798,6 +798,10 @@ such restriction.
};
})
.value();

$timeout(function () {
updateNodeSelectors();
}, 0);
}

/**
Expand Down

0 comments on commit bf5864c

Please sign in to comment.