Skip to content

Commit

Permalink
add assign policies
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Dec 11, 2023
1 parent a2b2028 commit e652356
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions src/views/endpoint/intune/MEMListPolicies.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import React, { useState } from 'react'
import { useSelector } from 'react-redux'
import { CButton } from '@coreui/react'
import { faBook, faEdit, faEllipsisV, faTrashAlt } from '@fortawesome/free-solid-svg-icons'
import {
faBook,
faEdit,
faEllipsisV,
faGlobeEurope,
faPager,
faTrashAlt,
faUser,
} from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { CippPageList } from 'src/components/layout'
import { Link } from 'react-router-dom'
Expand All @@ -14,13 +22,6 @@ const Actions = (row, rowIndex, formatExtraData) => {
const tenant = useSelector((state) => state.app.currentTenant)
return (
<>
<Link
to={`/endpoint/MEM/edit-policy?ID=${row.id}&tenantDomain=${tenant.defaultDomainName}&urlName=${row.URLName}`}
>
<CButton size="sm" variant="ghost" color="warning">
<FontAwesomeIcon icon={faEdit} />
</CButton>
</Link>
<CButton size="sm" color="link" onClick={() => setOCVisible(true)}>
<FontAwesomeIcon icon={faEllipsisV} />
</CButton>
Expand All @@ -41,6 +42,30 @@ const Actions = (row, rowIndex, formatExtraData) => {
modalUrl: `/api/AddIntuneTemplate?TenantFilter=${tenant.defaultDomainName}&ID=${row.id}&URLName=${row.URLName}`,
modalMessage: 'Are you sure you want to create a template based on this policy?',
},
{
icon: <FontAwesomeIcon icon={faUser} />,
label: ' Assign to All Users',
color: 'info',
modal: true,
modalUrl: `/api/ExecAssignPolicy?AssignTo=allLicensedUsers&TenantFilter=${tenant.defaultDomainName}&ID=${row.id}`,
modalMessage: `Are you sure you want to assign ${row.displayName} to all users?`,
},
{
icon: <FontAwesomeIcon icon={faPager} />,
label: ' Assign to All Devices',
color: 'info',
modal: true,
modalUrl: `/api/ExecAssignPolicy?AssignTo=AllDevices&TenantFilter=${tenant.defaultDomainName}&ID=${row.id}`,
modalMessage: `Are you sure you want to assign ${row.displayName} to all devices?`,
},
{
icon: <FontAwesomeIcon icon={faGlobeEurope} />,
label: ' Assign Globally (All Users / All Devices)',
color: 'info',
modal: true,
modalUrl: `/api/ExecAssignPolicy?AssignTo=AllDevicesAndUsers&TenantFilter=${tenant.defaultDomainName}&ID=${row.id}`,
modalMessage: `Are you sure you want to assign ${row.displayName} to all users and devices?`,
},
{
label: 'Delete Policy',
color: 'danger',
Expand Down

0 comments on commit e652356

Please sign in to comment.