-
Notifications
You must be signed in to change notification settings - Fork 121
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
Automatically add/remove leases when a rights category is selected for an image/s based on application level config #4358
base: main
Are you sure you want to change the base?
Conversation
3afaa2c
to
28d7488
Compare
28d7488
to
958dea5
Compare
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.
Looks good - only a couple of small comments/questions!
} | ||
break; | ||
default: | ||
startDate = undefined; |
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.
startDate is already intialised as undefined - does it need to be redeclared as undefined in the default case as well?
Also maybe not relevant here but object literals look like a good alternative to switch cases in javascript: https://dev.to/mhmdjaw/an-alternative-to-the-javascript-switch-statement-1kah
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.
Looks good to me
What does this change?
When a user selects a rights category for an image it may be necessary for leases to be added or removed from the image based on the rights rules associated with that rights category. Up to now it has been the responsibility of the user to understand those rules and apply the correct leases.
This PR introduces the ability to automatically add or remove leases based on the selected rights category in conjunction with application level config defining the leases that should be applied in relation to a rights category.
The application config takes the form;
When the user selects a rights category in the image edit screen then any leases defined in config should be applied to the image on save and any previous leases removed.
If the selected rights category does not have an leases defined but the previoous rights category had a lease defined the old lease should be removed.
The functionality also applies in the grid view to single or multiple selections of images.
The functionality also applies in the upload page to single and batch uploads.
How should a reviewer test this change?
The following use cases are supported;
In the Image Edit screen the User selects a Rights Category for which a lease or leases have been defined in config. On save of the rights category the appropriate lease/s should be added to the image replacing any previous leases.
In the Image Edit screen if the User selects a Rights Category that has no leases defined in config, but the prior Rights Category for the image had a lease, or leases, defined in config then the matching leases should be removed from the image when the new Rights Category is saved.
All other changes to Rights Categories in the Image Edit screen should work a previously if the new rights category and the previous rights category have no leases defined in config.
In the Image Grid view if one or more images are selected and the Rights category is updated the leases for all selected images should be updated in line with rules defined in use cases 1 to 3.
In the Image Upload page when a user selects a rights category for an uploaded image then on 'save' of the rights category any leases defined in config should be added to the image.
During batch upload of images if a rights category added to one image (including config defined leases) is propagated to the other images in the batch then leases chould be added to those images in line with config.
Who should look at this?
Tested? Documented?