Skip to content

Add Enhancement(promptService): add prompt if user has unsaved change…#163

Merged
NiallJoeMaher merged 3 commits into
codu-code:developfrom
xiaoniuniu89:dancallaghan/user_prompt_unsaved_changes_issue117
Feb 26, 2023
Merged

Add Enhancement(promptService): add prompt if user has unsaved change…#163
NiallJoeMaher merged 3 commits into
codu-code:developfrom
xiaoniuniu89:dancallaghan/user_prompt_unsaved_changes_issue117

Conversation

@xiaoniuniu89

Copy link
Copy Markdown
Contributor

…s and tries to naivgate from create page

✨ Codu Pull Request 💻

Codu Logo

👉 Please remove the below and replace with your own values, leaving the headers where they are. 👈

Pull Request details:

  • Prompts user if they have unsaved changes and try to navigate away from Create/Editing a post. Trying to reuse Modal component. Would be nice to make further changes and refactor in the future to create a reusable component for all prompts eg: deleting a post. Pass in title, type message body, buttons etc. Page refresh not addressed yet. PLEASE QA BEFORE MERGING!

Any Breaking changes:

None

Associated Screenshots:

( Welcome file extensions include gifs/png screenshots of your feature in action )

None

@vercel

vercel Bot commented Feb 11, 2023

Copy link
Copy Markdown

@xiaoniuniu89 is attempting to deploy a commit to the Codú Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Feb 11, 2023

Copy link
Copy Markdown

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

Name Status Preview Comments Updated
codu ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 26, 2023 at 8:12PM (UTC)

@NiallJoeMaher

Copy link
Copy Markdown
Contributor

Build is failing. 😢

Screenshot 2023-02-11 at 11 09 43

It might take a day or two for me to review this while I'm travelling so sorry in advance for the delay!

@xiaoniuniu89

Copy link
Copy Markdown
Contributor Author

im sorry, looks like a typo in the import statement, I have no idea how I changed that when pushing changes, will update later today!

@NiallJoeMaher NiallJoeMaher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great! That will come in useful in a lot of other places too.

One small thing this is probably unwanted behaviour:

Screen.Recording.2023-02-22.at.21.24.39.mov

If a user comes back, the page saves (which will publish updates) which might not be intended.

So I guess the user updating the article should only be by manually pressing the save button.

Thanks for this btw!

Runs really nicely. 🦾

@NiallJoeMaher

Copy link
Copy Markdown
Contributor

Also, sorry about the major delay! I was away for a couple of weeks and hoped someone else would have the chance to look. 😢

@xiaoniuniu89

Copy link
Copy Markdown
Contributor Author

No worries, will look at this at the weekend!!

@xiaoniuniu89 xiaoniuniu89 requested review from NiallJoeMaher and removed request for pkspyder007 February 25, 2023 13:16

@NiallJoeMaher NiallJoeMaher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thank you ❤️

@NiallJoeMaher NiallJoeMaher merged commit 98fd783 into codu-code:develop Feb 26, 2023
@xiaoniuniu89 xiaoniuniu89 deleted the dancallaghan/user_prompt_unsaved_changes_issue117 branch February 26, 2023 20:26
NiallJoeMaher pushed a commit that referenced this pull request Oct 6, 2023
#163)

* Add Enhancement(promptService): add prompt if the user has unsaved changes and tries to navigate from create page

* Update [[...postIdArr]].tsx

* add a check if the article was published before saving after cancel route change
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