Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Our415 44 Fix naming conventions throughout project #268

Merged
merged 30 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4a46b91
fix algolia logo
adriencyberspace Nov 13, 2024
3750431
search experience header color
adriencyberspace Nov 13, 2024
3baf66e
remove ternary
adriencyberspace Nov 13, 2024
fac6ff4
Header rename to BrowseSubheader
adriencyberspace Nov 13, 2024
a7c7947
ServiceDiscoveryResults -> BrowseResultsPage
adriencyberspace Nov 13, 2024
9e8c0b2
search -> searchAndBrowse
adriencyberspace Nov 13, 2024
60c049b
SecondaryNavigationWrapper -> PageHeader, move into /ui/Navigation
adriencyberspace Nov 13, 2024
65ed488
edit imports
adriencyberspace Nov 13, 2024
7c6522e
merge
adriencyberspace Nov 14, 2024
f283959
rm Auth
adriencyberspace Nov 14, 2024
fe15a89
legal -> LegalPage
adriencyberspace Nov 14, 2024
51e497b
Listing -> Detail i.e. in ServiceDetailPage
adriencyberspace Nov 14, 2024
2f77c58
rm debug page, not in use or following naming conventions
adriencyberspace Nov 14, 2024
95829d4
ListingPageWrapper -> DetailPageWrapper
adriencyberspace Nov 15, 2024
f2983ec
searchAndBrowse -> SearchAndBrowse
adriencyberspace Nov 15, 2024
2eba34a
searchAndBrowse -> SearchAndBrowse
adriencyberspace Nov 15, 2024
a2ff34b
searchAndBrowse -> SearchAndBrowse
adriencyberspace Nov 15, 2024
9b193e5
listing -> DetailPage
adriencyberspace Nov 15, 2024
410f62b
ListingInfoSection -> DetailInfoSection
adriencyberspace Nov 15, 2024
d7112a0
searchAndBrowse -> SearchAndBrowse
adriencyberspace Nov 15, 2024
1a4d5b6
make git acknowledge SearchAndBrowse case change
adriencyberspace Nov 15, 2024
8ef7119
Revert "make git acknowledge SearchAndBrowse case change"
adriencyberspace Nov 15, 2024
2cb4ce6
SearchAndBrowse back to searchAndBrowse because the cases were causin…
adriencyberspace Nov 15, 2024
0795ed1
fixing casing errors
adriencyberspace Nov 15, 2024
57f1bd8
searchAndBrowseTemp
adriencyberspace Nov 15, 2024
97a8396
searchAndBrowseTemp -> SearchAndBrowse
adriencyberspace Nov 15, 2024
4e860ae
searchAndBrowse -> SearchAndBrowse
adriencyberspace Nov 15, 2024
3ea488b
Delete app/components/searchAndBrowse/SearchMap/SearchMap.tsx
adriencyberspace Nov 15, 2024
52ed165
Delete app/components/searchAndBrowse/SearchResults/SearchResults.tsx
adriencyberspace Nov 15, 2024
f35ffb9
Delete app/components/searchAndBrowse/Sidebar/Sidebar.tsx
adriencyberspace Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 16 additions & 21 deletions app/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { Route, Routes } from "react-router-dom";
import { HomePage } from "pages/HomePage";
import { AboutPage } from "pages/AboutPage";
import { FaqPage } from "pages/FaqPage/FaqPage";
import { ListingDebugPage } from "pages/debug/ListingDemoPage";
import { OrganizationListingPage } from "pages/OrganizationListingPage";
import { PrivacyPolicyPage } from "pages/legal/PrivacyPolicy";
import { ServiceListingPage } from "pages/ServiceListingPage/ServiceListingPage";
import { TermsOfServicePage } from "pages/legal/TermsOfService";
import { ServiceDiscoveryResults } from "pages/ServiceDiscoveryResults";
import { SecondaryNavigationWrapper } from "components/navigation/SecondaryNavigationWrapper";
import { OrganizationDetailPage } from "pages/OrganizationDetailPage";
import { PrivacyPolicyPage } from "pages/LegalPage/PrivacyPolicy";
import { ServiceDetailPage } from "pages/ServiceDetailPage/ServiceDetailPage";
import { TermsOfServicePage } from "pages/LegalPage/TermsOfService";
import { BrowseResultsPage } from "pages/BrowseResultsPage/BrowseResultsPage";
import { PageHeader } from "components/ui/Navigation/PageHeader";
import { BackButton } from "components/ui/BackButton";
import { SearchHeaderSection } from "components/search/Header/SearchHeaderSection";
import { SearchHeaderSection } from "components/SearchAndBrowse/Header/SearchHeaderSection";
import { SearchResultsPage } from "pages/SearchResultsPage/SearchResultsPage";

export const Router = () => {
Expand All @@ -20,17 +19,16 @@ export const Router = () => {
<Route path="/" element={<HomePage />} />
<Route path="/about" element={<AboutPage />} />
<Route path="/faqs" element={<FaqPage />} />
<Route path="/demo/listing" element={<ListingDebugPage />} />
{/* NB: /organizations/new must be listed before /organizations/:id or else the /new
step will be interpreted as an ID and will thus break the OrganizationEditPage */}
<Route
path="/organizations/:organizationListingId"
element={
<>
<SecondaryNavigationWrapper>
<PageHeader>
<BackButton defaultReturnTo="/search">Back</BackButton>
</SecondaryNavigationWrapper>
<OrganizationListingPage />
</PageHeader>
<OrganizationDetailPage />
</>
}
/>
Expand All @@ -40,9 +38,9 @@ export const Router = () => {
path="/search"
element={
<>
<SecondaryNavigationWrapper variant="secondary">
<PageHeader variant="secondary">
<SearchHeaderSection descriptionText="Sign up for programs and access resources." />
</SecondaryNavigationWrapper>
</PageHeader>
<SearchResultsPage />
</>
}
Expand All @@ -51,20 +49,17 @@ export const Router = () => {
path="/services/:serviceListingId"
element={
<>
<SecondaryNavigationWrapper>
<PageHeader>
<BackButton defaultReturnTo="/search">
Back to Services
</BackButton>
</SecondaryNavigationWrapper>
<ServiceListingPage />
</PageHeader>
<ServiceDetailPage />
</>
}
/>
<Route path="/terms-of-service" element={<TermsOfServicePage />} />
<Route
path="/:categorySlug/results"
element={<ServiceDiscoveryResults />}
/>
<Route path="/:categorySlug/results" element={<BrowseResultsPage />} />
</Routes>
);
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../../styles/utils/_helpers.scss";

.listing-wrapper {
.detail-wrapper {
background: $color-grey1;
padding: $section-padding-desktop-vertical $general-spacing-md;
background: $color-white;
Expand All @@ -10,7 +10,7 @@
}
}

.listing {
.detail {
color: $text-secondary;

p {
Expand All @@ -37,7 +37,7 @@
}
}

.listing--main {
.detail--main {
width: 100%;
margin: auto;
display: flex;
Expand Down Expand Up @@ -65,7 +65,7 @@
}
}

.listing--aside {
.detail--aside {
max-height: 100vh;
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import React from "react";
import { Helmet } from "react-helmet-async";
import { ActionSidebar } from "components/listing";
import styles from "./ListingPageWrapper.module.scss";
import { ActionSidebar } from "components/DetailPage";
import styles from "./DetailPageWrapper.module.scss";
import { OrganizationAction } from "models";

type ListingPageWrapperProps = {
type DetailPageWrapperProps = {
title: string;
description: string;
children: React.ReactNode;
sidebarActions: OrganizationAction[];
onClickAction: (action: OrganizationAction) => void;
};

const ListingPageWrapper = ({
const DetailPageWrapper = ({
title,
description,
children,
sidebarActions,
onClickAction,
}: ListingPageWrapperProps) => (
<div className={styles[`listing-wrapper`]}>
}: DetailPageWrapperProps) => (
<div className={styles[`detail-wrapper`]}>
<Helmet>
<title>{title}</title>
<meta name="description" content={description} />
</Helmet>
<article className={styles.listing} id="resource">
<div className={styles["listing--main"]}>
<div className={styles["listing--main--left"]}>{children}</div>
<aside className={`${styles["listing--aside"]} no-print`}>
<article className={styles.detail} id="resource">
<div className={styles["detail--main"]}>
<div className={styles["detail--main--left"]}>{children}</div>
<aside className={`${styles["detail--aside"]} no-print`}>
<ActionSidebar
actions={sidebarActions}
onClickAction={onClickAction}
Expand All @@ -38,4 +38,4 @@ const ListingPageWrapper = ({
</div>
);

export default ListingPageWrapper;
export default DetailPageWrapper;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../../styles/utils/_helpers.scss";

.listingInfoTable {
.infoTable {
width: 100%;

tr {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import React, { ReactNode } from "react";
import styles from "./ListingInfoTable.module.scss";
import styles from "./InfoTable.module.scss";

interface ListingInfoTableProps<T = unknown> {
interface InfoTableProps<T = unknown> {
rows?: T[];
rowRenderer?: (row: T) => JSX.Element;
children?: ReactNode;
}

export const ListingInfoTable = <T,>({
export const InfoTable = <T,>({
rows,
rowRenderer,
children,
}: ListingInfoTableProps<T>) => {
}: InfoTableProps<T>) => {
const useRowRenderer = !children && rows && rowRenderer;

return (
<table className={styles.listingInfoTable}>
<table className={styles.infoTable}>
<tbody>
{children}
{useRowRenderer && rows.map((row) => rowRenderer(row))}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import LabelTagRows from "components/listing/LabelTagRows";
import LabelTagRows from "components/DetailPage/LabelTagRows";

describe("<LabelTagRows />", () => {
it("should show top level category labels if they exist", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
@import "../../styles/utils/_helpers.scss";

// TODO: Check if these are being used:

.attributed-service-icon-container {
width: 17px;
margin-right: 4px;
display: inline-block;
text-align: center;
}

.listing-menu--button-icon {
height: 14px;
width: auto;
}

.attributed-service-text {
font-size: 13px;
color: $color-grey5;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { InstantSearch } from "react-instantsearch-core";
import { render, screen, waitFor } from "@testing-library/react";
import BrowseRefinementList from "components/search/Refinements/BrowseRefinementList";
import BrowseRefinementList from "components/SearchAndBrowse/Refinements/BrowseRefinementList";
import { createSearchClient } from "../../../../test/helpers/createSearchClient";
import { createRandomCategories } from "../../../../test/helpers/createRandomCategories";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from "react";
import { Link } from "react-router-dom";
import ReactMarkdown from "react-markdown";
import websiteConfig from "utils/websiteConfig";
import { RelativeOpeningTime } from "components/listing/RelativeOpeningTime";
import { RelativeOpeningTime } from "components/DetailPage/RelativeOpeningTime";
import type { TransformedSearchHit } from "models/SearchHits";
import "./SearchEntry.scss";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { ReactElement, useState } from "react";
import GoogleMap from "google-map-react";
import { Tooltip } from "react-tippy";
import "react-tippy/dist/tippy.css";
import SearchEntry from "components/search/SearchMap/SearchEntry";
import SearchEntry from "components/SearchAndBrowse/SearchMap/SearchEntry";
import { useAppContext, useAppContextUpdater } from "utils";
import { Button } from "components/ui/inline/Button/Button";
import {
Expand All @@ -13,7 +13,7 @@ import {
import "./SearchMap.scss";
import { TransformedSearchHit } from "../../../models";
import config from "../../../config";
import { SearchMapActions } from "components/search/SearchResults/SearchResults";
import { SearchMapActions } from "components/SearchAndBrowse/SearchResults/SearchResults";

interface SearchMapProps {
hits: TransformedSearchHit[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback } from "react";
import { SearchMap } from "components/search/SearchMap/SearchMap";
import { SearchResult } from "components/search/SearchResults/SearchResult";
import { SearchMap } from "components/SearchAndBrowse/SearchMap/SearchMap";
import { SearchResult } from "components/SearchAndBrowse/SearchResults/SearchResult";
import {
TransformedSearchHit,
transformSearchResults,
Expand All @@ -13,7 +13,7 @@ import {
import styles from "./SearchResults.module.scss";
import ClearSearchButton from "../Refinements/ClearSearchButton";
import { Loader } from "components/ui/Loader";
import ResultsPagination from "components/search/Pagination/ResultsPagination";
import ResultsPagination from "components/SearchAndBrowse/Pagination/ResultsPagination";

export enum SearchMapActions {
SearchThisArea,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {
eligibilitiesMapping,
categoriesMapping,
} from "utils/refinementMappings";
import ClearAllFilters from "components/search/Refinements/ClearAllFilters";
import OpenNowFilter from "components/search/Refinements/OpenNowFilter";
import BrowseRefinementList from "components/search/Refinements/BrowseRefinementList";
import SearchRefinementList from "components/search/Refinements/SearchRefinementList";
import ClearAllFilters from "components/SearchAndBrowse/Refinements/ClearAllFilters";
import OpenNowFilter from "components/SearchAndBrowse/Refinements/OpenNowFilter";
import BrowseRefinementList from "components/SearchAndBrowse/Refinements/BrowseRefinementList";
import SearchRefinementList from "components/SearchAndBrowse/Refinements/SearchRefinementList";
import { Button } from "components/ui/inline/Button/Button";
import {
DEFAULT_AROUND_PRECISION,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "~styles/utils/_helpers.scss";

.listingInfoSection {
.detailInfoSection {
padding: $general-spacing-xl 0;
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React from "react";
import classNames from "classnames";
import styles from "./ListingInfoSection.module.scss";
import styles from "./DetailInfoSection.module.scss";

type ListingInfoSectionProps = {
type DetailInfoSectionProps = {
title: string;
borderBottom?: boolean;
} & React.HTMLProps<HTMLDivElement>;

export const ListingInfoSection = ({
export const DetailInfoSection = ({
children,
title,
borderBottom = true,
...props
}: ListingInfoSectionProps) => {
}: DetailInfoSectionProps) => {
const sectionClassnames = classNames(
styles.listingInfoSection,
styles.detailInfoSection,
borderBottom && styles.borderBottom
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { ReactNode } from "react";
import classNames from "classnames";
import styles from "./SecondaryNavigationWrapper.module.scss";
import styles from "./PageHeader.module.scss";

// Provides page-level styling for the secondary navigation bar
export const SecondaryNavigationWrapper = ({
export const PageHeader = ({
children,
variant = "primary",
}: {
Expand Down
4 changes: 2 additions & 2 deletions app/components/ui/NoSearchResultsDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styles from "components/search/SearchResults/SearchResults.module.scss";
import ClearSearchButton from "components/search/Refinements/ClearSearchButton";
import styles from "components/SearchAndBrowse/SearchResults/SearchResults.module.scss";
import ClearSearchButton from "components/SearchAndBrowse/Refinements/ClearSearchButton";

export const NoSearchResultsDisplay = ({ query }: { query: string | null }) => (
<div className={`${styles.noResultsMessage}`}>
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui/SearchResultsHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactNode } from "react";
import styles from "components/search/SearchResults/SearchResults.module.scss";
import styles from "components/SearchAndBrowse/SearchResults/SearchResults.module.scss";

/**
* Layout component for the header above the search results list that allows for
Expand Down
1 change: 0 additions & 1 deletion app/models/ChangeRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface ChangeRequest {
}

export type ChangeRequestParams = ScheduleDayChangeRequestParams;

interface ScheduleDayChangeRequestParams {
schedule_id: number;
type: "schedule_days";
Expand Down
Binary file removed app/pages/Auth/auth-background.jpg
Binary file not shown.
1 change: 1 addition & 0 deletions app/pages/BrowseResultsPage/BrowseResultsPage.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@use "~components/SearchAndBrowse/SearchAndBrowseResultsPage.module.scss";
Loading
Loading