Fix Publish and Submit for Review when no files are present in Dataset#12266
Fix Publish and Submit for Review when no files are present in Dataset#12266
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8a2ea18 to
9b1b478
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
landreev
left a comment
There was a problem hiding this comment.
Haven't tested, but the code looks good.
This comment has been minimized.
This comment has been minimized.
|
Getting a weird result here. If I'm logged in as a superuser and the dataset has no files, but is required to at the collection level there's a banner for "You must submit for Review", but there's no submit button (and there shouldn't be a button because the super user should be able to publish?). Nor is there a Publish button. This also happens to non-superusers with publish dataset privileges. If the collection requires files and they are not present the "Submit for Review" banner is displayed - but there's no Submit button. |
|
Maybe out of scope, but can we add a banner to the dataset page when files are required but not present to explain why the publish or submit button are not available? |
|
If you are a Contributor without the right to publish datasets then if files are required and they are not present then the display shows a "Submit for Review" banner, but there is no Submit button. Once you add a file then you get both the banner and the button - again I think it would be appropriate to have a new banner stating that files are required before a dataset may be submitted for review. |
This comment has been minimized.
This comment has been minimized.
|
📦 Pushed preview images as 🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
What this PR does / why we need it:
Per #10981 a dataset should not be publishable if it contains no files. This issue should check the number of files in the Dataset version and not the total number of files in the dataset.
This is only an issue when the attribute 'requireFilesToPublishDataset' is set
Which issue(s) this PR closes:#12258
Special notes for your reviewer:
Suggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Submit for review button on JSF UI Dataset Page will be hidden if no files are contained in the Dataset Version
requireFilesToPublishDataset set to true

requireFilesToPublishDataset set to false

Is there a release notes update needed for this change?: Included
Additional documentation: changelog