Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'Discard Changes' Modal for Form Editing Confirmation #7255

Closed
Keshav-0907 opened this issue Feb 23, 2024 · 19 comments
Closed

Implement 'Discard Changes' Modal for Form Editing Confirmation #7255

Keshav-0907 opened this issue Feb 23, 2024 · 19 comments
Labels
good first issue Good for newcomers

Comments

@Keshav-0907
Copy link
Contributor

Keshav-0907 commented Feb 23, 2024

Is your feature request related to a problem? Please describe.
Currently, when a user is updating a form with different fields and accidentally navigates away without saving, all updated data is lost.

Describe the solution you'd like
To mitigate the risk of unintentional data loss, we can implement a 'Discard Changes' modal that would serve as a confirmation step before discarding any modifications.

Additional context
( Video : No confirmation model when form is updated and user navigates away )

Screen.Recording.2024-02-23.at.2.03.56.PM.mov

Proposed Solution
Refactor the HTML Form used here to use the higher order <Form> component with draft support

@github-project-automation github-project-automation bot moved this to Triage in Care Feb 23, 2024
@rithviknishad rithviknishad moved this from Triage to Up Next in Care Feb 23, 2024
@Ashesh3
Copy link
Member

Ashesh3 commented Feb 23, 2024

We already have support for auto saving drafts for our <Form component, I think converting this basic html form to our higher order <Form component should resolve this issue alongside.

cc: @rithviknishad

@rithviknishad
Copy link
Member

@Ashesh3 I think @Keshav-0907 meant more like a "Confirm Navigate Away" popup to prevent accidental navigations. Yes, we can always enable form restorations too on top of this.

image

@Ashesh3
Copy link
Member

Ashesh3 commented Feb 23, 2024

@Ashesh3 I think @Keshav-0907 meant more like a "Confirm Navigate Away" popup to prevent accidental navigations. Yes, we can always enable form restorations too on top of this.

image

Yep, I got that, but since we don't have it anywhere else, even for the more imp and longer forms like consultation, patient etc. Instead of adding this popup for all existing long forms, I feel we should just upgrade this form to support drafts, that serves the same purpose to get users back their data in case they navigate away unintentionally. Just my thoughts, open to discussions!

This drafts solution also aligns with the required solution mentioned in the issue:

all updated data is lost. .... To mitigate the risk of unintentional data loss, ....

@rithviknishad
Copy link
Member

I agree with @Ashesh3

@nihal467 / @gigincg / @aparnacoronasafe

@Keshav-0907
Copy link
Contributor Author

@Ashesh3 I think @Keshav-0907 meant more like a "Confirm Navigate Away" popup to prevent accidental navigations. Yes, we can always enable form restorations too on top of this.

image

@rithviknishad Sir, I actually meant to address the unintentional data loss concern by adding a 'Discard Changes' confirmation modal. However, following @Ashesh3's suggestion, I think upgrading the form for draft support can be a better approach.

I want to work on this issue. Can you please assign this to me?

@Ashesh3
Copy link
Member

Ashesh3 commented Feb 23, 2024

@Ashesh3 I think @Keshav-0907 meant more like a "Confirm Navigate Away" popup to prevent accidental navigations. Yes, we can always enable form restorations too on top of this.
image

@rithviknishad Sir, I actually meant to address the unintentional data loss concern by adding a 'Discard Changes' confirmation modal. However, following @Ashesh3's suggestion, I think upgrading the form for draft support can be a better approach.

I want to work on this issue. Can you please assign this to me?

Hey, remember that our higher order <Form component already has drafts support, you just need to convert the shifting form to use that higher order <Form component.
basically to convert basic html

to our custom <Form implementation which we already have.

Copy link

github-actions bot commented Mar 9, 2024

Hi, @gigincg, @nihal467, @khavinshankar, @mathew-alex, @aparnacoronasafe, This issue has been automatically marked as stale because it has not had any recent activity.

@github-actions github-actions bot added the stale label Mar 9, 2024
@AshrafMd-1
Copy link
Contributor

@Keshav-0907 are you still working on this issue?
If not I would like to work on this

@github-actions github-actions bot removed the stale label Mar 26, 2024
@AshrafMd-1
Copy link
Contributor

@rithviknishad it seems like @Keshav-0907 is inactive
can you assign me this issue

Copy link

Hi, @gigincg, @nihal467, @khavinshankar, @mathew-alex, @aparnacoronasafe, This issue has been automatically marked as stale because it has not had any recent activity.

@github-actions github-actions bot added the stale label Apr 25, 2024
@AshrafMd-1
Copy link
Contributor

I am actually slightly busy in doing other issues [p2] so as of now I will unassign myself

@AshrafMd-1 AshrafMd-1 removed their assignment May 18, 2024
@gigincg gigincg added good first issue Good for newcomers and removed stale labels Aug 5, 2024
@gigincg gigincg moved this from Up Next to Wishlist in Care Aug 5, 2024
@gigincg
Copy link
Member

gigincg commented Aug 5, 2024

@Keshav-0907 Are you interested in taking this up?

@Keshav-0907
Copy link
Contributor Author

@gigincg Yeah sure, I will work on it

@gigincg
Copy link
Member

gigincg commented Aug 5, 2024

@Keshav-0907 Assigned the issue to you. Do create a draft PR when you start working on it

For any help, feel free to reach out here. Also join in on our slack community at https://slack.ohc.network

@JavidSumra
Copy link
Contributor

JavidSumra commented Oct 19, 2024

@gigincg Sir Does this issue still persist? If no one is working on it, may I take it up?

@Utkarsh-Anandani
Copy link

Hello @gigincg @rithviknishad can i work on this issue, I've understood the doings.

@rajku-dev
Copy link
Contributor

Hi @rithviknishad, can i take up this issue.
Please assign me so that i raise a PR soon.

@Utkarsh-Anandani
Copy link

I'm working on the issue @rajku-dev

@rajku-dev
Copy link
Contributor

I'm working on the issue @rajku-dev

I noticed an inactivity but that's alright go ahead.

Utkarsh-Anandani added a commit to Utkarsh-Anandani/care_fe that referenced this issue Dec 29, 2024
Utkarsh-Anandani added a commit to Utkarsh-Anandani/care_fe that referenced this issue Dec 29, 2024
…ng-Higher-Order-Form-in-Update-Shifting-Form
@rithviknishad rithviknishad closed this as not planned Won't fix, can't repro, duplicate, stale Dec 30, 2024
@github-project-automation github-project-automation bot moved this from Wishlist to Done in Care Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

8 participants