Skip to content

Commit

Permalink
Added Offcanvas actions to Auth Methods page, and added Scripted Aler…
Browse files Browse the repository at this point in the history
…t for Soft Deleted Mailboxes

Added Offcanvas actions to Auth Methods page
Added Scripted Alert for Soft Deleted Mailboxes
  • Loading branch information
BNWEIN committed Jul 2, 2024
1 parent 58a68bd commit fabdeff
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/data/alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,10 @@
"name": "DepTokenExpiry",
"label": "Alert on expiring DEP tokens",
"recommendedRunInterval": "1d"
},
{
"name": "SoftDeletedMailboxes",
"label": "Alert on soft deleted mailboxes",
"recommendedRunInterval": "1d"
}
]
]
64 changes: 64 additions & 0 deletions src/views/tenant/administration/AuthMethods.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,66 @@ import { useGenericGetRequestQuery } from 'src/store/api/app'
import { CippTable, cellBooleanFormatter } from 'src/components/tables'
import { CellTip, cellGenericFormatter } from 'src/components/tables/CellGenericFormat'

const Offcanvas = (row, rowIndex, formatExtraData) => {
const tenant = useSelector((state) => state.app.currentTenant)
const [ocVisible, setOCVisible] = useState(false)
const formatTargets = (targets) => {
if (Array.isArray(targets)) {
return targets.map((target) => JSON.stringify(target)).join(', ')
}
return targets
}

return (
<>
<CButton size="sm" color="link" onClick={() => setOCVisible(true)}>
<FontAwesomeIcon icon={faEllipsisV} />
</CButton>
<CippActionsOffcanvas
title="Extended Information"
extendedInfo={[
{ label: 'id', value: `${row.id}` },
{ label: 'state', value: `${row.state}` },
{ label: 'includeTargets', value: formatTargets(row.includeTargets) },
{ label: 'excludeTargets', value: formatTargets(row.excludeTargets) },
]}
actions={[
{
label: 'Enable Policy',
color: 'info',
modal: true,
modalType: 'POST',
modalBody: {
id: row.id,
state: 'enabled',
TenantFilter: tenant.defaultDomainName,
},
modalUrl: `/api/SetAuthMethod`,
modalMessage: 'Are you sure you want to enable this policy?',
},
{
label: 'Disable Policy',
color: 'info',
modal: true,
modalType: 'POST',
modalBody: {
id: row.id,
state: 'disabled',
TenantFilter: tenant.defaultDomainName,
},
modalUrl: `/api/SetAuthMethod`,
modalMessage: 'Are you sure you want to enable this policy?',
},
]}
placement="end"
visible={ocVisible}
id={row.id}
hideFunction={() => setOCVisible(false)}
/>
</>
)
}

const columns = [
{
name: 'id',
Expand Down Expand Up @@ -39,6 +99,10 @@ const columns = [
cell: cellGenericFormatter(),
exportSelector: 'excludeTargets',
},
{
name: 'Actions',
cell: Offcanvas,
},
]

const AuthenticationMethods = () => {
Expand Down

0 comments on commit fabdeff

Please sign in to comment.