From fbf9ac1338640ace16418bb4fade8943b149407a Mon Sep 17 00:00:00 2001 From: shivamg9 Date: Wed, 19 Jun 2024 12:32:21 +0530 Subject: [PATCH 1/8] G2P-2522: Format application submitted date to DD-MM-YYY --- src/app/[locale]/submission/page.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/[locale]/submission/page.tsx b/src/app/[locale]/submission/page.tsx index af308c7..759af26 100644 --- a/src/app/[locale]/submission/page.tsx +++ b/src/app/[locale]/submission/page.tsx @@ -64,6 +64,16 @@ export default function Submitted() { const hideToastSuccessMsg = () => { setIsToastVisible(false); }; + // Function to format the date as DD-MM-YYYY + const formatDate = (dateString: string) => { + if (!dateString) return ""; + const date = new Date(dateString); + const month = ("0" + (date.getMonth() + 1)).slice(-2); + const day = ("0" + date.getDate()).slice(-2); + const year = date.getFullYear(); + return `${day}-${month}-${year}`; // Format as DD-MM-YYYY + }; + return (
@@ -203,7 +213,9 @@ export default function Submitted() {

{t("Application ID")}

{applicationDetails.application_id}

{t("Submitted On")}

-

{applicationDetails.date_applied?.slice(0, 10)}

+

+ {formatDate(applicationDetails.date_applied?.slice(0, 10))} +


From 8c6f3b4b4f207f5c73fbfc5f5a0aea3d12cfff60 Mon Sep 17 00:00:00 2001 From: shivamg9 Date: Wed, 19 Jun 2024 16:56:24 +0530 Subject: [PATCH 2/8] G2P-2379: Updated z-index for dropdowns to improve visibility --- src/components/navigation/LanguageDropdown.tsx | 5 ++++- src/components/navigation/ProfileDropdown.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/navigation/LanguageDropdown.tsx b/src/components/navigation/LanguageDropdown.tsx index 9824e62..c65ef1a 100644 --- a/src/components/navigation/LanguageDropdown.tsx +++ b/src/components/navigation/LanguageDropdown.tsx @@ -50,7 +50,10 @@ export default function LanguageDropDown() { leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - +
{supportedLocales.map((locale) => ( diff --git a/src/components/navigation/ProfileDropdown.tsx b/src/components/navigation/ProfileDropdown.tsx index 7548056..6488fd3 100644 --- a/src/components/navigation/ProfileDropdown.tsx +++ b/src/components/navigation/ProfileDropdown.tsx @@ -45,7 +45,10 @@ export default function ProfileDropDown() { leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - +
{({active}) => ( From 6b2944bee4a906aa2f7b64ca0a66339f8b462ea8 Mon Sep 17 00:00:00 2001 From: shivamg9 Date: Wed, 19 Jun 2024 18:02:58 +0530 Subject: [PATCH 3/8] G2P-2386: Added New tag to recently added programs --- messages/en.json | 1 + messages/es.json | 1 + messages/fr.json | 1 + messages/tl.json | 1 + src/app/[locale]/programs/page.tsx | 17 +++++++++++++++++ src/types/index.ts | 1 + 6 files changed, 22 insertions(+) diff --git a/messages/en.json b/messages/en.json index 1ddf69c..cde2c57 100644 --- a/messages/en.json +++ b/messages/en.json @@ -37,6 +37,7 @@ "Benefits": "Benefits", "Tap to view your Benefits": "Tap to view your Benefits", "View all": "View All", + "NEW": "NEW", "This is the about page": "This is the about page", diff --git a/messages/es.json b/messages/es.json index 0324a3e..004fb98 100644 --- a/messages/es.json +++ b/messages/es.json @@ -37,6 +37,7 @@ "Benefits": "Beneficios", "Tap to view your Benefits": "Toque para ver sus beneficios", "View all": "Ver todo", + "NEW": "NUEVO", "This is the about page": "Esta es la página Acerca de", diff --git a/messages/fr.json b/messages/fr.json index 90cf59d..036c476 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -37,6 +37,7 @@ "Benefits": "Avantages", "Tap to view your Benefits": "Appuyez pour voir vos avantages", "View all": "Voir tout", + "NEW": "NOUVEAU", "This is the about page": "Ceci est la page À propos", diff --git a/messages/tl.json b/messages/tl.json index 33ba0e7..8e8ffd3 100644 --- a/messages/tl.json +++ b/messages/tl.json @@ -37,6 +37,7 @@ "Benefits": "Mga Benepisyo", "Tap to view your Benefits": "Pindutin para tingnan ang iyong mga benepisyo", "View all": "Tingnan lahat", + "NEW": "BAGO", "This is the about page": "Ito ang tungkol sa pahina", diff --git a/src/app/[locale]/programs/page.tsx b/src/app/[locale]/programs/page.tsx index 3081d86..edac4d2 100644 --- a/src/app/[locale]/programs/page.tsx +++ b/src/app/[locale]/programs/page.tsx @@ -361,6 +361,15 @@ export default function ProgrmPage({ } }; + // Function to check if a program is new (created within the last 21 days) + const isNewProgram = (createDate: string): boolean => { + const today = new Date(); + const twentyOneDaysAgo = new Date(); + twentyOneDaysAgo.setDate(today.getDate() - 21); + const programCreateDate = new Date(createDate); + return programCreateDate > twentyOneDaysAgo; + }; + return (
showTooltip(e, program.name)} onMouseLeave={() => hideTooltip()} // Hide tooltip on mouse leave > + {isNewProgram(program.create_date) && ( + + {t("NEW")} + + )} {program.name} diff --git a/src/types/index.ts b/src/types/index.ts index e126d03..25b5d95 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -11,6 +11,7 @@ export interface Program { is_portal_form_mapped: string; is_multiple_form_submission: number; last_application_status: number; + create_date: string; } export interface ProgramDetails { program_name: string; From d0d670bf600c3972ad246375e3dbc8551d242d9f Mon Sep 17 00:00:00 2001 From: shivamg9 Date: Thu, 20 Jun 2024 12:54:08 +0530 Subject: [PATCH 4/8] G2P-2388: Implement program details popup --- src/app/[locale]/programs/page.tsx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/app/[locale]/programs/page.tsx b/src/app/[locale]/programs/page.tsx index edac4d2..9a8b8a4 100644 --- a/src/app/[locale]/programs/page.tsx +++ b/src/app/[locale]/programs/page.tsx @@ -69,6 +69,7 @@ export default function ProgrmPage({ const [sortOrder, setSortOrder] = useState<"asc" | "desc">("asc"); const [sortedColumn, setSortedColumn] = useState(null); + const [selectedProgram, setSelectedProgram] = useState(null); useEffect(() => { if (searchQuery) { @@ -370,6 +371,14 @@ export default function ProgrmPage({ return programCreateDate > twentyOneDaysAgo; }; + const openProgramDetails = (program: Program) => { + setSelectedProgram(program); + }; + + const closeProgramDetails = () => { + setSelectedProgram(null); + }; + return (
openProgramDetails(program)} // Open details on click data-tooltip={program.name} // Add data-tooltip attribute onMouseEnter={(e) => showTooltip(e, program.name)} onMouseLeave={() => hideTooltip()} // Hide tooltip on mouse leave @@ -673,6 +684,23 @@ export default function ProgrmPage({ {/*
*/} + {selectedProgram && ( +
+
e.stopPropagation()}> +

{selectedProgram.name}

+

{selectedProgram.description}

+ +
+
+ )}
); } From b71525880513b91217dc1bc2adab07f808e3bd32 Mon Sep 17 00:00:00 2001 From: shivamg9 Date: Thu, 20 Jun 2024 17:56:15 +0530 Subject: [PATCH 5/8] G2P-2388: Made program details popup with fixed size and scroll --- messages/en.json | 2 +- messages/es.json | 2 +- messages/fr.json | 2 +- messages/tl.json | 2 +- src/app/[locale]/programs/page.tsx | 11 ++++++++--- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/messages/en.json b/messages/en.json index cde2c57..0806fb0 100644 --- a/messages/en.json +++ b/messages/en.json @@ -119,7 +119,7 @@ "No applications yet please tap on the below link to view all programs": "No applications yet, please tap on the below link to view all programs", "No benefits yet please tap on the below link to view all programs": "No benefits yet, please tap on the below link to view all programs", "You havent enrolled into any programs yet please tap on the below link to view all programs": "You haven’t enrolled into any programs yet, please tap on the below link to view all programs", - "No Applications No Benefits": "You haven’t applied to any programs yet; please tap on the below link to view all programs.", + "No Applications No Benefits": "You haven’t applied to any programs yet, please tap on the below link to view all programs.", "Applications but No Benefits": "No approved entitlement to show, please visit my application page.", "View All Program": "View All Program", "View My Applications": "View Applications", diff --git a/messages/es.json b/messages/es.json index 004fb98..ebc4700 100644 --- a/messages/es.json +++ b/messages/es.json @@ -119,7 +119,7 @@ "No applications yet please tap on the below link to view all programs": "Todavía no hay solicitudes, por favor toque el enlace de abajo para ver todos los programas", "No benefits yet please tap on the below link to view all programs": "Todavía no hay beneficios, por favor toque el enlace de abajo para ver todos los programas", "You havent enrolled into any programs yet please tap on the below link to view all programs": "Todavía no se ha inscrito en ningún programa, por favor toque el enlace de abajo para ver todos los programas", - "No Applications No Benefits": "Aún no has aplicado a ningún programa; por favor, toca el enlace de abajo para ver todos los programas.", + "No Applications No Benefits": "Aún no has aplicado a ningún programa, por favor, toca el enlace de abajo para ver todos los programas.", "Applications but No Benefits": "No hay ningún derecho aprobado para mostrar, por favor visita mi página de aplicaciones.", "View All Program": "Ver Todos los Programas", "View My Applications": "Ver Aplicaciones", diff --git a/messages/fr.json b/messages/fr.json index 036c476..9a726f9 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -119,7 +119,7 @@ "No applications yet please tap on the below link to view all programs": "Aucune demande pour le moment, veuillez appuyer sur le lien ci-dessous pour voir tous les programmes", "No benefits yet please tap on the below link to view all programs": "Aucun avantage pour le moment, veuillez appuyer sur le lien ci-dessous pour voir tous les programmes", "You havent enrolled into any programs yet please tap on the below link to view all programs": "Vous n'êtes inscrit à aucun programme pour le moment, veuillez appuyer sur le lien ci-dessous pour voir tous les programmes", - "No Applications No Benefits": "Vous n'avez encore postulé à aucun programme ; veuillez cliquer sur le lien ci-dessous pour voir tous les programmes.", + "No Applications No Benefits": "Vous n'avez encore postulé à aucun programme, veuillez cliquer sur le lien ci-dessous pour voir tous les programmes.", "Applications but No Benefits": "Aucun droit approuvé à afficher, veuillez visiter ma page de candidature.", "View All Program": "Voir Tous les Programmes", "View My Applications": "Voir Candidatures", diff --git a/messages/tl.json b/messages/tl.json index 8e8ffd3..ef2625f 100644 --- a/messages/tl.json +++ b/messages/tl.json @@ -119,7 +119,7 @@ "No applications yet please tap on the below link to view all programs": "Wala pang mga aplikasyon, mangyaring pindutin ang link sa ibaba upang tingnan lahat ng mga programa", "No benefits yet please tap on the below link to view all programs": "Wala pang mga benepisyo, mangyaring pindutin ang link sa ibaba upang tingnan lahat ng mga programa", "You havent enrolled into any programs yet please tap on the below link to view all programs": "Hindi ka pa nakapag-enroll sa anumang programa, mangyaring pindutin ang link sa ibaba upang tingnan lahat ng mga programa", - "No Applications No Benefits": "Wala ka pang inaaplayan na mga programa; pakitap ang link sa ibaba upang makita ang lahat ng mga programa.", + "No Applications No Benefits": "Wala ka pang inaaplayan na mga programa, pakitap ang link sa ibaba upang makita ang lahat ng mga programa.", "Applications but No Benefits": "Walang naaprubahang benepisyo na ipapakita, pakibisita ang aking pahina ng aplikasyon.", "View All Program": "Tingnan Lahat ng Programa", "View My Applications": "Tingnan ang Aking Mga Aplikasyon", diff --git a/src/app/[locale]/programs/page.tsx b/src/app/[locale]/programs/page.tsx index 9a8b8a4..42e17ad 100644 --- a/src/app/[locale]/programs/page.tsx +++ b/src/app/[locale]/programs/page.tsx @@ -689,14 +689,19 @@ export default function ProgrmPage({ className="fixed top-0 left-0 w-full h-full flex items-center justify-center bg-black bg-opacity-50" onClick={closeProgramDetails} > -
e.stopPropagation()}> -

{selectedProgram.name}

+
e.stopPropagation()} + style={{overflowY: "auto"}} // Add vertical scroll if content overflows + > +

{selectedProgram.name}

+
{/* Horizontal line */}

{selectedProgram.description}

From bc1750e927b551f5bcbb4092c8a407bd0ab0bc33 Mon Sep 17 00:00:00 2001 From: shivamg9 Date: Fri, 21 Jun 2024 18:48:11 +0530 Subject: [PATCH 6/8] G2P-2402: Removed extra space from submission page --- src/app/[locale]/programs/page.tsx | 21 +++++---- src/app/[locale]/submission/page.tsx | 64 ++++++++++++++-------------- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/src/app/[locale]/programs/page.tsx b/src/app/[locale]/programs/page.tsx index 42e17ad..c24574b 100644 --- a/src/app/[locale]/programs/page.tsx +++ b/src/app/[locale]/programs/page.tsx @@ -258,15 +258,20 @@ export default function ProgrmPage({ > {t("Reapply")} + ) : showReapplyButton ? ( + ) : ( - showReapplyButton && ( - - ) + ) ) : ( ))}