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

Prompt user to save their work when they click the "Back to {locale} {locale-code} Sim List" link #341

Closed
liammulh opened this issue Dec 21, 2022 · 4 comments

Comments

@liammulh
Copy link
Member

In phetsims/qa#869, @solaolateju noted that it would be a good idea to prompt the user to save their work if they click the "Back to {Locale} {locale-code}" link. We already have plans to warn the user to save their work if they are about to navigate away from the page in #325, but as a temporary measure, I think it would be a good idea to prompt the user to save if they click the "Back to {Locale} {locale-code}" link.

We might also be able to prompt them if they click the "Select Locale" link in the nav if we check the URL to verify they are on the translation form page.

When we do #325, we'll want to remove these warnings because they will be redundant.

@liammulh liammulh changed the title Prompt user to save their work when they click the "Back to {locale} {locale-code}" link Prompt user to save their work when they click the "Back to {locale} {locale-code} Sim List" link Dec 21, 2022
liammulh added a commit that referenced this issue Dec 21, 2022
Add prompt to save when user clicks the "Back to {locale} {locale-code}
Sim List" button.

See #341.

Part of phetsims/qa#869.
@liammulh
Copy link
Member Author

We might also be able to prompt them if they click the "Select Locale" link in the nav if we check the URL to verify they are on the translation form page.

I'm not sure if this is worth the extra effort and complexity it would introduce. I think it could be done, but it would involve some hackery to make the links work. I think we'd need to add an onClick to the links and then programatically navigate the user if they click "OK" in the window.confirm. I will discuss this with JB.

@liammulh
Copy link
Member Author

Since fc6c136 covers the original request, I'm going to mark this as ready for review.

@liammulh
Copy link
Member Author

@jbphet and I discussed this. Since the window.confirm is basically "dumb" in the sense that it doesn't actually check whether the form is dirty with respect to the database or whether the form is dirty with respect to the saved translation in phetsims/babel, we don't want to include this. It will prompt the user even if they have just saved their translation. It might actually be confusing rather than helpful.

That being said, eventually we want to have a proper prompt that asks the user to save before they leave if the form is dirty with respect to the database and dirty with respect to the saved translation in phetsims/babel.

liammulh added a commit that referenced this issue Dec 24, 2022
liammulh added a commit that referenced this issue Feb 8, 2023
Add prompt to save when user clicks the "Back to {locale} {locale-code}
Sim List" button.

See #341.

Part of phetsims/qa#869.
liammulh added a commit that referenced this issue Feb 8, 2023
@liammulh
Copy link
Member Author

liammulh commented Mar 5, 2023

There is another issue for this #325.

@liammulh liammulh closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2023
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

No branches or pull requests

2 participants