Skip to content

Comments

Restrict/Unrestrict File Feature in File Page#617

Merged
ofahimIQSS merged 13 commits intodevelopfrom
613-restrict-file-feature-in-files-tab-and-files-page
Mar 26, 2025
Merged

Restrict/Unrestrict File Feature in File Page#617
ofahimIQSS merged 13 commits intodevelopfrom
613-restrict-file-feature-in-files-tab-and-files-page

Conversation

@ChengShi-1
Copy link
Contributor

@ChengShi-1 ChengShi-1 commented Mar 3, 2025

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:

  • In order to add edit file option feature to dataset page, I have to add filesRepository as a parameter for dataset pages.
  • add a parameter isHeader to EditFileOptions.
    • isHeader == true means it's the EditFileOptions button existing in the header of filesTable, dealing with multiple files. isHeader == false means it is one of the file in files, dealing with a single file.
    • Actually, we could ignore this parameter and replace something here after we have editing multiple file API
  • One issue I didn't solve. According to current logic, if the dataset is published, after the restriction/delete/... is done and saved, the page navigates to dataset new draft version. However, if it's a draft currently, the page does nothing (because the operation is done in dataset page :draft version), the File Tab or the page should be re-rendered or refreshed to get the updated files and their status. I didn't find a good way to do this, need more thoughts.

Suggestions on how to test this:

  1. create a dataset > upload file

  2. click into the file page, Edit File > Restrict

  3. A modal should be shown
    (input box and checkbox are both disabled, waiting for api )
    image

  4. Please notice that Restrict Access and Terms of Access are hard-coded, not connect to api yet

  5. Save 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
    image

  6. click into the file page, Edit File > Unrestrict, a modal shown

Screenshot 2025-03-03 at 1 09 18 PM 7. Save Changes, a toast should be shown. The Unlock icon should be disappeared

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:

@ChengShi-1 ChengShi-1 linked an issue Mar 3, 2025 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Mar 3, 2025

Coverage Status

coverage: 97.618% (-0.1%) from 97.754%
when pulling aaa1f3f on 613-restrict-file-feature-in-files-tab-and-files-page
into 49ed01d on develop.

@ChengShi-1 ChengShi-1 self-assigned this Mar 3, 2025
@ChengShi-1 ChengShi-1 added Size: 3 A percentage of a sprint. 2.1 hours. SPA: File Page GREI Re-arch GREI re-architecture-related Original size: 3 SPA.Q1.6 Files Page: Files Edit Options FY25 Sprint 18 FY25 Sprint 18 (2025-02-26 - 2025-03-12) labels Mar 3, 2025
@ChengShi-1 ChengShi-1 moved this to In Progress 💻 in IQSS Dataverse Project Mar 3, 2025
@ChengShi-1 ChengShi-1 marked this pull request as ready for review March 4, 2025 17:28
@ChengShi-1 ChengShi-1 removed their assignment Mar 4, 2025
@ChengShi-1 ChengShi-1 moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Mar 4, 2025
@g-saracca g-saracca moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Mar 6, 2025
@g-saracca g-saracca self-assigned this Mar 6, 2025
Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor suggestions, looks solid!
Question, I think the scope of the issue is also to add the ability to restrict a file from the dataset files table.
See screenshot.

Screen Shot 2025-03-06 at 10 11 11

@ChengShi-1
Copy link
Contributor Author

Some minor suggestions, looks solid! Question, I think the scope of the issue is also to add the ability to restrict a file from the dataset files table. See screenshot.

Screen Shot 2025-03-06 at 10 11 11

Sorry I forgot this ... it's my fault, I'll add them here as well

@ChengShi-1 ChengShi-1 moved this from In Review 🔎 to In Progress 💻 in IQSS Dataverse Project Mar 6, 2025
@ChengShi-1 ChengShi-1 assigned ChengShi-1 and unassigned g-saracca Mar 6, 2025
@ChengShi-1 ChengShi-1 moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Mar 7, 2025
@g-saracca g-saracca self-assigned this Mar 10, 2025
@cmbz cmbz added the FY25 Sprint 19 FY25 Sprint 19 (2025-03-12 - 2025-03-26) label Mar 12, 2025
@ChengShi-1
Copy link
Contributor Author

@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.

g-saracca
g-saracca previously approved these changes Mar 21, 2025
Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Approved!

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Mar 21, 2025
@ofahimIQSS ofahimIQSS self-assigned this Mar 21, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Mar 21, 2025
@github-project-automation github-project-automation bot moved this from QA ✅ to Ready for QA ⏩ in IQSS Dataverse Project Mar 23, 2025
@scolapasta scolapasta moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Mar 24, 2025
@ofahimIQSS
Copy link
Contributor

I see that UI Tests: dataverse-frontend check is waiting for status to be reported. Whats going on with that one?

@g-saracca
Copy link
Contributor

@ofahimIQSS, done!

@ofahimIQSS
Copy link
Contributor

I'm unable to restrict a file through the SPA as I'm getting this message - please advise:

image

@g-saracca
Copy link
Contributor

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.
But please confirm with @ChengShi-1

@ofahimIQSS
Copy link
Contributor

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

@ChengShi-1
Copy link
Contributor Author

@ofahimIQSS Hi Omer, thanks for testing it.
Yes, you're right. This modal(for uploading files) should be replaced by the current one to keep consistency.

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.

@ofahimIQSS
Copy link
Contributor

Thank you @ChengShi-1 Merging as no issues found.

@ofahimIQSS ofahimIQSS merged commit 3114ec7 into develop Mar 26, 2025
15 of 16 checks passed
@github-project-automation github-project-automation bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Mar 26, 2025
@ofahimIQSS ofahimIQSS deleted the 613-restrict-file-feature-in-files-tab-and-files-page branch March 26, 2025 17:09
@ofahimIQSS ofahimIQSS removed their assignment Mar 26, 2025
@ofahimIQSS ofahimIQSS moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY25 Sprint 18 FY25 Sprint 18 (2025-02-26 - 2025-03-12) FY25 Sprint 19 FY25 Sprint 19 (2025-03-12 - 2025-03-26) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA: File Page SPA.Q1.6 Files Page: Files Edit Options

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Restrict File Feature in Files Tab and Files Page

5 participants