event.stopPropagation()}
aria-label="Clear selection"
+ tabIndex={-1}
>
diff --git a/frontend/src/components/BCDataGrid/components/Renderers/AccessibleHeader.jsx b/frontend/src/components/BCDataGrid/components/Renderers/AccessibleHeader.jsx
new file mode 100644
index 000000000..af0cdaf56
--- /dev/null
+++ b/frontend/src/components/BCDataGrid/components/Renderers/AccessibleHeader.jsx
@@ -0,0 +1,7 @@
+export const AccessibleHeader = (props) => {
+ return (
+
+ )
+}
diff --git a/frontend/src/components/BCDataGrid/components/Renderers/RequiredHeader.jsx b/frontend/src/components/BCDataGrid/components/Renderers/RequiredHeader.jsx
index 1e8ddfbfb..8a6b9174f 100644
--- a/frontend/src/components/BCDataGrid/components/Renderers/RequiredHeader.jsx
+++ b/frontend/src/components/BCDataGrid/components/Renderers/RequiredHeader.jsx
@@ -1,8 +1,8 @@
export const RequiredHeader = (props) => {
return (
-
+
*
- {props.column.colDef.headerName}
+ {props.column.colDef.headerName}
)
}
diff --git a/frontend/src/components/BCDataGrid/components/index.js b/frontend/src/components/BCDataGrid/components/index.js
index 16e855ef3..56eb9135a 100644
--- a/frontend/src/components/BCDataGrid/components/index.js
+++ b/frontend/src/components/BCDataGrid/components/index.js
@@ -6,6 +6,7 @@ export { DateRangeCellEditor } from './Editors/DateRangeCellEditor'
export { ActionsRenderer } from './Renderers/ActionsRenderer'
export { ActionsRenderer2 } from './Renderers/ActionsRenderer2'
export { RequiredHeader } from './Renderers/RequiredHeader'
+export { AccessibleHeader } from './Renderers/AccessibleHeader'
export { ValidationRenderer } from './Renderers/ValidationRenderer'
export { ValidationRenderer2 } from './Renderers/ValidationRenderer2'
export { BCColumnSetFilter } from './Filters/BCColumnSetFilter'
diff --git a/frontend/src/components/Footer.jsx b/frontend/src/components/Footer.jsx
index 0af3801f8..c62993d5b 100644
--- a/frontend/src/components/Footer.jsx
+++ b/frontend/src/components/Footer.jsx
@@ -19,25 +19,25 @@ const Footer = (props) => {
label: 'About this site'
},
{
- href: 'http://gov.bc.ca/disclaimer/',
+ href: 'https://gov.bc.ca/disclaimer/',
name: 'Disclaimer',
id: 'footer-disclaimer',
label: 'BC gov disclaimer information'
},
{
- href: 'http://gov.bc.ca/privacy/',
+ href: 'https://gov.bc.ca/privacy/',
name: 'Privacy',
id: 'footer-privacy',
label: 'BC gov privacy information'
},
{
- href: 'http://gov.bc.ca/webaccessibility/',
+ href: 'https://gov.bc.ca/webaccessibility/',
name: 'Accessibility',
id: 'footer-accessibility',
label: 'BC gov accessibility information'
},
{
- href: 'http://gov.bc.ca/copyright',
+ href: 'https://gov.bc.ca/copyright',
name: 'Copyright',
id: 'footer-copyright',
label: 'BC gov copyright information'
diff --git a/frontend/src/constants/statuses.js b/frontend/src/constants/statuses.js
index 91c7d3662..36844092a 100644
--- a/frontend/src/constants/statuses.js
+++ b/frontend/src/constants/statuses.js
@@ -66,3 +66,10 @@ export const FUEL_CODE_STATUSES = {
export function getAllFuelCodeStatuses() {
return Object.values(FUEL_CODE_STATUSES)
}
+
+export const TRANSACTION_TYPES = {
+ TRANSFER: 'Transfer',
+ INITIATIVE_AGREEMENT: 'InitiativeAgreement',
+ COMPLIANCE_REPORT: 'ComplianceReport',
+ ADMINISTRATIVE_ADJUSTMENT: 'AdminAdjustment'
+}
\ No newline at end of file
diff --git a/frontend/src/utils/grid/cellRenderers.jsx b/frontend/src/utils/grid/cellRenderers.jsx
index 642ba9fed..abaf0d179 100644
--- a/frontend/src/utils/grid/cellRenderers.jsx
+++ b/frontend/src/utils/grid/cellRenderers.jsx
@@ -35,64 +35,55 @@ export const LinkRenderer = (props) => {
)
}
+const BaseStatusRenderer = ({
+ isView = false,
+ value = false,
+ successText = 'Active',
+ failureText = 'Inactive',
+ successColor = 'success',
+ failureColor = 'smoky'
+}) => {
+ const badgeStyles = {
+ ...(!isView ? { display: 'flex', justifyContent: 'center' } : {}),
+ '& .MuiBadge-badge': {
+ minWidth: '120px',
+ fontWeight: 'regular',
+ textTransform: 'capitalize',
+ fontSize: '0.875rem',
+ padding: '0.4em 0.6em'
+ }
+ }
-export const StatusRenderer = (props) => {
return (
)
}
-export const LoginStatusRenderer = (props) => {
- return (
-
-
-
- )
-}
+export const StatusRenderer = (props) => (
+
+)
+
+export const LoginStatusRenderer = (props) => (
+
+)
export const OrgStatusRenderer = (props) => {
const location = useLocation()
diff --git a/frontend/src/views/Admin/AdminMenu/components/UserActivity.jsx b/frontend/src/views/Admin/AdminMenu/components/UserActivity.jsx
index 532214e8e..f54b5120a 100644
--- a/frontend/src/views/Admin/AdminMenu/components/UserActivity.jsx
+++ b/frontend/src/views/Admin/AdminMenu/components/UserActivity.jsx
@@ -13,9 +13,9 @@ export const UserActivity = () => {
const navigate = useNavigate()
const getRowId = useCallback((params) => {
- return `${params.data.transactionType.toLowerCase()}-${
- params.data.transactionId
- }`
+ return `${
+ params.data.actionTaken
+ }-${params.data.transactionType}-${params.data.transactionId}`
}, [])
const handleRowClicked = useCallback(
@@ -64,7 +64,6 @@ export const UserActivity = () => {
defaultMinWidth: 50,
defaultMaxWidth: 600
}}
- rowSelection={{ isRowSelectable: false }}
onRowClicked={handleRowClicked}
/>
diff --git a/frontend/src/views/Admin/AdminMenu/components/Users.jsx b/frontend/src/views/Admin/AdminMenu/components/Users.jsx
index 49921701b..4c67e3e63 100644
--- a/frontend/src/views/Admin/AdminMenu/components/Users.jsx
+++ b/frontend/src/views/Admin/AdminMenu/components/Users.jsx
@@ -15,7 +15,6 @@ import { useTranslation } from 'react-i18next'
import { ROUTES, apiRoutes } from '@/constants/routes'
import { usersColumnDefs, idirUserDefaultFilter } from './_schema'
-import { calculateRowHeight } from '@/utils/formatters'
export const Users = () => {
const { t } = useTranslation(['common', 'admin'])
diff --git a/frontend/src/views/Admin/AdminMenu/components/_schema.js b/frontend/src/views/Admin/AdminMenu/components/_schema.js
index 1c8093fe5..eadea1422 100644
--- a/frontend/src/views/Admin/AdminMenu/components/_schema.js
+++ b/frontend/src/views/Admin/AdminMenu/components/_schema.js
@@ -14,6 +14,11 @@ import {
BCSelectFloatingFilter,
BCDateFloatingFilter
} from '@/components/BCDataGrid/components/index'
+import {
+ COMPLIANCE_REPORT_STATUSES,
+ TRANSACTION_TYPES,
+ TRANSFER_STATUSES
+} from '@/constants/statuses'
export const usersColumnDefs = (t) => [
{
@@ -50,7 +55,6 @@ export const usersColumnDefs = (t) => [
},
floatingFilterComponent: BCSelectFloatingFilter,
suppressFloatingFilterButton: true,
- suppressHeaderFilterButton: true,
floatingFilterComponentParams: {
optionsQuery: useRoleList,
params: 'government_roles_only=true',
@@ -101,8 +105,7 @@ export const usersColumnDefs = (t) => [
labelKey: 'name'
},
minWidth: 120,
- suppressFloatingFilterButton: true,
- suppressHeaderFilterButton: true
+ suppressFloatingFilterButton: true
},
{
colId: 'organizationId',
@@ -128,12 +131,52 @@ export const userActivityColDefs = [
{
colId: 'actionTaken',
field: 'actionTaken',
- headerName: 'Action Taken'
+ headerName: 'Action Taken',
+ floatingFilterComponent: BCSelectFloatingFilter,
+ floatingFilterComponentParams: {
+ valueKey: 'action',
+ labelKey: 'action',
+ optionsQuery: () => {
+ const allStatuses = [
+ ...Object.values(TRANSFER_STATUSES).map((value) => ({
+ action: value
+ }))
+ // ...Object.values(COMPLIANCE_REPORT_STATUSES).map((value) => ({
+ // action: value
+ // }))
+ ]
+
+ const deduplicatedStatuses = Array.from(
+ new Set(allStatuses.map((item) => item.action))
+ ).map((action) => ({ action }))
+
+ return {
+ data: deduplicatedStatuses,
+ isLoading: false
+ }
+ }
+ },
+ suppressFloatingFilterButton: true
},
{
colId: 'transactionType',
field: 'transactionType',
- headerName: 'Transaction Type'
+ headerName: 'Transaction Type',
+ floatingFilterComponent: BCSelectFloatingFilter,
+ floatingFilterComponentParams: {
+ valueKey: 'value',
+ labelKey: 'label',
+ optionsQuery: () => ({
+ data: [
+ ...Object.values(TRANSACTION_TYPES).map((value) => ({
+ label: value.replace(/([A-Z])/g, ' $1').trim(),
+ value
+ }))
+ ],
+ isLoading: false
+ })
+ },
+ suppressFloatingFilterButton: true
},
{
colId: 'transactionId',
@@ -150,7 +193,8 @@ export const userActivityColDefs = [
field: 'createDate',
headerName: 'Date',
valueFormatter: dateFormatter,
- filter: false
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true
}
]
@@ -180,7 +224,26 @@ export const userLoginHistoryColDefs = (t) => [
{
field: 'isLoginSuccessful',
headerName: t('admin:userLoginHistoryColLabels.isLoginSuccessful'),
- cellRenderer: LoginStatusRenderer
+ cellRenderer: LoginStatusRenderer,
+ valueGetter: (params) => params.data.isLoginSuccessful,
+ filterParams: {
+ textMatcher: (filter) => {
+ return true
+ }
+ },
+ floatingFilterComponent: BCSelectFloatingFilter,
+ floatingFilterComponentParams: {
+ optionsQuery: () => ({
+ data: [
+ { id: 1, name: 'Success' },
+ { id: 0, name: 'Failed' }
+ ],
+ isLoading: false
+ }),
+ valueKey: 'name',
+ labelKey: 'name'
+ },
+ suppressFloatingFilterButton: true
},
{
field: 'loginErrorMessage',
@@ -190,7 +253,9 @@ export const userLoginHistoryColDefs = (t) => [
field: 'createDate',
headerName: t('admin:userLoginHistoryColLabels.createDate'),
cellDataType: 'dateString',
- valueFormatter: timezoneFormatter
+ valueFormatter: timezoneFormatter,
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true
}
]
@@ -255,7 +320,9 @@ export const auditLogColDefs = (t) => [
filterOptions: ['equals', 'lessThan', 'greaterThan', 'inRange'],
suppressAndOrCondition: true,
buttons: ['clear']
- }
+ },
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true
}
]
diff --git a/frontend/src/views/ComplianceReports/components/_schema.jsx b/frontend/src/views/ComplianceReports/components/_schema.jsx
index 6c52b88b6..e2e9ba6a4 100644
--- a/frontend/src/views/ComplianceReports/components/_schema.jsx
+++ b/frontend/src/views/ComplianceReports/components/_schema.jsx
@@ -75,7 +75,8 @@ export const reportsColDefs = (t, bceidRole) => [
}),
valueKey: 'name',
labelKey: 'name'
- }
+ },
+ suppressFloatingFilterButton: true
},
{
field: 'updateDate',
@@ -91,7 +92,8 @@ export const reportsColDefs = (t, bceidRole) => [
buttons: ['clear'],
maxValidYear: 2400
},
- floatingFilterComponent: BCDateFloatingFilter
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true
}
]
diff --git a/frontend/src/views/FuelCodes/_schema.jsx b/frontend/src/views/FuelCodes/_schema.jsx
index cb93d7617..48bbd4715 100644
--- a/frontend/src/views/FuelCodes/_schema.jsx
+++ b/frontend/src/views/FuelCodes/_schema.jsx
@@ -5,20 +5,23 @@ import {
} from '@/utils/grid/cellRenderers'
import { numberFormatter, timezoneFormatter } from '@/utils/formatters'
import BCTypography from '@/components/BCTypography'
-import { BCColumnSetFilter } from '@/components/BCDataGrid/components'
+import {
+ BCSelectFloatingFilter,
+ BCDateFloatingFilter
+} from '@/components/BCDataGrid/components'
import { useFuelCodeStatuses, useTransportModes } from '@/hooks/useFuelCode'
export const fuelCodeColDefs = (t) => [
{
field: 'status',
headerName: t('fuelCode:fuelCodeColLabels.status'),
- floatingFilterComponent: BCColumnSetFilter,
+ floatingFilterComponent: BCSelectFloatingFilter,
floatingFilterComponentParams: {
- apiOptionField: 'status',
- apiQuery: useFuelCodeStatuses,
- disableCloseOnSelect: false,
- multiple: false
+ valueKey: 'status',
+ labelKey: 'status',
+ optionsQuery: useFuelCodeStatuses
},
+ suppressFloatingFilterButton: true,
valueGetter: (params) => params.data.fuelCodeStatus.status,
cellRenderer: FuelCodeStatusTextRenderer
},
@@ -26,6 +29,7 @@ export const fuelCodeColDefs = (t) => [
field: 'prefix',
headerName: t('fuelCode:fuelCodeColLabels.prefix'),
valueGetter: (params) => params.data.fuelCodePrefix.prefix,
+ suppressFloatingFilterButton: true,
cellRenderer: TextRenderer
},
{
@@ -34,6 +38,7 @@ export const fuelCodeColDefs = (t) => [
cellRenderer: TextRenderer,
type: 'numericColumn',
filter: 'agNumberColumnFilter',
+ suppressFloatingFilterButton: true,
filterParams: {
filterOptions: ['startsWith'],
buttons: ['clear']
@@ -76,26 +81,34 @@ export const fuelCodeColDefs = (t) => [
{
field: 'applicationDate',
headerName: t('fuelCode:fuelCodeColLabels.applicationDate'),
- filter: false,
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true,
+ minWidth: 250,
cellRenderer: TextRenderer
},
{
field: 'approvalDate',
headerName: t('fuelCode:fuelCodeColLabels.approvalDate'),
- filter: false,
- cellRenderer: TextRenderer
+ cellRenderer: TextRenderer,
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true,
+ minWidth: 250
},
{
field: 'effectiveDate',
headerName: t('fuelCode:fuelCodeColLabels.effectiveDate'),
- filter: false,
- cellRenderer: TextRenderer
+ cellRenderer: TextRenderer,
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true,
+ minWidth: 250
},
{
field: 'expirationDate',
headerName: t('fuelCode:fuelCodeColLabels.expirationDate'),
- filter: false,
- cellRenderer: TextRenderer
+ cellRenderer: TextRenderer,
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true,
+ minWidth: 250
},
{
field: 'fuelType',
@@ -158,13 +171,13 @@ export const fuelCodeColDefs = (t) => [
field: 'feedstockFuelTransportMode',
headerName: t('fuelCode:fuelCodeColLabels.feedstockFuelTransportMode'),
sortable: false,
- floatingFilterComponent: BCColumnSetFilter,
+ floatingFilterComponent: BCSelectFloatingFilter,
floatingFilterComponentParams: {
- apiOptionField: 'transportMode',
- apiQuery: useTransportModes,
- disableCloseOnSelect: false,
- multiple: false
+ valueKey: 'transportMode',
+ labelKey: 'transportMode',
+ optionsQuery: useTransportModes
},
+ suppressFloatingFilterButton: true,
minWidth: 335,
valueGetter: (params) =>
params.data.feedstockFuelTransportModes.map(
@@ -176,13 +189,13 @@ export const fuelCodeColDefs = (t) => [
field: 'finishedFuelTransportMode',
headerName: t('fuelCode:fuelCodeColLabels.finishedFuelTransportMode'),
sortable: false,
- floatingFilterComponent: BCColumnSetFilter,
+ floatingFilterComponent: BCSelectFloatingFilter,
floatingFilterComponentParams: {
- apiOptionField: 'transportMode',
- apiQuery: useTransportModes,
- disableCloseOnSelect: false,
- multiple: false
+ valueKey: 'transportMode',
+ labelKey: 'transportMode',
+ optionsQuery: useTransportModes
},
+ suppressFloatingFilterButton: true,
minWidth: 335,
valueGetter: (params) =>
params.data.finishedFuelTransportModes.map(
diff --git a/frontend/src/views/Notifications/NotificationMenu/components/_schema.jsx b/frontend/src/views/Notifications/NotificationMenu/components/_schema.jsx
index 601fb29c6..235eccc50 100644
--- a/frontend/src/views/Notifications/NotificationMenu/components/_schema.jsx
+++ b/frontend/src/views/Notifications/NotificationMenu/components/_schema.jsx
@@ -1,6 +1,7 @@
import { dateFormatter } from '@/utils/formatters'
import { actions } from '@/components/BCDataGrid/columns'
import { ROUTES } from '@/constants/routes'
+import { BCDateFloatingFilter } from '@/components/BCDataGrid/components'
export const columnDefs = (t, currentUser) => [
{
@@ -16,7 +17,8 @@ export const columnDefs = (t, currentUser) => [
{
colId: 'date',
field: 'date',
- cellDataType: 'date',
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true,
headerName: t('notifications:notificationColLabels.date'),
valueGetter: (params) => params.data.createDate,
valueFormatter: dateFormatter
diff --git a/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx b/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx
index 812192fa9..00a633f7d 100644
--- a/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx
+++ b/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx
@@ -1,9 +1,8 @@
-import { useState, useEffect, useMemo, useRef, useCallback } from 'react'
+import { useState, useEffect, useRef, useCallback } from 'react'
import BCTypography from '@/components/BCTypography'
import Grid2 from '@mui/material/Unstable_Grid2/Grid2'
import { useTranslation } from 'react-i18next'
import { useLocation, useNavigate, useParams } from 'react-router-dom'
-import { BCAlert2 } from '@/components/BCAlert'
import BCBox from '@/components/BCBox'
import Loading from '@/components/Loading'
import { defaultColDef, notionalTransferColDefs } from './_schema'
@@ -15,7 +14,6 @@ import {
import { useCurrentUser } from '@/hooks/useCurrentUser'
import { v4 as uuid } from 'uuid'
import { BCGridEditor } from '@/components/BCDataGrid/BCGridEditor'
-import { useApiService } from '@/services/useApiService'
import * as ROUTES from '@/constants/routes/routes.js'
export const AddEditNotionalTransfers = () => {
@@ -26,7 +24,6 @@ export const AddEditNotionalTransfers = () => {
const gridRef = useRef(null)
const alertRef = useRef()
const location = useLocation()
- const apiService = useApiService()
const { t } = useTranslation(['common', 'notionalTransfer', 'reports'])
const { complianceReportId, compliancePeriod } = useParams()
const {
diff --git a/frontend/src/views/Organizations/ViewOrganization/_schema.js b/frontend/src/views/Organizations/ViewOrganization/_schema.js
index 8b78ce4d5..95625fe20 100644
--- a/frontend/src/views/Organizations/ViewOrganization/_schema.js
+++ b/frontend/src/views/Organizations/ViewOrganization/_schema.js
@@ -54,8 +54,7 @@ export const organizationsColDefs = (t) => [
labelKey: 'status',
optionsQuery: useOrganizationStatuses
},
- suppressFloatingFilterButton: true,
- suppressHeaderFilterButton: true
+ suppressFloatingFilterButton: true
}
]
diff --git a/frontend/src/views/Transactions/_schema.js b/frontend/src/views/Transactions/_schema.js
index 50827ed38..e5e2fded4 100644
--- a/frontend/src/views/Transactions/_schema.js
+++ b/frontend/src/views/Transactions/_schema.js
@@ -5,7 +5,10 @@ import {
spacesFormatter
} from '@/utils/formatters'
import { TransactionStatusRenderer } from '@/utils/grid/cellRenderers'
-import { BCSelectFloatingFilter } from '@/components/BCDataGrid/components'
+import {
+ BCSelectFloatingFilter,
+ BCDateFloatingFilter
+} from '@/components/BCDataGrid/components'
import { useTransactionStatuses } from '@/hooks/useTransactions'
const prefixMap = {
@@ -109,7 +112,6 @@ export const transactionsColDefs = (t) => [
optionsQuery: useTransactionStatuses
},
suppressFloatingFilterButton: true,
- suppressHeaderFilterButton: true,
minWidth: 180,
width: 250
},
@@ -118,7 +120,7 @@ export const transactionsColDefs = (t) => [
field: 'updateDate',
headerName: t('txn:txnColLabels.updateDate'),
valueFormatter: dateFormatter,
- width: 190,
+ minWidth: 250,
filter: 'agDateColumnFilter',
filterParams: {
filterOptions: ['inRange', 'equals', 'lessThan', 'greaterThan'],
@@ -137,7 +139,9 @@ export const transactionsColDefs = (t) => [
},
browserDatePicker: true, // Uses the browser's date picker if available
buttons: ['clear']
- }
+ },
+ floatingFilterComponent: BCDateFloatingFilter,
+ suppressFloatingFilterButton: true
}
]
diff --git a/frontend/src/views/Transactions/options.js b/frontend/src/views/Transactions/options.js
deleted file mode 100644
index 69cd55d5f..000000000
--- a/frontend/src/views/Transactions/options.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// import { getOrganization } from '@/utils/getOrganization'
-// import { getStatus } from '@/utils/getStatus'
-// import dayjs from 'dayjs'
-
-// export const gridProps = {
-// columnDefs: [
-// { field: 'transactionId', headerName: 'ID' },
-// {
-// field: 'compliancePeriod',
-// headerName: 'Compliant period'
-// },
-// { field: 'transactionType.type', headerName: 'Type' },
-// {
-// valueGetter: (data) => getOrganization(data, 'from'),
-// headerName: 'Compliance units from'
-// },
-// {
-// valueGetter: (data) => getOrganization(data, 'to'),
-// headerName: 'Compliance units to'
-// },
-// { field: 'complianceUnits', headerName: 'Number of units' },
-// { field: 'valuePerUnit', headerName: 'Value per unit' },
-// {
-// valueGetter: getStatus,
-// headerName: 'Status'
-// },
-// {
-// valueFormatter: (data) => dayjs(data.lastUpdated).format('YYYY-MM-DD'),
-// headerName: 'Last updated'
-// }
-// ],
-// defaultColDef: {
-// resizable: true,
-// sortable: true,
-// filter: true,
-// floatingFilter: true
-// }
-// }