Conversation
ChengShi-1
left a comment
There was a problem hiding this comment.
Hi Ellen, good work here! just a few suggestions.
About the UI behavior, there are two differences from JSF.
- in jsf, the popup custom text is wrapped by a grey box. I saw a style there but it is not applied to the modal.
- In jsf, if the dataset isn't published in the first time, the custom text is not shown.
src/info/infrastructure/repositories/DataverseInfoJSDataverseRepository.ts
Outdated
Show resolved
Hide resolved
src/info/infrastructure/repositories/DataverseInfoJSDataverseRepository.ts
Outdated
Show resolved
Hide resolved
tests/component/sections/dataset/dataset-publish/PublishDatasetModal.spec.tsx
Show resolved
Hide resolved
|
Hi Cheng, thanks for the review! I updated the style of the custom text box. I also saw that the JSF doesn't show custom text for subsequent drafts, but I asked about that on Slack, and Phil said he thinks it's a bug, so I decided to show it in the SPA. |
| @@ -110,21 +110,13 @@ export class DataverseInfoJSDataverseRepository implements DataverseInfoReposito | |||
| .execute() | |||
| .then((text) => { | |||
| const trimmedLength = text?.trim().length ?? 0 | |||
There was a problem hiding this comment.
'trimmedLength' is assigned a value but never used.
ChengShi-1
left a comment
There was a problem hiding this comment.
Thanks for the fix! For eliminating the lint warning, could you also remove 'trimmedLength' and 'error' that are assigned but never used?
| value: text | ||
| } | ||
| }) | ||
| .catch((error: unknown) => { |
There was a problem hiding this comment.
'error' is defined but never used.
There was a problem hiding this comment.
thanks for the catch! fixed
What this PR does / why we need it:
Add additional text and disclaimer to Publish Dataset Modal, to match behavior in JSF.
Which issue(s) this PR closes:
Special notes for your reviewer:
This PR depends on IQSS/dataverse-client-javascript#422, when that PR is merged, package.json needs to be updated
Suggestions on how to test this:
To setup, use the API to add the custom text and disclaimer, for example:
curl -X PUT -d'Please agree to this disclaimer text before publishing' http://localhost:8080/api/admin/settings/:PublishDatasetDisclaimerText
curl -X PUT -d'Additional custom text that appears in the modal' http://localhost:8080/api/admin/settings/:DatasetPublishPopupCustomText
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
It should match the JSF publish dataset modal:

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