mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
feat(app/registries): add warning modal on registries deletion (#5396)
* feat(app/registries): add warning modal on registries deletion feat(app/namespace): add confirmation modal on registry removal feat(app/registry-access): add confirmation modal on namespace removal fix(app/registry-access): change update to remove in confirmation modal refactor(app/registries): generic message on registry access removal * fix(app/registries): typo in warning messages
This commit is contained in:
parent
1b7296d5d1
commit
6fea8373c6
3 changed files with 27 additions and 8 deletions
|
@ -185,20 +185,26 @@ class KubernetesResourcePoolController {
|
|||
}
|
||||
|
||||
updateResourcePool() {
|
||||
const willBeDeleted = _.filter(this.formValues.IngressClasses, { WasSelected: true, Selected: false });
|
||||
const ingressesToDelete = _.filter(this.formValues.IngressClasses, { WasSelected: true, Selected: false });
|
||||
const registriesToDelete = _.filter(this.registries, { WasChecked: true, Checked: false });
|
||||
const warnings = {
|
||||
quota: this.hasResourceQuotaBeenReduced(),
|
||||
ingress: willBeDeleted.length !== 0,
|
||||
ingress: ingressesToDelete.length !== 0,
|
||||
registries: registriesToDelete.length !== 0,
|
||||
};
|
||||
|
||||
if (warnings.quota || warnings.ingress) {
|
||||
if (warnings.quota || warnings.ingress || warnings.registries) {
|
||||
const messages = {
|
||||
quota:
|
||||
'Reducing the quota assigned to an "in-use" namespace may have unintended consequences, including preventing running applications from functioning correctly and potentially even blocking them from running at all.',
|
||||
ingress: 'Deactivating ingresses may cause applications to be unaccessible. All ingress configurations from affected applications will be removed.',
|
||||
registries:
|
||||
'Some registries you removed might be used by one or more applications inside this environment. Removing the registries access could lead to a service interruption for these applications.',
|
||||
};
|
||||
const displayedMessage = `${warnings.quota ? messages.quota : ''}${warnings.quota && warnings.ingress ? '<br/><br/>' : ''}
|
||||
${warnings.ingress ? messages.ingress : ''}<br/><br/>Do you wish to continue?`;
|
||||
const displayedMessage = `${warnings.quota ? messages.quota + '<br/><br/>' : ''}
|
||||
${warnings.ingress ? messages.ingress + '<br/><br/>' : ''}
|
||||
${warnings.registries ? messages.registries + '<br/><br/>' : ''}
|
||||
Do you wish to continue?`;
|
||||
this.ModalService.confirmUpdate(displayedMessage, (confirmed) => {
|
||||
if (confirmed) {
|
||||
return this.$async(this.updateResourcePoolAsync, this.savedFormValues, this.formValues);
|
||||
|
@ -322,6 +328,7 @@ class KubernetesResourcePoolController {
|
|||
this.registries.forEach((reg) => {
|
||||
if (reg.RegistryAccesses && reg.RegistryAccesses[this.endpoint.Id] && reg.RegistryAccesses[this.endpoint.Id].Namespaces.includes(namespace)) {
|
||||
reg.Checked = true;
|
||||
reg.WasChecked = true;
|
||||
this.formValues.Registries.push(reg);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue