From e9652899fbece3a86c4c5b9bb819d4b98096e86e Mon Sep 17 00:00:00 2001 From: Kevin Hashimoto Date: Wed, 11 Dec 2024 10:25:20 -0800 Subject: [PATCH 1/9] fix: ci fuel for other fuel type --- .../src/views/FuelSupplies/AddEditFuelSupplies.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx b/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx index f5e3b6506..a13634a0f 100644 --- a/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx +++ b/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx @@ -126,12 +126,12 @@ export const AddEditFuelSupplies = () => { const fuelCategoryOptions = selectedFuelType.fuelCategories.map( (item) => item.fuelCategory ) - if (selectedFuelType.fuelType !== 'Other') { - params.node.setDataValue( - 'fuelCategory', - fuelCategoryOptions[0] ?? null - ) - } + + params.node.setDataValue( + 'fuelCategory', + fuelCategoryOptions[0] ?? null + ) + const fuelCodeOptions = selectedFuelType.fuelCodes.map( (code) => code.fuelCode ) From ba4e5830a8e4e5197ee09e825b97ff084506b4f0 Mon Sep 17 00:00:00 2001 From: Hamed Valiollahi Bayeki Date: Wed, 11 Dec 2024 13:18:43 -0800 Subject: [PATCH 2/9] refactor: replace typography with bctypography across components for consistency --- .../src/components/BCForm/BCFormCheckbox.jsx | 8 +-- .../src/components/BCForm/BCFormRadio.jsx | 8 +-- frontend/src/components/BCForm/BCFormText.jsx | 7 +-- .../src/components/BCForm/CustomLabel.jsx | 6 +-- .../BCTypography/BCTypographyRoot.jsx | 2 +- frontend/src/components/DisclaimerBanner.jsx | 7 +-- frontend/src/components/Loading.jsx | 6 +-- .../src/components/ProgressBreadcrumb.jsx | 11 ++-- .../Admin/AdminMenu/components/AuditLog.jsx | 6 +-- .../AdminMenu/components/ViewAuditLog.jsx | 26 ++++----- .../AddAllocationAgreements.jsx | 10 ++-- .../views/AllocationAgreements/_schema.jsx | 10 ++-- .../ComplianceReports/ComplianceReports.jsx | 12 +++-- .../EditViewComplianceReport.jsx | 17 +++--- .../components/ActivityListCard.jsx | 11 ++-- .../components/AssessmentCard.jsx | 24 ++++----- .../components/ComplianceReportSummary.jsx | 7 ++- .../components/Introduction.jsx | 22 ++++---- .../components/OrgDetailsCard.jsx | 23 ++++---- .../components/ReportDetails.jsx | 14 ++--- .../AddEditFinalSupplyEquipments.jsx | 10 ++-- .../views/FinalSupplyEquipments/_schema.jsx | 16 +++--- .../FuelCodes/AddFuelCode/AddEditFuelCode.jsx | 10 ++-- .../views/FuelCodes/AddFuelCode/_schema.jsx | 24 ++++----- frontend/src/views/FuelCodes/FuelCodes.jsx | 11 ++-- frontend/src/views/FuelCodes/_schema.jsx | 6 +-- .../views/FuelExports/AddEditFuelExports.jsx | 10 ++-- frontend/src/views/FuelExports/_schema.jsx | 16 +++--- .../FuelSupplies/AddEditFuelSupplies.jsx | 10 ++-- frontend/src/views/FuelSupplies/_schema.jsx | 12 ++--- .../AddEditNotionalTransfers.jsx | 6 +-- .../src/views/NotionalTransfers/_schema.jsx | 8 +-- .../Organizations/AddEditOrg/AddEditOrg.jsx | 54 +++++++++---------- .../src/views/OtherUses/AddEditOtherUses.jsx | 7 +-- frontend/src/views/OtherUses/_schema.jsx | 14 ++--- .../Transactions/AddEditViewTransaction.jsx | 14 ++--- .../Transactions/components/Comments.jsx | 5 +- .../Transactions/components/LabelBox.jsx | 4 +- .../components/OrgTransactionDetails.jsx | 23 ++++---- .../components/OrganizationList.jsx | 11 ++-- .../components/TransactionHistory.jsx | 10 ++-- .../views/Transfers/AddEditViewTransfer.jsx | 18 +++---- .../Transfers/components/AgreementDate.jsx | 7 ++- .../Transfers/components/AttachmentList.jsx | 12 +++-- .../Transfers/components/CommentList.jsx | 14 ++--- .../views/Transfers/components/LabelBox.jsx | 4 +- .../components/OrganizationBadge.jsx | 13 ++--- .../Transfers/components/Recommendation.jsx | 11 ++-- .../Transfers/components/SigningAuthority.jsx | 10 ++-- .../components/TransferDetailsCard.jsx | 11 ++-- .../Transfers/components/TransferGraphic.jsx | 18 +++---- .../Transfers/components/TransferHistory.jsx | 14 ++--- .../views/Users/AddEditUser/AddEditUser.jsx | 13 ++--- .../components/BCeIDSpecificRoleFields.jsx | 7 +-- .../components/IDIRSpecificRoleFields.jsx | 7 +-- 55 files changed, 351 insertions(+), 326 deletions(-) diff --git a/frontend/src/components/BCForm/BCFormCheckbox.jsx b/frontend/src/components/BCForm/BCFormCheckbox.jsx index 13f28a215..811a49e5c 100644 --- a/frontend/src/components/BCForm/BCFormCheckbox.jsx +++ b/frontend/src/components/BCForm/BCFormCheckbox.jsx @@ -2,9 +2,9 @@ import { Checkbox, FormControl, FormControlLabel, - FormLabel, - Typography + FormLabel } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { Controller } from 'react-hook-form' import { CustomLabel } from './CustomLabel' import PropTypes from 'prop-types' @@ -22,9 +22,9 @@ export const BCFormCheckbox = ({ name, form, label, options, disabled }) => { return ( - + {label} - +
diff --git a/frontend/src/components/BCForm/BCFormRadio.jsx b/frontend/src/components/BCForm/BCFormRadio.jsx index 215840d61..1854ae761 100644 --- a/frontend/src/components/BCForm/BCFormRadio.jsx +++ b/frontend/src/components/BCForm/BCFormRadio.jsx @@ -3,9 +3,9 @@ import { FormControlLabel, FormLabel, Radio, - RadioGroup, - Typography + RadioGroup } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { Controller } from 'react-hook-form' import PropTypes from 'prop-types' import { CustomLabel } from './CustomLabel' @@ -34,9 +34,9 @@ export const BCFormRadio = ({ name, control, label, options, disabled }) => { return ( - + {label} - + { @@ -14,14 +15,14 @@ export const BCFormText = ({ name, control, label, optional }) => { }) => ( <> - + {label}  {optional && ( (optional) )} - + ( - + {header} — {text} - + ) CustomLabel.propTypes = { diff --git a/frontend/src/components/BCTypography/BCTypographyRoot.jsx b/frontend/src/components/BCTypography/BCTypographyRoot.jsx index 605bcc6e9..b08b8ef3e 100644 --- a/frontend/src/components/BCTypography/BCTypographyRoot.jsx +++ b/frontend/src/components/BCTypography/BCTypographyRoot.jsx @@ -3,7 +3,7 @@ import Typography from '@mui/material/Typography' import { styled } from '@mui/material/styles' const BCTypographyRoot = styled(Typography)(({ theme, ownerState }) => { - const { palette, typography, functions } = theme + const { palette, typography, functions = {} } = theme const { color, textTransform, diff --git a/frontend/src/components/DisclaimerBanner.jsx b/frontend/src/components/DisclaimerBanner.jsx index fb0b2b87a..ac4e7e507 100644 --- a/frontend/src/components/DisclaimerBanner.jsx +++ b/frontend/src/components/DisclaimerBanner.jsx @@ -1,5 +1,6 @@ import PropTypes from 'prop-types' -import { Box, Typography } from '@mui/material' +import { Box } from '@mui/material' +import BCTypography from '@/components/BCTypography' import colors from '@/themes/base/colors' const DisclaimerBanner = ({ messages }) => { @@ -16,9 +17,9 @@ const DisclaimerBanner = ({ messages }) => { }} > {messages.map((message, index) => ( - + {message} - + ))} ) diff --git a/frontend/src/components/Loading.jsx b/frontend/src/components/Loading.jsx index 53575eac7..d1906365b 100644 --- a/frontend/src/components/Loading.jsx +++ b/frontend/src/components/Loading.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types' import CircularProgress from '@mui/material/CircularProgress' import Box from '@mui/material/Box' -import Typography from '@mui/material/Typography' +import BCTypography from '@/components/BCTypography' import colors from '@/themes/base/colors' import borders from '@/themes/base/borders' @@ -36,9 +36,9 @@ const Loading = ({ message = 'Loading...', fixed = false }) => { }} > - + {message} - + ) diff --git a/frontend/src/components/ProgressBreadcrumb.jsx b/frontend/src/components/ProgressBreadcrumb.jsx index 91743d589..c90d70988 100644 --- a/frontend/src/components/ProgressBreadcrumb.jsx +++ b/frontend/src/components/ProgressBreadcrumb.jsx @@ -1,6 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' -import { Breadcrumbs, Typography, Box, useMediaQuery } from '@mui/material' +import { Breadcrumbs, Box, useMediaQuery } from '@mui/material' +import BCTypography from '@/components/BCTypography' /** * ProgressBreadcrumb Component @@ -62,19 +63,19 @@ const ProgressBreadcrumb = ({ steps, currentStep }) => { mb: 1 }} > - {index + 1} - + - {step} - + ) } diff --git a/frontend/src/views/Admin/AdminMenu/components/AuditLog.jsx b/frontend/src/views/Admin/AdminMenu/components/AuditLog.jsx index 91f7bba1a..a6f994c90 100644 --- a/frontend/src/views/Admin/AdminMenu/components/AuditLog.jsx +++ b/frontend/src/views/Admin/AdminMenu/components/AuditLog.jsx @@ -1,7 +1,7 @@ import { useRef, useCallback } from 'react' import BCBox from '@/components/BCBox' import BCDataGridServer from '@/components/BCDataGrid/BCDataGridServer' -import { Typography } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { useTranslation } from 'react-i18next' import { auditLogColDefs, defaultAuditLogSortModel } from './_schema' import { apiRoutes, ROUTES } from '@/constants/routes' @@ -38,9 +38,9 @@ export const AuditLog = () => { return ( - + {t('admin:AuditLog')} - + { return ( - + {t('AuditLogDetails', { id })} - + {/* Display the additional information */} - + {t('auditLogColLabels.tableName')}: {tableName} - - + + {t('auditLogColLabels.operation')}: {operation} - - + + {t('auditLogColLabels.rowId')}: {rowId} - - + + {t('auditLogColLabels.createDate')}:{' '} {new Date(createDate).toLocaleString()} - - + + {t('auditLogColLabels.userId')}:{' '} {createUser || t('System')} - + diff --git a/frontend/src/views/AllocationAgreements/AddAllocationAgreements.jsx b/frontend/src/views/AllocationAgreements/AddAllocationAgreements.jsx index dd37955ad..7d3a50512 100644 --- a/frontend/src/views/AllocationAgreements/AddAllocationAgreements.jsx +++ b/frontend/src/views/AllocationAgreements/AddAllocationAgreements.jsx @@ -1,5 +1,5 @@ import { useState, useEffect, useMemo, useRef, useCallback } from 'react' -import { Typography } from '@mui/material' +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' @@ -239,17 +239,17 @@ export const AddEditAllocationAgreements = () => { !allocationAgreementsLoading && (
- + {t('allocationAgreement:addAllocationAgreementRowsTitle')} - - + {t('allocationAgreement:allocationAgreementSubtitle')} - +
[ }, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellStyle: (params) => StandardCellErrors(params, errors), suppressKeyboardEvent, minWidth: 120, @@ -95,7 +95,7 @@ export const allocationAgreementColDefs = (optionsData, errors) => [ cellRenderer: (params) => params.value || (!params.value && ( - Enter or search a name + Enter or search a name )), cellStyle: (params) => StandardCellErrors(params, errors), suppressKeyboardEvent, @@ -177,7 +177,7 @@ export const allocationAgreementColDefs = (optionsData, errors) => [ }, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellStyle: (params) => StandardCellErrors(params, errors), suppressKeyboardEvent, minWidth: 200, @@ -276,7 +276,7 @@ export const allocationAgreementColDefs = (optionsData, errors) => [ }, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellStyle: (params) => StandardCellErrors(params, errors), suppressKeyboardEvent, minWidth: 300, diff --git a/frontend/src/views/ComplianceReports/ComplianceReports.jsx b/frontend/src/views/ComplianceReports/ComplianceReports.jsx index 75476cd50..973b6f46b 100644 --- a/frontend/src/views/ComplianceReports/ComplianceReports.jsx +++ b/frontend/src/views/ComplianceReports/ComplianceReports.jsx @@ -1,5 +1,5 @@ // mui components -import { Typography, Stack } from '@mui/material' +import { Stack } from '@mui/material' import BCBox from '@/components/BCBox' import BCAlert from '@/components/BCAlert' import BCDataGridServer from '@/components/BCDataGrid/BCDataGridServer' @@ -19,6 +19,7 @@ import { useCreateComplianceReport } from '@/hooks/useComplianceReports' // internal components import { reportsColDefs, defaultSortModel } from './components/_schema' import { NewComplianceReportButton } from './components/NewComplianceReportButton' +import BCTypography from '@/components/BCTypography' export const ComplianceReports = () => { const { t } = useTranslation(['common', 'report']) @@ -39,7 +40,10 @@ export const ComplianceReports = () => { }), [t] ) - const getRowId = useCallback((params) => params.data.complianceReportId.toString(), []) + const getRowId = useCallback( + (params) => params.data.complianceReportId.toString(), + [] + ) // eslint-disable-next-line react-hooks/exhaustive-deps const handleRowClicked = useCallback( ({ data }) => { @@ -114,9 +118,9 @@ export const ComplianceReports = () => { )}
- + {t('report:title')} - + { return ( <> - {t('report:errorRetrieving')} + {t('report:errorRetrieving')} ) } @@ -180,22 +181,22 @@ export const EditViewComplianceReport = () => { data={modalData} /> - {compliancePeriod + ' ' + t('report:complianceReport')} -{' '} {reportData?.report.nickname} - - + Status: {currentStatus} - + @@ -242,9 +243,9 @@ export const EditViewComplianceReport = () => { {/* Internal Comments */} {isGovernmentUser && ( - + {t(`report:internalComments`)} - + { gap: 2 }} > - { }} /> - + {t('report:activityLinksList')}: - + - {t('report:uploadLabel')} - + - + {orgData?.name} - + @@ -190,7 +190,7 @@ export const AssessmentCard = ({ {!isGovernmentUser && ( - - {t('report:renewableFuelTarget')} - + @@ -223,13 +223,13 @@ export const AssessmentCard = ({ - {t('report:lowCarbonFuelTargetSummary')} - + @@ -248,14 +248,14 @@ export const AssessmentCard = ({ )} {!!chain.length && ( <> - {t('report:reportHistory')} - + {chain.map((report) => ( ))} @@ -266,13 +266,13 @@ export const AssessmentCard = ({ {isFeatureEnabled(FEATURE_FLAGS.SUPPLEMENTAL_REPORTING) && currentStatus === COMPLIANCE_REPORT_STATUSES.ASSESSED && ( <> - {t('report:supplementalWarning')} - + {t('report:errorRetrieving')} + return {t('report:errorRetrieving')} } return ( <> - + {t('report:summaryAndDeclaration')} - + } diff --git a/frontend/src/views/ComplianceReports/components/Introduction.jsx b/frontend/src/views/ComplianceReports/components/Introduction.jsx index 2a804dc96..ec3747941 100644 --- a/frontend/src/views/ComplianceReports/components/Introduction.jsx +++ b/frontend/src/views/ComplianceReports/components/Introduction.jsx @@ -3,22 +3,22 @@ import { Accordion, AccordionDetails, AccordionSummary, - Typography } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { GlobalStyles } from '@mui/system' import { useTranslation } from 'react-i18next' // Reusable Section Component const Section = ({ header, content }) => ( <> - + > {content.map((paragraph, index) => ( - ( } }} dangerouslySetInnerHTML={{ __html: paragraph }} - > + > ))} ) @@ -58,9 +58,9 @@ export const Introduction = ({ expanded, compliancePeriod }) => { id="compliance-report-intro" data-test="compliance-report-intro" > - + {t('report:introduction')} - + {/* Render each section using map */} @@ -69,10 +69,10 @@ export const Introduction = ({ expanded, compliancePeriod }) => { ))} - + {t('report:questions')} - - + { } }} dangerouslySetInnerHTML={{ __html: t('report:contact') }} - > + > ) } diff --git a/frontend/src/views/ComplianceReports/components/OrgDetailsCard.jsx b/frontend/src/views/ComplianceReports/components/OrgDetailsCard.jsx index fde2af7a1..c2c990dd7 100644 --- a/frontend/src/views/ComplianceReports/components/OrgDetailsCard.jsx +++ b/frontend/src/views/ComplianceReports/components/OrgDetailsCard.jsx @@ -1,5 +1,6 @@ import { useTranslation } from 'react-i18next' -import { Stack, Typography } from '@mui/material' +import { Stack } from '@mui/material' +import BCTypography from '@/components/BCTypography' import BCWidgetCard from '@/components/BCWidgetCard/BCWidgetCard' import { constructAddress } from '@/utils/constructAddress' @@ -12,24 +13,24 @@ export const OrgDetailsCard = ({ orgName, orgAddress, orgAttorneyAddress, isGove title={t('report:orgDetails')} content={ - + {orgName} - +
- + {t('report:serviceAddrLabel')}: - {' '} - + {' '} + {orgAddress && constructAddress(orgAddress)} - +
- {t('report:bcAddrLabel')}:{' '} - + {t('report:bcAddrLabel')}:{' '} + {orgAttorneyAddress && constructAddress(orgAttorneyAddress)} - +
- {!isGovernmentUser && { return ( <> - + {t('report:reportDetails')} { > {t('report:collapseAll')} - + {activityList.map((activity, index) => { const { data, error, isLoading } = activity.useFetch(complianceReportId) return ( @@ -223,7 +223,7 @@ const ReportDetails = ({ currentStatus = 'Draft' }) => { id={`panel${index}-header`} data-test={`panel${index}-summary`} > - {
)} - + {isLoading ? ( ) : error ? ( - Error loading data + Error loading data ) : activity.component ? ( activity.component(data) ) : ( - {JSON.stringify(data)} + {JSON.stringify(data)} )} diff --git a/frontend/src/views/FinalSupplyEquipments/AddEditFinalSupplyEquipments.jsx b/frontend/src/views/FinalSupplyEquipments/AddEditFinalSupplyEquipments.jsx index fbfa3ceb3..fb9fcafaa 100644 --- a/frontend/src/views/FinalSupplyEquipments/AddEditFinalSupplyEquipments.jsx +++ b/frontend/src/views/FinalSupplyEquipments/AddEditFinalSupplyEquipments.jsx @@ -1,5 +1,5 @@ import { useState, useEffect, useMemo, useRef, useCallback } from 'react' -import { Typography } from '@mui/material' +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' @@ -262,17 +262,17 @@ export const AddEditFinalSupplyEquipments = () => { !equipmentsLoading && (
- + {t('finalSupplyEquipment:addFSErowsTitle')} - - + {t('finalSupplyEquipment:fseSubtitle')} - +
( - + {params.value[0] ? `${params.value[0]} to ${params.value[1]}` : 'YYYY-MM-DD to YYYY-MM-DD'} - + ), suppressKeyboardEvent, cellStyle: (params) => StandardCellErrors(params, errors), @@ -162,7 +162,7 @@ export const finalSupplyEquipmentColDefs = ( cellStyle: (params) => StandardCellErrors(params, errors), cellRenderer: (params) => params.value || - (!params.value && Select) + (!params.value && Select) }, { field: 'ports', @@ -183,7 +183,7 @@ export const finalSupplyEquipmentColDefs = ( cellStyle: (params) => StandardCellErrors(params, errors), cellRenderer: (params) => params.value || - (!params.value && Select) + (!params.value && Select) }, { field: 'fuelMeasurementType', @@ -204,7 +204,7 @@ export const finalSupplyEquipmentColDefs = ( cellStyle: (params) => StandardCellErrors(params, errors), cellRenderer: (params) => params.value || - (!params.value && Select) + (!params.value && Select) }, { field: 'intendedUses', @@ -224,7 +224,7 @@ export const finalSupplyEquipmentColDefs = ( (params.value && params.value !== '' && ( )) || - (!params.value && Select), + (!params.value && Select), suppressKeyboardEvent, minWidth: 560 }, @@ -246,7 +246,7 @@ export const finalSupplyEquipmentColDefs = ( (params.value && params.value !== '' && ( )) || - (!params.value && Select), + (!params.value && Select), suppressKeyboardEvent, minWidth: 315 }, diff --git a/frontend/src/views/FuelCodes/AddFuelCode/AddEditFuelCode.jsx b/frontend/src/views/FuelCodes/AddFuelCode/AddEditFuelCode.jsx index 044c767a7..1b5d6448c 100644 --- a/frontend/src/views/FuelCodes/AddFuelCode/AddEditFuelCode.jsx +++ b/frontend/src/views/FuelCodes/AddFuelCode/AddEditFuelCode.jsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' -import { Stack, Typography } from '@mui/material' +import { Stack } from '@mui/material' import Grid2 from '@mui/material/Unstable_Grid2/Grid2' import { v4 as uuid } from 'uuid' import { BCGridEditor } from '@/components/BCDataGrid/BCGridEditor' @@ -307,13 +307,13 @@ const AddEditFuelCodeBase = () => { <>
- + {!existingFuelCode && t('fuelCode:newFuelCodeTitle')} {existingFuelCode?.fuelCodeStatus.status === FUEL_CODE_STATUSES.DRAFT && t('fuelCode:editFuelCodeTitle')} {existingFuelCode?.fuelCodeStatus.status === FUEL_CODE_STATUSES.APPROVED && t('fuelCode:viewFuelCodeTitle')} - +
{ } onClick={handleOpenApprovalModal} > - + {t('fuelCode:approveFuelCodeBtn')} - +
)} diff --git a/frontend/src/views/FuelCodes/AddFuelCode/_schema.jsx b/frontend/src/views/FuelCodes/AddFuelCode/_schema.jsx index 3c39a6f4c..e42f2b8c7 100644 --- a/frontend/src/views/FuelCodes/AddFuelCode/_schema.jsx +++ b/frontend/src/views/FuelCodes/AddFuelCode/_schema.jsx @@ -9,7 +9,7 @@ import { import { apiRoutes } from '@/constants/routes' import i18n from '@/i18n' import { CommonArrayRenderer } from '@/utils/grid/cellRenderers' -import { Typography } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { actions, validation } from '@/components/BCDataGrid/columns' import { numberFormatter } from '@/utils/formatters' @@ -30,7 +30,7 @@ const createCellRenderer = (field, customRenderer = null) => { const content = customRenderer ? customRenderer(params) : params.value || - (!params.value && Select) + (!params.value && Select) return
{content}
} @@ -257,9 +257,9 @@ export const fuelCodeColDefs = (optionsData, errors, isCreate, canEdit) => [ maxWidth: 220, minWidth: 200, cellRenderer: createCellRenderer('applicationDate', (params) => ( - + {params.value ? params.value : 'YYYY-MM-DD'} - + )), suppressKeyboardEvent, cellEditor: DateEditor @@ -272,9 +272,9 @@ export const fuelCodeColDefs = (optionsData, errors, isCreate, canEdit) => [ maxWidth: 220, minWidth: 220, cellRenderer: createCellRenderer('approvalDate', (params) => ( - + {params.value ? params.value : 'YYYY-MM-DD'} - + )), suppressKeyboardEvent, @@ -288,9 +288,9 @@ export const fuelCodeColDefs = (optionsData, errors, isCreate, canEdit) => [ maxWidth: 220, minWidth: 220, cellRenderer: createCellRenderer('effectiveDate', (params) => ( - + {params.value ? params.value : 'YYYY-MM-DD'} - + )), suppressKeyboardEvent, cellEditor: DateEditor @@ -303,9 +303,9 @@ export const fuelCodeColDefs = (optionsData, errors, isCreate, canEdit) => [ maxWidth: 220, minWidth: 220, cellRenderer: createCellRenderer('expirationDate', (params) => ( - + {params.value ? params.value : 'YYYY-MM-DD'} - + )), suppressKeyboardEvent, cellEditor: DateEditor @@ -561,7 +561,7 @@ export const fuelCodeColDefs = (optionsData, errors, isCreate, canEdit) => [ params.value && params.value.length > 0 ? ( ) : ( - Select + Select ) ), cellRendererParams: { @@ -586,7 +586,7 @@ export const fuelCodeColDefs = (optionsData, errors, isCreate, canEdit) => [ params.value && params.value.length > 0 ? ( ) : ( - Select + Select ) ), cellRendererParams: { diff --git a/frontend/src/views/FuelCodes/FuelCodes.jsx b/frontend/src/views/FuelCodes/FuelCodes.jsx index 094ee425d..fba322f9a 100644 --- a/frontend/src/views/FuelCodes/FuelCodes.jsx +++ b/frontend/src/views/FuelCodes/FuelCodes.jsx @@ -11,7 +11,8 @@ import { useApiService } from '@/services/useApiService' import withRole from '@/utils/withRole' import { faCirclePlus } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { Stack, Typography } from '@mui/material' +import { Stack } from '@mui/material' +import BCTypography from '@/components/BCTypography' import Grid2 from '@mui/material/Unstable_Grid2/Grid2' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -68,9 +69,9 @@ const FuelCodesBase = () => { )} - + {t('FuelCodes')} - + { data-test="new-fuel-code-btn" onClick={() => navigate(ROUTES.FUELCODES_ADD)} > - + {t('fuelCode:newFuelCodeBtn')} - + [ filter: false, headerName: t('fuelCode:fuelCodeColLabels.lastUpdated'), cellRenderer: (params) => ( - + {params.value ? timezoneFormatter({ value: params.value }) : 'YYYY-MM-DD'} - + ), minWidth: 300 }, diff --git a/frontend/src/views/FuelExports/AddEditFuelExports.jsx b/frontend/src/views/FuelExports/AddEditFuelExports.jsx index 5e6a3cf76..ebaa03498 100644 --- a/frontend/src/views/FuelExports/AddEditFuelExports.jsx +++ b/frontend/src/views/FuelExports/AddEditFuelExports.jsx @@ -7,7 +7,7 @@ import { useSaveFuelExport } from '@/hooks/useFuelExport' import { isArrayEmpty } from '@/utils/formatters' -import { Typography } from '@mui/material' +import BCTypography from '@/components/BCTypography' import Grid2 from '@mui/material/Unstable_Grid2/Grid2' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -228,17 +228,17 @@ export const AddEditFuelExports = () => { !fuelExportsLoading && (
- + {t('fuelExport:addFuelExportRowsTitle')} - - + {t('fuelExport:fuelExportSubtitle')} - +
[ maxWidth: 220, minWidth: 200, cellRenderer: (params) => ( - + {params.value ? params.value : 'YYYY-MM-DD'} - + ), suppressKeyboardEvent, cellEditor: DateEditor, @@ -112,7 +112,7 @@ export const fuelExportColDefs = (optionsData, errors) => [ cellEditor: AutocompleteCellEditor, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellEditorParams: { options: optionsData?.fuelTypes?.map((obj) => obj.fuelType).sort(), multiple: false, @@ -181,7 +181,7 @@ export const fuelExportColDefs = (optionsData, errors) => [ cellEditor: AutocompleteCellEditor, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellEditorParams: (params) => ({ options: optionsData?.fuelTypes ?.find((obj) => params.data.fuelType === obj.fuelType) @@ -255,7 +255,7 @@ export const fuelExportColDefs = (optionsData, errors) => [ cellEditor: AutocompleteCellEditor, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellStyle: (params) => cellErrorStyle(params, errors), suppressKeyboardEvent, valueGetter: (params) => { @@ -288,7 +288,7 @@ export const fuelExportColDefs = (optionsData, errors) => [ cellEditor: 'agSelectCellEditor', cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellEditorParams: (params) => ({ values: optionsData?.fuelTypes ?.find((obj) => params.data.fuelType === obj.fuelType) @@ -370,7 +370,7 @@ export const fuelExportColDefs = (optionsData, errors) => [ }), cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), suppressKeyboardEvent, editable: (params) => isFuelTypeOther(params), cellStyle: (params) => { diff --git a/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx b/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx index f5e3b6506..a6289c0d7 100644 --- a/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx +++ b/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx @@ -8,7 +8,7 @@ import { useSaveFuelSupply } from '@/hooks/useFuelSupply' import { isArrayEmpty } from '@/utils/formatters' -import { Typography } from '@mui/material' +import BCTypography from '@/components/BCTypography' import Grid2 from '@mui/material/Unstable_Grid2/Grid2' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -267,17 +267,17 @@ export const AddEditFuelSupplies = () => { !fuelSuppliesLoading && (
- + {t('fuelSupply:addFuelSupplyRowsTitle')} - - + {t('fuelSupply:fuelSupplySubtitle')} - +
[ cellEditor: AutocompleteCellEditor, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellEditorParams: { options: optionsData?.fuelTypes?.map((obj) => obj.fuelType).sort(), multiple: false, @@ -150,7 +150,7 @@ export const fuelSupplyColDefs = (optionsData, errors, warnings) => [ cellEditor: AutocompleteCellEditor, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellEditorParams: (params) => ({ options: optionsData?.fuelTypes ?.find((obj) => params.data.fuelType === obj.fuelType) @@ -223,7 +223,7 @@ export const fuelSupplyColDefs = (optionsData, errors, warnings) => [ cellEditor: AutocompleteCellEditor, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellStyle: (params) => StandardCellWarningAndErrors(params, errors, warnings), suppressKeyboardEvent, @@ -260,7 +260,7 @@ export const fuelSupplyColDefs = (optionsData, errors, warnings) => [ cellEditor: 'agSelectCellEditor', cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellEditorParams: (params) => ({ values: optionsData?.fuelTypes ?.find((obj) => params.data.fuelType === obj.fuelType) @@ -369,7 +369,7 @@ export const fuelSupplyColDefs = (optionsData, errors, warnings) => [ }), cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), suppressKeyboardEvent, editable: (params) => isFuelTypeOther(params), cellStyle: (params) => diff --git a/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx b/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx index dae931de3..2360dfb19 100644 --- a/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx +++ b/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx @@ -1,5 +1,5 @@ import { useState, useEffect, useMemo, useRef, useCallback } from 'react' -import { Typography } from '@mui/material' +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' @@ -201,9 +201,9 @@ export const AddEditNotionalTransfers = () => { !transfersLoading && (
- + {t('notionalTransfer:newNotionalTransferTitle')} - +
[ cellRenderer: (params) => params.value || (!params.value && ( - Enter or search a name + Enter or search a name )), suppressKeyboardEvent, minWidth: 300, @@ -107,7 +107,7 @@ export const notionalTransferColDefs = (optionsData, errors) => [ cellStyle: (params) => StandardCellErrors(params, errors), cellRenderer: (params) => params.value || - (!params.value && Select) + (!params.value && Select) }, { field: 'receivedOrTransferred', @@ -128,7 +128,7 @@ export const notionalTransferColDefs = (optionsData, errors) => [ cellStyle: (params) => StandardCellErrors(params, errors), cellRenderer: (params) => params.value || - (!params.value && Select) + (!params.value && Select) }, { field: 'quantity', diff --git a/frontend/src/views/Organizations/AddEditOrg/AddEditOrg.jsx b/frontend/src/views/Organizations/AddEditOrg/AddEditOrg.jsx index db41edc62..829ce2114 100644 --- a/frontend/src/views/Organizations/AddEditOrg/AddEditOrg.jsx +++ b/frontend/src/views/Organizations/AddEditOrg/AddEditOrg.jsx @@ -13,9 +13,9 @@ import { Paper, Radio, RadioGroup, - TextField, - Typography + TextField } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { useMutation } from '@tanstack/react-query' import { useCallback, useEffect, useState } from 'react' import { useForm, Controller } from 'react-hook-form' @@ -136,9 +136,9 @@ export const AddEditOrg = () => { } return ( errors[fieldName] && ( - + {errors[fieldName].message} - + ) ) } @@ -301,9 +301,9 @@ export const AddEditOrg = () => { {t('common:submitError')} )} - + {orgID ? t('org:editOrgTitle') : t('org:addOrgTitle')} - + { /> } label={ - + {t('org:sameAsLegalNameLabel')} - + } /> @@ -413,9 +413,9 @@ export const AddEditOrg = () => { - + {t('org:supplierTypLabel')}: - + @@ -435,9 +435,9 @@ export const AddEditOrg = () => { /> } label={ - + {t('supplier')} - + } /> @@ -451,9 +451,9 @@ export const AddEditOrg = () => { - + {t('org:regTrnLabel')}: - + @@ -474,9 +474,9 @@ export const AddEditOrg = () => { } label={ - + {t('yes')} - + } /> { } label={ - + {t('no')} - + } /> @@ -522,9 +522,9 @@ export const AddEditOrg = () => { - + {t('org:serviceAddrLabel')} - + {t('org:streetAddrLabel')}: @@ -612,9 +612,9 @@ export const AddEditOrg = () => { - + {t('org:bcAddrLabel')} - + { /> } label={ - + {t('org:sameAddrLabel')} - + } /> @@ -762,9 +762,9 @@ export const AddEditOrg = () => { } onClick={() => navigate(ROUTES.ORGANIZATIONS)} > - + {t('backBtn')} - + { } > - {t('saveBtn')} + {t('saveBtn')} diff --git a/frontend/src/views/OtherUses/AddEditOtherUses.jsx b/frontend/src/views/OtherUses/AddEditOtherUses.jsx index 6de1e3a21..58586cb9e 100644 --- a/frontend/src/views/OtherUses/AddEditOtherUses.jsx +++ b/frontend/src/views/OtherUses/AddEditOtherUses.jsx @@ -10,7 +10,8 @@ import { import { cleanEmptyStringValues } from '@/utils/formatters' import { faFloppyDisk } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { Stack, Typography } from '@mui/material' +import { Stack } from '@mui/material' +import BCTypography from '@/components/BCTypography' import Grid2 from '@mui/material/Unstable_Grid2/Grid2' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -233,9 +234,9 @@ export const AddEditOtherUses = () => { isFetched && (
- + {t('otherUses:newOtherUsesTitle')} - +
[ }, suppressKeyboardEvent, cellRenderer: (params) => - params.value || Select, + params.value || Select, cellStyle: (params) => StandardCellErrors(params, errors) }, { @@ -58,7 +58,7 @@ export const otherUsesColDefs = (optionsData, errors) => [ }, suppressKeyboardEvent, cellRenderer: (params) => - params.value || Select, + params.value || Select, cellStyle: (params) => StandardCellErrors(params, errors), minWidth: 200 }, @@ -84,7 +84,7 @@ export const otherUsesColDefs = (optionsData, errors) => [ }, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellStyle: (params) => StandardCellErrors(params, errors), suppressKeyboardEvent, valueSetter: (params) => { @@ -121,7 +121,7 @@ export const otherUsesColDefs = (optionsData, errors) => [ params.data.provisionOfTheAct === PROVISION_APPROVED_FUEL_CODE && fuelType?.fuelCodes?.length > 0 ) { - return params.value || Select; + return params.value || Select; } return null; }, @@ -193,7 +193,7 @@ export const otherUsesColDefs = (optionsData, errors) => [ }, suppressKeyboardEvent, cellRenderer: (params) => - params.value || Select, + params.value || Select, cellStyle: (params) => StandardCellErrors(params, errors) }, { @@ -246,7 +246,7 @@ export const otherUsesColDefs = (optionsData, errors) => [ }, suppressKeyboardEvent, cellRenderer: (params) => - params.value || Select, + params.value || Select, cellStyle: (params) => StandardCellErrors(params, errors), minWidth: 200 }, diff --git a/frontend/src/views/Transactions/AddEditViewTransaction.jsx b/frontend/src/views/Transactions/AddEditViewTransaction.jsx index 0470f3797..766559a92 100644 --- a/frontend/src/views/Transactions/AddEditViewTransaction.jsx +++ b/frontend/src/views/Transactions/AddEditViewTransaction.jsx @@ -23,12 +23,12 @@ import { import { useTheme, Stack, - Typography, useMediaQuery, Step, StepLabel, Stepper } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faArrowLeft } from '@fortawesome/free-solid-svg-icons' import BCBox from '@/components/BCBox' @@ -345,9 +345,9 @@ export const AddEditViewTransaction = () => { /> {/* Header section */} - + {title} - + {/* Progress bar */} { {/* Internal Comments */} - + {t(`txn:internalCommentsOptional`)} - + { onClick={() => navigate(ROUTES.TRANSACTIONS)} > - + {t('backBtn')} - + {buttonClusterConfig[ transactionId ? currentStatus : TRANSACTION_STATUSES.NEW diff --git a/frontend/src/views/Transactions/components/Comments.jsx b/frontend/src/views/Transactions/components/Comments.jsx index a630c7533..52de50b7e 100644 --- a/frontend/src/views/Transactions/components/Comments.jsx +++ b/frontend/src/views/Transactions/components/Comments.jsx @@ -1,5 +1,6 @@ import { useState, useEffect } from 'react' -import { Box, Typography, Collapse, IconButton, TextField } from '@mui/material' +import { Box, Collapse, IconButton, TextField } from '@mui/material' +import BCTypography from '@/components/BCTypography' import ExpandLessIcon from '@mui/icons-material/ExpandLess' import ExpandMoreIcon from '@mui/icons-material/ExpandMore' import { useFormContext } from 'react-hook-form' @@ -37,7 +38,7 @@ export const Comments = ({ commentField, isEditable }) => { onClick={handleToggle} sx={{ cursor: 'pointer' }} > - {t('txn:commentsDescText')} + {t('txn:commentsDescText')} {isExpanded ? : } diff --git a/frontend/src/views/Transactions/components/LabelBox.jsx b/frontend/src/views/Transactions/components/LabelBox.jsx index a5e837539..5fa29ae1d 100644 --- a/frontend/src/views/Transactions/components/LabelBox.jsx +++ b/frontend/src/views/Transactions/components/LabelBox.jsx @@ -28,9 +28,9 @@ export const LabelBox = ({ > {description && ( - + {description} - + )} {children} diff --git a/frontend/src/views/Transactions/components/OrgTransactionDetails.jsx b/frontend/src/views/Transactions/components/OrgTransactionDetails.jsx index b25fb2e1f..b48ea7897 100644 --- a/frontend/src/views/Transactions/components/OrgTransactionDetails.jsx +++ b/frontend/src/views/Transactions/components/OrgTransactionDetails.jsx @@ -1,5 +1,6 @@ import React from 'react' -import { Box, Grid, Typography } from '@mui/material' +import { Box, Grid } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { useTranslation } from 'react-i18next' import { dateFormatter, numberFormatter } from '@/utils/formatters' import BCWidgetCard from '@/components/BCWidgetCard/BCWidgetCard' @@ -33,32 +34,32 @@ export const OrgTransactionDetails = ({ transactionType, transactionData }) => { // Construct the content based on the transaction type const content = ( - + {transactionType === ADMIN_ADJUSTMENT ? t('txn:administrativeAdjustment') : t('txn:initiativeAgreement')}{' '} {t('txn:for')} {transactionData.toOrganization.name} - - + + {t('txn:complianceUnitsLabel')}{' '} {numberFormatter({ value: transactionData.complianceUnits })} - - + + {t('txn:effectiveDateLabel')}{' '} {dateFormatter({ value: effectiveDate })} - + {transactionData.govComment && ( - + {t('txn:commentsTextLabel')}{' '} {transactionData.govComment} - + )} - + {t('txn:approvedLabel')}{' '} {dateFormatter({ value: approvedDate })} {t('txn:approvedByDirector')} - + ) diff --git a/frontend/src/views/Transactions/components/OrganizationList.jsx b/frontend/src/views/Transactions/components/OrganizationList.jsx index e2f9719dd..1bc750edb 100644 --- a/frontend/src/views/Transactions/components/OrganizationList.jsx +++ b/frontend/src/views/Transactions/components/OrganizationList.jsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react' import PropTypes from 'prop-types' -import { Box, Stack, Typography, Autocomplete, TextField } from '@mui/material' +import { Box, Stack, Autocomplete, TextField } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { useTranslation } from 'react-i18next' import { useOrganizationNames } from '@/hooks/useOrganizations' import { numberFormatter } from '@/utils/formatters' @@ -47,9 +48,9 @@ const OrganizationList = ({ onOrgChange }) => { return ( - + {org} - + { useFlexGap flexWrap="wrap" > - + {t('txn:showTransactionsInvolve')}:  - + { return ( - + {t('txn:txnHistoryLabel')} - +
    {transactionHistory?.map((item, index) => (
  • - + {getTransactionStatusLabel(getStatusObject(item))} @@ -50,7 +50,7 @@ export const TransactionHistory = ({ transactionHistory }) => { of {t('govOrg')} - +
  • ))}
diff --git a/frontend/src/views/Transfers/AddEditViewTransfer.jsx b/frontend/src/views/Transfers/AddEditViewTransfer.jsx index 6e15fd993..2968b16a8 100644 --- a/frontend/src/views/Transfers/AddEditViewTransfer.jsx +++ b/frontend/src/views/Transfers/AddEditViewTransfer.jsx @@ -23,10 +23,10 @@ import { Step, StepLabel, Stepper, - Typography, useMediaQuery, useTheme } from '@mui/material' +import BCTypography from '@/components/BCTypography' import BCAlert from '@/components/BCAlert' import BCBox from '@/components/BCBox' import BCButton from '@/components/BCButton' @@ -365,18 +365,18 @@ export const AddEditViewTransfer = () => { /> {/* Header section */} - + {title} - + {transferStatus !== TRANSFER_STATUSES.RECORDED && ( - + {t('transfer:effectiveText')} - +
- + {t('transfer:considerationText')} - +
)} {/* Progress bar */} @@ -470,12 +470,12 @@ export const AddEditViewTransfer = () => { onClick={() => navigate(ROUTES.TRANSACTIONS)} > - {t('backBtn')} - + {buttonClusterConfig[transferId ? currentStatus : 'New']?.map( (config) => diff --git a/frontend/src/views/Transfers/components/AgreementDate.jsx b/frontend/src/views/Transfers/components/AgreementDate.jsx index c05887356..10effa986 100644 --- a/frontend/src/views/Transfers/components/AgreementDate.jsx +++ b/frontend/src/views/Transfers/components/AgreementDate.jsx @@ -1,4 +1,5 @@ -import { Box, TextField, Typography } from '@mui/material' +import { Box, TextField } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { useFormContext } from 'react-hook-form' import { LabelBox } from './LabelBox' import { useTranslation } from 'react-i18next' @@ -25,7 +26,9 @@ export const AgreementDate = () => { justifyContent="flex-start" gap="10px" > - {t('transfer:agrDateHeader')} + + {t('transfer:agrDateHeader')} + { return ( - + Attachments - + {attachments.map((attachment) => ( { key={attachment.attachmentID} alignItems="flex-start" > - + ({ diff --git a/frontend/src/views/Transfers/components/CommentList.jsx b/frontend/src/views/Transfers/components/CommentList.jsx index 8d7e135e3..33b88cf1a 100644 --- a/frontend/src/views/Transfers/components/CommentList.jsx +++ b/frontend/src/views/Transfers/components/CommentList.jsx @@ -1,7 +1,6 @@ import BCBox from '@/components/BCBox' import PropTypes from 'prop-types' import { - Typography, List, ListItem, ListItemAvatar, @@ -9,12 +8,13 @@ import { Avatar, Divider } from '@mui/material' +import BCTypography from '@/components/BCTypography' export const CommentList = ({ comments = [] }) => ( - + Comments - + ( - ( > {comment.name} {':'} - + } secondary={ <> - {comment.comment} - + } /> diff --git a/frontend/src/views/Transfers/components/LabelBox.jsx b/frontend/src/views/Transfers/components/LabelBox.jsx index a5e837539..5fa29ae1d 100644 --- a/frontend/src/views/Transfers/components/LabelBox.jsx +++ b/frontend/src/views/Transfers/components/LabelBox.jsx @@ -28,9 +28,9 @@ export const LabelBox = ({ > {description && ( - + {description} - + )} {children} diff --git a/frontend/src/views/Transfers/components/OrganizationBadge.jsx b/frontend/src/views/Transfers/components/OrganizationBadge.jsx index 132debc01..6ddeaee2a 100644 --- a/frontend/src/views/Transfers/components/OrganizationBadge.jsx +++ b/frontend/src/views/Transfers/components/OrganizationBadge.jsx @@ -1,6 +1,7 @@ import { PropTypes } from 'prop-types' import BCBadge from '@/components/BCBadge' -import { Stack, Typography } from '@mui/material' +import { Stack } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { Role } from '@/components/Role' import { roles } from '@/constants/roles' import { useOrganizationBalance } from '@/hooks/useOrganization' @@ -23,16 +24,16 @@ export const OrganizationBadge = ({ badgeContent={ <> - {organizationName} + {organizationName} {['Submitted', 'Recommended'].includes(transferStatus) && ( - + Balance: {orgInfo?.totalBalance.toLocaleString()} ( {Math.abs(orgInfo?.reservedBalance).toLocaleString()}) - - + + Registered: {orgInfo?.registered ? 'Yes' : 'No'} - + )} diff --git a/frontend/src/views/Transfers/components/Recommendation.jsx b/frontend/src/views/Transfers/components/Recommendation.jsx index 100568e89..aedaaf7da 100644 --- a/frontend/src/views/Transfers/components/Recommendation.jsx +++ b/frontend/src/views/Transfers/components/Recommendation.jsx @@ -1,7 +1,8 @@ import BCBox from '@/components/BCBox' import { TRANSFER_STATUSES } from '@/constants/statuses' import { useTransfer } from '@/hooks/useTransfer' -import { FormControlLabel, Radio, RadioGroup, Typography } from '@mui/material' +import { FormControlLabel, Radio, RadioGroup } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { Controller, useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { useParams } from 'react-router-dom' @@ -18,9 +19,9 @@ export const Recommendation = ({ currentStatus }) => { return ( - + {t('transfer:analystRecommend')} - + {transferData.currentStatus.status === TRANSFER_STATUSES.SUBMITTED ? ( { )} /> ) : ( - + The analyst has recommended that you to{' '} {transferData.recommendation} this transfer. - + )} ) diff --git a/frontend/src/views/Transfers/components/SigningAuthority.jsx b/frontend/src/views/Transfers/components/SigningAuthority.jsx index 910a6cdd0..2d734a2b5 100644 --- a/frontend/src/views/Transfers/components/SigningAuthority.jsx +++ b/frontend/src/views/Transfers/components/SigningAuthority.jsx @@ -1,4 +1,4 @@ -import { Box, FormControlLabel, Checkbox, Typography } from '@mui/material' +import { Box, FormControlLabel, Checkbox } from '@mui/material' import BCTypography from '@/components/BCTypography' import withRole from '@/utils/withRole' import { useFormContext } from 'react-hook-form' @@ -34,15 +34,15 @@ export const SigningAuthority = () => { /> } label={ - + {t('transfer:saConfirmation')} - + } /> {errors.signingAuthorityDeclaration && ( - + {errors.signingAuthorityDeclaration.message} - + )}
diff --git a/frontend/src/views/Transfers/components/TransferDetailsCard.jsx b/frontend/src/views/Transfers/components/TransferDetailsCard.jsx index 4e45cfb45..b215cef39 100644 --- a/frontend/src/views/Transfers/components/TransferDetailsCard.jsx +++ b/frontend/src/views/Transfers/components/TransferDetailsCard.jsx @@ -1,7 +1,8 @@ import PropTypes from 'prop-types' import SyncAltIcon from '@mui/icons-material/SyncAlt' import SwapVertIcon from '@mui/icons-material/SwapVert' -import { Stack, Typography, useMediaQuery, useTheme } from '@mui/material' +import { Stack, useMediaQuery, useTheme } from '@mui/material' +import BCTypography from '@/components/BCTypography' import BCBox from '@/components/BCBox' import { OrganizationBadge } from '@/views/Transfers/components' import { useTranslation } from 'react-i18next' @@ -42,11 +43,11 @@ export const TransferDetailsCard = ({ transferStatus={transferStatus} /> - + {isMobileSize ? `$${decimalFormatter(totalValue)}` : `${quantity} ${t('transfer:complianceUnits')}`} - + )} - + {!isMobileSize ? `$${decimalFormatter(totalValue)}` : `${quantity} ${t('transfer:complianceUnits')}`} - + { )?.name || '' const pricePerUnit = parseFloat(watch('pricePerUnit')) - const totalValue = - quantity && pricePerUnit ? quantity * pricePerUnit : 0 + const totalValue = quantity && pricePerUnit ? quantity * pricePerUnit : 0 const isNumberOfCreditsValid = (number) => !isNaN(number) && number > 0 const isTotalValueValid = (value) => typeof value === 'number' && value > 0 @@ -99,7 +99,7 @@ export const TransferGraphic = () => { overflow: 'hidden' }} > - {creditsFrom} + {creditsFrom} { }} > {isNumberOfCreditsValid(quantity) && ( - + {`${formattedNumberOfCredits} compliance units`} - + )} {renderIcon()} {isTotalValueValid(totalValue) && ( - + {formatCurrency(totalValue)} - + )} @@ -145,7 +145,7 @@ export const TransferGraphic = () => { justifyContent: 'center' }} > - {creditsTo || ''} + {creditsTo || ''}
) diff --git a/frontend/src/views/Transfers/components/TransferHistory.jsx b/frontend/src/views/Transfers/components/TransferHistory.jsx index f6be941ef..b4f50bf17 100644 --- a/frontend/src/views/Transfers/components/TransferHistory.jsx +++ b/frontend/src/views/Transfers/components/TransferHistory.jsx @@ -4,7 +4,7 @@ import { TRANSFER_RECOMMENDATION } from '@/constants/statuses' import { useTransfer } from '@/hooks/useTransfer' -import { Typography } from '@mui/material' +import BCTypography from '@/components/BCTypography' import dayjs from 'dayjs' import localizedFormat from 'dayjs/plugin/localizedFormat' import duration from 'dayjs/plugin/duration' @@ -65,9 +65,9 @@ function TransferHistory({ transferHistory }) { return ( - + {t('transfer:txnHistory')} - +
    {[ @@ -78,7 +78,7 @@ function TransferHistory({ transferHistory }) { ].includes(currentStatus) && agreementDate && (
  • - + Date of written agreement reached between the two organizations: {agreementDate.format('LL')} (proposal falls @@ -101,12 +101,12 @@ function TransferHistory({ transferHistory }) { )} ) - +
  • )} {transferHistory?.map((item, index) => (
  • - + {getTransferStatusLabel(item.transferStatus?.status)}{' '} on {dayjs(item.createDate).format('LL')} @@ -122,7 +122,7 @@ function TransferHistory({ transferHistory }) { ? item.userProfile.organization.name : t('govOrg')}{' '} - +
  • ))}
diff --git a/frontend/src/views/Users/AddEditUser/AddEditUser.jsx b/frontend/src/views/Users/AddEditUser/AddEditUser.jsx index 18b129042..bcb3db66b 100644 --- a/frontend/src/views/Users/AddEditUser/AddEditUser.jsx +++ b/frontend/src/views/Users/AddEditUser/AddEditUser.jsx @@ -21,7 +21,8 @@ import colors from '@/themes/base/colors' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faFloppyDisk, faArrowLeft } from '@fortawesome/free-solid-svg-icons' import BCButton from '@/components/BCButton' -import { Box, Stack, Typography } from '@mui/material' +import { Box, Stack } from '@mui/material' +import BCTypography from '@/components/BCTypography' import Grid2 from '@mui/material/Unstable_Grid2' import BCAlert from '@/components/BCAlert' import Loading from '@/components/Loading' @@ -232,10 +233,10 @@ export const AddEditUser = ({ userType }) => { {t('common:submitError')} )} - + {userID ? 'Edit' : 'Add'} user  {userType === 'bceid' && `to ${orgName}`} - +
@@ -310,9 +311,9 @@ export const AddEditUser = ({ userType }) => { ) } > - + {t('backBtn')} - + { /> } > - {t('saveBtn')} + {t('saveBtn')} diff --git a/frontend/src/views/Users/AddEditUser/components/BCeIDSpecificRoleFields.jsx b/frontend/src/views/Users/AddEditUser/components/BCeIDSpecificRoleFields.jsx index d0a30b0ff..95bb47b3a 100644 --- a/frontend/src/views/Users/AddEditUser/components/BCeIDSpecificRoleFields.jsx +++ b/frontend/src/views/Users/AddEditUser/components/BCeIDSpecificRoleFields.jsx @@ -1,4 +1,5 @@ -import { Box, Typography } from '@mui/material' +import { Box } from '@mui/material' +import BCTypography from '@/components/BCTypography' import { BCFormCheckbox, BCFormRadio } from '@/components/BCForm' import { nonGovRoles } from '@/constants/roles' import { bceidRoleOptions } from '../_schema' @@ -7,9 +8,9 @@ export const BCeIDSpecificRoleFields = ({ form, disabled, t }) => { const { control } = form return ( - + {t('admin:Roles')} - + { const { control } = form return ( - + {t('admin:Roles')} - + Date: Wed, 11 Dec 2024 13:24:13 -0800 Subject: [PATCH 3/9] refactor: reformat organizations and user management to material card design --- frontend/src/assets/locales/en/admin.json | 2 + .../src/assets/locales/en/organization.json | 4 +- .../components/BCWidgetCard/BCWidgetCard.jsx | 39 ++- .../Admin/AdminMenu/components/ViewUser.jsx | 263 +++++++++++------- .../views/Admin/__tests__/ViewUser.test.jsx | 4 +- .../ViewOrganization/ViewOrganization.jsx | 242 ++++++++-------- .../__tests__/TransferView.test.jsx | 3 +- 7 files changed, 325 insertions(+), 232 deletions(-) diff --git a/frontend/src/assets/locales/en/admin.json b/frontend/src/assets/locales/en/admin.json index 6a197da0f..f839b3570 100644 --- a/frontend/src/assets/locales/en/admin.json +++ b/frontend/src/assets/locales/en/admin.json @@ -22,6 +22,8 @@ "usersNotFound": "No users found", "activitiesNotFound": "No user activities found", "newUserBtn": "New user", + "userDetails": "User details", + "editBtn": "Edit", "userColLabels": { "userName": "User name", "role": "Role(s)", diff --git a/frontend/src/assets/locales/en/organization.json b/frontend/src/assets/locales/en/organization.json index b6f21ca34..1d3e9227c 100644 --- a/frontend/src/assets/locales/en/organization.json +++ b/frontend/src/assets/locales/en/organization.json @@ -45,5 +45,7 @@ "editOrgTitle": "Edit organization", "toUpdateMsg": " to update address information.", "selectOrgLabel": "Select an Organization", - "complianceUnitBalance": "Compliance Unit Balance" + "complianceUnitBalance": "Compliance Unit Balance", + "editBtn": "Edit", + "orgDetails": "Organization details" } diff --git a/frontend/src/components/BCWidgetCard/BCWidgetCard.jsx b/frontend/src/components/BCWidgetCard/BCWidgetCard.jsx index f93804226..319e3191c 100644 --- a/frontend/src/components/BCWidgetCard/BCWidgetCard.jsx +++ b/frontend/src/components/BCWidgetCard/BCWidgetCard.jsx @@ -1,17 +1,28 @@ import PropTypes from 'prop-types' - -// @mui material components import { Card, CardContent, Divider } from '@mui/material' import BCBox from '@/components/BCBox' import BCTypography from '@/components/BCTypography' +import { useNavigate } from 'react-router-dom' +import EditIcon from '@mui/icons-material/Edit' +import BCButton from '@/components/BCButton' function BCWidgetCard({ color = 'nav', title = 'Title', content, style, - disableHover = false + disableHover = false, + editButtonText = null, + editButtonRoute = null }) { + const navigate = useNavigate() + + const handleButtonClick = () => { + if (editButtonRoute) { + navigate(editButtonRoute) + } + } + return ( {title} + {editButtonRoute && ( + } + sx={{ + '&:hover': { + backgroundColor: 'rgba(255, 255, 255, 0.1)' + } + }} + > + {editButtonText} + + )} { const { t } = useTranslation(['common', 'admin']) const gridRef = useRef() const alertRef = useRef() + const gridOptions = { overlayNoRowsTemplate: t('admin:activitiesNotFound'), suppressHeaderMenuButton: false, @@ -30,134 +34,187 @@ export const ViewUser = () => { const { userID, orgID } = useParams() const { data: currentUser, hasRoles } = useCurrentUser() const navigate = useNavigate() - const { data, isLoading, isLoadingError, isError, error } = hasRoles(roles.supplier) + const [editButtonRoute, setEditButtonRoute] = useState(null) + + const { data, isLoading, isLoadingError, isError, error } = hasRoles( + roles.supplier + ) ? // eslint-disable-next-line react-hooks/rules-of-hooks - useOrganizationUser( - orgID || currentUser?.organization.organizationId, - userID - ) + useOrganizationUser( + orgID || currentUser?.organization.organizationId, + userID + ) : // eslint-disable-next-line react-hooks/rules-of-hooks - useUser(parseInt(userID)) + useUser(parseInt(userID)) + + const canEdit = hasRoles(roles.administrator) || hasRoles(roles.manage_users) - const handleEditClick = () => { + useEffect(() => { + let route = null if (hasRoles(roles.supplier)) { - navigate(ROUTES.ORGANIZATION_EDITUSER.replace(':userID', userID)) - } else if (orgID) - navigate( - ROUTES.ORGANIZATIONS_EDITUSER.replace(':orgID', orgID).replace( - ':userID', - userID - ) + route = ROUTES.ORGANIZATION_EDITUSER.replace(':userID', userID) + } else if (orgID) { + route = ROUTES.ORGANIZATIONS_EDITUSER.replace(':orgID', orgID).replace( + ':userID', + userID ) - else navigate(ROUTES.ADMIN_USERS_EDIT.replace(':userID', userID)) - } + } else { + route = ROUTES.ADMIN_USERS_EDIT.replace(':userID', userID) + } + setEditButtonRoute(route) + }, [hasRoles, orgID, userID]) const apiEndpoint = apiRoutes.getUserActivities.replace(':userID', userID) const gridKey = `user-activity-grid-${userID}` const getRowId = useCallback((params) => { - return `${params.data.transactionType.toLowerCase()}-${params.data.transactionId}`; - }, []); - - const handleRowClicked = useCallback((params) => { - const { transactionType, transactionId } = params.data; - - let route; - switch (transactionType) { - case 'Transfer': - route = ROUTES.TRANSFERS_VIEW.replace(':transferId', transactionId); - break; - case 'AdminAdjustment': - route = ROUTES.ADMIN_ADJUSTMENT_VIEW.replace(':transactionId', transactionId); - break; - case 'InitiativeAgreement': - route = ROUTES.INITIATIVE_AGREEMENT_VIEW.replace(':transactionId', transactionId); - } + return `${params.data.transactionType.toLowerCase()}-${ + params.data.transactionId + }` + }, []) + + const handleRowClicked = useCallback( + (params) => { + const { transactionType, transactionId } = params.data + let route + switch (transactionType) { + case 'Transfer': + route = ROUTES.TRANSFERS_VIEW.replace(':transferId', transactionId) + break + case 'AdminAdjustment': + route = ROUTES.ADMIN_ADJUSTMENT_VIEW.replace( + ':transactionId', + transactionId + ) + break + case 'InitiativeAgreement': + route = ROUTES.INITIATIVE_AGREEMENT_VIEW.replace( + ':transactionId', + transactionId + ) + break + default: + route = null + } - navigate(route); - }, [navigate]); + if (route) { + navigate(route) + } + }, + [navigate] + ) useEffect(() => { if (isError) { - alertRef.current?.triggerAlert({ message: error.response?.data?.detail || error.message, severity: 'error' }) + alertRef.current?.triggerAlert({ + message: error.response?.data?.detail || error.message, + severity: 'error' + }) } }, [isError, error]) if (isError) { - return <> - - + return ( + <> + + + ) } if (isLoading) return return ( -
+ <> {isLoadingError ? ( ) : ( <> - - {data.firstName + ' ' + data.lastName}  - - - - - - - - - {t('Organization')}:  - {data.organization?.name || t('govOrg')} - - - {t('admin:Email')}: {data.keycloakEmail} - - - {t('admin:WorkPhone')}:  - {phoneNumberFormatter({ value: data.phone })} - - - {t('admin:MobilePhone')}:  - {phoneNumberFormatter({ value: data.mobilePhone })} - - - {t('Status')}:  - {StatusRenderer({ data, isView: true })} - - - {t('admin:Roles')}:  - {RoleSpanRenderer({ data })} - - - {t('admin:Title')}: {data.title} + + + + {/* Left Column */} + + + {t('Name')}: {data.firstName}{' '} + {data.lastName} + + + {t('admin:Title')}: {data.title} + + + {t('Organization')}:{' '} + {data.organization?.name || t('govOrg')} + + + {t('Status')}:{' '} + {StatusRenderer({ data, isView: true })} + + + {t('Roles')}:{' '} + {RoleSpanRenderer({ data })} + + + + {/* Right Column */} + + + {t('admin:Email')}:{' '} + {data.keycloakEmail} + + + {t('admin:WorkPhone')}:{' '} + {phoneNumberFormatter({ value: data.phone })} + + + {t('admin:MobilePhone')}:{' '} + {phoneNumberFormatter({ value: data.mobilePhone })} + + + + + } + /> + + + + + {t('admin:UserActivity')} - - - - {t('admin:UserActivity')} - - - + + )} -
+ ) } + +export default ViewUser diff --git a/frontend/src/views/Admin/__tests__/ViewUser.test.jsx b/frontend/src/views/Admin/__tests__/ViewUser.test.jsx index bcf5984ef..6968208fa 100644 --- a/frontend/src/views/Admin/__tests__/ViewUser.test.jsx +++ b/frontend/src/views/Admin/__tests__/ViewUser.test.jsx @@ -153,8 +153,8 @@ describe('ViewUser Component', () => { wrapper({ children, initialEntries: ['/admin/users/1'] }) } ) - - const editButton = screen.getByLabelText('edit') + + const editButton = screen.getByRole('button', { name: /admin:editBtn/i }) fireEvent.click(editButton) await waitFor(() => { diff --git a/frontend/src/views/Organizations/ViewOrganization/ViewOrganization.jsx b/frontend/src/views/Organizations/ViewOrganization/ViewOrganization.jsx index 2bf32af03..d3c8dcf40 100644 --- a/frontend/src/views/Organizations/ViewOrganization/ViewOrganization.jsx +++ b/frontend/src/views/Organizations/ViewOrganization/ViewOrganization.jsx @@ -1,17 +1,13 @@ -// components import BCBox from '@/components/BCBox' import BCButton from '@/components/BCButton' import BCTypography from '@/components/BCTypography' import BCAlert from '@/components/BCAlert' import BCDataGridServer from '@/components/BCDataGrid/BCDataGridServer' import Loading from '@/components/Loading' -import { IconButton, Typography } from '@mui/material' -// icons +import BCWidgetCard from '@/components/BCWidgetCard/BCWidgetCard' import colors from '@/themes/base/colors.js' import { faCirclePlus } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import EditIcon from '@mui/icons-material/Edit' -// hooks import { useCallback, useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { ROUTES, apiRoutes } from '@/constants/routes' @@ -42,7 +38,9 @@ export const ViewOrganization = () => { isLoading: isCurrentUserLoading, hasRoles } = useCurrentUser() - const { data: orgData, isLoading } = useOrganization(orgID ?? currentUser?.organization?.organizationId) + const { data: orgData, isLoading } = useOrganization( + orgID ?? currentUser?.organization?.organizationId + ) let orgBalance = {} if (hasRoles(roles.government)) { @@ -51,20 +49,13 @@ export const ViewOrganization = () => { } const { data: orgBalaceInfo } = orgBalance - const handleEditClick = () => { - navigate( - ROUTES.ORGANIZATIONS_EDIT.replace( + const canEdit = hasRoles(roles.administrator) + const editButtonRoute = canEdit + ? ROUTES.ORGANIZATIONS_EDIT.replace( ':orgID', orgID || currentUser?.organization?.organizationId - ), - { - state: { - orgID: orgID || currentUser?.organization?.organizationId, - isEditMode: true - } - } - ) - } + ) + : null const [gridKey, setGridKey] = useState(`users-grid-${orgID}-active`) const handleGridKey = useCallback(() => { @@ -73,29 +64,34 @@ export const ViewOrganization = () => { } else { setGridKey(`users-grid-${orgID}-inactive`) } - }, []) + }, [showActive, orgID]) const gridOptions = { overlayNoRowsTemplate: 'No users found', includeHiddenColumnsInQuickFilter: true } - const handleRowClicked = useCallback((params) => - // Based on the user Type (BCeID or IDIR) navigate to specific view - hasRoles(roles.supplier) - ? navigate( - ROUTES.ORGANIZATION_VIEWUSER.replace( - ':userID', - params.data.userProfileId - ) - ) - : navigate( - ROUTES.ORGANIZATIONS_VIEWUSER.replace(':orgID', orgID).replace( - ':userID', - params.data.userProfileId + + const handleRowClicked = useCallback( + (params) => + // Based on the user Type (BCeID or IDIR) navigate to specific view + hasRoles(roles.supplier) + ? navigate( + ROUTES.ORGANIZATION_VIEWUSER.replace( + ':userID', + params.data.userProfileId + ) ) - ) + : navigate( + ROUTES.ORGANIZATIONS_VIEWUSER.replace(':orgID', orgID).replace( + ':userID', + params.data.userProfileId + ) + ), + [hasRoles, navigate, orgID] ) - const getRowId = useCallback((params) => params.data.userProfileId) + + const getRowId = useCallback((params) => params.data.userProfileId, []) + const gridRef = useRef() useEffect(() => { @@ -111,7 +107,7 @@ export const ViewOrganization = () => { } gridRef?.current?.api?.onFilterChanged() } - }, [showActive]) + }, [showActive, gridKey]) useEffect(() => { if (location.state?.message) { @@ -131,95 +127,99 @@ export const ViewOrganization = () => { {alertMessage} )} - - {orgData?.name}{' '} - - - - - - - - - - - {t('org:legalNameLabel')}: - - {orgData?.name} - - {t('org:operatingNameLabel')}: - - - {orgData?.operatingName || orgData?.name} - - - {t('org:phoneNbrLabel')}: - - - {phoneNumberFormatter({ value: orgData?.phone })} - - - {t('org:emailAddrLabel')}: - - {orgData?.email} - - - {t('org:complianceUnitBalance')}: - - - {orgBalaceInfo?.totalBalance.toLocaleString()} ( - {Math.abs(orgBalaceInfo?.reservedBalance).toLocaleString()}) - - - - - - {t('org:serviceAddrLabel')}: - - - {orgData && constructAddress(orgData?.orgAddress)} - - {t('org:bcAddrLabel')}: - - {orgData && constructAddress(orgData?.orgAttorneyAddress)} - - {t('org:regTrnLabel')}: - - {orgData?.orgStatus.status === ORGANIZATION_STATUSES.REGISTERED - ? 'Yes — A registered organization is able to transfer compliance units.' - : 'No — An organization must be registered to transfer compliance units.'} - - - - {!isCurrentUserLoading && !hasRoles(roles.government) && ( - - - Email {t('lcfsEmail')} - {t('org:toUpdateMsg')} - - - )} + + + + {/* Left Column */} + + + {t('org:legalNameLabel')}: {orgData?.name} + + + + {t('org:operatingNameLabel')}:{' '} + {orgData?.operatingName || orgData?.name} + + + + {t('org:phoneNbrLabel')}:{' '} + {phoneNumberFormatter({ value: orgData?.phone })} + + + + {t('org:emailAddrLabel')}: {orgData?.email} + + + + + {t('org:complianceUnitBalance')}:{' '} + {orgBalaceInfo?.totalBalance.toLocaleString()} ( + {Math.abs( + orgBalaceInfo?.reservedBalance + ).toLocaleString()} + ) + + + + + {/* Right Column */} + + + {t('org:serviceAddrLabel')}:{' '} + {orgData && constructAddress(orgData?.orgAddress)} + + + + {t('org:bcAddrLabel')}:{' '} + {orgData && constructAddress(orgData?.orgAttorneyAddress)} + + + + {t('org:regTrnLabel')}:{' '} + {orgData?.orgStatus.status === + ORGANIZATION_STATUSES.REGISTERED + ? 'Yes — A registered organization is able to transfer compliance units.' + : 'No — An organization must be registered to transfer compliance units.'} + + + + + {!isCurrentUserLoading && !hasRoles(roles.government) && ( + + + Email{' '} + {t('lcfsEmail')}{' '} + {t('org:toUpdateMsg')} + + + )} + + } + /> { ) } + +export default ViewOrganization diff --git a/frontend/src/views/Transfers/components/__tests__/TransferView.test.jsx b/frontend/src/views/Transfers/components/__tests__/TransferView.test.jsx index b8bee5bd0..d3a4d14ab 100644 --- a/frontend/src/views/Transfers/components/__tests__/TransferView.test.jsx +++ b/frontend/src/views/Transfers/components/__tests__/TransferView.test.jsx @@ -62,7 +62,8 @@ describe('TransferView Component', () => { sameOrganization: vi.fn(() => true), data: { isGovernmentUser: false - } + }, + hasAnyRole: vi.fn(() => false) }) }) From 3e90bbc50a74b7612fbe97313d9f63d4c06d736f Mon Sep 17 00:00:00 2001 From: Alex Zorkin Date: Wed, 11 Dec 2024 13:25:13 -0800 Subject: [PATCH 4/9] chore: add test environment users --- .../seeders/test/test_user_profile_seeder.py | 203 +++++++++++++----- 1 file changed, 145 insertions(+), 58 deletions(-) diff --git a/backend/lcfs/db/seeders/test/test_user_profile_seeder.py b/backend/lcfs/db/seeders/test/test_user_profile_seeder.py index 23a29b521..d367948fd 100644 --- a/backend/lcfs/db/seeders/test/test_user_profile_seeder.py +++ b/backend/lcfs/db/seeders/test/test_user_profile_seeder.py @@ -16,85 +16,172 @@ async def seed_test_user_profiles(session): # Define the user profiles to seed user_profiles_to_seed = [ { - "keycloak_email": "john.doe1@example.tld", - "keycloak_username": "john_doe_01", - "email": "john.doe1@example.tld", - "title": "Developer", - "phone": "+1-555-123-4567", - "mobile_phone": "+1-555-234-5678", - "first_name": "John", - "last_name": "Doe", + "keycloak_email": "stuart.galloway@gov.bc.ca", + "keycloak_username": "SGALLOWA", + "email": "stuart.galloway@gov.bc.ca", + "title": "Sr. UX Practitioner", + "phone": "1234567890", + "mobile_phone": "1234567890", + "first_name": "Stuart", + "last_name": "Galloway", + "organization_id": None, + "is_active": True, + }, + { + "keycloak_email": "daniel.haselhan@gov.bc.ca", + "keycloak_username": "DHASELHA", + "email": "daniel.haselhan@gov.bc.ca", + "title": "Dev", + "phone": "1234567890", + "mobile_phone": "1234567890", + "first_name": "Daniel", + "last_name": "Haselhan", + "organization_id": None, + "is_active": True, + }, + { + "keycloak_email": "Haris.Ishaq@gov.bc.ca", + "keycloak_username": "HISHAQ", + "email": "Haris.Ishaq@gov.bc.ca", + "title": "Chief Engineer", + "phone": None, + "mobile_phone": None, + "first_name": "Haris", + "last_name": "Ishaq", + "organization_id": None, + "is_active": True, + }, + { + "keycloak_email": "shannon.payne@gov.bc.ca", + "keycloak_username": "shpayne", + "email": "shannon.payne@gov.bc.ca", + "title": "Chief Engineer", + "phone": None, + "mobile_phone": None, + "first_name": "Shannon", + "last_name": "Payne", + "organization_id": None, + "is_active": True, + }, + { + "keycloak_email": "tfrs@gov.bc.ca", + "keycloak_username": "LCFS1_bat", + "email": "tfrs@gov.bc.ca", + "title": "CEO", + "phone": None, + "mobile_phone": None, + "first_name": "Donald", + "last_name": "Freeman", "organization_id": 1, + "is_active": True, }, { - "keycloak_email": "jane.smith2@example.tld", - "keycloak_username": "jane_smith_02", - "email": "jane.smith2@example.tld", + "keycloak_email": "alex.zorkin@gov.bc.ca", + "keycloak_username": "ALZORKIN", + "email": "alex.zorkin@gov.bc.ca", "title": "Developer", - "phone": "+1-555-345-6789", - "mobile_phone": "+1-555-456-7890", - "first_name": "Jane", - "last_name": "Smith", - "organization_id": 2, + "phone": "1234567890", + "mobile_phone": "1234567890", + "organization_id": None, + "is_active": True, + "first_name": "Alex", + "last_name": "Zorkin", }, { - "keycloak_email": "alice.jones3@example.tld", - "keycloak_username": "alice_jones_03", - "email": "alice.jones3@example.tld", + "keycloak_email": "hamed.valiollahibayeki@gov.bc.ca", + "keycloak_username": "HVALIOLL", + "email": "hamed.valiollahibayeki@gov.bc.ca", "title": "Developer", - "phone": "+1-555-567-8901", - "mobile_phone": "+1-555-678-9012", - "first_name": "Alice", - "last_name": "Jones", - "organization_id": 3, + "phone": "1234567890", + "mobile_phone": "1234567890", + "organization_id": None, + "is_active": True, + "first_name": "Hamed", + "last_name": "Bayeki", }, { - "keycloak_email": "idir@test.tld", - "keycloak_username": "IDIRUSER", - "email": "user@test.tld", + "keycloak_email": "kevin.hashimoto@gov.bc.ca", + "keycloak_username": "KHASHIMO", + "email": "kevin.hashimoto@gov.bc.ca", "title": "Developer", - "phone": "+1-555-789-0123", - "mobile_phone": "+1-555-890-1234", - "first_name": "Bob", - "last_name": "Johnson", + "phone": "1234567890", + "mobile_phone": "1234567890", "organization_id": None, "is_active": True, + "first_name": "Kevin", + "last_name": "Hashimoto", }, { - "keycloak_email": "bceid@test.tld", - "keycloak_username": "BCEIDUSER", - "email": "user@test.tld", + "keycloak_email": "prashanth.venkateshappa@gov.bc.ca", + "keycloak_username": "PVENKATE", + "email": "prashanth.venkateshappa@gov.bc.ca", "title": "Developer", - "phone": "+1-555-901-2345", - "mobile_phone": "+1-555-012-3456", - "first_name": "Charlie", - "last_name": "Brown", - "organization_id": 2, + "phone": "1234567890", + "mobile_phone": "1234567890", + "organization_id": None, "is_active": True, + "first_name": "Prashanth", + "last_name": "V", }, { - "keycloak_email": "active@test.tld", - "keycloak_username": "ACTIVEUSER", - "email": "user@test.tld", - "title": "Developer", - "phone": "+1-555-234-5678", - "mobile_phone": "+1-555-345-6789", - "first_name": "Diana", - "last_name": "Evans", - "organization_id": 3, + "keycloak_email": "justin.lepitzki@gov.bc.ca", + "keycloak_username": "JLEPITZ", + "email": "justin.lepitzki@gov.bc.ca", + "title": "Admin", + "phone": "1234567890", + "mobile_phone": "1234567890", + "organization_id": None, "is_active": True, + "first_name": "Justin", + "last_name": "Lepitzki", }, { - "keycloak_email": "inactive@test.tld", - "keycloak_username": "INACTIVEUSER", - "email": "user@test.tld", + "keycloak_email": "lindsy.grunert@gov.bc.ca", + "keycloak_username": "LGRUNERT", + "email": "lindsy.grunert@gov.bc.ca", + "title": "Admin", + "phone": "1234567890", + "mobile_phone": "1234567890", + "organization_id": None, + "is_active": True, + "first_name": "Lindsy", + "last_name": "Grunert", + }, + { + "keycloak_email": "Arturo.Reyes-Lopez@gov.bc.ca", + "keycloak_username": "ARTREYES", + "email": "Arturo.Reyes-Lopez@gov.bc.ca", "title": "Developer", - "phone": "+1-555-456-7890", - "mobile_phone": "+1-555-567-8901", - "first_name": "Eve", - "last_name": "Harris", - "organization_id": 3, - "is_active": False, + "phone": "1234567890", + "mobile_phone": "1234567890", + "organization_id": None, + "is_active": True, + "first_name": "Arturo", + "last_name": "Reyes", + }, + { + "keycloak_email": "alasdair.ring@gov.bc.ca", + "keycloak_username": "AIRING", + "email": "alasdair.ring@gov.bc.ca", + "title": "Product Owner", + "phone": "1234567890", + "mobile_phone": "1234567890", + "organization_id": None, + "is_active": True, + "first_name": "Al", + "last_name": "Ring", + }, + { + "keycloak_email": "rebekah.ford@gov.bc.ca", + "keycloak_username": "RRFORD", + "email": "rebekah.ford@gov.bc.ca", + "title": "Scrum Master", + "phone": "1234567890", + "mobile_phone": "1234567890", + "organization_id": None, + "is_active": True, + "first_name": "Rebekah", + "last_name": "Ford", }, ] @@ -112,7 +199,7 @@ async def seed_test_user_profiles(session): except Exception as e: context = { - "function": "seed_test_user_profiles", + "function": "seed_test_user_profiles", } logger.error( "Error occurred while seeding user profiles", From 1c7aa1bcc0c15351f20a5bf94b86ea79de7d5ea3 Mon Sep 17 00:00:00 2001 From: Hamed Valiollahi Bayeki Date: Wed, 11 Dec 2024 13:25:22 -0800 Subject: [PATCH 5/9] refactor: update bceid dashboard links and improve accessibility --- frontend/src/assets/locales/en/dashboard.json | 10 +++-- .../components/cards/bceid/OrgDetailsCard.jsx | 20 ++++++--- .../cards/bceid/OrgTransactionsCard.jsx | 41 ++++++++++++------- .../components/cards/bceid/WebsiteCard.jsx | 31 +++++++++++--- 4 files changed, 73 insertions(+), 29 deletions(-) diff --git a/frontend/src/assets/locales/en/dashboard.json b/frontend/src/assets/locales/en/dashboard.json index 48f5f0505..c88fa945b 100644 --- a/frontend/src/assets/locales/en/dashboard.json +++ b/frontend/src/assets/locales/en/dashboard.json @@ -12,8 +12,9 @@ "title": "Transactions", "orgHas": "{{name}} has:", "transfersInProgress": "Transfer(s) in progress", - "organizationsRegistered": "Organizations registered for transfers", + "organizationsRegistered": "Organizations registered for transfers (see bulletin RLCF-013)", "startNewTransfer": "Start a new transfer", + "linkTooltip": "Link opens in a new browser tab", "loadingMessage": "Loading transactions card..." }, "transactions": { @@ -31,7 +32,9 @@ }, "website": { "title": "Low Carbon Fuel Standard", - "link": "Visit our website at:
gov.bc.ca/lowcarbonfuels" + "linkText": "Visit our website at:", + "linkUrl": "gov.bc.ca/lowcarbonfuels", + "linkTooltip": "Link opens in a new browser tab" }, "orgBalance": { "loading": "Loading balance details...", @@ -52,7 +55,8 @@ "orgDetailsLabel": "Organization Details", "orgDetailsLoadingMsg": "Loading organization details...", "users": "Users", - "createNewUsrLabel": "Create new BCeID account" + "createNewUsrLabel": "Create new BCeID account", + "linkTooltip": "Link opens in a new browser tab" }, "orgComplianceReports": { "title": "Compliance reports", diff --git a/frontend/src/views/Dashboard/components/cards/bceid/OrgDetailsCard.jsx b/frontend/src/views/Dashboard/components/cards/bceid/OrgDetailsCard.jsx index 6304314a8..e78c73607 100644 --- a/frontend/src/views/Dashboard/components/cards/bceid/OrgDetailsCard.jsx +++ b/frontend/src/views/Dashboard/components/cards/bceid/OrgDetailsCard.jsx @@ -15,6 +15,12 @@ const OrgDetailsCard = () => { const { t } = useTranslation(['dashboard']) const { data: orgData, isLoading: orgLoading } = useOrganization() const navigate = useNavigate() + + function openExternalLink(event, url) { + event.preventDefault() + window.open(url, '_blank', 'noopener,noreferrer') + } + return ( { {orgData?.email} - + navigate(ROUTES.ORGANIZATION)} + sx={{ padding: '4px 0' }} > { navigate(ROUTES.ORGANIZATION_ADDUSER)} + onClick={(e) => openExternalLink(e, 'https://www.bceid.ca/')} + sx={{ padding: '4px 0' }} > { textDecoration: 'underline', '&:hover': { color: 'info.main' } }} + title={t('dashboard:orgDetails.linkTooltip')} > {t('dashboard:orgDetails.createNewUsrLabel')} ( variant="h3" sx={{ color: 'success.main', - marginX: 3 + marginX: 3, + visibility: count != null ? 'visible' : 'hidden' }} > - {count} + {count ?? 0} ) const OrgTransactionsCard = () => { const { t } = useTranslation(['dashboard']) const navigate = useNavigate() + const { data: orgData, isLoading: orgLoading } = useOrganization() const { data: counts, isLoading } = useOrgTransactionCounts() @@ -45,23 +46,31 @@ const OrgTransactionsCard = () => { navigate(route, { state: { filters } }) } - function handleExternalNavigate(event, route) { + function openExternalLink(event, url) { event.preventDefault() - window.open(route, '_blank', 'noopener,noreferrer') + window.open(url, '_blank', 'noopener,noreferrer') } - const renderLinkWithCount = (text, count, onClick, icons = []) => { + const renderLinkWithCount = ( + text, + count, + onClick, + icons = [], + title = '' + ) => { return ( <> - {count != null && } + {text} {icons.map((icon, index) => ( @@ -79,7 +88,6 @@ const OrgTransactionsCard = () => { return ( { maxWidth: '100%', padding: 0, '& .MuiListItemButton-root': { - padding: '2px 0' + padding: '1px 0' } }} > @@ -121,10 +129,11 @@ const OrgTransactionsCard = () => { ]) )} + - handleExternalNavigate( + openExternalLink( e, 'https://www2.gov.bc.ca/assets/gov/farming-natural-resources-and-industry/electricity-alternative-energy/transportation/renewable-low-carbon-fuels/rlcf-013.pdf' ) @@ -134,13 +143,15 @@ const OrgTransactionsCard = () => { t('dashboard:orgTransactions.organizationsRegistered'), null, (e) => - handleExternalNavigate( + openExternalLink( e, - 'https://www2.gov.bc.ca/assets/gov/farming-natural-resources-and-industry/electricity-alternative-energy/transportation/renewable-low-carbon-fuels/rlcf-013.pdf' + 'https://www2.gov.bc.ca/gov/content?id=4B2DC59D77F64C8491C5CDFCF8732F10' ), - [faFilePdf, faShareFromSquare] + [faShareFromSquare], + t('dashboard:orgTransactions.linkTooltip') )} + navigate(ROUTES.TRANSFERS_ADD)} diff --git a/frontend/src/views/Dashboard/components/cards/bceid/WebsiteCard.jsx b/frontend/src/views/Dashboard/components/cards/bceid/WebsiteCard.jsx index 11085b3dc..cd7273434 100644 --- a/frontend/src/views/Dashboard/components/cards/bceid/WebsiteCard.jsx +++ b/frontend/src/views/Dashboard/components/cards/bceid/WebsiteCard.jsx @@ -1,7 +1,8 @@ -import React from 'react' import { useTranslation } from 'react-i18next' import { Box } from '@mui/material' import BCTypography from '@/components/BCTypography' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faShareFromSquare } from '@fortawesome/free-solid-svg-icons' const WebsiteCard = () => { const { t } = useTranslation(['dashboard']) @@ -29,10 +30,30 @@ const WebsiteCard = () => { {t('dashboard:website.title')} + style={{ + fontSize: '16px', + color: '#003366', + textAlign: 'center' + }} + > + {t('dashboard:website.linkText')} +
+ + {t('dashboard:website.linkUrl')} + + +
) } From a299583193a048569464e431028b2f39f4919e5d Mon Sep 17 00:00:00 2001 From: Hamed Valiollahi Bayeki Date: Wed, 11 Dec 2024 13:27:16 -0800 Subject: [PATCH 6/9] refactor: replace typography with bctypography across components for consistency --- .../Organizations/ViewOrganization/ViewOrganization.jsx | 6 +++--- frontend/src/views/Transfers/components/TransferView.jsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/Organizations/ViewOrganization/ViewOrganization.jsx b/frontend/src/views/Organizations/ViewOrganization/ViewOrganization.jsx index 2bf32af03..5fbac39bc 100644 --- a/frontend/src/views/Organizations/ViewOrganization/ViewOrganization.jsx +++ b/frontend/src/views/Organizations/ViewOrganization/ViewOrganization.jsx @@ -5,7 +5,7 @@ import BCTypography from '@/components/BCTypography' import BCAlert from '@/components/BCAlert' import BCDataGridServer from '@/components/BCDataGrid/BCDataGridServer' import Loading from '@/components/Loading' -import { IconButton, Typography } from '@mui/material' +import { IconButton } from '@mui/material' // icons import colors from '@/themes/base/colors.js' import { faCirclePlus } from '@fortawesome/free-solid-svg-icons' @@ -175,10 +175,10 @@ export const ViewOrganization = () => { {t('org:complianceUnitBalance')}: - + {orgBalaceInfo?.totalBalance.toLocaleString()} ( {Math.abs(orgBalaceInfo?.reservedBalance).toLocaleString()}) - + { backgroundColor: 'transparent.main' }} > - + {fromOrganization} {t('transfer:transfers')} {quantity} @@ -64,7 +64,7 @@ export const TransferView = ({ transferId, editorMode, transferData }) => { ${decimalFormatter({ value: pricePerUnit })} {t('transfer:complianceUnitsPerTvo')} ${decimalFormatter(totalValue)} CAD. - + {/* Comments */} {transferData?.comments.length > 0 && ( From d668ffdf76eb1f2fcc70c0ed53542a770e61f4d3 Mon Sep 17 00:00:00 2001 From: Alex Zorkin Date: Wed, 11 Dec 2024 13:39:34 -0800 Subject: [PATCH 7/9] chore: testing parallel testing workflow file --- .github/workflows/docker-auto-test.yaml | 167 ++++++------------------ 1 file changed, 43 insertions(+), 124 deletions(-) diff --git a/.github/workflows/docker-auto-test.yaml b/.github/workflows/docker-auto-test.yaml index cafe32b48..a60142e70 100644 --- a/.github/workflows/docker-auto-test.yaml +++ b/.github/workflows/docker-auto-test.yaml @@ -6,9 +6,8 @@ on: - "*" jobs: - build-and-test: + backend-tests: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 with: @@ -37,14 +36,6 @@ jobs: restore-keys: | ${{ runner.os }}-poetry- - - name: Cache npm dependencies - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Cache Docker images uses: actions/cache@v3 with: @@ -53,30 +44,17 @@ jobs: restore-keys: | ${{ runner.os }}-docker- - # Commented out mochawesome installation as it's only needed for Cypress - # - name: Install mochawesome and marge - # run: | - # npm install mochawesome mochawesome-merge mochawesome-report-generator --save-dev - - name: Install Poetry run: pip install poetry==1.6.1 - name: Install backend dependencies run: | - # Ensure that pip, setuptools, and wheel are up to date pip install --upgrade pip setuptools wheel - - # Install Poetry dependencies cd backend poetry config virtualenvs.create false poetry install pip install pytest-github-actions-annotate-failures typing_extensions - - name: Install frontend dependencies - run: | - cd frontend - npm ci - - name: Fix docker-compose.yml run: | sed -i 's/: true/: "true"/g; s/: false/: "false"/g' docker-compose.yml @@ -110,94 +88,6 @@ jobs: name: pytest-results path: backend/pytest-results.xml - - name: Run frontend tests - id: frontend_tests - continue-on-error: true - run: | - cd frontend - npm run test:run -- --reporter=junit --outputFile=vitest-results.xml - env: - CI: true - - - name: Upload Vitest results - if: always() - uses: actions/upload-artifact@v4 - with: - name: vitest-results - path: frontend/vitest-results.xml - - # Commented out Cypress-related steps - # - name: Create cypress.env.json - # run: | - # echo '{ - # "admin_idir_username": "${{ secrets.ADMIN_IDIR_USERNAME }}", - # "admin_idir_password": "${{ secrets.ADMIN_IDIR_PASSWORD }}", - # "org1_bceid_username": "${{ secrets.ORG1_BCEID_USERNAME }}", - # "org1_bceid_password": "${{ secrets.ORG1_BCEID_PASSWORD }}", - # "org1_bceid_id": "${{ secrets.ORG1_BCEID_ID }}", - # "org1_bceid_userId": "${{ secrets.ORG1_BCEID_USERID }}", - # "org2_bceid_username": "${{ secrets.ORG2_BCEID_USERNAME }}", - # "org2_bceid_password": "${{ secrets.ORG2_BCEID_PASSWORD }}", - # "org2_bceid_id": "${{ secrets.ORG2_BCEID_ID }}", - # "org2_bceid_userId": "${{ secrets.ORG2_BCEID_USERID }}" - # }' > frontend/cypress.env.json - - # - name: Run Cypress tests - # id: cypress_tests - # continue-on-error: true - # uses: cypress-io/github-action@v6 - # with: - # command: npm run cypress:run - # wait-on: 'http://localhost:3000' - # working-directory: frontend - # env: - # ADMIN_IDIR_USERNAME: ${{ secrets.ADMIN_IDIR_USERNAME }} - # ADMIN_IDIR_PASSWORD: ${{ secrets.ADMIN_IDIR_PASSWORD }} - # org1_bceid_username: ${{ secrets.ORG1_BCEID_USERNAME }} - # org1_bceid_password: ${{ secrets.ORG1_BCEID_PASSWORD }} - # org1_bceid_id: ${{ secrets.ORG1_BCEID_ID }} - # org1_bceid_userId: ${{ secrets.ORG1_BCEID_USERID }} - # org2_bceid_username: ${{ secrets.ORG2_BCEID_USERNAME }} - # org2_bceid_password: ${{ secrets.ORG2_BCEID_PASSWORD }} - # org2_bceid_id: ${{ secrets.ORG2_BCEID_ID }} - # org2_bceid_userId: ${{ secrets.ORG2_BCEID_USERID }} - - # - name: Combine mochawesome reports - # run: | - # npx mochawesome-merge frontend/cypress/reports/*.json > frontend/cypress/reports/combined-report.json - - # - name: Generate HTML report - # run: | - # npx marge frontend/cypress/reports/combined-report.json --reportDir frontend/cypress/reports --inline - - # - name: Generate test summary - # run: | - # node generate-summary.js - - # - name: Post test summary as a comment - # if: always() - # run: | - # SUMMARY=$(cat frontend/cypress/reports/test-summary.txt) - # gh pr comment ${{ github.event.pull_request.number }} --body "$SUMMARY" - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # - name: Upload Cypress results - # if: always() - # uses: actions/upload-artifact@v4 - # with: - # name: cypress-results - # path: | - # frontend/cypress/reports/ - # frontend/cypress/screenshots/ - - # - name: Post Cypress results as a comment - # if: always() - # run: | - # gh pr comment ${{ github.event.pull_request.number }} --body "Cypress test report is available [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). Download the 'cypress-results' artifact to view the report." - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Stop services if: always() run: docker-compose down @@ -214,6 +104,48 @@ jobs: report_individual_runs: "true" deduplicate_classes_by_file_name: "true" + + frontend-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Cache npm dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install frontend dependencies + run: | + cd frontend + npm ci + + - name: Run frontend tests + id: frontend_tests + continue-on-error: true + run: | + cd frontend + npm run test:run -- --reporter=junit --outputFile=vitest-results.xml + env: + CI: true + + - name: Upload Vitest results + if: always() + uses: actions/upload-artifact@v4 + with: + name: vitest-results + path: frontend/vitest-results.xml + - name: Publish Frontend Test Results uses: EnricoMi/publish-unit-test-result-action@v2 if: always() @@ -225,16 +157,3 @@ jobs: fail_on: "errors" report_individual_runs: "true" deduplicate_classes_by_file_name: "true" - - - name: Check test results - if: always() - run: | - if [ "${{ steps.backend_tests.outcome }}" == "failure" ] || \ - [ "${{ steps.frontend_tests.outcome }}" == "failure" ]; then - # Note: When re-enabling Cypress tests, add this condition: - # || [ "${{ steps.cypress_tests.outcome }}" == "failure" ] - echo "One or more tests failed" - exit 1 - else - echo "All tests passed" - fi From f30fc9bbe170ad8333928a18cae973ba8a802ab0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:07:54 +0000 Subject: [PATCH 8/9] chore(deps): bump nanoid from 3.3.7 to 3.3.8 in /frontend Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8) --- updated-dependencies: - dependency-name: nanoid dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f1e8793f7..129680549 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -16272,15 +16272,16 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, From 907963b4312c9119728aa66074af29eba4352260 Mon Sep 17 00:00:00 2001 From: Arturo Reyes Lopez Date: Thu, 12 Dec 2024 09:31:59 -0700 Subject: [PATCH 9/9] Replace Typography with BCTypography --- frontend/src/views/FinalSupplyEquipments/_schema.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/FinalSupplyEquipments/_schema.jsx b/frontend/src/views/FinalSupplyEquipments/_schema.jsx index 656471a6c..c65ff5764 100644 --- a/frontend/src/views/FinalSupplyEquipments/_schema.jsx +++ b/frontend/src/views/FinalSupplyEquipments/_schema.jsx @@ -50,7 +50,7 @@ export const finalSupplyEquipmentColDefs = ( cellEditor: AutocompleteCellEditor, cellRenderer: (params) => params.value || - (!params.value && Select), + (!params.value && Select), cellEditorParams: { options: optionsData?.organizationNames?.sort() || [], multiple: false,