1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

fix(dialog): dialog migration issues [EE-5385] (#8849)

* fix(dialog): dialog migration issues [EE-5385]

* don't highlight slider tooltip text

---------

Co-authored-by: testa113 <testa113>
This commit is contained in:
Ali 2023-05-04 16:23:27 +12:00 committed by GitHub
parent ed279ba65b
commit 14a581e86b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 120 additions and 56 deletions

View file

@ -0,0 +1,46 @@
import { ModalType } from '@@/modals';
import { confirm } from '@@/modals/confirm';
import { buildConfirmButton } from '@@/modals/utils';
export function confirmUpdateNode(
taintsWarning: boolean,
labelsWarning: boolean,
cordonWarning: boolean,
drainWarning: boolean
) {
let message;
if (taintsWarning && !labelsWarning) {
message =
'Changes to taints will immediately deschedule applications running on this node without the corresponding tolerations. Do you wish to continue?';
} else if (!taintsWarning && labelsWarning) {
message =
'Removing or changing a label that is used might prevent applications from being scheduled on this node in the future. Do you wish to continue?';
} else if (taintsWarning && labelsWarning) {
message = (
<>
<p>
Changes to taints will immediately deschedule applications running on
this node without the corresponding tolerations.
</p>
<p>
Removing or changing a label that is used might prevent applications
from scheduling on this node in the future.
</p>
<p>Do you wish to continue?</p>
</>
);
} else if (cordonWarning) {
message =
'Marking this node as unschedulable will effectively cordon the node and prevent any new workload from being scheduled on that node. Are you sure?';
} else if (drainWarning) {
message =
'Draining this node will cause all workloads to be evicted from that node. This might lead to some service interruption. Are you sure?';
}
return confirm({
title: 'Are you sure?',
modalType: ModalType.Warn,
message,
confirmButton: buildConfirmButton('Update', 'primary'),
});
}

View file

@ -0,0 +1,19 @@
import { confirmDestructive } from '@@/modals/confirm';
import { buildConfirmButton } from '@@/modals/utils';
export function confirmDeleteAccess() {
return confirmDestructive({
title: 'Are you sure?',
message: (
<>
<p>
This registry might be used by one or more applications inside this
environment. Removing the registry access could lead to a service
interruption for these applications.
</p>
<p>Do you wish to continue?</p>
</>
),
confirmButton: buildConfirmButton('Remove', 'danger'),
});
}

View file

@ -0,0 +1,42 @@
import { ModalType } from '@@/modals';
import { confirm } from '@@/modals/confirm';
import { buildConfirmButton } from '@@/modals/utils';
export function confirmUpdateNamespace(
quotaWarning: boolean,
ingressWarning: boolean,
registriesWarning: boolean
) {
const message = (
<>
{quotaWarning && (
<p>
Reducing the quota assigned to an &quot;in-use&quot; namespace may
have unintended consequences, including preventing running
applications from functioning correctly and potentially even blocking
them from running at all.
</p>
)}
{ingressWarning && (
<p>
Deactivating ingresses may cause applications to be unaccessible. All
ingress configurations from affected applications will be removed.
</p>
)}
{registriesWarning && (
<p>
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.
</p>
)}
</>
);
return confirm({
title: 'Are you sure?',
modalType: ModalType.Warn,
message,
confirmButton: buildConfirmButton('Update', 'primary'),
});
}