Restrict/Unrestrict File Feature in File Page#617
Conversation
...edit-file-menu/restrict-file-button/confirm-restrict-file-modal/ConfirmRestrictFileModal.tsx
Outdated
Show resolved
Hide resolved
...edit-file-menu/restrict-file-button/confirm-restrict-file-modal/ConfirmRestrictFileModal.tsx
Show resolved
Hide resolved
src/sections/file/file-action-buttons/edit-file-menu/restrict-file-button/useRestrictFile.tsx
Outdated
Show resolved
Hide resolved
tests/component/sections/file/file-action-buttons/edit-file-menu/EditFileMenu.spec.tsx
Outdated
Show resolved
Hide resolved
|
@g-saracca Hi German, I finished changes split delete button and Restrict button into two, one for dataset page and other for file page. Also, exclude fileuploader test component to help pass the test coverage. |
|
I see that UI Tests: dataverse-frontend check is waiting for status to be reported. Whats going on with that one? |
|
@ofahimIQSS, done! |
|
Hi @ofahimIQSS, I believe it is not an error but just info to the user that those fields are disabled for now because we don't have api needed for that, you can restrict a file but without editing those fields. |
|
Hello, I had 2 observations: This is on the file upload page, when I upload a file then click on restricted, the modal shows up. My question is regarding the button on the modal: "Cancel upload". I'm guessing that should say: "Cancel"? - since we aren't canceling the upload ^_^ Also noticed that in that Restrict File Modal, "Cancel" & "Save Changes" button placements are inconsistent. One files upload page, "Cancel" appears on the right side and "Save Changes" appears on the left and on the Dataset page, "Cancel" appears on the left. Which one did we want to go with or do we keep it as is for diversity. Screen.Recording.2025-03-26.at.11.28.01.AM.mov |
|
@ofahimIQSS Hi Omer, thanks for testing it. Since @g-saracca German refactored the upload files feature #625 here, this part will be covered after merging this PR #625. To reduce conflicts and repeated work, I think it's OK leaving this modal as it is for now. But we definitely need another issue to add current restrict feature to file uploading component. |
|
Thank you @ChengShi-1 Merging as no issues found. |



What this PR does / why we need it:
Implement the Restrict/Unrestrict Feature for a single file
Which issue(s) this PR closes:
Special notes for your reviewer:
Some changes need to know:
isHeadertoEditFileOptions.isHeader == truemeans it's the EditFileOptions button existing in the header of filesTable, dealing with multiple files.isHeader == falsemeans it is one of the file in files, dealing with a single file.Suggestions on how to test this:
create a dataset > upload file
click into the file page, Edit File > Restrict
A modal should be shown

(input box and checkbox are both disabled, waiting for api )
Please notice that
Restrict AccessandTerms of Accessare hard-coded, not connect to api yetSave Changes, a toast should be shown. then check if the file is restricted by checking if a Unlock Icon is shown on dataset page > File tab

click into the file page, Edit File > Unrestrict, a modal shown
lOG
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: