Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] dev from KelvinTegelaar:dev #177

Merged
merged 10 commits into from
May 26, 2024
28 changes: 14 additions & 14 deletions src/components/tables/CippTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ export default function CippTable({
(modalMessage, modalUrl, modalType = 'GET', modalBody, modalInput, modalDropdown) => {
if (modalType === 'GET') {
ModalService.confirm({
getData: () => inputRef.current?.value,
body: (
<div style={{ overflow: 'visible' }}>
<div>{modalMessage}</div>
Expand Down Expand Up @@ -466,6 +467,18 @@ export default function CippTable({
title: 'Confirm',
onConfirm: async () => {
const resultsarr = []
const selectedValue = inputRef.current.value
let additionalFields = {}
if (inputRef.current.nodeName === 'SELECT') {
const selectedItem = dropDownInfo.data.find(
(item) => item[modalDropdown.valueField] === selectedValue,
)
if (selectedItem && modalDropdown.addedField) {
Object.keys(modalDropdown.addedField).forEach((key) => {
additionalFields[key] = selectedItem[modalDropdown.addedField[key]]
})
}
}
for (const row of selectedRows) {
setLoopRunning(true)
const urlParams = new URLSearchParams(modalUrl.split('?')[1])
Expand All @@ -492,26 +505,13 @@ export default function CippTable({
}
}
const NewModalUrl = `${modalUrl.split('?')[0]}?${urlParams.toString()}`
const selectedValue = inputRef.current.value
let additionalFields = {}
if (inputRef.current.nodeName === 'SELECT') {
const selectedItem = dropDownInfo.data.find(
(item) => item[modalDropdown.valueField] === selectedValue,
)
if (selectedItem && modalDropdown.addedField) {
Object.keys(modalDropdown.addedField).forEach((key) => {
additionalFields[key] = selectedItem[modalDropdown.addedField[key]]
})
}
}

const results = await genericPostRequest({
path: NewModalUrl,
values: {
...modalBody,
...newModalBody,
...additionalFields,
...{ input: inputRef.current.value },
...{ input: selectedValue },
},
})
resultsarr.push(results)
Expand Down
38 changes: 33 additions & 5 deletions src/data/standards.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@
"label": "Show header"
},
{
"type":"boolean",
"name":"standards.Branding.isFooterShown",
"label":"Show footer"
"type": "boolean",
"name": "standards.Branding.isFooterShown",
"label": "Show footer"
}
],
"label": "Set branding for the tenant",
Expand Down Expand Up @@ -156,8 +156,36 @@
"cat": "Global Standards",
"tag": ["mediumimpact", "CIS", "spo_idle_session_timeout"],
"helpText": "Enables and sets Idle session timeout for Microsoft 365 to 1 hour. This policy affects most M365 web apps",
"addedComponent": [],
"label": "Enable 1 hour Activity based Timeout",
"addedComponent": [
{
"type": "Select",
"label": "Select value",
"name": "standards.ActivityBasedTimeout.timeout",
"values": [
{
"label": "1 Hour",
"value": "01:00:00"
},
{
"label": "3 Hours",
"value": "03:00:00"
},
{
"label": "6 Hours",
"value": "06:00:00"
},
{
"label": "12 Hours",
"value": "12:00:00"
},
{
"label": "24 Hours",
"value": "1.00:00:00"
}
]
}
],
"label": "Enable Activity based Timeout",
"impact": "Medium Impact",
"impactColour": "warning"
},
Expand Down
11 changes: 10 additions & 1 deletion src/views/endpoint/intune/MEMListAppProtection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Actions = (row, rowIndex, formatExtraData) => {
color: 'danger',
modal: true,
icon: <FontAwesomeIcon icon={faTrashAlt} className="me-2" />,
modalUrl: `/api/RemovePolicy?TenantFilter=${tenant.defaultDomainName}&ID=${row.id}&URLName=${row.URLName}`,
modalUrl: `/api/RemovePolicy?TenantFilter=${tenant.defaultDomainName}&ID=${row.id}&URLName=managedAppPolicies`,
modalMessage: 'Are you sure you want to delete this policy?',
},
]}
Expand Down Expand Up @@ -122,6 +122,15 @@ const AppProtectionList = () => {
expandableRows: true,
expandableRowsComponent: ExpandedComponent,
expandOnRowClicked: true,
selectableRows: true,
actionsList: [
{
label: 'Delete Policy',
modal: true,
modalUrl: `api/RemovePolicy?TenantFilter=${tenant?.defaultDomainName}&ID=!id&URLName=managedAppPolicies`,
modalMessage: 'Are you sure you want to convert these users to a shared mailbox?',
},
],
},
}}
/>
Expand Down
11 changes: 10 additions & 1 deletion src/views/endpoint/intune/MEMListCompliance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const Actions = (row, rowIndex, formatExtraData) => {
color: 'danger',
modal: true,
icon: <FontAwesomeIcon icon={faTrashAlt} className="me-2" />,
modalUrl: `/api/RemovePolicy?TenantFilter=${tenant.defaultDomainName}&ID=${row.id}&URLName=${row.URLName}`,
modalUrl: `/api/RemovePolicy?TenantFilter=${tenant.defaultDomainName}&ID=${row.id}&URLName=deviceCompliancePolicies`,
modalMessage: 'Are you sure you want to delete this policy?',
},
]}
Expand Down Expand Up @@ -145,6 +145,15 @@ const ComplianceList = () => {
expandableRows: true,
expandableRowsComponent: ExpandedComponent,
expandOnRowClicked: true,
selectableRows: true,
actionsList: [
{
label: 'Delete Policy',
modal: true,
modalUrl: `api/RemovePolicy?TenantFilter=${tenant?.defaultDomainName}&ID=!id&URLName=deviceCompliancePolicies`,
modalMessage: 'Are you sure you want to convert these users to a shared mailbox?',
},
],
},
}}
/>
Expand Down
9 changes: 9 additions & 0 deletions src/views/endpoint/intune/MEMListPolicies.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ const IntuneList = () => {
expandableRows: true,
expandableRowsComponent: ExpandedComponent,
expandOnRowClicked: true,
selectableRows: true,
actionsList: [
{
label: 'Delete Policy',
modal: true,
modalUrl: `api/RemovePolicy?TenantFilter=${tenant?.defaultDomainName}&ID=!id&URLName=!URLName`,
modalMessage: 'Are you sure you want to convert these users to a shared mailbox?',
},
],
},
}}
/>
Expand Down
45 changes: 25 additions & 20 deletions src/views/identity/administration/OffboardingWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,18 @@ const OffboardingWizard = () => {
data: users = [],
isFetching: usersIsFetching,
error: usersError,
} = useListUsersQuery({ tenantDomain })
} = useGenericGetRequestQuery({
path: `/api/ListGraphRequest`,
params: {
TenantFilter: tenantDomain,
Endpoint: 'users',
$select:
'id,displayName,givenName,mail,mailNickname,proxyAddresses,usageLocation,userPrincipalName,userType,assignedLicenses,onPremisesSyncEnabled',
$count: true,
$orderby: 'displayName',
$top: 999,
},
})

const {
data: recipients = [],
Expand Down Expand Up @@ -121,7 +132,7 @@ const OffboardingWizard = () => {
<RFFSelectSearch
multi
label={'Users in ' + tenantDomain}
values={users?.map((user) => ({
values={users?.Results?.map((user) => ({
value: user.userPrincipalName,
name: `${user.displayName} <${user.userPrincipalName}>`,
}))}
Expand Down Expand Up @@ -177,36 +188,30 @@ const OffboardingWizard = () => {
<RFFSelectSearch
label="Give other user full access on mailbox without automapping"
multi
values={users
?.filter((x) => x.mail)
.map((user) => ({
value: user.mail,
name: `${user.displayName} <${user.mail}>`,
}))}
values={users.Results?.filter((x) => x.mail).map((user) => ({
value: user.mail,
name: `${user.displayName} <${user.mail}>`,
}))}
placeholder={!usersIsFetching ? 'Select user' : 'Loading...'}
name="AccessNoAutomap"
/>
<RFFSelectSearch
label="Give other user full access on mailbox with automapping"
multi
values={users
?.filter((x) => x.mail)
.map((user) => ({
value: user.mail,
name: `${user.displayName} <${user.mail}>`,
}))}
values={users.Results?.filter((x) => x.mail).map((user) => ({
value: user.mail,
name: `${user.displayName} <${user.mail}>`,
}))}
placeholder={!usersIsFetching ? 'Select user' : 'Loading...'}
name="AccessAutomap"
/>
<RFFSelectSearch
label="Give other user full access on Onedrive"
multi
values={users
?.filter((x) => x.mail)
.map((user) => ({
value: user.mail,
name: `${user.displayName} <${user.mail}>`,
}))}
values={users.Results?.filter((x) => x.mail).map((user) => ({
value: user.mail,
name: `${user.displayName} <${user.mail}>`,
}))}
placeholder={!usersIsFetching ? 'Select user' : 'Loading...'}
name="OnedriveAccess"
/>
Expand Down
27 changes: 26 additions & 1 deletion src/views/identity/administration/Roles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ const Offcanvas = (row, rowIndex, formatExtraData) => {
>
<h5>Role Group Name:</h5> {row.DisplayName}
<br></br> <br></br>
<h5>Member Names:</h5> {row.Members ? <p>{row.Members}</p> : <p>Role has no members.</p>}
<h5>Member Names:</h5>{' '}
{row.Members ? (
row.Members.split(',').map((member, index) => <p key={index}>{member}</p>)
) : (
<p>Role has no members.</p>
)}
</CippOffcanvas>
</>
)
Expand Down Expand Up @@ -53,6 +58,26 @@ const columns = [
exportSelector: 'Members',
omit: true,
},
{
selector: (row) => row['Members'],
name: 'Assignments',
sortable: false,
cell: (row) => {
if (row.Members === 'none') {
return null
}
const memberCount = row.Members ? row.Members.split(',').length : 0
const memberText =
row.Members && row.Members !== 'none' ? `Member${memberCount === 1 ? '' : 's'}` : null
return (
<>
{memberCount} {memberText}
</>
)
},
exportSelector: 'Members',
maxWidth: '150px',
},
{
selector: (row) => 'View Members',
name: 'Members',
Expand Down
2 changes: 1 addition & 1 deletion src/views/tenant/administration/ListGDAPRelationships.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const GDAPRelationships = () => {
columns,
reportName: `GDAP-Relationships`,
path: '/api/ListGraphRequest',
params: { Endpoint: 'tenantRelationships/delegatedAdminRelationships' },
params: { Endpoint: 'tenantRelationships/delegatedAdminRelationships', $top: 300 },
}}
/>
</div>
Expand Down