Skip to content

Nit: Add Closing confirmation to Declare Absences#139

Closed
RahulTandon1 wants to merge 1 commit intomainfrom
rahul/confirm-unsaved-changes-declare-absence
Closed

Nit: Add Closing confirmation to Declare Absences#139
RahulTandon1 wants to merge 1 commit intomainfrom
rahul/confirm-unsaved-changes-declare-absence

Conversation

@RahulTandon1
Copy link
Contributor

@RahulTandon1 RahulTandon1 commented Apr 24, 2025

Notion Ticket

Link to NITS page

Summary & Review Focus

I'm requesting a cursory review to first see whether the expected functionality is being met.
The code is not ideal right now and will need some cleaning up.

Attempts to address:

Add Are you sure you want to exit modal when declaring absence has some filled in details

under Declare/Edit/Absence Details Modal

Testing Instructions

Checklist

  • PR title is descriptive and in imperative tense
  • Commit messages are descriptive, atomic, and follow best practices
  • Linter(s) have been run
  • Requested reviews from the PL and relevant team members

@vercel
Copy link

vercel bot commented Apr 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sistema ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 4:49pm

Copy link
Member

@ChinemeremChigbo ChinemeremChigbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm good first stab. A couple things:

  • The modal’s style should match other modals — including layout (centered), button colors, text sizes, and spacing.
image
  • Should be closer to:
image
  • Or can be styled like this existing modal:
image
  • The modal should appear when exiting both the absence declaration form and the absence edit form.

  • It should only appear if any fields have been modified. To implement this, you might compare the modal's state at the time of exit with its state when it was first opened.

    • If there's a difference, show the confirmation modal.
    • If the user changes a field and then reverts it (so the final state matches the initial one), no confirmation modal should be shown.
  • For reference, check how the System Options modal works it correctly implements this logic.
    To view it:

    • Go to /dashboard while logged in as an admin.
    • You can seed yourself as an admin in seed.ts (third easiest), remove the admin check in dashboard.tsx (second easiest), or just sign in using the Sistema email (already seeded as an admin) (easiest).

Let me know if you need help with any of this or feel free to work on a different ticket if this one is too convoluted.

@ChinemeremChigbo ChinemeremChigbo marked this pull request as draft April 24, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants