Skip to content
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

Restrict/Unrestrict File Feature in File Page #617

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

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.703% (+0.5%) from 97.241%
when pulling 5f3a91d on 613-restrict-file-feature-in-files-tab-and-files-page
into fa6299a 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 marked this pull request as ready for review March 4, 2025 17:28
@ChengShi-1 ChengShi-1 removed their assignment Mar 4, 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 assigned ChengShi-1 and unassigned g-saracca Mar 6, 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) 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: Ready for Review ⏩
Development

Successfully merging this pull request may close these issues.

Restrict File Feature in Files Tab and Files Page
3 participants