Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 src/common/i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@
"DATA_PRIVACY_CONTENT": "The Volunteer agrees to comply with all applicable data protection laws and regulations, including but not limited to the General Data Protection Regulation (GDPR) or any other local data protection laws. The Volunteer agrees to: <1/> - Handle all personal data in accordance with the Organization's data protection policies. <1/> - Protect the integrity and confidentiality of any personal data accessed during volunteer activities. <1/> - Immediately report any data breaches or incidents of unauthorized access to the Organization.",
"DEFAULT DASHBOARD VIEW": "Default Dashboard View",
"DELETE_ACCOUNT": "Delete Account",
"DELETE": "Delete",
"DELETING": "Deleting...",
"DENY": "Deny",
"DENY_SUCCESS_MESSAGE": "You denied this request.",
"DESCRIPTION": "Description",
"DESCRIPTION_HELP_TEXT": "Please give a detailed description of the request",
"DESIGN_CREATIVE_LEAD": "Design Creative Lead",
"COMMENTS": "Comments",
"DETAILS": "Details",
"SPECIFICS": "Specifics",
"DEVELOPER_ADVOCATE_AI_ML_DEV_MANAGER": "Developer Advocate AI/ML Dev Manager",
Expand All @@ -139,6 +141,7 @@
"DONORS": "DONORS",
"DRIVEN_BY_BELIEF_HUMANITY": "Driven By Belief Humanity",
"Design and Creative Lead": "Design and Creative Lead",
"CHANGE_VOLUNTEER": "Change Volunteer",
"Developer Advocate/AI/ML Dev Manager": "Developer Advocate/AI/ML Dev Manager",
"Director": "Director",
"Director & Chief Financial Officer": "Director & Chief Financial Officer",
Expand Down Expand Up @@ -468,6 +471,7 @@
"REQUEST_CATEGORY": "Request Category",
"REQUEST_DETAILS": "Request Details",
"REQUEST_FOR_HELP": "Request For Help",
"REASON": "Reason",
"REQUEST_TYPE": "Request Type",
"REQUEST_TYPE_HELP_TEXT": "Indicate how you'd like help delivered: \"Remote\" for virtual support or \"In Person\" for onsite assistance.",
"REQUEST_VOLUNTEERS": "Request Volunteers",
Expand Down
4 changes: 4 additions & 0 deletions src/common/i18n/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@
"DATA_PRIVACY_CONTENT": "स्वयंसेवक सभी लागू डेटा सुरक्षा कानूनों और विनियमों का पालन करने के लिए सहमत होता है, जिनमें जनरल डेटा प्रोटेक्शन रेगुलेशन (GDPR) और अन्य स्थानीय डेटा संरक्षण कानून शामिल हैं। स्वयंसेवक सहमत होता है: <1/> - संगठन की डेटा सुरक्षा नीतियों के अनुसार सभी व्यक्तिगत डेटा को संभालना। <1/> - स्वयंसेवक गतिविधियों के दौरान प्राप्त व्यक्तिगत डेटा की अखंडता और गोपनीयता की रक्षा करना। <1/> - किसी भी डेटा उल्लंघन या अनधिकृत पहुँच की घटनाओं को तुरंत संगठन को सूचित करना।",
"DEFAULT DASHBOARD VIEW": "डिफ़ॉल्ट डैशबोर्ड दृश्य",
"DELETE_ACCOUNT": "Delete Account",
"DELETE": "हटाएँ",
"DELETING": "Deleting...",
"DENY": "अस्वीकार करें",
"DENY_SUCCESS_MESSAGE": "आपने इस अनुरोध को अस्वीकार कर दिया।",
"DESCRIPTION": "विवरण",
"DESCRIPTION_HELP_TEXT": "कृपया अनुरोध का विस्तृत विवरण दें।",
"DESIGN_CREATIVE_LEAD": "Design Creative Lead",
"COMMENTS": "टिप्पणियाँ",
"DETAILS": "जानकारी",
"SPECIFICS": "विशिष्टताएं",
"DEVELOPER_ADVOCATE_AI_ML_DEV_MANAGER": "Developer Advocate AI/ML Dev Manager",
Expand All @@ -128,6 +130,7 @@
"Lead AI/ML Developer/Engineer": "Lead AI/ML Developer/Engineer",
"DIRECTOR_SECRETARY": "Director Secretary",
"DISPUTE_RESOLUTION": "विवाद समाधान",
"CHANGE_VOLUNTEER": "स्वयंसेवक बदलें",
"DISPUTE_RESOLUTION_CONTENT": "इस समझौते से संबंधित किसी भी विवाद की स्थिति में, दोनों पक्ष इसे अच्छे विश्वास के साथ बातचीत द्वारा सुलझाने का प्रयास करेंगे। यदि समाधान नहीं निकलता है, तो कानूनी कार्रवाई से पहले आपसी सहमति से मध्यस्थता या पंचाट का सहारा लिया जाएगा।",
"DONATE": "दान करें",
"DONATE_MONEY": "संयम फॉर ऑल एक गैर-लाभकारी संगठन है, जिसकी 501(c)(3) स्थिति है। इस संगठन को दिए गए सभी दान कर-कटौती योग्य हैं। आप पैसे दान करने के लिए इस <1 className=\"text-blue-500 underline\" target=\"_blank\" to=\"https://www.paypal.com/donate/?hosted_button_id=4KLWNM5JWKJ4S\">PayPal लिंक</1> का उपयोग कर सकते हैं।",
Expand Down Expand Up @@ -465,6 +468,7 @@
"REQUEST_CATEGORY": "अनुरोध श्रेणी",
"REQUEST_DETAILS": "अनुरोध विवरण",
"REQUEST_FOR_HELP": "Request For Help",
"REASON": "कारण",
"REQUEST_TYPE": "अनुरोध प्रकार",
"REQUEST_TYPE_HELP_TEXT": "Indicate how you'd like help delivered: \"Remote\" for virtual support or \"In Person\" for onsite assistance.",
"REQUEST_VOLUNTEERS": "स्वयंसेवकों का अनुरोध करें",
Expand Down
42 changes: 33 additions & 9 deletions src/pages/RequestDetails/RequestDescription.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,35 @@ const RequestDescription = ({ requestData, setIsEditing }) => {
const categoriesBundle = i18n.hasResourceBundle?.(lang, "categories")
? i18n.getResourceBundle(lang, "categories")
: i18n.getResourceBundle("en", "categories");
const enumsBundle = i18n.hasResourceBundle?.(lang, "enums")
? i18n.getResourceBundle(lang, "enums")
: i18n.getResourceBundle("en", "enums");

const categoryLabel =
findCategoryLabel(
categoriesBundle?.REQUEST_CATEGORIES,
requestData?.category,
) || requestData?.category;

const statusKey = String(requestData?.status || "").toUpperCase();
const priorityKey = String(requestData?.priority || "").toUpperCase();
const statusLabel =
enumsBundle?.requestStatus?.[statusKey] || t(statusKey) || statusKey;
const priorityLabel =
enumsBundle?.requestPriority?.[priorityKey] ||
t(priorityKey) ||
priorityKey;

const tabTitle = (label) => {
const tabMap = {
Comments: t("COMMENTS") || t("Comments") || "Comments",
Volunteers: t("VOLUNTEERS") || t("Volunteers") || "Volunteers",
Details: t("DETAILS") || t("Details") || "Details",
};

return tabMap[label] || label;
};

const attributes = [
{
context: formattedDate,
Expand Down Expand Up @@ -95,13 +117,13 @@ const RequestDescription = ({ requestData, setIsEditing }) => {

<li>
<span className="bg-green-200 text-xs px-3 py-1 rounded-full">
{t(requestData.status)}
{statusLabel}
</span>
</li>

<li className="flex items-center">
<PiWarningDiamondFill className="mr-1 text-red-500" />
<span className="font-bold">{t(requestData.priority)}</span>
<span className="font-bold">{priorityLabel}</span>
</li>

{/* Buttons */}
Expand All @@ -110,14 +132,16 @@ const RequestDescription = ({ requestData, setIsEditing }) => {
className="bg-blue-500 text-white text-sm px-6 py-2 rounded-lg hover:bg-blue-600"
onClick={() => console.log("Change Volunteer clicked")}
>
{t("Change Volunteer")}
{t("CHANGE_VOLUNTEER") ||
t("Change Volunteer") ||
"Change Volunteer"}
</button>

<button
className="bg-red-500 text-white text-sm px-6 py-2 rounded-lg hover:bg-red-600"
onClick={() => setDeleteDialogOpen(true)}
>
{t("Delete")}
{t("DELETE") || t("Delete") || "Delete"}
</button>

<button
Expand All @@ -139,22 +163,22 @@ const RequestDescription = ({ requestData, setIsEditing }) => {
open={deleteDialogOpen}
onClose={() => setDeleteDialogOpen(false)}
>
<DialogTitle>{t("Delete")}</DialogTitle>
<DialogTitle>{t("DELETE") || t("Delete") || "Delete"}</DialogTitle>

<DialogContent>
<Typography>{t("Reason")}</Typography>
<Typography>{t("REASON") || t("Reason") || "Reason"}</Typography>

<textarea
value={deleteReason}
onChange={(e) => setDeleteReason(e.target.value)}
className="border p-2 w-full mt-3 rounded-lg min-h-[100px]"
placeholder={t("Reason")}
placeholder={t("REASON") || t("Reason") || "Reason"}
/>
</DialogContent>

<DialogActions>
<Button onClick={() => setDeleteDialogOpen(false)} variant="outlined">
{t("Cancel")}
{t("CANCEL") || t("Cancel") || "Cancel"}
</Button>

<Button
Expand All @@ -163,7 +187,7 @@ const RequestDescription = ({ requestData, setIsEditing }) => {
variant="contained"
disabled={!deleteReason.trim()}
>
{t("Delete")}
{t("DELETE") || t("Delete") || "Delete"}
</Button>
</DialogActions>
</Dialog>
Expand Down
8 changes: 7 additions & 1 deletion src/pages/RequestDetails/RequestDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ const RequestDetails = () => {
<div className="flex w-full bg-gray-200 gap-px">
{["Comments", "Volunteers", "Details"].map((newTab) => {
const isActive = newTab === tab;
const tabLabel =
newTab === "Comments"
? t("COMMENTS") || t("Comments") || "Comments"
: newTab === "Volunteers"
? t("Volunteers") || t("VOLUNTEERS") || "Volunteers"
: t("DETAILS") || t("Details") || "Details";

return (
<button
Expand All @@ -199,7 +205,7 @@ const RequestDetails = () => {
: "bg-gray-300 text-gray-800 border-b-2 border-transparent hover:bg-gray-200",
].join(" ")}
>
{t(newTab)}
{tabLabel}
</button>
);
})}
Expand Down
Loading