-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add urls for change_password modal and login modal. #154
Add urls for change_password modal and login modal. #154
Conversation
Thanks for this 😄 With regards to your point, I think this is good enough tbh - especially since most users will only come across those links via a clickable URL in an email. Alternatively, the proper fix would be to create another two endpoints - |
static/assets/js/home.js
Outdated
@@ -67,6 +67,13 @@ if (!PP) { | |||
}); | |||
|
|||
$(document).ready(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to have a $(document).ready()
here? It should work without?
The PP.initLogin()
function is called from the html - see here...
Note - $(document).ready()
will be executed once the document is loaded. $(function(){...});
(what we have in the html) is a shortcut for $(document).ready()
and does the exact same thing. On the other hand, (function(){...})();
will be executed as soon as it is encountered in the Javascript (i.e. the PP
JS module) - basically invoking itself.
AS such there shouldn't be any need have another document.ready
function.
Also, if possible move the indexOf lines into a separate function and call it from the initLogin or directly from the html.
I typically prefer to just define functions in the JS library files and then have a single on.ready
function in the HTML where I call the necessary functions...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've made those changes.
Added https://......../change_password and https://......../login. These do refresh the browser when called. Removed $(document).ready() and put the functionality in to initLogin() instead. |
…ful password change.
…ful password change.
…ful password change.
…ful password change.
…ful password change.
views/__init__.py
Outdated
@@ -180,6 +180,11 @@ def login(): | |||
return jsonify(success="Authenticated"), 200 | |||
|
|||
# | |||
@app.route('/login', methods=['GET']) | |||
def login_form(): | |||
return redirect('/#login') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we need an if statement here and below as the one here: https://github.com/phenopolis/phenopolis/blob/master/views/__init__.py#L187
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh not sure why that if statement is there but I suspect that it's there because redirecting to the home page caused some issues on the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After that I'm happy with this PR 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted. Done, thanks.
…ful password change.
* Add urls for login modal and change_password modal. * Added new url endpoints for change_password and login. * Added 'Search Phenopolis' button that becomes visible after a successful password change. * Added 'Search Phenopolis' button that becomes visible after a successful password change. * Added 'Search Phenopolis' button that becomes visible after a successful password change. * Added 'Search Phenopolis' button that becomes visible after a successful password change. * Added 'Search Phenopolis' button that becomes visible after a successful password change. * Added 'Search Phenopolis' button that becomes visible after a successful password change.
Add the ability to get to the Change Password screen directly from
https://......../#change_password
useful for when the admin has given a user a new password and wants to direct the user to immediately change their password.
Also added url to go directly to login screen
https://......./#login
Needs improvement -
This works fine if your browser tab is not already on Phenopolis. However, if your tab is already open at Phenopolis home screen, then you need to enter the url https://......../#change_password and hit refresh in order to get the modal to pop up.