Skip to content

Commit

Permalink
Merge pull request #1567 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
dev to release
  • Loading branch information
KelvinTegelaar authored Jun 9, 2023
2 parents bc59a45 + eeec901 commit f5304da
Show file tree
Hide file tree
Showing 28 changed files with 15,734 additions and 120 deletions.
2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.1
3.6.0
8 changes: 6 additions & 2 deletions src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,16 @@ const _nav = [
name: 'Alerts Wizard',
to: '/tenant/administration/alertswizard',
},

{
component: CNavItem,
name: 'Scheduled Alerts',
to: '/tenant/administration/alertsqueue',
},
{
component: CNavItem,
name: 'Enterprise Applications',
to: '/tenant/administration/enterprise-apps',
},
],
},
{
Expand Down Expand Up @@ -178,7 +182,7 @@ const _nav = [
},
{
component: CNavItem,
name: 'Apply Standards',
name: 'Standards Wizard',
to: '/tenant/standards/apply-standard',
},
{
Expand Down
Binary file modified src/assets/images/datto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/rewst.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/components/layout/AppFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CFooter, CImage, CLink } from '@coreui/react'
import { Link } from 'react-router-dom'
import huntressLogo from 'src/assets/images/huntress_teal.png'
import dattoLogo from 'src/assets/images/datto.png'
import rewstLogo from 'src/assets/images/rewst.png'

const AppFooter = () => {
return (
Expand All @@ -13,10 +14,12 @@ const AppFooter = () => {
<CLink href="https://www.huntress.com/">
<CImage src={huntressLogo} alt="Huntress" />
</CLink>{' '}
&
<CLink href="https://datto.com/">
<CImage src={dattoLogo} alt="Datto" />
</CLink>
<CLink href="https://rewst.io/">
<CImage src={rewstLogo} alt="Datto" />
</CLink>
</p>
</div>
<nav className="footer-nav">
Expand Down
24 changes: 24 additions & 0 deletions src/components/tables/CellLicense.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import PropTypes from 'prop-types'
import M365Licenses from 'src/data/M365Licenses'

export function CellLicense({ cell }) {
let licenses = []
cell?.map((licenseAssignment, idx) => {
for (var x = 0; x < M365Licenses.length; x++) {
if (licenseAssignment.skuId == M365Licenses[x].GUID) {
licenses.push(M365Licenses[x].Product_Display_Name)
break
}
}
})
return licenses.join(', ')
}

CellLicense.propTypes = {
cell: PropTypes.object,
}

export const cellLicenseFormatter = () => (row, index, column, id) => {
const cell = column.selector(row)
return CellLicense({ cell })
}
20 changes: 20 additions & 0 deletions src/components/tables/CellLogo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import PropTypes from 'prop-types'
import { CImage } from '@coreui/react'

export function CellLogo({ cell }) {
if (cell?.logoUrl) {
return <CImage src={cell.logoUrl} height={16} width={16} />
} else {
return ''
}
}

CellLogo.propTypes = {
propName: PropTypes.string,
cell: PropTypes.object,
}

export const cellLogoFormatter = () => (row, index, column, id) => {
const cell = column.selector(row)
return CellLogo({ cell })
}
37 changes: 27 additions & 10 deletions src/components/tables/CippDatatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,41 @@ import { useListDatatableQuery } from 'src/store/api/datatable'
import PropTypes from 'prop-types'
import { CippTable } from 'src/components/tables'
import { CippTablePropTypes } from 'src/components/tables/CippTable'
import { CCallout } from '@coreui/react'

export default function CippDatatable({ path, params, ...rest }) {
const [refreshGuid, setRefreshGuid] = React.useState('')
const [graphFilter, setGraphFilter] = React.useState('')
const [graphFilter, setGraphFilter] = React.useState(params?.Parameters?.$filter)
const {
data = [],
isFetching,
error,
} = useListDatatableQuery({ path, params: { refreshGuid, graphFilter, ...params } })
} = useListDatatableQuery({ path, params: { refreshGuid, $filter: graphFilter, ...params } })
return (
<CippTable
{...rest}
data={data}
isFetching={isFetching}
error={error}
refreshFunction={setRefreshGuid}
graphFilterFunction={setGraphFilter}
/>
<>
{data[0]?.Queued ? (
<>
<CCallout color="info">{data[0]?.QueueMessage}</CCallout>
<CippTable
{...rest}
data={[]}
isFetching={isFetching}
error={error}
refreshFunction={setRefreshGuid}
graphFilterFunction={setGraphFilter}
/>
</>
) : (
<CippTable
{...rest}
data={data}
isFetching={isFetching}
error={error}
refreshFunction={setRefreshGuid}
graphFilterFunction={setGraphFilter}
/>
)}
</>
)
}

Expand Down
149 changes: 84 additions & 65 deletions src/components/tables/CippTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,68 +326,8 @@ export default function CippTable({
</CButton>,
])
}
if (!disablePDFExport) {
if (dynamicColumns === true) {
const addColumn = (columnname) => {
var index = columns.length - 1
let alreadyInArray = columns.find((o) => o.exportSelector === columnname)
if (!alreadyInArray) {
columns.splice(index, 0, {
name: columnname,
selector: (row) => row[columnname],
sortable: true,
exportSelector: columnname,
cell: cellGenericFormatter(),
})
} else {
let indexOfExisting = columns.findIndex((o) => o.exportSelector === columnname)
columns = columns.splice(indexOfExisting, 1)
}
setUpdatedColumns(Date())
}

defaultActions.push([
<CDropdown className="me-2" variant="input-group">
<CDropdownToggle
className="btn btn-primary btn-sm m-1"
size="sm"
style={{
backgroundColor: '#f88c1a',
}}
>
<FontAwesomeIcon icon={faColumns} />
</CDropdownToggle>
<CDropdownMenu>
{dataKeys() &&
dataKeys().map((item, idx) => {
return (
<CDropdownItem key={idx} onClick={() => addColumn(item)}>
{columns.find((o) => o.exportSelector === item) && (
<FontAwesomeIcon icon={faCheck} />
)}{' '}
{item}
</CDropdownItem>
)
})}
</CDropdownMenu>
</CDropdown>,
])
}
actions.forEach((action) => {
defaultActions.push(action)
})
defaultActions.push([
<ExportPDFButton
key="export-pdf-action"
pdfData={data}
pdfHeaders={columns}
pdfSize="A4"
reportName={reportName}
/>,
])
}

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

const filtered = data.map((obj) =>
// eslint-disable-next-line no-sequences
keys.reduce((acc, curr) => ((acc[curr] = obj[curr]), acc), {}),
/* keys.reduce((acc, curr) => ((acc[curr] = obj[curr]), acc), {}),*/
keys.reduce((acc, curr) => {
const key = curr.split('/')
if (key.length > 1) {
const parent = key[0]
const subkey = key[1]
if (obj[parent] !== null && obj[parent][subkey] !== null) {
acc[curr] = obj[parent][subkey]
} else {
acc[curr] = 'n/a'
}
} else {
acc[curr] = obj[curr]
}
return acc
}, {}),
)
defaultActions.push([
<ExportCsvButton key="export-csv-action" csvData={filtered} reportName={reportName} />,
])

if (!disablePDFExport) {
if (dynamicColumns === true) {
const addColumn = (columnname) => {
var index = columns.length - 1
let alreadyInArray = columns.find((o) => o.exportSelector === columnname)
if (!alreadyInArray) {
columns.splice(index, 0, {
name: columnname,
selector: (row) => row[columnname],
sortable: true,
exportSelector: columnname,
cell: cellGenericFormatter(),
})
} else {
let indexOfExisting = columns.findIndex((o) => o.exportSelector === columnname)
columns = columns.splice(indexOfExisting, 1)
}
setUpdatedColumns(Date())
}

defaultActions.push([
<CDropdown className="me-2" variant="input-group">
<CDropdownToggle
className="btn btn-primary btn-sm m-1"
size="sm"
style={{
backgroundColor: '#f88c1a',
}}
>
<FontAwesomeIcon icon={faColumns} />
</CDropdownToggle>
<CDropdownMenu>
{dataKeys() &&
dataKeys().map((item, idx) => {
return (
<CDropdownItem key={idx} onClick={() => addColumn(item)}>
{columns.find((o) => o.exportSelector === item) && (
<FontAwesomeIcon icon={faCheck} />
)}{' '}
{item}
</CDropdownItem>
)
})}
</CDropdownMenu>
</CDropdown>,
])
}
actions.forEach((action) => {
defaultActions.push(action)
})
defaultActions.push([
<ExportPDFButton
key="export-pdf-action"
pdfData={filtered}
pdfHeaders={columns}
pdfSize="A4"
reportName={reportName}
/>,
])
}

if (!disableCSVExport) {
defaultActions.push([
<ExportCsvButton key="export-csv-action" csvData={filtered} reportName={reportName} />,
])
}
}
if (selectedRows && actionsList) {
defaultActions.push([
Expand Down
9 changes: 2 additions & 7 deletions src/components/utilities/TenantSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,12 @@ const TenantSelector = ({ action, showAllTenantSelector = true, NavSelector = fa
return (
<>
{NavSelector && (
<CDropdown
component="li"
variant="nav-item"
direction="center"
className="flex-grow-1 my-auto"
>
<CDropdown component="li" variant="nav-item" className="flex-grow-1 my-auto">
<CDropdownToggle>
<FontAwesomeIcon icon={faBuilding} className="me-2" />
{currentTenant?.defaultDomainName ? (
<>
<span class="text-wrap">{currentTenant.displayName}</span>
<span className="text-wrap">{currentTenant.displayName}</span>
</>
) : (
placeholder
Expand Down
Loading

0 comments on commit f5304da

Please sign in to comment.