-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Expand file tree
/
Copy pathindex.js
More file actions
115 lines (109 loc) · 3.1 KB
/
Copy pathindex.js
File metadata and controls
115 lines (109 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import { Layout as DashboardLayout } from '../../../../layouts/index.js'
import { CippTablePage } from '../../../../components/CippComponents/CippTablePage.jsx'
import { Book, Block, Check } from '@mui/icons-material'
import { TrashIcon } from '@heroicons/react/24/outline'
import { CippDeployCompliancePolicyDrawer } from '../../../../components/CippComponents/CippDeployCompliancePolicyDrawer.jsx'
import { PermissionButton } from '../../../../utils/permissions.js'
import { useSettings } from '../../../../hooks/use-settings'
const Page = () => {
const pageTitle = 'DLP Compliance Policies'
const apiUrl = '/api/ListDlpCompliancePolicy'
const tenantFilter = useSettings().currentTenant
const cardButtonPermissions = ['Security.DlpCompliancePolicy.ReadWrite']
const actions = [
{
label: 'Create template based on policy',
type: 'POST',
icon: <Book />,
url: '/api/AddDlpCompliancePolicyTemplate',
dataFunction: (data) => {
return { ...data }
},
confirmText: 'Are you sure you want to create a template based on this DLP policy?',
hideBulk: true,
},
{
label: 'Enable Policy',
type: 'POST',
icon: <Check />,
url: '/api/EditDlpCompliancePolicy',
data: {
State: '!enable',
Identity: 'Name',
},
confirmText: 'Are you sure you want to enable this DLP policy?',
condition: (row) => row.Enabled === false,
},
{
label: 'Disable Policy',
type: 'POST',
icon: <Block />,
url: '/api/EditDlpCompliancePolicy',
data: {
State: '!disable',
Identity: 'Name',
},
confirmText: 'Are you sure you want to disable this DLP policy?',
condition: (row) => row.Enabled === true,
},
{
label: 'Delete Policy',
type: 'POST',
icon: <TrashIcon />,
url: '/api/RemoveDlpCompliancePolicy',
data: {
Identity: 'Name',
},
confirmText: 'Are you sure you want to delete this DLP policy?',
color: 'danger',
},
]
const offCanvas = {
extendedInfoFields: [
'Name',
'Comment',
'Mode',
'Enabled',
'Workload',
'ExchangeLocation',
'SharePointLocation',
'OneDriveLocation',
'TeamsLocation',
'EndpointDlpLocation',
'RuleCount',
'CreatedBy',
'WhenCreatedUTC',
'WhenChangedUTC',
],
actions: actions,
}
const simpleColumns = [
'Name',
'Mode',
'Enabled',
'Workload',
'RuleCount',
'CreatedBy',
'WhenCreatedUTC',
'WhenChangedUTC',
]
return (
<CippTablePage
title={pageTitle}
apiUrl={apiUrl}
queryKey={`ListDlpCompliancePolicy-${tenantFilter}`}
actions={actions}
offCanvas={offCanvas}
simpleColumns={simpleColumns}
cardButton={
<CippDeployCompliancePolicyDrawer
mode="DlpCompliancePolicy"
requiredPermissions={cardButtonPermissions}
PermissionButton={PermissionButton}
/>
}
/>
)
}
Page.getLayout = (page) => <DashboardLayout allTenantsSupport={false}>{page}</DashboardLayout>
export default Page