Skip to content

Commit

Permalink
Fix: LCFS BUG - Navigating directly to organization detail errors #1586
Browse files Browse the repository at this point in the history
  • Loading branch information
prv-proton committed Jan 8, 2025
1 parent cfc3bc7 commit f876f05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion frontend/src/assets/locales/en/fuelCode.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"company": "Company",
"contactName": "Contact name",
"contactEmail": "Contact email",
"carbonIntensity": "Carbon intensity (gCO²e/MJ)",
"carbonIntensity": "Carbon intensity (gCOe/MJ)",
"edrms": "EDRMS#",
"applicationDate": "Application date",
"approvalDate": "Approval date",
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export const Login = () => {
<BCButton
variant="contained"
color="primary"
aria-label="Login with BCeID"
onClick={() => {
keycloak.login({
idpHint: IDENTITY_PROVIDERS.BCEID_BUSINESS,
Expand Down Expand Up @@ -221,6 +222,7 @@ export const Login = () => {
<BCButton
variant="outlined"
color="white"
aria-label="Login with IDIR"
onClick={() => {
keycloak.login({
idpHint: IDENTITY_PROVIDERS.IDIR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ export const ViewOrganization = () => {
orgID ?? currentUser?.organization?.organizationId
)

let orgBalance = {}
if (hasRoles(roles.government)) {
// eslint-disable-next-line react-hooks/rules-of-hooks
orgBalance = useOrganizationBalance(orgID)
}
const { data: orgBalaceInfo } = orgBalance
const { data: orgBalanceInfo } = useOrganizationBalance(
orgID ?? currentUser?.organization?.organizationId
)

const canEdit = hasRoles(roles.administrator)
const editButtonRoute = canEdit
Expand Down Expand Up @@ -174,9 +171,9 @@ export const ViewOrganization = () => {
<Role roles={[roles.government]}>
<BCTypography variant="body4">
<strong>{t('org:complianceUnitBalance')}:</strong>{' '}
{orgBalaceInfo?.totalBalance.toLocaleString()} (
{orgBalanceInfo?.totalBalance?.toLocaleString()} (
{Math.abs(
orgBalaceInfo?.reservedBalance
orgBalanceInfo?.reservedBalance || 0
).toLocaleString()}
)
</BCTypography>
Expand Down

0 comments on commit f876f05

Please sign in to comment.