-
Notifications
You must be signed in to change notification settings - Fork 1
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-remove-organisation-button-npdauser-form #223
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…om employer select
…tmx, new organisation adapter function
…te adapter to populate rcpch organisation list without removing user_instance affiliations
…nt validation error. workaround for new user creation
…patient to use new relationship, remove automatic allocation of year and quarter from save method in submssion model and move to view
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
…ill a PDUWithOrganisations object, but with error values Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
…ject Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
…erFactory` Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
…rectly Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
… patient form. form initialized with current quarter if unbound
…ests-from-new-datamodel
Signed-off-by: anchit-chandran <anchit97123@gmail.com>
…code` Signed-off-by: anchit-chandran <anchit97123@gmail.com>
Fixing-tests-from-new-datamodel
Reviewed with @eatyourpeas. all happy |
Seen on STAGING (created by @eatyourpeas and merged by @anchit-chandran 5 minutes and 6 seconds ago) Please check your changes! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Slightly more complicated PR than anticipated.
The refactor of models to create OrganisationEmployer, PaediatricDiabetesUnit models meant a restruction of the user update and creation workflow.
Since a user can have more than one employer, this workflow is handled with htmx in the npdauser form.
Now the user form lists all affiliated PDUs and allows the user to add/delete this list and set which is the primary organisation, based on permissions. There is some latency with this as there are API calls, so it would be worth putting a spinner on button press to signpost this.
In the user edit form superusers see a national list of organisations with their own removed, whereas normal users see only those organisations in their own PDU, with their own removed. In the create userform, the lists include their own organisations.
Code changes
npdauser_form
- includes 2 partials -employers.html
which has lists of affiliated organisations with htmx buttons to delete, add or assign primary PDU:rcpch_organisations_select.html
- a select for the orgsviews/npda_users
: removes a lot of API look up which is abstracted out to the adapter in the createuser and updateuser classes.-
admin.py
: incidental unrelated change. added PaediatricDiabetesUnit to adminorganisations_adapter.py
has function which accepts a user instance and a request. Uses these to return lists for the rcpch organisations selects in the update/create forms.-
tailwind.css
: adds a new hidden class which is used to toggle the add / hide organisations select in the user form using hyperscriptDocumentation changes (done or required as a to follow