forked from KelvinTegelaar/CIPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'KelvinTegelaar:main' into main
- Loading branch information
Showing
25 changed files
with
744 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.4.0 | ||
4.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react' | ||
import { CButton } from '@coreui/react' | ||
import { ModalService } from '../utilities' | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
import { faCheckCircle } from '@fortawesome/free-solid-svg-icons' | ||
import { cellGenericFormatter } from '../tables/CellGenericFormat' | ||
|
||
export default function TableModalButton({ data, title, className }) { | ||
const handleTable = (data) => { | ||
const QueryColumns = [] | ||
const columns = Object.keys(data[0]).map((key) => { | ||
QueryColumns.push({ | ||
name: key, | ||
selector: (row) => row[key], // Accessing the property using the key | ||
sortable: true, | ||
exportSelector: key, | ||
cell: cellGenericFormatter(), | ||
}) | ||
}) | ||
ModalService.open({ | ||
data: data, | ||
componentType: 'table', | ||
componentProps: { | ||
columns: QueryColumns, | ||
keyField: 'id', | ||
}, | ||
title: title, | ||
size: 'lg', | ||
}) | ||
} | ||
const buttonClass = 'btn ' + className | ||
|
||
return ( | ||
<CButton className={buttonClass} onClick={() => handleTable(data)}> | ||
<> | ||
{title} ({data.length}) | ||
</> | ||
</CButton> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import ExportCsvButton from 'src/components/buttons/CsvButton' | ||
import ExportPDFButton from 'src/components/buttons/PdfButton' | ||
import TitleButton from 'src/components/buttons/TitleButton' | ||
import TableModalButton from 'src/components/buttons/TableModalButton' | ||
|
||
export { ExportCsvButton, ExportPDFButton, TitleButton } | ||
export { ExportCsvButton, ExportPDFButton, TitleButton, TableModalButton } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.