-
Notifications
You must be signed in to change notification settings - Fork 6
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
CARDS-2514: New "locking" module, with basic locking feature #1756
base: dev
Are you sure you want to change the base?
Conversation
Improved UI so it updates subject data whenever the locking dialog is completed Locking3.mp4 |
modules/locking/src/main/java/io/uhndata/cards/locking/LockServlet.java
Outdated
Show resolved
Hide resolved
modules/data-entry/src/main/frontend/src/questionnaire/Subject.jsx
Outdated
Show resolved
Hide resolved
modules/data-entry/src/main/frontend/src/questionnaire/Subject.jsx
Outdated
Show resolved
Hide resolved
modules/data-entry/src/main/frontend/src/dataHomepage/LockButton.jsx
Outdated
Show resolved
Hide resolved
modules/locking/src/main/java/io/uhndata/cards/locking/LockServlet.java
Outdated
Show resolved
Hide resolved
final VersionManager versionManager = session.getWorkspace().getVersionManager(); | ||
|
||
final Node requestNode = request.getResource().adaptTo(Node.class); | ||
// TODO: check if user has permission to lock and unlock the request node |
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.
This should be implemented in a separate issue that adds rights to lock and unlock resources
modules/locking/src/main/frontend/src/locking/SubjectLockAction.jsx
Outdated
Show resolved
Hide resolved
modules/data-entry/src/main/frontend/src/questionnaire/QuestionnaireStyle.jsx
Outdated
Show resolved
Hide resolved
...ta-entry/src/main/resources/SLING-INF/content/apps/cards/ExtensionPoints/SubjectActions.json
Outdated
Show resolved
Hide resolved
modules/locking/src/main/resources/SLING-INF/nodetypes/locking.cnd
Outdated
Show resolved
Hide resolved
modules/locking/src/main/resources/SLING-INF/nodetypes/locking.cnd
Outdated
Show resolved
Hide resolved
// Hardcode the resource type | ||
- sling:resourceType (STRING) = "cards/Lock" mandatory autocreated protected | ||
// Hardcode the resource supertype: the login page is a resource | ||
- sling:resourceSuperType (STRING) = "cards/Resource" mandatory autocreated protected |
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.
This isn't a resource. It should be a cards:Item
, but that PR is still a draft.
...ocking/src/main/resources/SLING-INF/content/Extensions/SubjectActions/subjectLockAction.json
Outdated
Show resolved
Hide resolved
modules/locking/src/main/java/io/uhndata/cards/locking/LockedRestrictionPattern.java
Outdated
Show resolved
Hide resolved
modules/locking/src/main/java/io/uhndata/cards/locking/LockServlet.java
Outdated
Show resolved
Hide resolved
modules/locking/src/main/java/io/uhndata/cards/locking/LockedRestrictionPattern.java
Show resolved
Hide resolved
I think this will need adjusting, but not right now: creating a new form from the dashboard should not allow selecting a locked subject. I think this would be better handled by checking rights themselves, instead of customizing even more the subject selector component. |
Initial implementation including: - Locking restriction - TODO: Once lock and unlock rights are implemented, apply locked restriction to everyone by default - Lock node on subjects - Includes author who locked the node - Only locked subjects with a child lock node can be unlocked and only if their parent is unlocked to prevent partially unlocked child trees - TODO: add time to lock node - Basic UI for locking and unlocking - Single lock/unlock button based on current lock state - TODO: list any incomplete forms - TODO: update UI when locking or unlocking successfull to reflect new lock state - TODO: list current user and timestamp Other tasks TODO: - Make locking opt-in - Make subject actions extensible to move the locking button into the locking modules
Lock button will now update the subject view so changes to locked status will be displayed to the user without needing to refresh the page
Switch to LOCK and UNLOCK HTTP methods rather than Post
- Add username and date to lock dialog
Create new Subject Action extension - Move lock button into locking module and access it through the extension
Fix incorrectly named configuration
- Make locking opt-in
- Restrict form and child subject creation for locked subjects
- Improve locking UI - Simplify subject actions extension - Add list of incomplete forms to lock UI - Update child form display when a subject is locked or unlocked
Improve locking UI - Split locking dialog into up to 2 dialogs: - List of incomplete forms + continue - Sign off - Convert username and date into disabled inputs - Convert list of incomplete forms into Material UI list
Refactor lock handling into LockManager rather than built into LockServlet
Remove extraneous lock action extension definition
Update locking module version
Initial implementation including:
to prevent partially unlocked child trees
Testing:
./start_cards.sh --test --dev
to make sure nothing has changed and that locking is disabled by default./start_cards.sh --test --dev --locking
to test that locking is can be enabled and is working as expectedpython3 generate_compose_yaml.py --cards_project cards4prems --oak_filesystem --dev_docker_image --locking
docker-compose build && docker-compose up
docker-compose down && docker-compose rm && docker volume prune -f && ./cleanup.sh
python3 generate_compose_yaml.py --cards_project cards4prems --oak_filesystem --dev_docker_image
Make sure that:
Locking2.mp4