Skip to content

Commit e4c74f2

Browse files
committed
Merge branch 'release-1.0.85'
2 parents 821f931 + b433287 commit e4c74f2

File tree

25 files changed

+1859
-1429
lines changed

25 files changed

+1859
-1429
lines changed

.github/ISSUE_TEMPLATE/a---blank-issue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: A - Blank Issue
33
about: Consistent formatting make Issues concise and easy to navigate
44
title: ''
5-
labels: ''
5+
labels: 'Missing: Feature, Missing: Milestone, Missing: Role, Missing: Size'
66
assignees: ''
77

88
---

.github/ISSUE_TEMPLATE/a---bug-report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: A - Bug report
33
about: Create a report to help us improve
44
title: 'Bug: '
5-
labels: ''
5+
labels: 'Release Note: Bug'
66
assignees: ''
77

88
---

.github/ISSUE_TEMPLATE/a---feature-request.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ labels: ''
66
assignees: ''
77

88
---
9+
910
(This form helps the reporter give enough information so that product managers, designers/researchers, and programmers can evaluate the issue, prioritize it, and resolve it.)
1011

1112

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Recruit volunteers for specific open roles template
3+
about: Use this when you want to post an open role see issue 2161
4+
title: "[Replace with PROJECT INITIALS]: Open Role for: [Replace with NAME OF ROLE]"
5+
labels: 'Missing: Milestone, Missing: Role'
6+
assignees: ''
7+
8+
---
9+
10+
<img src="https://tinyurl.com/picfoodoasis" width=400px>
11+
12+
#### Body
13+
**Project Name**: Food Oasis
14+
15+
**Name of Role**: [Replace with NAME OF ROLE]
16+
17+
**Volunteer Opportunity**: [Replace with CUSTOM RECRUITMENT MESSAGE]
18+
19+
**Duration**: [Replace with On-going, or SPECIFY DURATION]
20+
21+
**Meeting Times**: [Replace with the MEETING TIMES THAT THIS ROLE MUST ATTEND AND ANY OPTIONAL MEETINGS, MARKING THEM AS OPTIONAL)
22+
23+
**Who to communicate your interest to**
24+
- Slack channel link: [#[Replace with NAME OF SLACK CHANNEL]]([Replace with LINK TO YOUR SLACK CHANNEL])
25+
- Slack name of person to contact in the channel: see who this issue is assigned to and @ message them in the channel above
26+
27+
[Read more about the project](https://www.hackforla.org/projects/food-oasis

client/package-lock.json

Lines changed: 281 additions & 262 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "foodoasis-client",
33
"description": "React Client for Food Oasis",
4-
"version": "1.0.84",
4+
"version": "1.0.85",
55
"author": "Hack for LA",
66
"license": "GPL-2.0",
77
"private": true,
@@ -20,13 +20,12 @@
2020
"@emotion/react": "^11.10.5",
2121
"@emotion/styled": "^11.10.5",
2222
"@mapbox/geo-viewport": "^0.4.1",
23-
"@mui/icons-material": "^5.16.4",
23+
"@mui/icons-material": "^5.16.7",
2424
"@mui/lab": "^5.0.0-alpha.113",
2525
"@mui/material": "^5.11.1",
2626
"@mui/x-data-grid": "^5.17.20",
2727
"@mui/x-date-pickers": "^6.8.0",
28-
"@types/mapbox-gl": "^3.1.0",
29-
"axios": "^1.6.7",
28+
"axios": "^1.7.4",
3029
"dayjs": "^1.11.7",
3130
"debounce-fn": "^5.0.0",
3231
"formik": "^2.2.9",

client/src/App.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { CssBaseline } from "@mui/material";
1+
import { CssBaseline, Snackbar } from "@mui/material";
2+
import SurveySnackbar from "./components/UI/SurveySnackbar";
23
import { SiteProvider } from "contexts/siteContext";
34
import { ToasterProvider } from "contexts/toasterContext";
45
import { UserProvider } from "contexts/userContext";
5-
import { useEffect } from "react";
6+
import { useEffect, useState } from "react";
67
import { HelmetProvider } from "react-helmet-async";
78
import { BrowserRouter as Router } from "react-router-dom";
89
import { ThemeProvider } from "theme";
@@ -17,6 +18,18 @@ function App() {
1718
analytics.postEvent("visitAppComponent");
1819
}, []);
1920

21+
const [snackbarOpen, setSnackbarOpen] = useState(false);
22+
const [snackbarMessage, setSnackbarMessage] = useState("");
23+
24+
const handleOpenSnackbar = (message) => {
25+
setSnackbarMessage(message);
26+
setSnackbarOpen(true);
27+
};
28+
29+
const handleCloseSnackbar = () => {
30+
setSnackbarOpen(false);
31+
};
32+
2033
return (
2134
<HelmetProvider>
2235
<CssBaseline />
@@ -33,6 +46,12 @@ function App() {
3346
<MapProvider>
3447
<Router>
3548
<AppRoutes />
49+
<SurveySnackbar
50+
open={snackbarOpen}
51+
autoHideDuration={6000}
52+
onClose={handleCloseSnackbar}
53+
message={snackbarMessage}
54+
/>
3655
</Router>
3756
</MapProvider>
3857
</ThemeProvider>

client/src/components/Admin/OrganizationEdit.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,34 @@ const validationSchema = Yup.object().shape({
5151
longitude: Yup.number().required("Longitude is required").min(-180).max(180),
5252
email: Yup.string().email("Invalid email address format"),
5353
hours: Yup.array().of(HourSchema),
54+
instagram: Yup.string()
55+
.transform((value, originalValue) => (originalValue === "" ? null : value))
56+
.matches(
57+
/^(?:@?[a-zA-Z0-9_.]{1,30})$/,
58+
"Valid Instagram username required."
59+
)
60+
.nullable(),
5461
twitter: Yup.string()
62+
.transform((value, originalValue) => (originalValue === "" ? null : value))
63+
.matches(/^(?:@?[a-zA-Z0-9_]{1,15})$/, "Valid Twitter username required.")
64+
.nullable(),
65+
66+
pinterest: Yup.string()
67+
.transform((value, originalValue) =>
68+
originalValue.trim() === "" ? null : value
69+
)
5570
.matches(
56-
/^https?:\/\/(www\.)?(twitter\.com|x\.com)\/.*/,
57-
"Invalid URL, e.g. 'https://twitter.com/ or https://x.com/'"
71+
/^@?(?=.*[a-zA-Z])[a-zA-Z0-9_]{3,30}$/,
72+
"Valid Pinterest username is required."
5873
)
59-
.required("Full Twitter/X URL is required."),
74+
.nullable(),
75+
facebook: Yup.string()
76+
.matches(
77+
/^[a-zA-Z][a-zA-Z0-9.]{4,49}$/,
78+
"Valid Facebook username required."
79+
)
80+
.nullable(),
81+
6082
selectedCategoryIds: Yup.array().min(
6183
1,
6284
"You must select at least one category"

client/src/components/Admin/OrganizationEdit/ContactDetails.js

Lines changed: 97 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,58 @@
1-
import { Grid, TextField } from "@mui/material";
1+
import { Grid } from "@mui/material";
22
import { TabPanel } from "components/Admin/ui/TabPanel";
3+
import { InputAdornment, TextField } from "@mui/material";
34
import Label from "../ui/Label";
45

6+
const CustomTextFieldComponent = ({
7+
id,
8+
name,
9+
placeholder,
10+
value,
11+
onChange,
12+
onBlur,
13+
touched,
14+
errors,
15+
startAdornment,
16+
}) => (
17+
<TextField
18+
id={id}
19+
sx={{
20+
"& .MuiOutlinedInput-root": {
21+
borderRadius: "4px",
22+
backgroundColor: "white",
23+
paddingLeft: "0",
24+
"& fieldset": {
25+
borderColor: "grey",
26+
},
27+
"& input::placeholder": {
28+
color: "#B0BEC5",
29+
opacity: 1,
30+
},
31+
},
32+
"& .MuiInputAdornment-root": {
33+
backgroundColor: "#F4F6F8",
34+
padding: "22px 8px 22px 8px",
35+
borderRight: "1px solid grey",
36+
borderRadius: "4px 0 0 4px",
37+
color: "#B0BEC5",
38+
margin: "-20px 0",
39+
},
40+
}}
41+
name={name}
42+
placeholder={placeholder}
43+
value={value}
44+
onChange={onChange}
45+
onBlur={onBlur}
46+
helperText={touched ? errors : ""}
47+
error={Boolean(touched && errors)}
48+
InputProps={{
49+
startAdornment: startAdornment && (
50+
<InputAdornment position="start">{startAdornment}</InputAdornment>
51+
),
52+
}}
53+
/>
54+
);
55+
556
export default function ContactDetails({
657
tabPage,
758
values,
@@ -34,67 +85,89 @@ export default function ContactDetails({
3485
</Grid>
3586
<Grid item sm={6} xs={12}>
3687
<div>
37-
<Label id="instagram" label="Instagram" />
38-
<TextField
88+
<Label
89+
id="instagram"
90+
label="Instagram"
91+
tooltipTitle="Enter your Instagram username"
92+
href="https://instagram.com/"
93+
handle={values.instagram}
94+
/>
95+
<CustomTextFieldComponent
3996
id="instagram"
4097
name="instagram"
41-
placeholder="Instagram"
98+
placeholder="Instagram username"
4299
value={values.instagram}
43100
onChange={handleChange}
44101
onBlur={handleBlur}
45-
helperText={touched.instagram ? errors.instagram : ""}
46-
error={touched.instagram && Boolean(errors.instagram)}
102+
touched={touched.instagram}
103+
errors={errors.instagram}
104+
startAdornment="https://instagram.com/"
47105
/>
48106
</div>
49107
</Grid>
50108
<Grid item sm={6} xs={12}>
51109
<div>
52-
<Label id="facebook" label="Facebook" />
53-
<TextField
110+
<Label
111+
id="facebook"
112+
label="Facebook"
113+
tooltipTitle="Enter your Facebook username"
114+
href="https://facebook.com/"
115+
handle={values.facebook}
116+
/>
117+
<CustomTextFieldComponent
54118
id="facebook"
55119
name="facebook"
56-
placeholder="Facebook"
120+
placeholder="Facebook username"
57121
value={values.facebook}
58122
onChange={handleChange}
59123
onBlur={handleBlur}
60-
helperText={touched.facebook ? errors.facebook : ""}
61-
error={touched.facebook && Boolean(errors.facebook)}
124+
touched={touched.facebook}
125+
errors={errors.facebook}
126+
startAdornment="https://facebook.com/"
62127
/>
63128
</div>
64129
</Grid>
65130
<Grid item sm={6} xs={12}>
66131
<div>
67132
<Label
68-
id="twitter"
133+
id="twitter-label"
69134
label="Twitter"
70-
tooltipTitle="URL must start with 'https://twitter.com/ or https://x.com/'"
71-
href={values.twitter}
135+
tooltipTitle="Enter your Twitter username"
136+
href="https://twitter.com/"
137+
handle={values.twitter}
72138
/>
73-
74-
<TextField
139+
<CustomTextFieldComponent
75140
id="twitter"
76141
name="twitter"
77-
placeholder="Twitter"
142+
placeholder="Twitter username"
78143
value={values.twitter}
79144
onChange={handleChange}
80145
onBlur={handleBlur}
81-
helperText={touched.twitter ? errors.twitter : ""}
82-
error={touched.twitter && Boolean(errors.twitter)}
146+
touched={touched.twitter}
147+
errors={errors.twitter}
148+
startAdornment="https://twitter.com/"
83149
/>
84150
</div>
85151
</Grid>
86152
<Grid item sm={6} xs={12}>
87153
<div>
88-
<Label id="pinterest" label="Pinterest" />
89-
<TextField
154+
<Label
155+
id="pinterest"
156+
label="Pinterest"
157+
href="https://pinterest.com/"
158+
handle={values.pinterest}
159+
tooltipTitle="Enter your Pinterest username"
160+
/>
161+
<CustomTextFieldComponent
90162
id="pinterest"
91163
name="pinterest"
92-
placeholder="Pinterest"
164+
placeholder="Pinterest username"
93165
value={values.pinterest}
94166
onChange={handleChange}
95167
onBlur={handleBlur}
96-
helperText={touched.pinterest ? errors.pinterest : ""}
97-
error={touched.pinterest && Boolean(errors.pinterest)}
168+
touched={touched.pinterest}
169+
errors={errors.pinterest}
170+
startAdornment="https://pinterest.com/"
98171
/>
99172
</div>
100173
</Grid>

client/src/components/Admin/ui/Label.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ import {
1313
import { useState } from "react";
1414
import { tooltipHover } from "theme/palette";
1515

16-
const Label = ({ id, label, tooltipTitle, href }) => {
16+
const Label = ({ id, label, tooltipTitle, href, handle }) => {
1717
const [tooltipOpen, setTooltipOpen] = useState(false);
1818

1919
const handleToolTipToggle = () => {
2020
setTooltipOpen((prevOpen) => !prevOpen);
2121
};
2222

23+
const combinedLink = `${href}${handle}`;
24+
2325
return (
2426
<InputLabel htmlFor={id}>
2527
<Stack
@@ -50,14 +52,14 @@ const Label = ({ id, label, tooltipTitle, href }) => {
5052
)}
5153
</Stack>
5254

53-
{href && (
55+
{handle && (
5456
<Button
5557
variant="text"
5658
size="small"
5759
sx={{ textTransform: "none" }}
5860
rel="noopener"
5961
component={Link}
60-
href={href}
62+
href={combinedLink}
6163
startIcon={<LaunchIcon />}
6264
>
6365
Go To Link

0 commit comments

Comments
 (0)