Skip to content

Commit

Permalink
Filter out null partnership_level, fix up formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Dec 9, 2024
1 parent 5279a10 commit 77a8d37
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/app/pages/partners/active-filters/active-filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

.active-filters {
@extend %content;
padding: 0;

@include wider-than($phone-max) {
margin-top: 4rem;
Expand Down
18 changes: 12 additions & 6 deletions src/app/pages/partners/results/results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
15 changes: 13 additions & 2 deletions src/app/pages/partners/results/results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/src/pages/partners/partners.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 77a8d37

Please sign in to comment.