1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00

refactor(ui/modals): replace bootbox with react solution [EE-4541] (#8010)

This commit is contained in:
Chaim Lev-Ari 2023-02-14 13:49:41 +05:30 committed by GitHub
parent 392c7f74b8
commit e66dea44e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 1330 additions and 1562 deletions

View file

@ -15,6 +15,9 @@ import { KubernetesServiceTypes } from 'Kubernetes/models/service/models';
import { KubernetesPodNodeAffinityNodeSelectorRequirementOperators } from 'Kubernetes/pod/models';
import { KubernetesPodContainerTypes } from 'Kubernetes/pod/models/index';
import KubernetesNamespaceHelper from 'Kubernetes/helpers/namespaceHelper';
import { confirmUpdate, confirm } from '@@/modals/confirm';
import { buildConfirmButton } from '@@/modals/utils';
import { ModalType } from '@@/modals';
function computeTolerations(nodes, application) {
const pod = application.Pods[0];
@ -108,7 +111,6 @@ class KubernetesApplicationController {
clipboard,
Notifications,
LocalStorage,
ModalService,
KubernetesResourcePoolService,
KubernetesApplicationService,
KubernetesEventService,
@ -122,7 +124,6 @@ class KubernetesApplicationController {
this.clipboard = clipboard;
this.Notifications = Notifications;
this.LocalStorage = LocalStorage;
this.ModalService = ModalService;
this.KubernetesResourcePoolService = KubernetesResourcePoolService;
this.StackService = StackService;
@ -224,7 +225,7 @@ class KubernetesApplicationController {
}
rollbackApplication() {
this.ModalService.confirmUpdate('Rolling back the application to a previous configuration may cause service interruption. Do you wish to continue?', (confirmed) => {
confirmUpdate('Rolling back the application to a previous configuration may cause service interruption. Do you wish to continue?', (confirmed) => {
if (confirmed) {
return this.$async(this.rollbackApplicationAsync);
}
@ -234,10 +235,11 @@ class KubernetesApplicationController {
* REDEPLOY
*/
async redeployApplicationAsync() {
const confirmed = await this.ModalService.confirmAsync({
const confirmed = await confirm({
modalType: ModalType.Warn,
title: 'Are you sure?',
message: 'Redeploying the application may cause a service interruption. Do you wish to continue?',
buttons: { confirm: { label: 'Redeploy', className: 'btn-primary' } },
confirmButton: buildConfirmButton('Redeploy'),
});
if (!confirmed) {
return;