From 1d9e2f07db5920fea98061bf8bff0dd9677273af Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:48:35 -0400 Subject: [PATCH] [Fix] Roll back lint coalescing bugs (#11757) * Fix lint coalescing bugs * type to boolean * type coercion to boolean --- .../src/components/EmploymentEquity/dialogs/DialogFooter.tsx | 2 +- .../src/components/Table/ResponsiveTable/ResponsiveTable.tsx | 2 +- .../src/components/Table/ResponsiveTable/RowSelection.tsx | 2 +- apps/web/src/components/Table/ResponsiveTable/styles.ts | 2 +- .../ProfileSections/DiversityEquityInclusionSection.tsx | 2 +- .../components/SpecialNoteSection/SpecialNoteSection.tsx | 5 ++--- .../Users/UserInformationPage/components/AboutSection.tsx | 2 +- packages/ui/src/components/Accordion/Accordion.tsx | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/apps/web/src/components/EmploymentEquity/dialogs/DialogFooter.tsx b/apps/web/src/components/EmploymentEquity/dialogs/DialogFooter.tsx index 6d0883593cb..7646692e342 100644 --- a/apps/web/src/components/EmploymentEquity/dialogs/DialogFooter.tsx +++ b/apps/web/src/components/EmploymentEquity/dialogs/DialogFooter.tsx @@ -18,7 +18,7 @@ const DialogFooter = ({ saveText, disabled }: DialogFooterProps) => { type="submit" mode="solid" color="secondary" - disabled={disabled ?? isSubmitting} + disabled={disabled || isSubmitting} > {saveText ?? intl.formatMessage(formMessages.saveChanges)} diff --git a/apps/web/src/components/Table/ResponsiveTable/ResponsiveTable.tsx b/apps/web/src/components/Table/ResponsiveTable/ResponsiveTable.tsx index b45e922344a..d3241a08843 100644 --- a/apps/web/src/components/Table/ResponsiveTable/ResponsiveTable.tsx +++ b/apps/web/src/components/Table/ResponsiveTable/ResponsiveTable.tsx @@ -368,7 +368,7 @@ const ResponsiveTable = ({ ))} - {(rowSelect ?? download?.all) && ( + {(!!rowSelect || !!download?.all) && ( - {(download?.csv?.enable ?? download?.doc?.enable) && ( + {(download?.csv?.enable || download?.doc?.enable) && ( { - const shrinkCol = shouldShrink ?? isRowSelect; + const shrinkCol = shouldShrink || isRowSelect; return { td: { ...(!isRowTitle && diff --git a/apps/web/src/components/UserProfile/ProfileSections/DiversityEquityInclusionSection.tsx b/apps/web/src/components/UserProfile/ProfileSections/DiversityEquityInclusionSection.tsx index 53b4fd4b060..844258a54eb 100644 --- a/apps/web/src/components/UserProfile/ProfileSections/DiversityEquityInclusionSection.tsx +++ b/apps/web/src/components/UserProfile/ProfileSections/DiversityEquityInclusionSection.tsx @@ -148,7 +148,7 @@ const DiversityEquityInclusionSection = ({ )} - {(isWoman ?? isVisibleMinority ?? hasDisability) && ( + {(isWoman || isVisibleMinority || hasDisability) && (
    ({ - hasSpecialNote: !!( - initialData.specialNote?.en ?? initialData.specialNote?.fr - ), + hasSpecialNote: + !!initialData.specialNote?.en || !!initialData.specialNote?.fr, specialNoteEn: initialData.specialNote?.en ?? "", specialNoteFr: initialData.specialNote?.fr ?? "", }); diff --git a/apps/web/src/pages/Users/UserInformationPage/components/AboutSection.tsx b/apps/web/src/pages/Users/UserInformationPage/components/AboutSection.tsx index 8b2f9bfaac0..49e85c3e6f9 100644 --- a/apps/web/src/pages/Users/UserInformationPage/components/AboutSection.tsx +++ b/apps/web/src/pages/Users/UserInformationPage/components/AboutSection.tsx @@ -93,7 +93,7 @@ const AboutSection = ({ user }: BasicUserInformationProps) => { )}

    - {(user.currentCity ?? user.currentProvince) && ( + {(!!user.currentCity || !!user.currentProvince) && (

    {intl.formatMessage({ diff --git a/packages/ui/src/components/Accordion/Accordion.tsx b/packages/ui/src/components/Accordion/Accordion.tsx index 3d85fdd8406..a66b52fb8eb 100644 --- a/packages/ui/src/components/Accordion/Accordion.tsx +++ b/packages/ui/src/components/Accordion/Accordion.tsx @@ -232,7 +232,7 @@ const Trigger = forwardRef< - {(Icon ?? context) && ( + {(!!Icon || !!context) && (