Skip to content

Commit

Permalink
Merge pull request #1222 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
Dev to master
  • Loading branch information
KelvinTegelaar authored Nov 18, 2022
2 parents 8c1b220 + bc20132 commit 099a087
Show file tree
Hide file tree
Showing 22 changed files with 671 additions and 167 deletions.
62 changes: 27 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.16.0
2.17.0
5 changes: 5 additions & 0 deletions src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ const _nav = [
name: 'Add Choco App',
to: '/endpoint/applications/add-choco-app',
},
{
component: CNavItem,
name: 'Add WinGet or Store App',
to: '/endpoint/applications/add-winget-app',
},
{
component: CNavItem,
name: 'Add Office App',
Expand Down
Binary file added 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.
7 changes: 6 additions & 1 deletion src/components/layout/AppFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ import React from 'react'
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'

const AppFooter = () => {
return (
<CFooter className="d-flex justify-content-between align-items-center">
<div className="sponsors">
<p>
This application is sponsored by&nbsp;
This application is sponsored by{' '}
<CLink href="https://www.huntress.com/">
<CImage src={huntressLogo} alt="Huntress" />
</CLink>{' '}
&
<CLink href="https://datto.com/">
<CImage src={dattoLogo} alt="Datto" />
</CLink>
</p>
</div>
Expand Down
129 changes: 94 additions & 35 deletions src/components/tables/CippTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
import DataTable, { createTheme } from 'react-data-table-component'
import PropTypes from 'prop-types'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faSearch } from '@fortawesome/free-solid-svg-icons'
import { faCheck, faColumns, faSearch } from '@fortawesome/free-solid-svg-icons'
import { useEffect } from 'react'

const FilterComponent = ({ filterText, onFilter, onClear, filterlist, onFilterPreset }) => (
<>
Expand Down Expand Up @@ -112,10 +113,16 @@ export default function CippTable({
} = {},
}) {
const [filterText, setFilterText] = React.useState('')
const [updatedColumns, setUpdatedColumns] = React.useState(columns)
const [resetPaginationToggle, setResetPaginationToggle] = React.useState(false)
const filteredItems = data.filter(
(item) => JSON.stringify(item).toLowerCase().indexOf(filterText.toLowerCase()) !== -1,
)
useEffect(() => {
if (columns !== updatedColumns) {
setUpdatedColumns(columns)
}
}, [updatedColumns])

createTheme(
'cyberdrain',
Expand Down Expand Up @@ -168,13 +175,62 @@ export default function CippTable({
setFilterText('')
}
}
const defaultActions = []

actions.forEach((action) => {
defaultActions.push(action)
})
const defaultActions = []
const dataKeys = () => {
if (filteredItems.length >= 1) {
return Object.keys(filteredItems[0])
} else {
return ['No additional columns available']
}
}

if (!disablePDFExport) {
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,
})
} 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"
Expand All @@ -185,6 +241,7 @@ export default function CippTable({
/>,
])
}

if (!disableCSVExport) {
const keys = []
columns.map((col) => {
Expand Down Expand Up @@ -231,36 +288,38 @@ export default function CippTable({
{!isFetching && error && <span>Error loading data</span>}
{!error && (
<div>
<DataTable
customStyles={customStyles}
className="cipp-table"
theme={theme}
subHeader={subheader}
selectableRows={selectableRows}
onSelectedRowsChange={onSelectedRowsChange}
subHeaderComponent={subHeaderComponentMemo}
subHeaderAlign="left"
paginationResetDefaultPage={resetPaginationToggle}
//actions={actionsMemo}
pagination={pagination}
responsive={responsive}
dense={dense}
striped={striped}
columns={columns}
data={filteredItems}
expandableRows={expandableRows}
expandableRowsComponent={expandableRowsComponent}
highlightOnHover={highlightOnHover}
expandOnRowClicked={expandOnRowClicked}
defaultSortAsc
defaultSortFieldId={1}
sortFunction={customSort}
paginationPerPage={tablePageSize}
progressPending={isFetching}
progressComponent={<CSpinner color="info" component="div" />}
paginationRowsPerPageOptions={[25, 50, 100, 200, 500]}
{...rest}
/>
{columns.length === updatedColumns.length && (
<DataTable
customStyles={customStyles}
className="cipp-table"
theme={theme}
subHeader={subheader}
selectableRows={selectableRows}
onSelectedRowsChange={onSelectedRowsChange}
subHeaderComponent={subHeaderComponentMemo}
subHeaderAlign="left"
paginationResetDefaultPage={resetPaginationToggle}
//actions={actionsMemo}
pagination={pagination}
responsive={responsive}
dense={dense}
striped={striped}
columns={columns}
data={filteredItems}
expandableRows={expandableRows}
expandableRowsComponent={expandableRowsComponent}
highlightOnHover={highlightOnHover}
expandOnRowClicked={expandOnRowClicked}
defaultSortAsc
defaultSortFieldId={1}
sortFunction={customSort}
paginationPerPage={tablePageSize}
progressPending={isFetching}
progressComponent={<CSpinner color="info" component="div" />}
paginationRowsPerPageOptions={[25, 50, 100, 200, 500]}
{...rest}
/>
)}
</div>
)}
</div>
Expand Down
16 changes: 15 additions & 1 deletion src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ const ApplicationsQueue = React.lazy(() =>
const ApplicationsAddChocoApp = React.lazy(() =>
import('src/views/endpoint/applications/ApplicationsAddChocoApp'),
)
const ApplicationsAddWingetApp = React.lazy(() =>
import('src/views/endpoint/applications/ApplicationsAddWinGet'),
)
const ApplicationsAddOfficeApp = React.lazy(() =>
import('src/views/endpoint/applications/ApplicationsAddOffice'),
)
Expand Down Expand Up @@ -145,6 +148,7 @@ const EditMailboxPermissions = React.lazy(() =>
const AddSharedMailbox = React.lazy(() =>
import('src/views/email-exchange/administration/AddSharedMailbox'),
)
const AddContact = React.lazy(() => import('src/views/email-exchange/administration/AddContact'))
const EditCalendarPermissions = React.lazy(() =>
import('src/views/email-exchange/administration/EditCalendarPermissions'),
)
Expand Down Expand Up @@ -354,6 +358,11 @@ const routes = [
name: 'Add Choco App',
component: ApplicationsAddChocoApp,
},
{
path: '/endpoint/applications/add-winget-app',
name: 'Add Choco App',
component: ApplicationsAddWingetApp,
},
{
path: '/endpoint/applications/add-office-app',
name: 'Add Office App',
Expand Down Expand Up @@ -488,10 +497,15 @@ const routes = [
component: EditMailboxPermissions,
},
{
name: 'Edit Mailbox Permissions',
name: 'Add Shared Mailbox',
path: '/email/administration/add-shared-mailbox',
component: AddSharedMailbox,
},
{
name: 'Edit Contact',
path: '/email/administration/add-contact',
component: AddContact,
},
{
name: 'Edit Calendar Permissions',
path: '/email/administration/edit-calendar-permissions',
Expand Down
Loading

0 comments on commit 099a087

Please sign in to comment.