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

fixed 404 issue when pressing cancel #175

Conversation

Ducica
Copy link
Contributor

@Ducica Ducica commented Jan 7, 2025

Description

Resolution to issue #171

It is probably not the safest to use href="." when goal is to reload the current page. I used url_for, another option would be something like href="javascript:window.location.reload(true)", but feel that url_for, might be the safer solution.

@ntarocco
Copy link
Contributor

ntarocco commented Jan 7, 2025

@Ducica thanks a lot for this fix, I tested it and it works. Not related to your changes, but the fact that we stay in the same page is not super user-friendly...
Anyway, can you please remove the change the of the version number, and add a very simple line in the CHANGES.rst file instead?

Version <next version>
- ... brief fix description ...

We will add the version bump in the a dedicated release commit.

@@ -31,7 +31,7 @@
from .ext import InvenioUserProfiles
from .models import UserProfile, UserProfileProxy

__version__ = "4.0.0"
__version__ = "4.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please remove this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ntarocco Hey, thank you both for the quick reaction. I've made the changes as requested. Out of curiosity, what would you say the desirable behavior would be? I understood the goal is to just flush any changes that user was making, so this solution gets the job done. Of course full page refresh is not ideal, but it is a MPA anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ntarocco Hey, thank you both for the quick reaction. I've made the changes as requested. Out of curiosity, what would you say the desirable behavior would be? I understood the goal is to just flush any changes that user was making, so this solution gets the job done. Of course full page refresh is not ideal, but it is a MPA anyway.

The behaviour is not consistent. In other places, when we hit the Cancel button, we leave the page and go back/somewhere else. Anyway, not a big deal.
Thanks a lot for the fix!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ntarocco thank you for the merge!

@Ducica Ducica force-pushed the issue-171-Cancel-button-in-profile-settinsg-leads-to-404 branch from b4a68df to f60b932 Compare January 7, 2025 20:53
CHANGES.rst Outdated
@@ -9,6 +9,10 @@
Changes
=======

Version 4.0.1
Copy link
Contributor

Choose a reason for hiding this comment

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

this is good, but should go with the version change in init into a separate commit which then contains the addition in the CHANGES.rst file and the version change in the invenio_userprofiles/__init__.py file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@utnapischtim Sorry, my bad. So just to be clear, final result shall be one commit for actual changes and then 1 commit where I write to changes.rst and init.py? Do I need to place some date into changes.rst (released 2025-01.07) or is this not necessary? Please let me know.

Copy link
Contributor

@utnapischtim utnapischtim Jan 7, 2025

Choose a reason for hiding this comment

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

yes, it should be one commit for the actual changes, or more if the changes should be committed by more than one commit. more info here and one commit for the version changes which includes the addition to CHANGES.rst and __init__.py

the addition in CHANGES.rst should follow how the other release notes have been written like

Version 4.0.1 (released 2025-01-07)
- title of commit message

but normally you don't have to add this commit to your PR, because it could be that the changes are not released directly afterwards, or because there are other commits in the history and the changes.rst has to be updated anyway. or the chosen version is wrong.

better only add your changes to the PR and let the maintainer do the work on releasing your changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@utnapischtim Thanks, I have left just the changes to the code itself as suggested in your previous comment. Regards, Dusan

@Ducica Ducica force-pushed the issue-171-Cancel-button-in-profile-settinsg-leads-to-404 branch from f60b932 to 160e9c1 Compare January 7, 2025 21:39
@ntarocco ntarocco merged commit 8c20107 into inveniosoftware:master Jan 8, 2025
2 checks passed
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.

4 participants