Skip to content

Commit

Permalink
Merge pull request #1264 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
Dev to release
  • Loading branch information
KelvinTegelaar authored Dec 16, 2022
2 parents 1218013 + a533a3e commit 12f5fb7
Show file tree
Hide file tree
Showing 20 changed files with 737 additions and 587 deletions.
2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.18.0
2.19.0
4 changes: 2 additions & 2 deletions src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,14 @@ const _nav = [
},
{
component: CNavGroup,
name: 'Sharepoint',
name: 'SharePoint',
section: 'Teams & Sharepoint',
to: '/teams-share/sharepoint',
icon: <FontAwesomeIcon icon={faLink} className="nav-icon" />,
items: [
{
component: CNavItem,
name: 'Sharepoint',
name: 'SharePoint',
to: '/teams-share/sharepoint/list-sharepoint',
},
],
Expand Down
18 changes: 15 additions & 3 deletions src/components/tables/CippDatatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@ import { CippTable } from 'src/components/tables'
import { CippTablePropTypes } from 'src/components/tables/CippTable'

export default function CippDatatable({ path, params, ...rest }) {
const { data = [], isFetching, error } = useListDatatableQuery({ path, params })

return <CippTable {...rest} data={data} isFetching={isFetching} error={error} />
const [refreshGuid, setRefreshGuid] = React.useState('')
const {
data = [],
isFetching,
error,
} = useListDatatableQuery({ path, params: { refreshGuid, ...params } })
return (
<CippTable
{...rest}
data={data}
isFetching={isFetching}
error={error}
refreshFunction={setRefreshGuid}
/>
)
}

CippDatatable.propTypes = {
Expand Down
18 changes: 16 additions & 2 deletions src/components/tables/CippTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import {
CDropdownToggle,
CDropdownMenu,
CDropdownItem,
CButton,
} from '@coreui/react'
import DataTable, { createTheme } from 'react-data-table-component'
import PropTypes from 'prop-types'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faCheck, faColumns, faSearch } from '@fortawesome/free-solid-svg-icons'
import { faCheck, faColumns, faSearch, faSync } from '@fortawesome/free-solid-svg-icons'
import { useEffect } from 'react'

const FilterComponent = ({ filterText, onFilter, onClear, filterlist, onFilterPreset }) => (
Expand Down Expand Up @@ -89,6 +90,7 @@ export default function CippTable({
disableCSVExport = false,
error,
reportName,
refreshFunction = null,
columns = [],
dynamicColumns = true,
filterlist,
Expand Down Expand Up @@ -185,7 +187,19 @@ export default function CippTable({
return ['No additional columns available']
}
}

if (refreshFunction) {
defaultActions.push([
<CButton
onClick={() => {
refreshFunction((Math.random() + 1).toString(36).substring(7))
}}
className="m-1"
size="sm"
>
<FontAwesomeIcon icon={faSync} />
</CButton>,
])
}
if (!disablePDFExport) {
if (dynamicColumns === true) {
const addColumn = (columnname) => {
Expand Down
Loading

0 comments on commit 12f5fb7

Please sign in to comment.