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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] dev from KelvinTegelaar:dev #56

Merged
merged 13 commits into from
Oct 30, 2023
2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.4.0
4.5.0
19 changes: 2 additions & 17 deletions src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const _nav = [
name: 'GDAP Roles',
to: '/tenant/administration/gdap-roles',
},
/*{
{
component: CNavItem,
name: 'Migration Wizard',
to: '/tenant/administration/gdap',
Expand All @@ -272,7 +272,7 @@ const _nav = [
component: CNavItem,
name: 'GDAP Migration Status',
to: '/tenant/administration/gdap-status',
},*/
},
{
component: CNavItem,
name: 'Invite Wizard',
Expand All @@ -283,12 +283,6 @@ const _nav = [
name: 'GDAP Relationships',
to: '/tenant/administration/gdap-relationships',
},
{
component: CNavItem,
name: 'Documentation',
href: 'https://cipp.app/docs/user/usingcipp/GDAP/migration',
target: '_blank',
},
],
},
{
Expand Down Expand Up @@ -338,15 +332,6 @@ const _nav = [
},
],
},
// Coming in another branch (heads up)
//{
//component: CNavGroup,
//name: 'Vulnerabilities',
//section: 'Security & Compliance',
//to: '/security/vulnerabilities',
//icon: <FontAwesomeIcon icon={faChessRook} className="nav-icon" />,
//items: [],
//},
{
component: CNavGroup,
name: 'Defender',
Expand Down
7 changes: 7 additions & 0 deletions src/data/standards.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@
},
"label": "Set Outbound Spam Alert e-mail"
},
{
"name": "standards.SafeSendersDisable",
"cat": "Exchange",
"helpText": "",
"addedComponent": null,
"label": "Remove Safe Senders to prevent SPF bypass"
},
{
"name": "standards.DisableSharedMailbox",
"cat": "Exchange",
Expand Down
6 changes: 3 additions & 3 deletions src/views/cipp/Logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const Logs = () => {
const DateFilter = query.get('DateFilter')
//const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery()
const [visibleA, setVisibleA] = useState(false)
const [startDate, setStartDate] = useState(new Date())
const [startDate, setStartDate] = useState(DateFilter ? new Date(DateFilter) : new Date())
const handleSubmit = async (values) => {
Object.keys(values).filter(function (x) {
if (values[x] === null) {
Expand All @@ -117,7 +117,7 @@ const Logs = () => {
})
const shippedValues = {
SearchNow: true,
DateFilter: startDate.toLocaleDateString('en-GB').split('/').reverse().join(''),
DateFilter: startDate.toISOString().split('T')[0].replace(/-/g, ''),
...values,
}
var queryString = Object.keys(shippedValues)
Expand Down Expand Up @@ -154,7 +154,7 @@ const Logs = () => {
initialValues={{
Severity: severity,
user: user,
DateFilter: DateFilter,
DateFilter: startDate.toISOString().split('T')[0].replace(/-/g, ''),
}}
onSubmit={handleSubmit}
render={({ handleSubmit, submitting, values }) => {
Expand Down
17 changes: 16 additions & 1 deletion src/views/endpoint/applications/ApplicationsAddChocoApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { CippWizard } from 'src/components/layout'
import { WizardTableField } from 'src/components/tables'
import PropTypes from 'prop-types'
import {
Condition,
RFFCFormCheck,
RFFCFormInput,
RFFCFormRadio,
Expand Down Expand Up @@ -57,6 +58,9 @@ const ApplyStandard = () => {
values.selectedTenants.map(
(tenant) => (values[`Select_${tenant.defaultDomainName}`] = tenant.defaultDomainName),
)
if (values.AssignTo === 'customGroup') {
values.AssignTo = values.customGroup
}
genericPostRequest({ path: '/api/AddChocoApp', values: values })
}
const handleSearch = async ({ searchString, customRepo }) => {
Expand Down Expand Up @@ -87,7 +91,6 @@ const ApplyStandard = () => {
console.log(value)
return obj.packagename === value
})
console.log(template[0])
onChange(template[0][set])
}}
</OnChange>
Expand Down Expand Up @@ -246,6 +249,18 @@ const ApplyStandard = () => {
name="AssignTo"
label="Assign to all users and devices"
></RFFCFormRadio>
<RFFCFormRadio
value="customGroup"
name="AssignTo"
label="Assign to Custom Group"
></RFFCFormRadio>
<Condition when="AssignTo" is="customGroup">
<RFFCFormInput
type="text"
name="customGroup"
label="Custom Group Names separated by comma. Wildcards (*) are allowed"
/>
</Condition>
</CForm>
<hr className="my-4" />
</CippWizard.Page>
Expand Down
15 changes: 15 additions & 0 deletions src/views/endpoint/applications/ApplicationsAddRMM.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const AddRMM = () => {
values.selectedTenants.map(
(tenant) => (values[`Select_${tenant.defaultDomainName}`] = tenant.defaultDomainName),
)
if (values.AssignTo === 'customGroup') {
values.AssignTo = values.customGroup
}
genericPostRequest({ path: '/api/AddMSPApp', values: values })
}

Expand Down Expand Up @@ -312,6 +315,18 @@ const AddRMM = () => {
name="AssignTo"
label="Assign to all users and devices"
></RFFCFormRadio>
<RFFCFormRadio
value="customGroup"
name="AssignTo"
label="Assign to Custom Group"
></RFFCFormRadio>
<Condition when="AssignTo" is="customGroup">
<RFFCFormInput
type="text"
name="customGroup"
label="Custom Group Names seperated by comma. Wildcards (*) are allowed"
/>
</Condition>
</CForm>
<hr className="my-4" />
</CippWizard.Page>
Expand Down
16 changes: 16 additions & 0 deletions src/views/endpoint/applications/ApplicationsAddWinGet.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { CippWizard } from 'src/components/layout'
import { WizardTableField } from 'src/components/tables'
import PropTypes from 'prop-types'
import {
Condition,
RFFCFormCheck,
RFFCFormInput,
RFFCFormRadio,
Expand Down Expand Up @@ -54,6 +55,9 @@ const AddWinGet = () => {
const [searchPostRequest, foundPackages] = useLazyGenericPostRequestQuery()

const handleSubmit = async (values) => {
if (values.AssignTo === 'customGroup') {
values.AssignTo = values.customGroup
}
values.selectedTenants.map(
(tenant) => (values[`Select_${tenant.defaultDomainName}`] = tenant.defaultDomainName),
)
Expand Down Expand Up @@ -240,6 +244,18 @@ const AddWinGet = () => {
name="AssignTo"
label="Assign to all users and devices"
></RFFCFormRadio>
<RFFCFormRadio
value="customGroup"
name="AssignTo"
label="Assign to Custom Group"
></RFFCFormRadio>
<Condition when="AssignTo" is="customGroup">
<RFFCFormInput
type="text"
name="customGroup"
label="Custom Group Names separated by comma. Wildcards (*) are allowed"
/>
</Condition>
</CCol>
</CRow>
</CForm>
Expand Down
15 changes: 15 additions & 0 deletions src/views/endpoint/intune/MEMAddPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const AddPolicy = () => {
(tenant) => (values[`Select_${tenant.defaultDomainName}`] = tenant.defaultDomainName),
)
values.TemplateType = values.Type
if (values.AssignTo === 'customGroup') {
values.AssignTo = values.customGroup
}
genericPostRequest({ path: '/api/AddPolicy', values: values })
}
const [matchMap, setMatchMap] = useState([])
Expand Down Expand Up @@ -234,6 +237,18 @@ const AddPolicy = () => {
name="AssignTo"
label="Assign to all users and devices"
></RFFCFormRadio>
<RFFCFormRadio
value="customGroup"
name="AssignTo"
label="Assign to Custom Group"
></RFFCFormRadio>
<Condition when="AssignTo" is="customGroup">
<RFFCFormInput
type="text"
name="customGroup"
label="Custom Group Names separated by comma. Wildcards (*) are allowed"
/>
</Condition>
<hr className="my-4" />
<WhenFieldChanges field="TemplateList" set="Description" />
<WhenFieldChanges field="TemplateList" set="Displayname" />
Expand Down
2 changes: 1 addition & 1 deletion src/views/identity/reports/MFAReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const MFAList = () => {
datatable={{
filterlist: [
{ filterName: 'Enabled users', filter: '"accountEnabled":true' },
{ filterName: 'Licensed users', filter: '"isLicensed":"true"' },
{ filterName: 'Licensed users', filter: 'Complex: IsLicensed eq true' },
],
columns: tenant.defaultDomainName === 'AllTenants' ? Altcolumns : columns,
path: '/api/ListMFAUsers',
Expand Down
24 changes: 22 additions & 2 deletions src/views/tenant/administration/ListGDAPRelationships.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const RefreshAction = () => {
{isLoading && <CSpinner size="sm" />}
{error && <FontAwesomeIcon icon={faExclamationTriangle} className="pe-1" />}
{isSuccess && <FontAwesomeIcon icon={faCheck} className="pe-1" />}
Map GDAP Groups
Map recently approved relationships
</CButton>
)
}
Expand Down Expand Up @@ -89,6 +89,13 @@ const Actions = (row, rowIndex, formatExtraData) => {
title={'GDAP - ' + row?.customer?.displayName}
extendedInfo={extendedInfo}
actions={[
{
label: 'Enable automatic extension',
color: 'info',
modal: true,
modalUrl: `/api/ExecAutoExtendGDAP?ID=${row.id}`,
modalMessage: 'Are you sure you want to enable auto-extend for this relationship',
},
{
label: 'Terminate Relationship',
color: 'danger',
Expand Down Expand Up @@ -149,6 +156,13 @@ const GDAPRelationships = () => {
exportSelector: 'endDateTime',
cell: cellDateFormatter({ format: 'short' }),
},
{
name: 'Auto Extend',
selector: (row) => row['autoExtendDuration'],
sortable: true,
exportSelector: 'endDateTime',
cell: (row) => (row['autoExtendDuration'] === 'PT0S' ? 'No' : 'Yes'),
},
{
name: 'Actions',
cell: Actions,
Expand All @@ -158,6 +172,7 @@ const GDAPRelationships = () => {
return (
<div>
<CippPageList
titleButton={<RefreshAction />}
capabilities={{ allTenants: true, helpContext: 'https://google.com' }}
title="GDAP Relationship List"
tenantSelector={false}
Expand All @@ -176,8 +191,13 @@ const GDAPRelationships = () => {
modalUrl: `/api/ExecDeleteGDAPRelationship?&GDAPID=!id`,
modalMessage: 'Are you sure you want to terminate these relationships?',
},
{
label: 'Auto Extend Relationship',
modal: true,
modalUrl: `/api/ExecAutoExtendGDAP?ID=!id`,
modalMessage: 'Are you sure you want to enable automatic extension?',
},
],
actions: [<RefreshAction key="refresh-action-button" />],
},
keyField: 'id',
columns,
Expand Down
48 changes: 48 additions & 0 deletions src/views/tenant/standards/ListAppliedStandards.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import Skeleton from 'react-loading-skeleton'
import { CippTable } from 'src/components/tables'
import allStandardsList from 'src/data/standards'
import { useState } from 'react'
import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas'

const RefreshAction = () => {
const [execStandards, execStandardsResults] = useLazyGenericGetRequestQuery()
Expand Down Expand Up @@ -80,6 +82,43 @@ const DeleteAction = () => {
)
}
const ListAppliedStandards = () => {
const [ExecuteGetRequest, getResults] = useLazyGenericGetRequestQuery()

const Offcanvas = (row, rowIndex, formatExtraData) => {
const [ocVisible, setOCVisible] = useState(false)
const handleDeleteIntuneTemplate = (apiurl, message) => {
ModalService.confirm({
title: 'Confirm',
body: <div>{message}</div>,
onConfirm: () => ExecuteGetRequest({ path: apiurl }),
confirmLabel: 'Continue',
cancelLabel: 'Cancel',
})
}
return (
<>
<CButton
size="sm"
variant="ghost"
color="danger"
onClick={() =>
handleDeleteIntuneTemplate(
`api/RemoveStandard?ID=${row.displayName}`,
'Do you want to delete this standard?',
)
}
>
<FontAwesomeIcon icon={'trash'} href="" />
</CButton>
<CippCodeOffCanvas
row={row}
state={ocVisible}
type="CATemplate"
hideFunction={() => setOCVisible(false)}
/>
</>
)
}
const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName)

const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery()
Expand Down Expand Up @@ -124,6 +163,11 @@ const ListAppliedStandards = () => {
sortable: true,
exportSelector: 'StandardsExport',
},
{
name: 'Actions',
cell: Offcanvas,
maxWidth: '80px',
},
]
const [intuneGetRequest, intuneTemplates] = useLazyGenericGetRequestQuery()
const [transportGetRequest, transportTemplates] = useLazyGenericGetRequestQuery()
Expand Down Expand Up @@ -530,6 +574,10 @@ const ListAppliedStandards = () => {
<CCol lg={6} xs={12}>
{listStandardsAllTenants && (
<CippContentCard title="Currently Applied Standards">
{getResults.isLoading && <CSpinner size="sm" />}
{getResults.isSuccess && (
<CCallout color="info">{getResults.data?.Results}</CCallout>
)}
<CippTable
reportName={`Standards`}
data={listStandardsAllTenants}
Expand Down