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

Merge staging into main #667

Merged
merged 52 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
85dd925
Merge remote-tracking branch 'upstream/staging' into staging
AZBL Apr 12, 2024
5abae61
Merge remote-tracking branch 'upstream/staging' into staging
AZBL Apr 23, 2024
69772e9
Merge remote-tracking branch 'upstream/staging' into staging
AZBL Apr 27, 2024
230bc94
fix property list controls
AZBL Apr 27, 2024
0b3050a
Merge remote-tracking branch 'upstream/staging' into AZBL/594-fix-pro…
AZBL Apr 29, 2024
d2ab1b4
removed left padding from properties and right padding from download …
AZBL Apr 29, 2024
b3519ce
add left margin to properties in view for sm and md screens
AZBL Apr 29, 2024
493ef20
Fix malformed JSON in .all-contributorsrc
CodeWritingCow Apr 29, 2024
9b2bbc1
Merge pull request #613 from CodeWritingCow/codewritingcow/fix-all-co…
brandonfcohen1 Apr 29, 2024
2382ff1
Added useMemo to DimensionFilter "filter" value to prevent re-renders
jgrimes86 Apr 30, 2024
ca6fd46
Merge pull request #615 from CodeForPhilly/main
nlebovits Apr 30, 2024
96ab3d9
Merge pull request #617 from jgrimes86/jgrimes86/601-fix-strobing-but…
nlebovits Apr 30, 2024
c56edb2
build: first draft of CI pipeline
SKalt May 1, 2024
a5e8a2c
Merge pull request #620 from SKalt/quick-and-dirty-ci
nlebovits May 1, 2024
1303e90
Merge remote-tracking branch 'upstream/staging' into AZBL/594-fix-pro…
AZBL May 2, 2024
e492af2
added top margin property table container div
AZBL May 2, 2024
5704e21
Merge pull request #611 from AZBL/AZBL/594-fix-property-list-controls
nlebovits May 2, 2024
c7f175d
Replace h4 tags on Transform Property page
CodeWritingCow May 3, 2024
dde9d9a
Merge pull request #621 from CodeWritingCow/codewritingcow/618-change…
nlebovits May 3, 2024
2415cc4
Moved toggle button and changed style
amyyeung17 May 4, 2024
c4c16a4
Removed button and related from side bar
amyyeung17 May 4, 2024
45d5319
Property legend is toggable
amyyeung17 May 4, 2024
4f00cd0
Create CookieConsentBanner
CodeWritingCow May 15, 2024
28f79a1
Add Cookie Settings link to footer
CodeWritingCow May 15, 2024
8d8a64d
Updated share tooltip to appear when button is tabbed
amyyeung17 May 15, 2024
9239690
Removed unnecessary tabindex
amyyeung17 May 16, 2024
d49291f
Add styling for cookie banner in mobile view
CodeWritingCow May 17, 2024
c059e16
Merge pull request #636 from amyyeung17/602-tooltip-a11y
bacitracin May 18, 2024
6e0eed6
Fix the issue of map-legends going offscreen
10234567Z May 19, 2024
90473f9
added hover styling to property cards when keyboard focus is on card
AZBL May 21, 2024
a45f2e3
Add CookieConsentBanner to Footer component
CodeWritingCow May 21, 2024
c33d681
Add padding-top to cookie banner buttons
CodeWritingCow May 22, 2024
3dc3f3b
Added tooltip classes
amyyeung17 May 22, 2024
f1b9530
Added tooltips for singlepropertydetail options
amyyeung17 May 22, 2024
8ebb909
Add sections to contributing, clarify CI/CD steps
cjfit May 23, 2024
b7b8463
Create CookieProvider to share cookie settings in app
CodeWritingCow May 28, 2024
2e01b25
Share CookieContext across UI application
CodeWritingCow May 28, 2024
b2fedfd
Update footer, cookie banner to use cookie context
CodeWritingCow May 28, 2024
b88fb5b
Change anchor tag to Next.js Link
CodeWritingCow May 28, 2024
3777ed7
Replace NextUI Link with Next.js Link in IconLink
CodeWritingCow May 28, 2024
cf4804e
Merge pull request #637 from 10234567Z/598-fix-mobile-map-height
nlebovits May 28, 2024
713310d
Merge pull request #644 from AZBL/AZBL/604-apply-hover-styling-on-pro…
nlebovits May 28, 2024
b56d552
Merge pull request #647 from amyyeung17/612-tooltips
nlebovits May 28, 2024
2e887c7
Merge pull request #648 from CodeForPhilly/cjfit/634-devops-update-co…
nlebovits May 28, 2024
f109a78
Add new state to CookieProvider
CodeWritingCow May 28, 2024
36a3207
Update cookie banner to use setShouldAllowCookies
CodeWritingCow May 28, 2024
c8e7a81
Add cookie consent logic to Save Property button
CodeWritingCow May 29, 2024
990e70d
Provide Cookie Context to all pages
CodeWritingCow May 29, 2024
99a6593
Refactor onClickSaveButton to improve code legibility
CodeWritingCow May 29, 2024
8f445e7
Merged stagingupdates and postionings for new info and mobile map men…
amyyeung17 May 29, 2024
6c6e6c8
Merge pull request #635 from CodeWritingCow/codewritingcow/597-cookie…
nlebovits May 31, 2024
8d4e384
Merge pull request #622 from amyyeung17/599-map-toggle
nlebovits May 31, 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
4 changes: 4 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"code"
]
},
{
"login": "jgaye",
"name": "Julien Gaye",
"avatar_url": "https://avatars.githubusercontent.com/u/4049458?v=4",
Expand All @@ -145,6 +146,7 @@
"code"
]
},
{
"login": "BayLadyCoder",
"name": "Bay Chairangsaris",
"avatar_url": "https://avatars.githubusercontent.com/u/33296817?v=4",
Expand All @@ -153,6 +155,8 @@
"code",
"doc"
]
},
{
"login": "paulhchoi",
"name": "Paul Choi",
"avatar_url": "https://avatars.githubusercontent.com/u/8061917?v=4",
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pr_checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Frontend PR Checks
on: # see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
workflow_dispatch:
pull_request:
paths:
- "src/**/*"
- "package.json"
- "package-lock.json"
- "*.js"
jobs:
lint_and_build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: "package-lock.json"
- name: Install dependencies
run: npm ci
- name: Run lints
run: npm run lint
- name: Check the build
run: npm run build
38 changes: 34 additions & 4 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,47 @@ We hold weekly meetings via Zoom, plus the monthly in-person Code for Philly hac

## How can I contribute?

### Find an issue
We welcome all kinds of contributions, big or small. The best way to start is to look through the [issues page](https://github.com/CodeForPhilly/vacant-lots-proj/issues) to see what's available to be working on. If you're not sure which issue to tackle, consider filtering them by tags or asking in the [Slack channel](https://codeforphilly.slack.com/archives/C05H9QBMP96).

Once you've found an issue you'd like to work on, please comment on it to let us know you're interested. We'll do our best to assign it to you ASAP. If you're unable to complete the issue in a timely manner (a week or two), please let us know so we can reassign it. If we see an issue with no activity for 3 or more days, we'll reach out via GitHub and Slack to the person to whom it's assigned. If there is no activity at all on the issue for 1 week, we'll reassign it. If there is some activity (e.g., a draft PR or a message to let us know that you're out of town), then you're free to continue working on the issue for another week. However, in the interest of avoiding bottlenecks and giving everyone a fair chance to contribute, we ask that everyone try to complete all issues within 2 weeks of assignment.
Once you've found an issue you'd like to work on, please comment on it to let us know you're interested. We'll do our best to assign it to you ASAP.

### Being fair
If you're unable to complete the issue in a timely manner (a week or two), please let us know so we can reassign it. If we see an issue with no activity for 3 or more days, we'll reach out via GitHub and Slack to the person to whom it's assigned. If there is no activity at all on the issue for 1 week, we'll reassign it. If there is some activity (e.g., a draft PR or a message to let us know that you're out of town), then you're free to continue working on the issue for another week. However, in the interest of avoiding bottlenecks and giving everyone a fair chance to contribute, we ask that everyone try to complete all issues within 2 weeks of assignment.

### Local setup

For info on how to get the codebase setup, see the [SETUP](/SETUP) folder, which contains instructions for setting up the front end, back end, and full stack, depending on your interest. If you have questions about the process, please ask in the [Slack channel](https://codeforphilly.slack.com/archives/C05H9QBMP96).

To make sure the repo is protected and organized, merges to `main` are not allowed. All changes must be made through pull requests to the `staging` branch. Once you have commits ready to merge, please create a new branch named in the format of `<github-username>`/`<issue-number>`-`<kebab-case-description>`. For example vimusds/1069-fix-territory-on-mobile. Your PR will need to be approved by at least one required reviewer (see [CODEOWNERS](https://github.com/CodeForPhilly/vacant-lots-proj/blob/main/.github/CODEOWNERS)) and must pass all required status checks. When these are complete, it will be merged to the `staging` branch and then eventually reviwed by our design team and merged to `main` for deployment. To help them in this, please provide clear instructions on how to test/view the changes you've made, and tag the issues you're addressing. You can do this when writing the PR by writing `#<number>` in the `Does this close any currently open issues` section.

If you're unclear on the precise implementation of a ticket, please refer to [the prototype](https://www.figma.com/proto/NAFkgq34abW6uJ0R7PW24T/Prototype---Clean-%26-Green-Philly?page-id=187%3A12602&type=design&node-id=2592-30019&viewport=-657%2C-623%2C0.1&t=fqZvOvLyE9qv7AAV-8&scaling=min-zoom&starting-point-node-id=2592%3A30019&hide-ui=1).
## Quickstart

To maintain repo organization and protection, merges to main are not allowed. All changes must be made through pull requests to the `staging` branch. Follow these steps, [example PR](https://github.com/CodeForPhilly/clean-and-green-philly/pull/617) for reference:

1. Have an assigned issue (e.g. [#646](https://github.com/CodeForPhilly/clean-and-green-philly/issues/646))
1. Ensure you're up to date with the `staging` branch
2. Create a new branch
- Name it `<github-username>`/`<issue-number>`-`<kebab-case-description>`.
- Example: `vimusds/1069-fix-territory-on-mobile`.
3. Push changes and open PR: Push your commits and open a PR with the template filled in.
- Provide clear instructions on how to test/view your changes
- Tag the issues you're addressing using `#<number>` in the "Does this close any currently open issues?" section.
4. Ensure your PR passes all checks. If not, resolve the errors and try again.
5. Tag reviewers: Tag a code approver (see [CODEOWNERS](https://github.com/CodeForPhilly/vacant-lots-proj/blob/main/.github/CODEOWNERS)) for review.

Once approved and all checks pass, your code will be built in Vercel if it's a frontend change and merged into staging by a reviewer. Now you just need to close your issue!

### Closing your Issue
To close the issue you worked on, add a comment to the issue tagging the appropriate reviewer(s).
- Front-End Issues: Tag @paulhchoi and @thansidwell. If it involves the map, also tag @brandonfcohen1.
- Back-End Issues: Tag @brandonfcohen1.

🎉 Congrats, you finished your contribution!

### What's next?

Note: when you have completed an issue and are ready to close it, please tag the appropriate reviewe(s). It it's a front-end issue, tag @paulhchoi and @thansidwell (plus @brandonfcohen1 if it involves the map). If it's a back-end issue, tag @brandonfcohen1. Feel free to drop a message in the Slack channel if you have questions.
- Design review: The design team will review and eventually merge it into main for deployment.
- Deploy to prod: A Clean and Green Philly team member will deploy your changes to the production site.

## Open an Issue

Expand Down
2 changes: 1 addition & 1 deletion src/app/(content-pages)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const ContentPagesLayout = ({ children }: { children: React.ReactNode }) => {
<Header />
<main id="main">
<div className="max-w-[68.75rem] mx-auto pb-[30px] pt-[60px] w-[90%]">
{children}
{children}
</div>
</main>
<Footer />
Expand Down
11 changes: 11 additions & 0 deletions src/app/CookieProviderWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use client";

import { CookieProvider } from "@/context/CookieContext";

export const CookieProviderWrapper = ({
children,
}: {
children: React.ReactNode;
}) => {
return <CookieProvider>{children}</CookieProvider>;
};
2 changes: 2 additions & 0 deletions src/app/find-properties/[[...opa_id]]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Header, Hotjar } from "@/components";
import CookieConsentBanner from "@/components/CookieConsentBanner";

export const metadata = {
title: "Find Properties",
Expand All @@ -10,6 +11,7 @@ const MapLayout = ({ children }: { children: React.ReactNode }) => {
<Header />
<main id="main">{children}</main>
<Hotjar />
<CookieConsentBanner />
</div>
);
};
Expand Down
16 changes: 14 additions & 2 deletions src/app/find-properties/[[...opa_id]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@/components";
import { FilterProvider } from "@/context/FilterContext";
import { NextUIProvider, Spinner } from "@nextui-org/react";
import { X } from "@phosphor-icons/react";
import { X, GlobeHemisphereWest, ListBullets } from "@phosphor-icons/react";
import { MapGeoJSONFeature } from "maplibre-gl";
import StreetView from "../../../components/StreetView";
import { centroid } from "@turf/centroid";
Expand Down Expand Up @@ -180,7 +180,6 @@ const MapPage = ({ params }: MapPageProps) => {
smallScreenMode,
setShouldFilterSavedProperties,
updateCurrentView,
updateSmallScreenMode,
};
const isVisible = (mode: string) =>
smallScreenMode === mode ? "" : "max-sm:hidden";
Expand Down Expand Up @@ -306,6 +305,19 @@ const MapPage = ({ params }: MapPageProps) => {
/>
)}
</SidePanel>
<ThemeButton
aria-label={`Change to ${smallScreenMode}`}
label={smallScreenMode === "map" ? "List View" : "Map View"}
className="fixed bottom-10 left-1/2 -ml-[3.5rem] rounded-2xl sm:hidden max-md:min-w-[7rem]"
onPress={updateSmallScreenMode}
startContent={
smallScreenMode === "map" ? (
<ListBullets />
) : (
<GlobeHemisphereWest />
)
}
/>
</div>
</div>
</NextUIProvider>
Expand Down
48 changes: 47 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ a .bg-color-none {
/* Style override for map controls */
.maplibregl-ctrl button.maplibregl-ctrl-geolocate,
.maplibregl-ctrl button.maplibregl-ctrl-zoom-in,
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out {
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out,
.maplibregl-ctrl button.custom-legend-info {
border-radius: 0.25em;
height: 40px;
width: 40px;
Expand All @@ -345,6 +346,41 @@ a .bg-color-none {
background-image: url('data:image/svg+xml,<svg width="16" height="2" viewBox="0 0 16 2" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 0.724609C15.5 0.89037 15.4342 1.04934 15.3169 1.16655C15.1997 1.28376 15.0408 1.34961 14.875 1.34961H1.125C0.95924 1.34961 0.800269 1.28376 0.683058 1.16655C0.565848 1.04934 0.5 0.89037 0.5 0.724609C0.5 0.558849 0.565848 0.399878 0.683058 0.282668C0.800269 0.165458 0.95924 0.0996094 1.125 0.0996094H14.875C15.0408 0.0996094 15.1997 0.165458 15.3169 0.282668C15.4342 0.399878 15.5 0.558849 15.5 0.724609Z" fill="%2303141B"/></svg>') !important;
}

.custom-legend-info-div {
top: 82%;
@apply left-7 fixed;
}

.custom-legend-info-icon {
background-image: url('data:image/svg+xml,<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 0.875C7.39303 0.875 5.82214 1.35152 4.486 2.24431C3.14985 3.1371 2.10844 4.40605 1.49348 5.8907C0.87852 7.37535 0.717618 9.00901 1.03112 10.5851C1.34463 12.1612 2.11846 13.6089 3.25476 14.7452C4.39106 15.8815 5.8388 16.6554 7.4149 16.9689C8.99099 17.2824 10.6247 17.1215 12.1093 16.5065C13.594 15.8916 14.8629 14.8502 15.7557 13.514C16.6485 12.1779 17.125 10.607 17.125 9C17.1227 6.84581 16.266 4.78051 14.7427 3.25727C13.2195 1.73403 11.1542 0.877275 9 0.875ZM9 15.875C7.64026 15.875 6.31105 15.4718 5.18046 14.7164C4.04987 13.9609 3.16868 12.8872 2.64833 11.6309C2.12798 10.3747 1.99183 8.99237 2.2571 7.65875C2.52238 6.32513 3.17716 5.10013 4.13864 4.13864C5.10013 3.17716 6.32514 2.52237 7.65876 2.2571C8.99238 1.99183 10.3747 2.12798 11.631 2.64833C12.8872 3.16868 13.9609 4.04987 14.7164 5.18045C15.4718 6.31104 15.875 7.64025 15.875 9C15.8729 10.8227 15.1479 12.5702 13.8591 13.8591C12.5702 15.1479 10.8227 15.8729 9 15.875ZM10.25 12.75C10.25 12.9158 10.1842 13.0747 10.0669 13.1919C9.94974 13.3092 9.79076 13.375 9.625 13.375C9.29348 13.375 8.97554 13.2433 8.74112 13.0089C8.5067 12.7745 8.375 12.4565 8.375 12.125V9C8.20924 9 8.05027 8.93415 7.93306 8.81694C7.81585 8.69973 7.75 8.54076 7.75 8.375C7.75 8.20924 7.81585 8.05027 7.93306 7.93306C8.05027 7.81585 8.20924 7.75 8.375 7.75C8.70652 7.75 9.02447 7.8817 9.25889 8.11612C9.49331 8.35054 9.625 8.66848 9.625 9V12.125C9.79076 12.125 9.94974 12.1908 10.0669 12.3081C10.1842 12.4253 10.25 12.5842 10.25 12.75ZM7.75 5.5625C7.75 5.37708 7.80499 5.19582 7.908 5.04165C8.01101 4.88748 8.15743 4.76732 8.32874 4.69636C8.50004 4.62541 8.68854 4.60684 8.8704 4.64301C9.05226 4.67919 9.2193 4.76848 9.35042 4.89959C9.48153 5.0307 9.57082 5.19775 9.60699 5.3796C9.64316 5.56146 9.6246 5.74996 9.55364 5.92127C9.48268 6.09257 9.36252 6.23899 9.20835 6.342C9.05418 6.44502 8.87292 6.5 8.6875 6.5C8.43886 6.5 8.20041 6.40123 8.02459 6.22541C7.84878 6.0496 7.75 5.81114 7.75 5.5625Z" fill="%23173009"/></svg>') !important;
}
/* Tooltips for maplibre components, classes style the title attributes */
.maplibregl-ctrl button.maplibregl-ctrl-geolocate[title]:hover::after,
.maplibregl-ctrl button.maplibregl-ctrl-zoom-in[title]:hover::after,
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out[title]:hover::after {
content: attr(title);
font-size: 14px;
padding: 4px 10px;
width: max-content;
z-index: 100;
@apply absolute items-center flex bg-gray-900 rounded-[14px] text-white z-[75];
}

.maplibregl-ctrl button.maplibregl-ctrl-geolocate[title]:hover::after {
transform: translateX(-102.5%);
@apply top-1.5;
}

.maplibregl-ctrl button.maplibregl-ctrl-zoom-in[title]:hover::after {
transform: translateX(-105.5%);
@apply top-1.5;
}

.maplibregl-ctrl button.maplibregl-ctrl-zoom-out[title]:hover::after {
transform: translateX(-105.5%);
@apply top-[46px];
}

/* styling for the map tooltip */
.customized-map-popup {
.maplibregl-popup-content {
Expand All @@ -367,3 +403,13 @@ a .bg-color-none {
width: 24px;
}
}

@media screen and (max-width: 640px) {
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-bottom-left {
position: fixed !important;
}
.maplibregl-ctrl-bottom-left {
bottom: 50px !important;
}
}
3 changes: 2 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Metadata } from "next";
import "./globals.css";
import { CookieProviderWrapper } from "./CookieProviderWrapper";

export const metadata: Metadata = {
title: {
Expand Down Expand Up @@ -28,7 +29,7 @@ export default function RootLayout({
>
Skip to main content
</a>
{children}
<CookieProviderWrapper>{children}</CookieProviderWrapper>
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const ContentCard: FC<ContentCardProps> = ({
</div>
<div className="flex items-center p-6">
<div>
<h4 className="font-bold mb-2 heading-lg">{title}</h4>
<h3 className="font-bold mb-2 heading-lg">{title}</h3>
<p>{body}</p>

{details && details.length > 0 && (
Expand Down
53 changes: 53 additions & 0 deletions src/components/CookieConsentBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"use client";

import { ThemeButton } from "./ThemeButton";
import { Check, X } from "@phosphor-icons/react";
import { useCookieContext } from "@/context/CookieContext";

const CookieConsentBanner = () => {
const { shouldShowBanner, setShouldAllowCookies, setShouldShowBanner } =
useCookieContext();

const onClickButton = (shouldSaveCookies: boolean) => {
setShouldAllowCookies(shouldSaveCookies);
setShouldShowBanner(false);
};

return (
<div
className={`${
shouldShowBanner
? "md:flex fixed inset-x-0 bottom-0 z-20 justify-between bg-blue-200 p-4 sm:p-6"
: "hidden"
}`}
>
<div>
<div className="heading-md">Can we store cookies to your browser?</div>
<div className="body-sm">
This provides you a nice experience preserving your filtering, your
position on the map and your property saved list.
</div>
</div>

<div className="flex justify-end gap-2 pt-4 sm:pt-0">
<div className="flex flex-none items-center gap-x-2">
<ThemeButton
color="tertiary"
label="Decline"
startContent={<X />}
onPress={() => onClickButton(false)}
/>

<ThemeButton
color="primary"
label="Accept"
startContent={<Check />}
onPress={() => onClickButton(true)}
/>
</div>
</div>
</div>
);
};

export default CookieConsentBanner;
Loading