diff --git a/src/components/utilities/CippActionsOffcanvas.jsx b/src/components/utilities/CippActionsOffcanvas.jsx index c335bae5db5a..e543a511ffb1 100644 --- a/src/components/utilities/CippActionsOffcanvas.jsx +++ b/src/components/utilities/CippActionsOffcanvas.jsx @@ -36,6 +36,7 @@ import ReactTimeAgo from 'react-time-ago' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faGlobe } from '@fortawesome/free-solid-svg-icons' import { cellGenericFormatter } from '../tables/CellGenericFormat' +import ReactSelect from 'react-select' const CippOffcanvasCard = ({ action, key }) => { const [offcanvasVisible, setOffcanvasVisible] = useState(false) @@ -111,11 +112,14 @@ export default function CippActionsOffcanvas(props) { const handleModal = useCallback( (modalMessage, modalUrl, modalType = 'GET', modalBody, modalInput, modalDropdown) => { const handlePostConfirm = () => { - const selectedValue = inputRef.current.value + console.log(inputRef) + const selectedValue = inputRef.current.props?.id + ? inputRef.current.props.value.value + : inputRef.current.value //console.log(inputRef) let additionalFields = {} - if (inputRef.current.nodeName === 'SELECT') { + if (inputRef.current.props?.id) { const selectedItem = dropDownInfo.data.find( (item) => item[modalDropdown.valueField] === selectedValue, ) @@ -190,7 +194,10 @@ export default function CippActionsOffcanvas(props) { {modalDropdown && (
{dropDownInfo.isSuccess && ( - ({ value: data[modalDropdown.valueField], diff --git a/src/views/email-exchange/administration/MailboxesList.jsx b/src/views/email-exchange/administration/MailboxesList.jsx index 09c9cd57a477..ee624c2cfa7a 100644 --- a/src/views/email-exchange/administration/MailboxesList.jsx +++ b/src/views/email-exchange/administration/MailboxesList.jsx @@ -140,6 +140,20 @@ const MailboxList = () => { modalMessage: 'Are you sure you want to start the managed folder assistant for the user?', }, + { + label: 'Set mailbox locale', + color: 'info', + modal: true, + modalType: 'POST', + modalBody: { + user: row.UPN, + TenantFilter: tenant.defaultDomainName, + ProhibitSendQuota: true, + }, + modalUrl: `/api/ExecSetMailboxLocale`, + modalInput: true, + modalMessage: 'Enter a locale, e.g. en-US', + }, { label: 'Set Send Quota', color: 'info', diff --git a/src/views/identity/administration/RiskyUsers.jsx b/src/views/identity/administration/RiskyUsers.jsx index 03f58eaf241f..727ee8dd896d 100644 --- a/src/views/identity/administration/RiskyUsers.jsx +++ b/src/views/identity/administration/RiskyUsers.jsx @@ -1,54 +1,151 @@ +import React, { useState } from 'react' import { useSelector } from 'react-redux' import { CippPageList } from 'src/components/layout' - -const columns = [ - { - name: 'Risk Last Updated Date', - selector: (row) => row['riskLastUpdatedDateTime'], - sortable: true, - exportSelector: 'riskLastUpdatedDateTime', - }, - { - name: 'User Principal Name', - selector: (row) => row['userPrincipalName'], - sortable: true, - exportSelector: 'userPrincipalName', - }, - { - name: 'Risk Level', - selector: (row) => row['riskLevel'], - sortable: true, - exportSelector: 'riskLevel', - }, - { - name: 'Risk State', - selector: (row) => row['riskState'], - sortable: true, - exportSelector: 'riskState', - }, - { - name: 'Risk Detail', - selector: (row) => row['riskDetail'], - sortable: true, - exportSelector: 'riskDetail', - }, - { - name: 'isProcessing', - selector: (row) => row['isProcessing'], - sortable: true, - exportSelector: 'isProcessing', - }, - { - name: 'isDeleted', - selector: (row) => row['isDeleted'], - sortable: true, - exportSelector: 'isDeleted', - }, -] +import { CButton } from '@coreui/react' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faEllipsisV, faMinusCircle, faPaperPlane, faEye } from '@fortawesome/free-solid-svg-icons' +import { CippActionsOffcanvas } from 'src/components/utilities' +import { Link, useSearchParams } from 'react-router-dom' const RiskyUsers = () => { const tenant = useSelector((state) => state.app.currentTenant) + const Offcanvas = (row, rowIndex, formatExtraData) => { + const [ocVisible, setOCVisible] = useState(false) + const viewLink = `/identity/administration/ViewBec?userId=${row.id}&tenantDomain=${tenant.defaultDomainName}&ID=${row.userPrincipalName}` + return ( + <> + + + + + + setOCVisible(true)}> + + + , + }, + /* TODO Add action for Compromised + { + label: 'Confirm Compromised', + color: 'info', + modal: true, + modalUrl: `/api/ExecBECRemediate?TenantFilter=${tenant.defaultDomainName}&userid=${row.id}`, + modalMessage: 'Are you sure you want to confirm this user as compromised?', + icon: , + },*/ + ]} + placement="end" + visible={ocVisible} + id={row.id} + hideFunction={() => setOCVisible(false)} + /> + + ) + } + + const columns = [ + { + name: 'Risk Last Updated Date', + selector: (row) => row['riskLastUpdatedDateTime'], + sortable: true, + exportSelector: 'riskLastUpdatedDateTime', + }, + { + name: 'User Principal Name', + selector: (row) => row['userPrincipalName'], + sortable: true, + exportSelector: 'userPrincipalName', + }, + { + name: 'Risk Level', + selector: (row) => row['riskLevel'], + sortable: true, + exportSelector: 'riskLevel', + }, + { + name: 'Risk State', + selector: (row) => row['riskState'], + sortable: true, + exportSelector: 'riskState', + }, + { + name: 'Risk Detail', + selector: (row) => row['riskDetail'], + sortable: true, + exportSelector: 'riskDetail', + }, + { + name: 'isProcessing', + selector: (row) => row['isProcessing'], + sortable: true, + exportSelector: 'isProcessing', + }, + { + name: 'isDeleted', + selector: (row) => row['isDeleted'], + sortable: true, + exportSelector: 'isDeleted', + }, + { + name: 'Actions', + cell: Offcanvas, + maxWidth: '100px', + }, + ] + return ( <> { $count: true, $orderby: 'riskLastUpdatedDateTime desc', }, + tableProps: { + selectableRows: true, + actionsList: [ + { + label: 'Dismiss Risk', + color: 'info', + model: true, + modalUrl: `/api/ExecDismissRiskyUser?TenantFilter=${tenant.defaultDomainName}&userid=!id&userDisplayName=!userDisplayName`, + }, + /* TODO Add action for Compromised + { + label: 'Confirm Compromised', + color: 'danger', + model: true, + modalUrl: `/api/ExecBECRemediate?TenantFilter=${tenant.defaultDomainName}&userid=!id`, + },*/ + ], + }, }} /> diff --git a/src/views/identity/reports/RiskDetections.jsx b/src/views/identity/reports/RiskDetections.jsx index 02b84a9b1086..b139fa058161 100644 --- a/src/views/identity/reports/RiskDetections.jsx +++ b/src/views/identity/reports/RiskDetections.jsx @@ -1,80 +1,183 @@ +import React, { useState } from 'react' import { useSelector } from 'react-redux' import { CippPageList } from 'src/components/layout' import { CellTip } from 'src/components/tables' - -const columns = [ - { - name: 'Detected Date', - selector: (row) => row['detectedDateTime'], - sortable: true, - exportSelector: 'detectedDateTime', - }, - { - name: 'User Principal Name', - selector: (row) => row['userPrincipalName'], - sortable: true, - exportSelector: 'userPrincipalName', - }, - { - name: 'Location', - selector: (row) => `${row.location?.city} - ${row.location?.countryOrRegion}`, - sortable: true, - exportSelector: 'Location', - cell: (row) => CellTip(`${row.location?.city} - ${row.location?.countryOrRegion}`), - }, - { - name: 'IP Address', - selector: (row) => row['ipAddress'], - sortable: true, - exportSelector: 'ipAddress', - }, - { - name: 'Risk State', - selector: (row) => row['riskState'], - sortable: true, - exportSelector: 'riskState', - }, - { - name: 'Risk Detail', - selector: (row) => row['riskDetail'], - sortable: true, - exportSelector: 'riskDetail', - }, - { - name: 'Risk Level', - selector: (row) => row['riskLevel'], - sortable: true, - exportSelector: 'riskLevel', - }, - { - name: 'Risk Type', - selector: (row) => row['riskType'], - sortable: true, - exportSelector: 'riskType', - }, - { - name: 'Risk Event Type', - selector: (row) => row['riskEventType'], - sortable: true, - exportSelector: 'riskEventType', - }, - { - name: 'Detection Type', - selector: (row) => row['detectionTimingType'], - sortable: true, - exportSelector: 'detectionTimingType', - }, - { - name: 'Activity', - selector: (row) => row['activity'], - sortable: true, - exportSelector: 'activity', - }, -] +import { CButton } from '@coreui/react' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faEllipsisV, faMinusCircle, faPaperPlane, faEye } from '@fortawesome/free-solid-svg-icons' +import { CippActionsOffcanvas } from 'src/components/utilities' +import { Link, useSearchParams } from 'react-router-dom' const RiskDetections = () => { const tenant = useSelector((state) => state.app.currentTenant) + const Offcanvas = (row, rowIndex, formatExtraData) => { + const [ocVisible, setOCVisible] = useState(false) + const viewLink = `/identity/administration/ViewBec?userId=${row.userId}&tenantDomain=${tenant.defaultDomainName}&ID=${row.userPrincipalName}` + return ( + <> + + + + + + setOCVisible(true)}> + + + setOCVisible(false)} + /> + + ) + } + + const columns = [ + { + name: 'Detected Date', + selector: (row) => row['detectedDateTime'], + sortable: true, + exportSelector: 'detectedDateTime', + minWidth: '150px', + }, + { + name: 'User Principal Name', + selector: (row) => row['userPrincipalName'], + sortable: true, + exportSelector: 'userPrincipalName', + minWidth: '200px', + }, + { + name: 'Location', + selector: (row) => `${row.location?.city} - ${row.location?.countryOrRegion}`, + sortable: true, + exportSelector: 'Location', + cell: (row) => CellTip(`${row.location?.city} - ${row.location?.countryOrRegion}`), + minWidth: '40px', + }, + { + name: 'IP Address', + selector: (row) => row['ipAddress'], + sortable: true, + exportSelector: 'ipAddress', + minWidth: '40px', + }, + { + name: 'Risk State', + selector: (row) => row['riskState'], + sortable: true, + exportSelector: 'riskState', + minWidth: '40px', + }, + { + name: 'Risk Detail', + selector: (row) => row['riskDetail'], + sortable: true, + exportSelector: 'riskDetail', + minWidth: '200px', + }, + { + name: 'Risk Level', + selector: (row) => row['riskLevel'], + sortable: true, + exportSelector: 'riskLevel', + minWidth: '30px', + }, + { + name: 'Risk Type', + selector: (row) => row['riskType'], + sortable: true, + exportSelector: 'riskType', + minWidth: '150px', + }, + { + name: 'Risk Event Type', + selector: (row) => row['riskEventType'], + sortable: true, + exportSelector: 'riskEventType', + minWidth: '150px', + }, + { + name: 'Detection Type', + selector: (row) => row['detectionTimingType'], + sortable: true, + exportSelector: 'detectionTimingType', + minWidth: '50px', + }, + { + name: 'Activity', + selector: (row) => row['activity'], + sortable: true, + exportSelector: 'activity', + minWidth: '40px', + }, + { + name: 'Actions', + cell: Offcanvas, + maxWidth: '100px', + }, + ] + return ( <>