From 05c4b4e2d7610d47ec653f9d895b174171caff91 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Sat, 7 Dec 2024 07:24:32 -0600 Subject: [PATCH] Filter out null partnership_level, fix up formatting --- .../active-filters/active-filters.scss | 1 - src/app/pages/partners/results/results.scss | 18 ++++++++++++------ src/app/pages/partners/results/results.tsx | 15 +++++++++++++-- test/src/pages/partners/partners.test.tsx | 2 +- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/app/pages/partners/active-filters/active-filters.scss b/src/app/pages/partners/active-filters/active-filters.scss index 38cad52c0..086989998 100644 --- a/src/app/pages/partners/active-filters/active-filters.scss +++ b/src/app/pages/partners/active-filters/active-filters.scss @@ -2,7 +2,6 @@ .active-filters { @extend %content; - padding: 0; @include wider-than($phone-max) { margin-top: 4rem; diff --git a/src/app/pages/partners/results/results.scss b/src/app/pages/partners/results/results.scss index b95868e48..b996a9a27 100644 --- a/src/app/pages/partners/results/results.scss +++ b/src/app/pages/partners/results/results.scss @@ -3,7 +3,7 @@ .partners .results { align-items: start; - padding: 2rem 0 20rem; + padding: 2rem $normal-margin 20rem; row-gap: 2rem; @include width-up-to($phone-max) { @@ -105,16 +105,17 @@ } } + .boxed { + grid-gap: 3rem; + } + .with-sidebar { display: flex; flex-direction: row; gap: 3rem; max-width: 120rem; margin: 0 auto; - - > .boxed { - grid-gap: 3rem; - } + padding-right: $normal-margin; .grid { max-width: unset; @@ -125,8 +126,13 @@ border: thin solid black; height: max-content; + .sidebar-content { + background-color: ui-color(white); + } + h2 { - background-color: white; + background-color: transparent; + padding: 0.5rem 0; text-align: center; } diff --git a/src/app/pages/partners/results/results.tsx b/src/app/pages/partners/results/results.tsx index bb5f2b15e..5b69e0bb5 100644 --- a/src/app/pages/partners/results/results.tsx +++ b/src/app/pages/partners/results/results.tsx @@ -200,7 +200,7 @@ function resultEntry(pd: PartnerData) { cost: pd.affordability_cost, rating: pd.average_rating.rating__avg, ratingCount: pd.rating_count, - partnershipLevel: pd.partnership_level, + partnershipLevel: pd.partnership_level as string, yearsAsPartner: pd.partner_anniversary_date ? differenceInYears( Date.now(), @@ -254,8 +254,19 @@ function ResultGridLoader({ partnerData: PartnerData[]; linkTexts: LinkTexts; }) { + // // *** FOR TESTING because Dev data is missing some things + // let altered = false; + + // if (!altered) { + // partnerData.slice(-5).forEach((d) => {d.partnership_level = 'startup'}); + // partnerData.slice(0, 5).forEach((d, i) => {d.partner_anniversary_date = `10 Jun ${2014 + i}`}); + // altered = true; + // } + // // *** /FOR TESTING const entries = React.useMemo( - () => partnerData.map(resultEntry), + () => partnerData + .filter((d) => d.partnership_level !== null) + .map(resultEntry), [partnerData] ); const filteredEntries = useFilteredEntries(entries); diff --git a/test/src/pages/partners/partners.test.tsx b/test/src/pages/partners/partners.test.tsx index 8e62deb72..3ff8622d1 100644 --- a/test/src/pages/partners/partners.test.tsx +++ b/test/src/pages/partners/partners.test.tsx @@ -83,7 +83,7 @@ describe('partners full page', () => { expect(buttons).toHaveLength(6); await screen.findByText('Carolina Distance Learning'); - expect(screen.getAllByRole('link')).toHaveLength(22); + expect(screen.getAllByRole('link')).toHaveLength(21); await user.click(buttons[1]); const options = screen.getAllByRole('option');