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

feat: Folder Explorer as an independent component #2529

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

ironAiken2
Copy link
Contributor

@ironAiken2 ironAiken2 commented Jul 9, 2024

TL;DR

This is a task to decouple folder-explorer from storage-list so that folder-explorer can be called and used from anywhere in React Root and also reslove #2298, #2529Issue

What changed?

The folder explorer that was dependent on backend-ai-storage-list has been separated and used inside LegacyFolderExplorer, which can be called and used from any part of react root.

The API response to get files of a vfolder exists files(for legacy compatibility) and items. In explorer, I changed to using items.

Currently, you can use the folder ID passed as a query parameter by passing it as a prop.

How to test?

  1. navigate to the Data & Storage tab.
  2. create a folder or open an existing folder.
  3. Check the folder explorer modal.

The LegacyFolderExplorer provides the same functionality as before. I'd appreciate it if you could check if there are any changes I missed compared to the existing modal.

Why make this change?

To improve the usability and functionality of the modal and folder explorer components in the application.


Checklist: (if applicable)

  • Mention to the original issue
  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

Copy link

graphite-app bot commented Jul 9, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the size:XL 500~ LoC label Jul 9, 2024
Copy link
Contributor Author

ironAiken2 commented Jul 9, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ironAiken2 and the rest of your teammates on Graphite Graphite

Copy link

github-actions bot commented Jul 9, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
2.64% (-0.01% 🔻)
142/5375
🔴 Branches
2.85% (-0% 🔻)
101/3541
🔴 Functions
1.51% (-0.01% 🔻)
27/1784
🔴 Lines
2.52% (-0.01% 🔻)
133/5272
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / LegacyFolderExplorer.tsx
0% 0% 0% 0%

Test suite run success

51 tests passing in 5 suites.

Report generated by 🧪jest coverage report action from 584f9ce

@rapsealk
Copy link
Member

Please check for the title! 😉

@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch 3 times, most recently from ee7d897 to c4ea9e9 Compare July 12, 2024 07:46
@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch 2 times, most recently from 8254a2a to 0400fa1 Compare July 12, 2024 10:02
@github-actions github-actions bot added the area:ux UI / UX issue. label Jul 12, 2024
@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from 0400fa1 to 7e2155e Compare July 15, 2024 08:19
@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch 2 times, most recently from e00c2fe to 3ff8d45 Compare July 15, 2024 08:33
@ironAiken2 ironAiken2 marked this pull request as ready for review July 15, 2024 08:38
@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from 3ff8d45 to 584f9ce Compare July 15, 2024 08:50
@ironAiken2 ironAiken2 changed the title feat: introduce regacy folder explorer for calling explorer at anywhere feat: introduce Legacy folder explorer for calling explorer at anywhere Jul 15, 2024
@yomybaby yomybaby changed the title feat: introduce Legacy folder explorer for calling explorer at anywhere feat: Folder Explorer as an independent component Jul 15, 2024
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

Please check below:

  • In the existing version, the delete button at the top appears when the user selects files.
    image.png
  • When the explorer is closed, the selected tab in the query string is deleted.
🎥 Video uploaded on Graphite:

src/components/backend-ai-data-view.ts Outdated Show resolved Hide resolved
src/components/backend-ai-storage-list.ts Outdated Show resolved Hide resolved
@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from 584f9ce to 59caf59 Compare July 19, 2024 01:04
@ironAiken2 ironAiken2 marked this pull request as draft July 19, 2024 01:16
@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from 59caf59 to 1dd4ed1 Compare July 19, 2024 02:59
Copy link

github-actions bot commented Jul 19, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
3.17% (-0.02% 🔻)
184/5804
🔴 Branches
3.16% (-0.02% 🔻)
123/3897
🔴 Functions
1.87% (-0.01% 🔻)
36/1922
🔴 Lines
3.04% (-0.02% 🔻)
173/5686
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / LegacyFolderExplorer.tsx
0% 0% 0% 0%

Test suite run success

64 tests passing in 6 suites.

Report generated by 🧪jest coverage report action from cbf60b0

@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from 1dd4ed1 to f17ba0c Compare July 19, 2024 05:05
@ironAiken2 ironAiken2 requested a review from agatha197 July 29, 2024 04:18
@ironAiken2 ironAiken2 marked this pull request as ready for review July 29, 2024 04:18
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

  1. It would be better to show this modal if user try to modify extension.
    image.png
  2. And the bottom buttons of upper confirm modal doesn't have gap.
  3. The right bottom button string is too long.

src/components/backend-ai-folder-explorer.ts Fixed Show resolved Hide resolved
@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from de52c9c to 6058a7e Compare July 31, 2024 04:52
@github-actions github-actions bot added the area:i18n Localization label Jul 31, 2024
@ironAiken2 ironAiken2 requested a review from agatha197 July 31, 2024 04:53
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

Let's add destroyOnClose to rename modal.

@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from 6058a7e to c4771b1 Compare July 31, 2024 05:30
Copy link
Contributor Author

Let's add destroyOnClose to rename modal.

Since the modal is written as a web component, I modified it to set empty the field when the modal opens.
@agatha197

@ironAiken2 ironAiken2 requested a review from agatha197 July 31, 2024 05:33
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from c4771b1 to da5dd02 Compare July 31, 2024 08:55
react/src/components/FolderExplorerOpener.tsx Outdated Show resolved Hide resolved
react/src/components/BAIModal.tsx Show resolved Hide resolved
@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from da5dd02 to a4313d5 Compare August 5, 2024 08:11
@ironAiken2 ironAiken2 requested a review from yomybaby August 5, 2024 08:11
@agatha197 agatha197 force-pushed the feat/legacy-folder-explorer branch from a4313d5 to 4a4a00b Compare August 8, 2024 05:03
@yomybaby yomybaby force-pushed the feat/legacy-folder-explorer branch from 4a4a00b to 17cd1e4 Compare August 9, 2024 10:20
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

🙌 LGTM with #2622. Don't merge without #2622 .

Copy link

graphite-app bot commented Aug 12, 2024

Merge activity

### TL;DR

This is a task to decouple folder-explorer from storage-list so that folder-explorer can be called and used from anywhere in React Root.

### What changed?

The folder explorer that was dependent on `backend-ai-storage-list` has been separated and used inside `LegacyFolderExplorer`, which can be called and used from any part of react root.

The API response to get files of a vfolder exists files(for legacy compatibility) and items. In explorer, I changed to using items.

Currently, you can use the folder ID passed as a query parameter by passing it as a prop.

### How to test?

1. navigate to the Data & Storage tab.
2. create a folder or open an existing folder.
3. Check the folder explorer modal.

The `LegacyFolderExplorer` provides the same functionality as before. I'd appreciate it if you could check if there are any changes I missed compared to the existing modal.

### Why make this change?

To improve the usability and functionality of the modal and folder explorer components in the application.

---

<!--
Please precisely, concisely, and concretely describe what this PR changes, the rationale behind codes,
and how it affects the users and other developers.
-->

**Checklist:** (if applicable)

- [ ] Mention to the original issue
- [ ] Documentation
- [ ] Minium required manager version
- [ ] Specific setting for review (eg., KB link, endpoint or how to setup)
- [ ] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
@ironAiken2 ironAiken2 force-pushed the feat/legacy-folder-explorer branch from 17cd1e4 to cbf60b0 Compare August 12, 2024 07:50
@graphite-app graphite-app bot merged commit cbf60b0 into main Aug 12, 2024
6 checks passed
@graphite-app graphite-app bot deleted the feat/legacy-folder-explorer branch August 12, 2024 07:51
agatha197 pushed a commit that referenced this pull request Aug 20, 2024
### TL;DR

After #2529, vFodler share button has disappeared.
- restore functionality to retrieve and process allowed vFolder hosts for the current user.
- Removed folder explorer event listener which event are not used.

### What changed?

- Removed `openFolderExplorer` method and its associated event listeners from `BackendAIData` class.
- Restore methods in `BackendAiStorageList` class:
  - `_getCurrentKeypairResourcePolicy`: Fetches the current keypair's resource policy.
  - `_getAllowedVFolderHostsByCurrentUserInfo`: Retrieves and processes allowed vFolder hosts for the current user, considering domain, group, and resource policy permissions.
- Restore `_viewStateChanged` and `connectedCallback` methods to call `_getAllowedVFolderHostsByCurrentUserInfo`.

### How to test?

1. Navigate to the data view in the Backend.AI interface.
2. Verify that folder explorer functionality still works as expected, despite the removal of the explicit event listener.
3. Create a vfolder
4. Verify that the share button in control column is displayed and works as expected.

### Why make this change?

This change improves the efficiency of handling folder explorer actions and provides a more comprehensive way to determine allowed vFolder hosts for the current user. By considering domain, group, and resource policy permissions, the system can now present a more accurate and personalized view of available storage options to each user.
ironAiken2 added a commit to lablup/backend.ai-docs-webui that referenced this pull request Nov 22, 2024
### This PR is about updating vfolder section for 24.09

**Changes:**
- Added a feature description for the new folder creation modal and updated related images.

**Related PR:**
- lablup/backend.ai-webui#2745 @ironAiken2 
- lablup/backend.ai-webui#2529 @ironAiken2 

PDF[ko] : [데이터 & 폴더 활용하기 — Backend.AI Web-UI User Guide 24.03 문서.pdf](https://github.com/user-attachments/files/17488475/Backend.AI.Web-UI.User.Guide.24.03.pdf)

PDF[en] : [Handling Data & Storage Folders — Backend.AI Web-UI User Guide 24.03 documentation.pdf](https://github.com/user-attachments/files/17488477/Handling.Data.Storage.Folders.Backend.AI.Web-UI.User.Guide.24.03.documentation.pdf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:i18n Localization area:lib Library and SDK related issue. area:ux UI / UX issue. size:XL 500~ LoC
Projects
None yet
4 participants