From 459d27bc7064af80d238b41c3ed7924341fac54d Mon Sep 17 00:00:00 2001 From: Himali Malvawala <86650000+Himali-Malvawala@users.noreply.github.com> Date: Sat, 14 Dec 2024 23:01:39 +0530 Subject: [PATCH] add: print nametag field to groups (#297) * add: print nametag field to groups * update groupInterface from apphelper --- package-lock.json | 22 +++++++++--------- package.json | 2 +- public/locales/en.json | 4 +++- src/groups/components/GroupDetails.tsx | 5 +++-- src/groups/components/GroupDetailsEdit.tsx | 26 +++++++++++++++------- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index ad6839f..a240ec7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "hasInstallScript": true, "dependencies": { - "@churchapps/apphelper": "0.2.81", + "@churchapps/apphelper": "0.2.82", "@mui/icons-material": "^5.14.7", "@mui/material": "^5.14.7", "@types/react-cropper": "^1.3.2", @@ -1963,11 +1963,11 @@ "license": "MIT" }, "node_modules/@churchapps/apphelper": { - "version": "0.2.81", - "resolved": "https://registry.npmjs.org/@churchapps/apphelper/-/apphelper-0.2.81.tgz", - "integrity": "sha512-lfDj0tdJMKfk+h5UTE3d0B+sjH/CvaUTuDGjUTEd5oYq3BZd9laJhaq6U1MgSqRk6v3JZgY5hQfnYMJv6WdpYQ==", + "version": "0.2.82", + "resolved": "https://registry.npmjs.org/@churchapps/apphelper/-/apphelper-0.2.82.tgz", + "integrity": "sha512-vqH75vA4JmmLTdXFD89C8eDziFFDoB3DyNzUrYEmnWflDaw7f81bNTWGvU5ELrKEBOdVGZT3HZeD1ZAcVAAf8g==", "dependencies": { - "@churchapps/helpers": "^1.0.24", + "@churchapps/helpers": "^1.0.26", "@emotion/cache": "^11.11.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", @@ -2033,9 +2033,9 @@ } }, "node_modules/@churchapps/helpers": { - "version": "1.0.24", - "resolved": "https://registry.npmjs.org/@churchapps/helpers/-/helpers-1.0.24.tgz", - "integrity": "sha512-0AdhvfvnZZSxLAEV+uA+DXFDZy31DQDGsC7Z0GIpZpT6+kFflIcDpWsu+MNWWh0TF2PRzHljXYM7nZkb4EP3eA==", + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/@churchapps/helpers/-/helpers-1.0.26.tgz", + "integrity": "sha512-FNCVqGYH/8dZCjfDxwvhZcdKiWW3ps6sBbZ5OvhPe/AzQd7pI/+j0606RZJ1SXIrYq9gPJp1ldw8tJgVQD29Uw==", "dependencies": { "axios": "^1.5.0", "date-fns": "^2.30.0", @@ -5292,9 +5292,9 @@ } }, "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", diff --git a/package.json b/package.json index 3f5ff53..f770222 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { - "@churchapps/apphelper": "0.2.81", + "@churchapps/apphelper": "0.2.82", "@mui/icons-material": "^5.14.7", "@mui/material": "^5.14.7", "@types/react-cropper": "^1.3.2", diff --git a/public/locales/en.json b/public/locales/en.json index ebb9cd8..3a94552 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -261,7 +261,8 @@ "attTrack": "Track Attendance:", "cat": "Category", "groupDet": "Group Details", - "parPick": "Parent Pickup:" + "parPick": "Parent Pickup:", + "prinName": "Print Nametag:" }, "groupDetailsEdit": { "attTrack": "Track Attendance", @@ -274,6 +275,7 @@ "groupName": "Group Name", "groupNameMsg": "Please enter a group name.", "parPick": "Parent Pickup", + "prinName": "Print Nametag", "selImg": "Select Photo" }, "groupMembers": { diff --git a/src/groups/components/GroupDetails.tsx b/src/groups/components/GroupDetails.tsx index f7c03af..761714c 100644 --- a/src/groups/components/GroupDetails.tsx +++ b/src/groups/components/GroupDetails.tsx @@ -17,14 +17,15 @@ export const GroupDetails: React.FC = (props) => { const getRows = () => { if (!props.group) return else return (<> - + {isStandard && {props.group.categoryName}} {props.group.name} {isStandard && <> - + {(props.group.trackAttendance?.toString().replace("false", Locale.label("common.no")).replace("true", Locale.label("common.yes")) || "")} {(props.group.parentPickup?.toString().replace("false", Locale.label("common.no")).replace("true", Locale.label("common.yes")) || "")} + {(props.group.printNametag?.toString().replace("false", Locale.label("common.no")).replace("true", Locale.label("common.yes")) || "")} } diff --git a/src/groups/components/GroupDetailsEdit.tsx b/src/groups/components/GroupDetailsEdit.tsx index 74013da..43549c5 100644 --- a/src/groups/components/GroupDetailsEdit.tsx +++ b/src/groups/components/GroupDetailsEdit.tsx @@ -2,7 +2,7 @@ import React from "react"; import { ServiceTimesEdit } from "."; import { ApiHelper, InputBox, ErrorMessages, Locale } from "@churchapps/apphelper"; import { Navigate } from "react-router-dom"; -import { Button, FormControl, Grid, InputLabel, MenuItem, Select, SelectChangeEvent, TextField } from "@mui/material"; +import { Button, FormControl, Grid, InputLabel, MenuItem, Select, SelectChangeEvent, Stack, TextField } from "@mui/material"; import { useMountedState, GalleryModal, GroupInterface } from "@churchapps/apphelper"; import { MarkdownEditor } from "@churchapps/apphelper"; @@ -33,6 +33,7 @@ export const GroupDetailsEdit: React.FC = (props) => { case "name": g.name = e.target.value; break; case "trackAttendance": g.trackAttendance = e.target.value === "true"; break; case "parentPickup": g.parentPickup = e.target.value === "true"; break; + case "printNametag": g.printNametag = e.target.value === "true"; break; } setGroup(g); }; @@ -109,13 +110,22 @@ export const GroupDetailsEdit: React.FC = (props) => { - - {Locale.label("groups.groupDetailsEdit.parPick")} - - + + + {Locale.label("groups.groupDetailsEdit.parPick")} + + + + {Locale.label("groups.groupDetailsEdit.prinName")} + + +