-
Notifications
You must be signed in to change notification settings - Fork 505
Add submission section for item embargo #1475
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
Conversation
|
This pull request introduces 4 alerts when merging bb64058 into ba268d4 - view on LGTM.com new alerts:
|
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.
@atarix83 : Thanks for the hard work on this. Mostly this "works" and the code seems reasonable (though see inline comments below for minor suggestions). That said, I ran into a few obvious bugs.
- First, this new "Item Access Conditions" section doesn't work in Production mode (
yarn start). It only works in Dev Mode (yarn start:dev). In Production mode, the UI section is empty:
- Sometimes, the access conditions end up overlapping oddly. I seem to be able to reliably reproduce this by doing the following: (1) Add one or more Item access conditions, (2) upload a file, (3) click Edit on the file, (4) close the popup modal. Then you see this odd alignment/overlap:

- After submitting an Item with two access conditions (as I can create multiple), I found that only one of the two access conditions are inherited to the "ORIGINAL" bundle or the bitstream in that bundle. Here's what it looks like (In case, I added both an embargo & openaccess, which I know isn't really "valid". But, in the below screenshot, you'll see the Item & LICENSE bundle get both access conditions, while the Bitstream & ORIGINAL Bundle only get the embargo)
- I'm not sure if this is a UI or backend error yet, as I haven't dug into it.
- I think the "Discoverable" checkbox needs help text. See my suggested text inline below.
- There is an LGTM alert above that needs resolving.
Overall, this code seems to work (in Dev mode only though) and looks good.
src/app/core/submission/models/submission-accesses.resource-type.ts
Outdated
Show resolved
Hide resolved
src/app/submission/sections/accesses/section-accesses.service.ts
Outdated
Show resolved
Hide resolved
src/app/submission/sections/accesses/section-accesses.service.ts
Outdated
Show resolved
Hide resolved
…e submission.module
# Conflicts: # src/app/core/core.module.ts # src/app/submission/objects/submission-objects.effects.ts # src/app/submission/submission.module.ts
|
feedback addressed |
|
This pull request introduces 2 alerts when merging 89c9e9a into 4fdd3b8 - view on LGTM.com new alerts:
|
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.
@atarix83 : I re-tested this today, and it's working better than before, but I'm still seeing a few issues:
- (New Issue) After applying this PR, the "Edit Bitstream" button in the Submission form no longer works (Upload a file, and click "Edit"). This error appears in DevTools Console:
core.js:6210 ERROR NullInjectorError: R3InjectorError(e)[e -> e -> e]:
NullInjectorError: No provider for e!
at aa.get (core.js:11116:27)
at ga.get (core.js:11283:33)
at ga.get (core.js:11283:33)
at ga.get (core.js:11283:33)
at qm.get (core.js:25337:33)
at Object.get (core.js:25051:35)
at ln (core.js:3389:39)
at un (core.js:3501:12)
at Module.pl (core.js:14707:12)
at Ht.e.ɵfac [as factory] (section-upload-file-edit.component.ts:61:54)
- I still can reproduce the previously reported issue (see bullet 3 in that previous review) where when you add multiple access permissions to an Item, only the first one is inherited to the
ORIGINALBundle and any Bitstreams in that Bundle. (However, other bundles, likeLICENSEproperly inherit all access permissions.)- I'm not yet sure whether this is a frontend or backend bug. But, it's unexpected behavior, as you don't know which access permissions will be applied to the ORIGINAL Bitstreams...it seems to be whichever access permission you apply first.
- We should either find a way to fix this bug, or potentially disable the ability to add multiple access conditions at the Item level, as it appears we have some code which expects there to only be one access condition.
- Finally, there are new minor LGTM issues listed above.
Overall, this functionality works, but it's still got a few bugs to fix.
this is already present in the main, however now it's fixed
this is an issue on backend side, we'are going to fix in the DSpace/DSpace#8091
fixed |
tdonohue
left a comment
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.
@atarix83 : Thanks for the quick updates! I re-tested today & can verify now that all issues are fixed, except the one you said you'll fix in the backend PR.
So, I'm basically a +1 on this PR, but I want to give it one final test once the backend is ready to re-test again.
@artlowel : It'd be good to get your feedback on this PR as well, so that we can move it forward quickly once the backend is completed.
tdonohue
left a comment
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 @atarix83 ! Adding my official +1, as I just re-tested this with the updated backend PR and all my feedback has been resolved (the backend PR updates fixed the policy inheritance issue I was seeing).
artlowel
left a comment
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 @atarix83!
It works well for the most part
The biggest issue I found however is that these access conditions have drag and drop handles, but don't appear to be draggable.
When you first choose embargo, fill out an "access from" date, and then select lease. The access from datepicker is disabled but not cleared. The same thing is possible if you do it the other way around. It doesn't affect the actual permissions if you save though, so it's a bit confusing but not a major issue
The alignment of the delete button looks off. The same goes for the date fields if there's an error message

The error issue should be easy to fix by using d-flex and align-items-start on the div containing all the fields. The delete button is shared with all the other submission fields though so that might be tricky to fix for this without breaking it elsewhere. Perhaps a background color, some padding and a border can make it clearer what the button aligns with? e.g.:
I would consider the drag handle on a field that isn't draggable a problematic issue, the others can be dealt with later if there isn't a quick easy fix
| defaultPrevented: false, | ||
| eventPhase: 0, | ||
| isTrusted: true, | ||
| path: ['input#accessCondition-0-endDate.form-control.ng-touched.ng-dirty.ng-valid', 'div.input-group.ng-touched.ng-valid.ng-pristine', 'ds-dynamic-date-picker-inline.ng-star-inserted, div, div, div, div.ng-touched.ng-valid.ng-pristine, ds-dynamic-form-control-container.col-6.ng-star-inserted, div#accessCondition-0-accessConditionGroup.form-row.ng-star-inserted.ng-touched.ng-valid.ng-pristine, ds-dynamic-form-group.ng-star-inserted, div, div, div, div.pl-1.pr-1.ng-touched.ng-valid.ng-pristine, ds-dynamic-form-control-container.form-group.flex-fill.access-condition-group.ng-star-inserted.ng-to…, div.cdk-drag.cdk-drag-handle.form-row.cdk-drag-disabled.ng-star-inserted.ng-touched.ng-valid.ng-pris…, div#cdk-drop-list-5.cdk-drop-list, div#accessCondition.ng-star-inserted.ng-touched.ng-valid.ng-pristine, ds-dynamic-form-array.ng-star-inserted, div, div, div, div.form-group.ng-touched.ng-valid.ng-pristine, ds-dynamic-form-control-container.ng-star-inserted, ds-dynamic-form.ng-touched.ng-valid.ng-pristine, form.form-horizontal.ng-touched.ng-valid.ng-pristine, div.container-fluid, ds-form.ng-star-inserted, ds-section-accesses.ng-star-inserted, div#sectionContent_AccessConditionDefaultConfiguration.ng-star-inserted, div.card-body, div#AccessConditionDefaultConfiguration.collapse.show.ng-star-inserted, div.card.ng-star-inserted, ngb-accordion.accordion, div#section_AccessConditionDefaultConfiguration.section-focus, ds-submission-section-container.ng-star-inserted, div.submission-form-content, div.container-fluid, ds-submission-form, div.submission-submit-container, ds-submission-edit.ng-star-inserted, ds-themed-submission-edit.ng-star-inserted, div.ng-tns-c392-0, main.main-content.ng-tns-c392-0, div.inner-wrapper.ng-tns-c392-0.ng-trigger.ng-trigger-slideSidebarPadding, div.outer-wrapper.ng-tns-c392-0.ng-star-inserted, ds-root.ng-tns-c392-0.ng-star-inserted, ds-themed-root, ds-app, body, html.wf-droidsans-n4-active.wf-active, document, Window'], |
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 looks like it could break the moment even the slightest thing changes about the feature later. I assume the exact path isn't really that important to test the functionality. Is there any way to make this more generic?
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.
@artlowel removed
|
While testing the backend, I noticed I was unable to remove an access policy if there's only one. |
|
The issues reported are present also in the edit bitstream access conditions form, since the implementations are similar. So, if you are agree, I'd say to create a new issue and resolved in afollow-up PR for both. |
|
@atarix83 , @artlowel and @benbosman : I've verified that @atarix83 is mostly correct. Some of these flaws exist in the current "Edit Bitstream" form (for Bitstream embargo functionality), but a few do not. I've broken them out below, including workarounds where possible. Flaws that exist in both Item & Bitstream Embargo forms. (These should be moved to 7.3, and I'll create a ticket for each & flag as high priority)
Flaws that ONLY exist in the Item Embargo form: (These should ideally be fixed in this PR, @atarix83 )
My recommendation would be for @atarix83 to do the minor cleanup to get this form working the same as the Bitstream embargo form. The other two bugs I'll create tickets for & link up to this comment once they are created. |
|
@tdonohue @artlowel @benbosman here the list of issues I have fixed :
|
artlowel
left a comment
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 @atarix83!
It looks a lot better, and I don't see any side effects on other fields.
One more very minor inline comment:
| .drag-disable { | ||
| visibility: hidden !important; | ||
| &:hover, &:focus { | ||
| cursor: grab; |
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.
Perhaps this should be cursor: default? Currently you still see the hand when hovering where the drag handle would be
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.
fixed
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 too, @atarix83 !
I've verified that the previous feedback has been addressed. Also verified that this fixes #1504 (by hiding those draggable options)
As a sidenote, I'm still seeing the hand icon appear (instead of cursor or pointer) when you hover over the "draggable" section. It's very minor though, so if we need to fix it later, no big deal. Either way, this PR will be merged as soon as the backend PRs are re-reviewed and ready. Thanks!
[DSC-1468] port of GLAM-353 entity type dropdown is now organized in alphabetical order Approved-by: Andrea Barbasso





References
Description
This PR add a new submission section in order to deal with the access condition for the item during the submission

Instructions for Reviewers
Create a new submission and test the new submission section
List of changes in this PR:
Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
yarn run lintpackage.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.