-
Notifications
You must be signed in to change notification settings - Fork 50
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
825 add toggle to add/remove current site to/from element sites #875
Merged
MyPyDavid
merged 27 commits into
dev-2.2.0
from
825-exclude-sites-assignment-from-protection-of-a-catalogue
Jun 6, 2024
Merged
825 add toggle to add/remove current site to/from element sites #875
MyPyDavid
merged 27 commits into
dev-2.2.0
from
825-exclude-sites-assignment-from-protection-of-a-catalogue
Jun 6, 2024
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
need to re-do the commits and add the tests but buttons seem to be working like this |
8b60c37
to
23767c6
Compare
23767c6
to
395ce52
Compare
ca32db7
to
d10fa87
Compare
2bd6281
to
c3abc7a
Compare
c3abc7a
to
64f1fec
Compare
jochenklar
reviewed
Feb 8, 2024
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 for the work. I have some minor suggestions.
…ion mixins, makes urls part of api/v1
jochenklar
requested changes
May 14, 2024
Signed-off-by: David Wallace <[email protected]>
Signed-off-by: David Wallace <[email protected]>
… rename hasCurrentSite Signed-off-by: David Wallace <[email protected]>
Signed-off-by: David Wallace <[email protected]>
Signed-off-by: David Wallace <[email protected]>
Signed-off-by: David Wallace <[email protected]>
Signed-off-by: David Wallace <[email protected]>
Signed-off-by: David Wallace <[email protected]>
MyPyDavid
commented
May 15, 2024
Signed-off-by: David Wallace <[email protected]>
65ef10e
to
8757d2c
Compare
Signed-off-by: David Wallace <[email protected]>
jochenklar
requested changes
May 17, 2024
…lement Signed-off-by: David Wallace <[email protected]>
Signed-off-by: David Wallace <[email protected]>
Signed-off-by: David Wallace <[email protected]>
|
Signed-off-by: David Wallace <[email protected]>
…element components Signed-off-by: David Wallace <[email protected]>
jochenklar
approved these changes
May 27, 2024
Can this be merged? |
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.
Description
The new endpoints that add or remove the current site from the
sites
of an element are:Django back-end
questions
PUT /api/v1/questions/catalogs/{id}/toggle-site/
tasks
PUT /api/v1/tasks/tasks/{id}/toggle-site/
views
PUT /api/v1/views/views/{id}/toggle-site/
These are defined in a new
ViewSetMixin
,ElementToggleCurrentSiteViewSetMixin
inrdmo/management/viewsets.py
. This mixin has one actiontoggle-site
and only forput
is allowed.It adds or removes the current site from the object, depending on whether is was there already or not (like a toggle).
For permissions it uses a new (rules-based)
CanToggleElementCurrentSite
permission class.The mixin class could be simplified by removing the
serializer_class
and theget_queryset
method.Could we adapt the
ElementSucces
reducer to not need the serialized object for these actions?Permissions could by checked right in the action methods by eg.
test_rule()
.React front-end:
ToggleCurrentSiteLink
inrdmo/management/assets/js/components/common/Links.js
elementAction
tostoreElement
andstoreElementInit
MultiSiteApi.js
storeElement
via theaction
Related issue: #825
Motivation and Context
How has this been tested?
Screenshots (if appropriate)
Logged in as example-editor.

Types of Changes
Checklist