Skip to content

Commit d962057

Browse files
committed
Added volunteer signup
1 parent 6f7d72e commit d962057

8 files changed

Lines changed: 28 additions & 11 deletions

File tree

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@churchapps/apphelper-markdown": "0.6.15",
1212
"@churchapps/apphelper-website": "0.6.17",
1313
"@churchapps/content-providers": "0.1.0",
14-
"@churchapps/helpers": "1.2.27",
14+
"@churchapps/helpers": "1.2.28",
1515
"@mui/icons-material": "^7.1.2",
1616
"@mui/material": "^7.1.2",
1717
"@react-google-maps/api": "^2.20.0",

src/helpers/Interfaces.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ export interface PlanInterface {
9797
providerId?: string;
9898
providerPlanId?: string;
9999
providerPlanName?: string;
100+
signupDeadlineHours?: number;
101+
showVolunteerNames?: boolean;
100102
}
101103

102104
export interface ProgramInterface {

src/serving/components/PlanEdit.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const PlanEdit = (props: Props) => {
4444
case "name": p.name = value; break;
4545
case "serviceDate": p.serviceDate = DateHelper.toDate(value); break;
4646
case "planTypeId": p.planTypeId = value; break;
47+
case "signupDeadlineHours": p.signupDeadlineHours = value ? parseInt(value) : undefined; break;
4748
case "copyMode":
4849
setCopyMode(value);
4950
return; // Don't update plan state
@@ -136,6 +137,12 @@ export const PlanEdit = (props: Props) => {
136137
<FormControlLabel control={<Checkbox checked={copyServiceOrder} onChange={(e) => setCopyServiceOrder(e.target.checked)} />} label={Locale.label("plans.planEdit.copyServiceOrder") || "Copy Order of Service"} />
137138
</>
138139
)}
140+
{plan.id && (
141+
<>
142+
<TextField fullWidth label="Signup Deadline (hours before service)" id="signupDeadlineHours" name="signupDeadlineHours" type="number" value={plan.signupDeadlineHours || ""} onChange={handleChange} helperText="Leave blank for no deadline" />
143+
<FormControlLabel control={<Checkbox checked={plan.showVolunteerNames !== false} onChange={(e) => setPlan({ ...plan, showVolunteerNames: e.target.checked })} />} label="Show volunteer names on signup page" />
144+
</>
145+
)}
139146
</InputBox>
140147
</>
141148
);

src/serving/components/PositionEdit.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from "react";
2-
import { FormControl, InputLabel, MenuItem, Select, TextField, type SelectChangeEvent } from "@mui/material";
2+
import { Checkbox, FormControl, FormControlLabel, InputLabel, MenuItem, Select, TextField, type SelectChangeEvent } from "@mui/material";
33
import { type GroupInterface, type PositionInterface } from "@churchapps/helpers";
44
import { ApiHelper, ErrorMessages, InputBox, Locale } from "@churchapps/apphelper";
55
import ReactSelect from "react-select";
@@ -34,6 +34,7 @@ export const PositionEdit = (props: Props) => {
3434
case "name": p.name = value; break;
3535
case "count": p.count = parseInt(value); break;
3636
case "groupId": p.groupId = value; break;
37+
case "description": p.description = value; break;
3738
}
3839
setPosition(p);
3940
};
@@ -131,6 +132,11 @@ export const PositionEdit = (props: Props) => {
131132
{getGroupOptions()}
132133
</Select>
133134
</FormControl>
135+
<FormControlLabel
136+
control={<Checkbox checked={position.allowSelfSignup || false} onChange={(e) => setPosition({ ...position, allowSelfSignup: e.target.checked })} />}
137+
label="Allow Self-Signup"
138+
/>
139+
<TextField fullWidth label="Description" id="description" name="description" type="text" multiline rows={2} value={position.description || ""} onChange={handleChange} helperText="Shown to volunteers when browsing signup opportunities" />
134140
</InputBox>
135141
</>
136142
);

src/serving/components/PositionList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { Badge, Table, TableBody, TableCell, TableHead, TableRow, Avatar, useTheme } from "@mui/material";
2+
import { Badge, Chip, Table, TableBody, TableCell, TableHead, TableRow, Avatar, useTheme } from "@mui/material";
33
import {
44
type AssignmentInterface,
55
type GroupInterface,
@@ -120,6 +120,7 @@ export const PositionList = (props: Props) => {
120120
{group && <span style={{ color: "#999", marginLeft: "8px" }}>({group.name})</span>}
121121
</span>
122122
)}
123+
{position.allowSelfSignup && <Chip label={assignments.length + "/" + position.count + " signup"} size="small" color="info" variant="outlined" sx={{ ml: 1, fontSize: "0.6875rem" }} />}
123124
</TableCell>
124125
<TableCell style={{ paddingTop: hasPeople ? 2 : 10, paddingBottom: hasPeople ? 2 : 10, verticalAlign: "top" }}>{getPeopleLinks(position)}</TableCell>
125126
</TableRow>

src/settings/components/AppEdit.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ export function AppEdit({ currentTab: currentTabFromProps, updatedFunction = ()
266266
<MenuItem value="directory">{Locale.label("settings.appEdit.memberDirectory")}</MenuItem>
267267
<MenuItem value="groups">{Locale.label("settings.appEdit.myGroups")}</MenuItem>
268268
<MenuItem value="lessons">{Locale.label("settings.appEdit.lessons")}</MenuItem>
269+
<MenuItem value="volunteer">Volunteer Opportunities</MenuItem>
269270
<MenuItem value="url">{Locale.label("settings.appEdit.externalUrl")}</MenuItem>
270271
<MenuItem value="page">{Locale.label("settings.appEdit.internalPage")}</MenuItem>
271272
</Select>

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,10 @@
275275
resolved "https://registry.npmjs.org/@churchapps/content-providers/-/content-providers-0.1.0.tgz"
276276
integrity sha512-RN05pODnkYZtoD1JdEfFe88y/uZU38G00k/jqX4WLlsOmHIWEk3dbjRWg3bNPn7yli5wAERUlLjDfxS5x5X0oA==
277277

278-
"@churchapps/helpers@^1.2.4", "@churchapps/helpers@^1.2.5", "@churchapps/helpers@1.2.27":
279-
version "1.2.27"
280-
resolved "https://registry.npmjs.org/@churchapps/helpers/-/helpers-1.2.27.tgz"
281-
integrity sha512-j3MVG/MpX+i9foZW8UIsmDdyJPne1yzKLJai48vw+UCIm7hNJiS7VsjRtTelOElEJKHU9PPKeG39q7XnlrCMGw==
278+
"@churchapps/helpers@^1.2.4", "@churchapps/helpers@^1.2.5", "@churchapps/helpers@1.2.28":
279+
version "1.2.28"
280+
resolved "https://registry.npmjs.org/@churchapps/helpers/-/helpers-1.2.28.tgz"
281+
integrity sha512-bNJGF9P8gMpx0i6DGBCeV6W8B1rCM2ps09ux0x7tooWoTmDdpNKPu5cHmEcpduOyahwtO1SsCxu8yZ8jHHN8pw==
282282
dependencies:
283283
dayjs "^1.11.18"
284284

0 commit comments

Comments
 (0)