Skip to content

Commit f5304da

Browse files
Merge pull request #1567 from KelvinTegelaar/dev
dev to release
2 parents bc59a45 + eeec901 commit f5304da

28 files changed

+15734
-120
lines changed

public/version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.5.1
1+
3.6.0

src/_nav.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,16 @@ const _nav = [
127127
name: 'Alerts Wizard',
128128
to: '/tenant/administration/alertswizard',
129129
},
130-
131130
{
132131
component: CNavItem,
133132
name: 'Scheduled Alerts',
134133
to: '/tenant/administration/alertsqueue',
135134
},
135+
{
136+
component: CNavItem,
137+
name: 'Enterprise Applications',
138+
to: '/tenant/administration/enterprise-apps',
139+
},
136140
],
137141
},
138142
{
@@ -178,7 +182,7 @@ const _nav = [
178182
},
179183
{
180184
component: CNavItem,
181-
name: 'Apply Standards',
185+
name: 'Standards Wizard',
182186
to: '/tenant/standards/apply-standard',
183187
},
184188
{

src/assets/images/datto.png

-320 Bytes
Loading

src/assets/images/rewst.png

9.03 KB
Loading

src/components/layout/AppFooter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CFooter, CImage, CLink } from '@coreui/react'
33
import { Link } from 'react-router-dom'
44
import huntressLogo from 'src/assets/images/huntress_teal.png'
55
import dattoLogo from 'src/assets/images/datto.png'
6+
import rewstLogo from 'src/assets/images/rewst.png'
67

78
const AppFooter = () => {
89
return (
@@ -13,10 +14,12 @@ const AppFooter = () => {
1314
<CLink href="https://www.huntress.com/">
1415
<CImage src={huntressLogo} alt="Huntress" />
1516
</CLink>{' '}
16-
&
1717
<CLink href="https://datto.com/">
1818
<CImage src={dattoLogo} alt="Datto" />
1919
</CLink>
20+
<CLink href="https://rewst.io/">
21+
<CImage src={rewstLogo} alt="Datto" />
22+
</CLink>
2023
</p>
2124
</div>
2225
<nav className="footer-nav">

src/components/tables/CellLicense.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import PropTypes from 'prop-types'
2+
import M365Licenses from 'src/data/M365Licenses'
3+
4+
export function CellLicense({ cell }) {
5+
let licenses = []
6+
cell?.map((licenseAssignment, idx) => {
7+
for (var x = 0; x < M365Licenses.length; x++) {
8+
if (licenseAssignment.skuId == M365Licenses[x].GUID) {
9+
licenses.push(M365Licenses[x].Product_Display_Name)
10+
break
11+
}
12+
}
13+
})
14+
return licenses.join(', ')
15+
}
16+
17+
CellLicense.propTypes = {
18+
cell: PropTypes.object,
19+
}
20+
21+
export const cellLicenseFormatter = () => (row, index, column, id) => {
22+
const cell = column.selector(row)
23+
return CellLicense({ cell })
24+
}

src/components/tables/CellLogo.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import PropTypes from 'prop-types'
2+
import { CImage } from '@coreui/react'
3+
4+
export function CellLogo({ cell }) {
5+
if (cell?.logoUrl) {
6+
return <CImage src={cell.logoUrl} height={16} width={16} />
7+
} else {
8+
return ''
9+
}
10+
}
11+
12+
CellLogo.propTypes = {
13+
propName: PropTypes.string,
14+
cell: PropTypes.object,
15+
}
16+
17+
export const cellLogoFormatter = () => (row, index, column, id) => {
18+
const cell = column.selector(row)
19+
return CellLogo({ cell })
20+
}

src/components/tables/CippDatatable.js

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,41 @@ import { useListDatatableQuery } from 'src/store/api/datatable'
33
import PropTypes from 'prop-types'
44
import { CippTable } from 'src/components/tables'
55
import { CippTablePropTypes } from 'src/components/tables/CippTable'
6+
import { CCallout } from '@coreui/react'
67

78
export default function CippDatatable({ path, params, ...rest }) {
89
const [refreshGuid, setRefreshGuid] = React.useState('')
9-
const [graphFilter, setGraphFilter] = React.useState('')
10+
const [graphFilter, setGraphFilter] = React.useState(params?.Parameters?.$filter)
1011
const {
1112
data = [],
1213
isFetching,
1314
error,
14-
} = useListDatatableQuery({ path, params: { refreshGuid, graphFilter, ...params } })
15+
} = useListDatatableQuery({ path, params: { refreshGuid, $filter: graphFilter, ...params } })
1516
return (
16-
<CippTable
17-
{...rest}
18-
data={data}
19-
isFetching={isFetching}
20-
error={error}
21-
refreshFunction={setRefreshGuid}
22-
graphFilterFunction={setGraphFilter}
23-
/>
17+
<>
18+
{data[0]?.Queued ? (
19+
<>
20+
<CCallout color="info">{data[0]?.QueueMessage}</CCallout>
21+
<CippTable
22+
{...rest}
23+
data={[]}
24+
isFetching={isFetching}
25+
error={error}
26+
refreshFunction={setRefreshGuid}
27+
graphFilterFunction={setGraphFilter}
28+
/>
29+
</>
30+
) : (
31+
<CippTable
32+
{...rest}
33+
data={data}
34+
isFetching={isFetching}
35+
error={error}
36+
refreshFunction={setRefreshGuid}
37+
graphFilterFunction={setGraphFilter}
38+
/>
39+
)}
40+
</>
2441
)
2542
}
2643

src/components/tables/CippTable.js

Lines changed: 84 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -326,68 +326,8 @@ export default function CippTable({
326326
</CButton>,
327327
])
328328
}
329-
if (!disablePDFExport) {
330-
if (dynamicColumns === true) {
331-
const addColumn = (columnname) => {
332-
var index = columns.length - 1
333-
let alreadyInArray = columns.find((o) => o.exportSelector === columnname)
334-
if (!alreadyInArray) {
335-
columns.splice(index, 0, {
336-
name: columnname,
337-
selector: (row) => row[columnname],
338-
sortable: true,
339-
exportSelector: columnname,
340-
cell: cellGenericFormatter(),
341-
})
342-
} else {
343-
let indexOfExisting = columns.findIndex((o) => o.exportSelector === columnname)
344-
columns = columns.splice(indexOfExisting, 1)
345-
}
346-
setUpdatedColumns(Date())
347-
}
348-
349-
defaultActions.push([
350-
<CDropdown className="me-2" variant="input-group">
351-
<CDropdownToggle
352-
className="btn btn-primary btn-sm m-1"
353-
size="sm"
354-
style={{
355-
backgroundColor: '#f88c1a',
356-
}}
357-
>
358-
<FontAwesomeIcon icon={faColumns} />
359-
</CDropdownToggle>
360-
<CDropdownMenu>
361-
{dataKeys() &&
362-
dataKeys().map((item, idx) => {
363-
return (
364-
<CDropdownItem key={idx} onClick={() => addColumn(item)}>
365-
{columns.find((o) => o.exportSelector === item) && (
366-
<FontAwesomeIcon icon={faCheck} />
367-
)}{' '}
368-
{item}
369-
</CDropdownItem>
370-
)
371-
})}
372-
</CDropdownMenu>
373-
</CDropdown>,
374-
])
375-
}
376-
actions.forEach((action) => {
377-
defaultActions.push(action)
378-
})
379-
defaultActions.push([
380-
<ExportPDFButton
381-
key="export-pdf-action"
382-
pdfData={data}
383-
pdfHeaders={columns}
384-
pdfSize="A4"
385-
reportName={reportName}
386-
/>,
387-
])
388-
}
389329

390-
if (!disableCSVExport) {
330+
if (!disablePDFExport || !disableCSVExport) {
391331
const keys = []
392332
columns.map((col) => {
393333
if (col.exportSelector) keys.push(col.exportSelector)
@@ -396,11 +336,90 @@ export default function CippTable({
396336

397337
const filtered = data.map((obj) =>
398338
// eslint-disable-next-line no-sequences
399-
keys.reduce((acc, curr) => ((acc[curr] = obj[curr]), acc), {}),
339+
/* keys.reduce((acc, curr) => ((acc[curr] = obj[curr]), acc), {}),*/
340+
keys.reduce((acc, curr) => {
341+
const key = curr.split('/')
342+
if (key.length > 1) {
343+
const parent = key[0]
344+
const subkey = key[1]
345+
if (obj[parent] !== null && obj[parent][subkey] !== null) {
346+
acc[curr] = obj[parent][subkey]
347+
} else {
348+
acc[curr] = 'n/a'
349+
}
350+
} else {
351+
acc[curr] = obj[curr]
352+
}
353+
return acc
354+
}, {}),
400355
)
401-
defaultActions.push([
402-
<ExportCsvButton key="export-csv-action" csvData={filtered} reportName={reportName} />,
403-
])
356+
357+
if (!disablePDFExport) {
358+
if (dynamicColumns === true) {
359+
const addColumn = (columnname) => {
360+
var index = columns.length - 1
361+
let alreadyInArray = columns.find((o) => o.exportSelector === columnname)
362+
if (!alreadyInArray) {
363+
columns.splice(index, 0, {
364+
name: columnname,
365+
selector: (row) => row[columnname],
366+
sortable: true,
367+
exportSelector: columnname,
368+
cell: cellGenericFormatter(),
369+
})
370+
} else {
371+
let indexOfExisting = columns.findIndex((o) => o.exportSelector === columnname)
372+
columns = columns.splice(indexOfExisting, 1)
373+
}
374+
setUpdatedColumns(Date())
375+
}
376+
377+
defaultActions.push([
378+
<CDropdown className="me-2" variant="input-group">
379+
<CDropdownToggle
380+
className="btn btn-primary btn-sm m-1"
381+
size="sm"
382+
style={{
383+
backgroundColor: '#f88c1a',
384+
}}
385+
>
386+
<FontAwesomeIcon icon={faColumns} />
387+
</CDropdownToggle>
388+
<CDropdownMenu>
389+
{dataKeys() &&
390+
dataKeys().map((item, idx) => {
391+
return (
392+
<CDropdownItem key={idx} onClick={() => addColumn(item)}>
393+
{columns.find((o) => o.exportSelector === item) && (
394+
<FontAwesomeIcon icon={faCheck} />
395+
)}{' '}
396+
{item}
397+
</CDropdownItem>
398+
)
399+
})}
400+
</CDropdownMenu>
401+
</CDropdown>,
402+
])
403+
}
404+
actions.forEach((action) => {
405+
defaultActions.push(action)
406+
})
407+
defaultActions.push([
408+
<ExportPDFButton
409+
key="export-pdf-action"
410+
pdfData={filtered}
411+
pdfHeaders={columns}
412+
pdfSize="A4"
413+
reportName={reportName}
414+
/>,
415+
])
416+
}
417+
418+
if (!disableCSVExport) {
419+
defaultActions.push([
420+
<ExportCsvButton key="export-csv-action" csvData={filtered} reportName={reportName} />,
421+
])
422+
}
404423
}
405424
if (selectedRows && actionsList) {
406425
defaultActions.push([

src/components/utilities/TenantSelector.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,12 @@ const TenantSelector = ({ action, showAllTenantSelector = true, NavSelector = fa
7575
return (
7676
<>
7777
{NavSelector && (
78-
<CDropdown
79-
component="li"
80-
variant="nav-item"
81-
direction="center"
82-
className="flex-grow-1 my-auto"
83-
>
78+
<CDropdown component="li" variant="nav-item" className="flex-grow-1 my-auto">
8479
<CDropdownToggle>
8580
<FontAwesomeIcon icon={faBuilding} className="me-2" />
8681
{currentTenant?.defaultDomainName ? (
8782
<>
88-
<span class="text-wrap">{currentTenant.displayName}</span>
83+
<span className="text-wrap">{currentTenant.displayName}</span>
8984
</>
9085
) : (
9186
placeholder

0 commit comments

Comments
 (0)