From e9652899fbece3a86c4c5b9bb819d4b98096e86e Mon Sep 17 00:00:00 2001 From: Kevin Hashimoto Date: Wed, 11 Dec 2024 10:25:20 -0800 Subject: [PATCH 1/3] 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 1c7aa1bcc0c15351f20a5bf94b86ea79de7d5ea3 Mon Sep 17 00:00:00 2001 From: Hamed Valiollahi Bayeki Date: Wed, 11 Dec 2024 13:25:22 -0800 Subject: [PATCH 2/3] 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 907963b4312c9119728aa66074af29eba4352260 Mon Sep 17 00:00:00 2001 From: Arturo Reyes Lopez Date: Thu, 12 Dec 2024 09:31:59 -0700 Subject: [PATCH 3/3] 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,