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: user resource policy allocation in user setting modal #2749

Merged

Conversation

ironAiken2
Copy link
Contributor

@ironAiken2 ironAiken2 commented Oct 14, 2024

This PR resolves #2727 issue.

Changes:

  • The user creation modal is written as a Lit Element, so I applied it to the edit modal first.
  • When migrating the user creation modal to react component, I �thought that we need a user resource policy selector, so I wrote it as a separate component.
  • The user_resource_policy query doesn't provide filtering options yet, so I didn't add any filtering logic, but used antd's built-in search.

How to test:

  • Verify that the existing user's resource policy is properly applied as the default value.
  • In the user information edit modal, verify that the user's resoure policy is modified correctly.
before after
image.png image.png

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 Oct 14, 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.

Copy link
Contributor Author

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

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

@github-actions github-actions bot added the size:M 30~100 LoC label Oct 14, 2024
Copy link

github-actions bot commented Oct 14, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
5.35% (-0% 🔻)
348/6506
🔴 Branches 4.84% 218/4503
🔴 Functions
3.12% (-0% 🔻)
67/2150
🔴 Lines
5.24% (-0% 🔻)
333/6356
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / UserResourcePolicySelector.tsx
0% 100% 0% 0%

Test suite run success

93 tests passing in 12 suites.

Report generated by 🧪jest coverage report action from f060300

@ironAiken2 ironAiken2 marked this pull request as ready for review October 14, 2024 07:43
@yomybaby yomybaby changed the title feat: user resource policy allcation in user setting modal feat: user resource policy allocation in user setting modal Oct 14, 2024
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. Please make another PR to display user resource policy info on the info modal.

Copy link

graphite-app bot commented Oct 15, 2024

Merge activity

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

This PR resolves #2727 issue.

**Changes:**
- The user creation modal is written as a Lit Element, so I applied it to the edit modal first.
- When migrating the user creation modal to react component, I �thought that we need a user resource policy selector, so I wrote it as a separate component.
- The `user_resource_policy` query doesn't provide filtering options yet, so I didn't add any filtering logic, but used antd's built-in search.

**How to test:**
- Verify that the existing user's resource policy is properly applied as the default value.
- In the user information edit modal, verify that the user's resoure policy is modified correctly.

|before|after|
|---|---|
|![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lSyr8xXz1wdXALkJKzVx/e0c21f2d-a56b-4fd8-ab23-36048c46904d.png)|![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lSyr8xXz1wdXALkJKzVx/b520b92e-be57-40dc-bd99-4ce9b04dc451.png)|

**Checklist:** (if applicable)

- [x] 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/user-resource-policy-allocation-in-user-setting-modal branch from b7eac6a to f060300 Compare October 15, 2024 05:20
@github-actions github-actions bot added area:ux UI / UX issue. 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:2 With time limit, it should be finished within it; otherwise, resolve it when no other chores. labels Oct 15, 2024
@graphite-app graphite-app bot merged commit f060300 into main Oct 15, 2024
7 checks passed
@graphite-app graphite-app bot deleted the feat/user-resource-policy-allocation-in-user-setting-modal branch October 15, 2024 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ux UI / UX issue. 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 size:M 30~100 LoC type:enhance Add new features urgency:2 With time limit, it should be finished within it; otherwise, resolve it when no other chores.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let's add user resource policy allocation UI
2 participants