Skip to content

Commit df8e011

Browse files
create
1 parent e655b28 commit df8e011

File tree

6 files changed

+161
-3
lines changed

6 files changed

+161
-3
lines changed

src/_nav.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,14 @@ const _nav = [
481481
},
482482
{
483483
component: CNavItem,
484-
name: 'MEM Policies',
484+
name: 'Configuration Policies',
485485
to: '/endpoint/MEM/list-policies',
486486
},
487+
{
488+
component: CNavItem,
489+
name: 'Protection Policies',
490+
to: '/endpoint/MEM/list-appprotection-policies',
491+
},
487492
{
488493
component: CNavItem,
489494
name: 'Apply Policy',

src/routes.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ const AutopilotListStatusPages = React.lazy(() =>
130130
import('src/views/endpoint/autopilot/AutopilotListStatusPages'),
131131
)
132132
const IntuneListPolicies = React.lazy(() => import('src/views/endpoint/intune/MEMListPolicies'))
133+
const IntuneListAppProtection = React.lazy(() =>
134+
import('src/views/endpoint/intune/MEMListAppProtection'),
135+
)
136+
133137
const MEMEditPolicy = React.lazy(() => import('src/views/endpoint/intune/MEMEditPolicy'))
134138

135139
const IntuneCAPolicies = React.lazy(() => import('src/views/endpoint/intune/MEMCAPolicies'))
@@ -481,7 +485,17 @@ const routes = [
481485
component: AutopilotListStatusPages,
482486
},
483487
{ path: '/endpoint/MEM', name: 'MEM' },
484-
{ path: '/endpoint/MEM/list-policies', name: 'List MEM Policies', component: IntuneListPolicies },
488+
{
489+
path: '/endpoint/MEM/list-policies',
490+
name: 'List Intune Policies',
491+
component: IntuneListPolicies,
492+
},
493+
{
494+
path: '/endpoint/MEM/list-appprotection-policies',
495+
name: 'List App Protection Policies',
496+
component: IntuneListAppProtection,
497+
},
498+
485499
{ path: '/endpoint/MEM/edit-policy', name: 'Edit MEM Policy', component: MEMEditPolicy },
486500
{ path: '/endpoint/MEM/ca-policies', name: 'List Status Pages', component: IntuneCAPolicies },
487501
{ path: '/endpoint/MEM/add-policy', name: 'Add Intune Policy', component: IntuneAddPolicy },

src/views/endpoint/intune/MEMAddPolicy.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ const AddPolicy = () => {
170170
{ label: 'Administrative Template', value: 'Admin' },
171171
{ label: 'Settings Catalog', value: 'Catalog' },
172172
{ label: 'Custom Configuration', value: 'Device' },
173+
{ label: 'App Protection or Configuration Policy', value: 'AppProtection' },
173174
]}
174175
/>
175176
</CCol>
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
import React, { useState } from 'react'
2+
import { useSelector } from 'react-redux'
3+
import { CButton } from '@coreui/react'
4+
import {
5+
faBook,
6+
faEdit,
7+
faEllipsisV,
8+
faGlobeEurope,
9+
faPager,
10+
faTrashAlt,
11+
faUser,
12+
} from '@fortawesome/free-solid-svg-icons'
13+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
14+
import { CippPageList } from 'src/components/layout'
15+
import { Link } from 'react-router-dom'
16+
import { CippActionsOffcanvas, CippCodeBlock } from 'src/components/utilities'
17+
import { TitleButton } from 'src/components/buttons'
18+
import { cellBooleanFormatter, cellDateFormatter } from 'src/components/tables'
19+
20+
const Actions = (row, rowIndex, formatExtraData) => {
21+
const [ocVisible, setOCVisible] = useState(false)
22+
console.log(row)
23+
const tenant = useSelector((state) => state.app.currentTenant)
24+
return (
25+
<>
26+
<CButton size="sm" color="link" onClick={() => setOCVisible(true)}>
27+
<FontAwesomeIcon icon={faEllipsisV} />
28+
</CButton>
29+
<CippActionsOffcanvas
30+
title="Policy Information"
31+
extendedInfo={[
32+
{ label: 'Created on', value: `${row.createdDateTime}` },
33+
{ label: 'Display Name', value: `${row.displayName}` },
34+
{ label: 'Last Modified', value: `${row.lastModifiedDateTime}` },
35+
{ label: 'Type', value: `${row.PolicyTypeName}` },
36+
]}
37+
actions={[
38+
{
39+
label: 'Create template based on policy (beta)',
40+
color: 'info',
41+
modal: true,
42+
icon: <FontAwesomeIcon icon={faBook} className="me-2" />,
43+
modalUrl: `/api/AddIntuneTemplate?TenantFilter=${tenant.defaultDomainName}&ID=${row.id}&URLName=managedAppPolicies`,
44+
modalMessage: 'Are you sure you want to create a template based on this policy?',
45+
},
46+
{
47+
label: 'Delete Policy',
48+
color: 'danger',
49+
modal: true,
50+
icon: <FontAwesomeIcon icon={faTrashAlt} className="me-2" />,
51+
modalUrl: `/api/RemovePolicy?TenantFilter=${tenant.defaultDomainName}&ID=${row.id}&URLName=${row.URLName}`,
52+
modalMessage: 'Are you sure you want to delete this policy?',
53+
},
54+
]}
55+
placement="end"
56+
visible={ocVisible}
57+
id={row.id}
58+
hideFunction={() => setOCVisible(false)}
59+
/>
60+
</>
61+
)
62+
}
63+
64+
const columns = [
65+
{
66+
selector: (row) => row['displayName'],
67+
name: 'Name',
68+
sortable: true,
69+
exportSelector: 'displayName',
70+
},
71+
{
72+
selector: (row) => row['isAssigned'],
73+
name: 'Is Assigned',
74+
sortable: true,
75+
exportSelector: 'isAssigned',
76+
cell: cellBooleanFormatter(),
77+
},
78+
{
79+
selector: (row) => row['lastModifiedDateTime'],
80+
name: 'Last Modified',
81+
exportSelector: 'lastModifiedDateTime',
82+
cell: cellDateFormatter({ format: 'relative' }),
83+
},
84+
{
85+
name: 'Actions',
86+
cell: Actions,
87+
maxWidth: '80px',
88+
},
89+
]
90+
91+
const AppProtectionList = () => {
92+
const tenant = useSelector((state) => state.app.currentTenant)
93+
94+
// eslint-disable-next-line react/prop-types
95+
const ExpandedComponent = ({ data }) => (
96+
// eslint-disable-next-line react/prop-types
97+
<CippCodeBlock code={JSON.stringify(data, null, 2)} language="json" />
98+
)
99+
100+
return (
101+
<CippPageList
102+
title="App Protection & Configuration Policies"
103+
titleButton={
104+
<>
105+
<TitleButton
106+
href={`/endpoint/MEM/add-policy?customerId=${tenant?.customerId}&tableFilter=${tenant?.defaultDomainName}`}
107+
title="Deploy MEM Policy"
108+
/>
109+
</>
110+
}
111+
tenantSelector={true}
112+
datatable={{
113+
path: '/api/ListGraphRequest',
114+
params: {
115+
TenantFilter: tenant?.defaultDomainName,
116+
Endpoint: 'deviceAppManagement/managedAppPolicies',
117+
$orderby: 'displayName',
118+
},
119+
columns,
120+
reportName: `${tenant?.defaultDomainName}-MEMPolicies-List`,
121+
tableProps: {
122+
expandableRows: true,
123+
expandableRowsComponent: ExpandedComponent,
124+
expandOnRowClicked: true,
125+
},
126+
}}
127+
/>
128+
)
129+
}
130+
131+
export default AppProtectionList

src/views/endpoint/intune/MEMListPolicies.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const IntuneList = () => {
121121

122122
return (
123123
<CippPageList
124-
title="MEM Policies"
124+
title="Configuration Policies"
125125
titleButton={
126126
<>
127127
<TitleButton

src/views/identity/administration/Users.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,13 @@ const Users = (row) => {
428428
title="Invite Guest"
429429
/>
430430
</div>
431+
<div style={{ marginLeft: '10px' }}>
432+
<TitleButton
433+
key="Invite-Bulk"
434+
href="/identity/administration/users/addbulk"
435+
title="Bulk Add"
436+
/>
437+
</div>
431438
</div>
432439
)
433440

0 commit comments

Comments
 (0)