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: add new resource policy page (keypair, user, project) #2357

Merged
merged 10 commits into from
May 23, 2024

Conversation

agatha197
Copy link
Contributor

@agatha197 agatha197 commented Apr 18, 2024

New resource policy page

resolves #2351

Keypair resource policy page

Description

Replace the original keypair resource policy page with the react component.

Checklist

  • list page: added idle timeout, max session lifetime
  • modify/create modal
    • If the value is unlimited, checkbox is checked and input is disabled.
    • If the initial value exists -> check Unlimited: form value is undefined -> uncheck Unlimited: form value is reset.
  • modify modal: host name is disabled.
  • create modal: host name is enabled.
  • allowed host
    • It displays only host name.
    • allowed permission list follows original value.
    • If the allowed permission is undefined, the default value is {} as follows server value.
  • you can delete keypair resource policy by clicking the delete icon in the controls column.

Screenshots

  • keypair resource policy list
    image.png
  • Update keypair resource policy modal
    image.png
  • Create keypair resource policy modal
    image.png
  • AllowedHostNamesSelect
    image.png

User resource policy page

ref #2421

Project resource policy page

ref #2423

Checklist: (if applicable)

  • Mention to the original issue
  • Documentation: Update resource policy page guide backend.ai-docs-webui#62
  • 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
Contributor Author

agatha197 commented Apr 30, 2024

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

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

@agatha197 agatha197 mentioned this pull request Apr 30, 2024
6 tasks
@agatha197 agatha197 force-pushed the feature/new-resource-policy-page branch 2 times, most recently from bc4fb91 to b0e755b Compare May 20, 2024 10:26
Copy link

github-actions bot commented May 20, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
2.85% (-0.09% 🔻)
132/4628
🔴 Branches
3.27% (-0.12% 🔻)
103/3147
🔴 Functions
1.51% (-0.06% 🔻)
23/1523
🔴 Lines
2.77% (-0.09% 🔻)
126/4543
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / ResourcePolicyPage.tsx
0% 0% 0% 0%
🔴
... / KeypairResourcePolicySettingModal.tsx
0% 0% 0% 0%
🔴
... / ProjectResourcePolicyList.tsx
0% 100% 0% 0%
🔴
... / FormItemWithUnlimited.tsx
0% 0% 0% 0%
🔴
... / KeypairResourcePolicyList.tsx
0% 0% 0% 0%
🔴
... / AllowedHostNamesSelect.tsx
0% 100% 0% 0%
🔴
... / UserResourcePolicyList.tsx
0% 100% 0% 0%

Test suite run success

43 tests passing in 5 suites.

Report generated by 🧪jest coverage report action from 7ea98dc

react/src/hooks/backendai.tsx Outdated Show resolved Hide resolved
react/src/components/FormItemWithUnlimited.tsx Outdated Show resolved Hide resolved
react/src/components/KeypairResourcePolicySettingModal.tsx Outdated Show resolved Hide resolved
@agatha197 agatha197 force-pushed the feature/new-resource-policy-page branch 2 times, most recently from a32d385 to 50ad115 Compare May 21, 2024 01:43
@agatha197 agatha197 requested a review from yomybaby May 21, 2024 08:37
@yomybaby yomybaby force-pushed the feature/new-resource-policy-page branch from 50ad115 to 1323df5 Compare May 22, 2024 02:22
@github-actions github-actions bot added effort:normal Need to understand a few modules / some extent of contextual or historical information. impact:visible This change is visible to users. platform:general type:enhance Add new features urgency:3 Must be finished within a certain time frame. labels May 22, 2024
@agatha197 agatha197 force-pushed the feature/new-resource-policy-page branch from 1323df5 to 50ad115 Compare May 22, 2024 02:45
@agatha197 agatha197 force-pushed the feature/new-resource-policy-page branch from 50ad115 to 946816c Compare May 22, 2024 02:59
@agatha197 agatha197 mentioned this pull request May 22, 2024
14 tasks
agatha197 and others added 8 commits May 23, 2024 11:40
* feat: new resources page

* cosmetic touches and bordered table

* Use Segment component for status and refactor codes related to the fetch transition

* table sorter by GraphQL order

* refactor: sorter setting and remove architecture sorter

* remove auto refresh feature

---------

Co-authored-by: Jong Eun Lee <[email protected]>
@agatha197 agatha197 force-pushed the feature/new-resource-policy-page branch from 946816c to ae17f55 Compare May 23, 2024 02:47
@yomybaby yomybaby marked this pull request as ready for review May 23, 2024 03:33
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

Copy link
Member

yomybaby commented May 23, 2024

Merge activity

  • May 22, 11:52 PM EDT: @yomybaby started a stack merge that includes this pull request via Graphite.
  • May 22, 11:53 PM EDT: @yomybaby merged this pull request with Graphite.

@yomybaby yomybaby merged commit f2c1cf2 into main May 23, 2024
7 checks passed
@yomybaby yomybaby deleted the feature/new-resource-policy-page branch May 23, 2024 03:53
@agatha197 agatha197 mentioned this pull request May 23, 2024
13 tasks
yomybaby pushed a commit that referenced this pull request May 28, 2024
follows #2357 
Add User Resource Policy Page

## Description
- Add User resource policy CRUD.
- Add `FormItemProps` props to `FormItemWithUnlimited`.
- Add simple error handler to `KeypairResourcePolicySettingModal`.
- Remove unused component, `ResourcePolicyCard`.

## Checklist
- [ ] List Page: name, max folder count, max session count per model session, max quota scope size, id, created at
  - [ ] Each item will be shown/hidden according to the server version. 
  - [ ] In particular, it is stated in the schema that `max_vfolder_count` is supported from version 24.03.1, but this is incorrectly documented, and it follows lablup/backend.ai#1993.
  - [ ] `max_session_count_per_model_session` is supported from version 23.09.10 as follows lablup/backend.ai#1993 too.
- [ ] Create/Modal: Create or modify user resource policy.
  - [ ] Version compatibility is the same as the list.
  - [ ] Unlimited value of `Max Folder Count` is 0.
  - [ ] Unlimited value of `Max Folder Size` is -1.

## Screenshots
<table>
<tr>
 <td>
 <td>24.03.0b1 (10.82.230.101)</td>
 <td>24.09.0dev1 (main)</td>
<tr>
 <td>List</td>
 <td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/7c23ba67-e22f-4770-8a4a-dfef8856ba96.png)

</td>
 <td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/c42974ac-fa28-4abb-a7a9-e2c6f67af335.png)

</td>
<tr>
 <td>Create Modal</td>
 <td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/da4d4c9d-a5cb-48fc-88c2-ca801642fde7.png)

</td>
 <td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/887306a4-00b9-4758-a72f-df897c60d634.png)

</td>
<tr>
 <td>Modify Modal</td>
 <td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/88c9f6e7-26fd-4780-b9fd-ce242724fcf1.png)

</td>
 <td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/af6c825c-5fb1-4417-a21c-f946e0f9ad3a.png)

</td>
</tr>
<tr>
<td>Table Setting</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/5a6dc107-9ff2-4b14-87d2-badd419b242d.png)

</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/ec04ff59-5f3f-47a8-a3a5-4b192c5528c5.png)

</td>
</tr>
</table>

**Checklist:** (if applicable)

- [x] Mention to the original issue
- [ ] Documentation
- [x] Minium required manager version
- [x] Specific setting for review (eg., KB link, endpoint or how to setup)
- [x] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
yomybaby pushed a commit that referenced this pull request May 28, 2024
follows #2357 
Add Project Resource Policy Page


### TL;DR
This pull request introduces changes related to FormItemWithUnlimited and ProjectResourcePolicyList components.

### What changed?
The changes include:
- Addition of FormItemWithUnlimitedProps in `FormItemWithUnlimited` component
- Updates to `ProjectResourcePolicyList` component with enhanced functionality and UI improvements

### Checklist
- [ ] List Page: name, max folder count, max quota scope size, id, created at
  - [ ] Each item will be shown/hidden according to the server version. 
  - [ ] In particular, it is stated in the schema that `max_vfolder_count` is supported from version 24.03.1, but this is incorrectly documented, and it follows lablup/backend.ai#1993.
- [ ] Create/Modal: Create or modify project resource policy.
  - [ ] Version compatibility is the same as the list.
  - [ ] Unlimited value of `Max Folder Count` is 0.
  - [ ] Unlimited value of `Max Folder Size` is -1.


### Screenshots
<table>
<tr>
<td></td>
 <td>24.03.0b1 (10.82.230.101)</td>
 <td>24.09.0dev1 (main)</td>
</tr>
<tr>
<td>List</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/bc9a3d28-9119-47f7-b697-f1d54935c020.png)


</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/21e03b17-1d18-4fb7-8683-7bcdfe009beb.png)


</td>
</tr>
<tr>
<td>Create Modal</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/93f5f421-3c09-47f6-ab7e-9404c4bdbb8c.png)


</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/8c958f14-b3e7-427d-997c-aa5a331343a2.png)

</td>
</tr>
<tr>
<td>Modify Modal</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/81144f9b-a55a-4136-b298-58038f2f224b.png)


</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/32d1f8d6-9fa9-4377-aee0-0427183fa573.png)


</td>
</tr>
<tr>
<td>Table Setting</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/fc7e605b-b957-47fd-95ec-c92381931d0a.png)

</td>
<td>

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/11659c5b-cb04-4a5f-97fc-d1122913e1a5.png)

</td>
</tr>
</table>

---

<!--
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)

- [x] Mention to the original issue
- [ ] Documentation
- [x] Minium required manager version
- [x] Specific setting for review (eg., KB link, endpoint or how to setup)
- [x] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:i18n Localization area:ux UI / UX issue. effort:normal Need to understand a few modules / some extent of contextual or historical information. field:localization field:UI / UX impact:visible This change is visible to users. platform:general size:XL 500~ LoC type:enhance Add new features urgency:3 Must be finished within a certain time frame.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: resource page - user, project, keypair
2 participants