From dca10ce00c214312ece44ea4801655bc3f68f66e Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 14 Sep 2021 02:20:40 -0400 Subject: [PATCH] [Security Solution][Endpoint][Trusted Apps] TA delete modal shows # of policies it will impact (#111481) (#112048) Co-authored-by: Candace Park <56409205+parkiino@users.noreply.github.com> --- .../trusted_app_deletion_dialog.test.tsx.snap | 156 ++++++++++++++---- .../view/trusted_app_deletion_dialog.tsx | 44 ++++- .../translations/translations/ja-JP.json | 2 - .../translations/translations/zh-CN.json | 2 - 4 files changed, 159 insertions(+), 45 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/__snapshots__/trusted_app_deletion_dialog.test.tsx.snap b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/__snapshots__/trusted_app_deletion_dialog.test.tsx.snap index 0343ab62b9773..070f1b9eabe23 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/__snapshots__/trusted_app_deletion_dialog.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/__snapshots__/trusted_app_deletion_dialog.test.tsx.snap @@ -42,7 +42,13 @@ exports[`TrustedAppDeletionDialog renders correctly when deletion failed 1`] = `
- You are removing trusted application " - + + - trusted app 3 - - ". -
+ Warning + ++ Deleting this entry will remove it from all associated policies. +
+This action cannot be undone. Are you sure you wish to continue?
@@ -98,7 +128,7 @@ exports[`TrustedAppDeletionDialog renders correctly when deletion failed 1`] = ` - Remove trusted application + Delete @@ -146,7 +176,13 @@ exports[`TrustedAppDeletionDialog renders correctly when deletion is in progress- You are removing trusted application " - + + - trusted app 3 - - ". -
+ Warning + ++ Deleting this entry will remove it from all associated policies. +
+This action cannot be undone. Are you sure you wish to continue?
@@ -207,7 +267,7 @@ exports[`TrustedAppDeletionDialog renders correctly when deletion is in progress - Remove trusted application + Delete @@ -255,7 +315,13 @@ exports[`TrustedAppDeletionDialog renders correctly when dialog started 1`] = `- You are removing trusted application " - + + - trusted app 3 - - ". -
+ Warning + ++ Deleting this entry will remove it from all associated policies. +
+This action cannot be undone. Are you sure you wish to continue?
@@ -311,7 +401,7 @@ exports[`TrustedAppDeletionDialog renders correctly when dialog started 1`] = ` - Remove trusted application + Delete diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx index 3afa2642eba12..9e76cfd001c97 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx @@ -14,6 +14,8 @@ import { EuiButtonEmpty, EuiButtonProps, PropsForButton, + EuiCallOut, + EuiSpacer, EuiModal, EuiModalBody, EuiModalFooter, @@ -22,7 +24,13 @@ import { EuiText, } from '@elastic/eui'; -import { Immutable, TrustedApp } from '../../../../../common/endpoint/types'; +import { + Immutable, + ImmutableObject, + PolicyEffectScope, + GlobalEffectScope, + TrustedApp, +} from '../../../../../common/endpoint/types'; import { AppAction } from '../../../../common/store/actions'; import { useTrustedAppsSelector } from './hooks'; import { @@ -33,19 +41,36 @@ import { const CANCEL_SUBJ = 'trustedAppDeletionCancel'; const CONFIRM_SUBJ = 'trustedAppDeletionConfirm'; +const isTrustedAppByPolicy = ( + trustedApp: ImmutableObject{translations.calloutMessage}
+{translations.mainMessage}
{translations.subMessage}