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: migrate /credentials page to react component #2757

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

ironAiken2
Copy link
Contributor

@ironAiken2 ironAiken2 commented Oct 17, 2024

This PR is about migrating User Credential page and User List to react component.

! This PR should be merged after the implementation is complete up to the Credential Tab #2758. !

Since the existing user and credential tabs are not composed of separate code, I decided to migrate the user list to react and the credential list to web components at once, as it would be too laborious to configure them as both react and web components.

Changes:

  • Created a new UserCredentialsPage component in React
  • Implemented UserList component to display user information
  • Updated UserInfoModal and UserSettingModal to work with the new React components
  • Removed legacy web components for user credentials and settings
  • Added new translations for "Created At" in multiple languages
  • Updated routing in App.tsx to include the new UserCredentialsPage

How to test:

  1. Navigate to the User Credentials page
  2. Verify that the user list is displayed correctly
  3. Test filtering and pagination functionality
  4. Check that user info and settings modals open and function properly
  5. Confirm that creating, modifying, and deleting users work as expected
before after
image.png image.png
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 17, 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 area:ux UI / UX issue. area:i18n Localization labels Oct 17, 2024
@github-actions github-actions bot added the size:XL 500~ LoC label Oct 17, 2024
Copy link
Contributor Author

ironAiken2 commented Oct 17, 2024


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

@ironAiken2 ironAiken2 force-pushed the feat/user-list-page branch 2 times, most recently from 2ede528 to 1417227 Compare October 18, 2024 04:36
@ironAiken2 ironAiken2 marked this pull request as ready for review October 18, 2024 04:44
@ironAiken2 ironAiken2 force-pushed the feat/react-create-user-modal branch from e73f379 to 244ed9f Compare October 18, 2024 05:01
@ironAiken2 ironAiken2 marked this pull request as draft October 18, 2024 05:02
@ironAiken2 ironAiken2 marked this pull request as ready for review October 18, 2024 05:07
@ironAiken2 ironAiken2 marked this pull request as draft October 18, 2024 06:49
@ironAiken2 ironAiken2 force-pushed the feat/react-create-user-modal branch from 244ed9f to 1ab4661 Compare November 6, 2024 04:42
@yomybaby yomybaby changed the base branch from feat/react-create-user-modal to graphite-base/2757 November 6, 2024 08:16
yomybaby pushed a commit that referenced this pull request Nov 6, 2024
<!--
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 is about migrating user generate modal to React components.

> This PR is the bottom of the stack so that it can be merged into main first.This is why this PR also including the part that will be fixed in #2757 PR.

**Changes:**
- I modified the `UserSettingModal.tsx` component because the input for the `modify_user` query and the `create_user` query are not very different.
- If you don't pass a userEmail value in the web component, the response data for the user query will be null. �I took advantage of this and branched the modify and create logic.
- (minor) Modified UserInfoModal to show resource policy and description.

**How to test:**
1. move to `User Credential & Polices` page
2. Verify that the modal looks correctly different on create/modify.
3. Verify that user creation is successful.
4. Verify that the non-required value is mapped and applied correctly.
5. Verify that �the User is properly part of the `default`, `model-store` group.
6. Verify that user information is modified correctly.

|before|after|
|---|---|
|![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lSyr8xXz1wdXALkJKzVx/68176aef-2729-41f2-9084-541fc9f45576.png)|![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lSyr8xXz1wdXALkJKzVx/98fe7179-c7cc-4720-83ac-4fc13478e7f8.png)|

|Info Modal||
|---|---|
|![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lSyr8xXz1wdXALkJKzVx/21382d4d-1b60-4017-b59f-c042f25e969e.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
@yomybaby yomybaby force-pushed the feat/user-list-page branch from 88112af to 1f06be9 Compare November 6, 2024 08:17
@yomybaby yomybaby changed the base branch from graphite-base/2757 to main November 6, 2024 08:18
@yomybaby yomybaby force-pushed the feat/user-list-page branch from 1f06be9 to 42880b8 Compare November 6, 2024 08:18
Copy link

github-actions bot commented Dec 10, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
5.2% (-0.03% 🔻)
398/7655
🔴 Branches
4.48% (-0.02% 🔻)
237/5295
🔴 Functions
3.1% (-0.03% 🔻)
78/2520
🔴 Lines
5.12% (-0.03% 🔻)
383/7486
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / UserCredentialsPage.tsx
0% 0% 0% 0%
🔴
... / UserList.tsx
0% 0% 0% 0%

Test suite run success

124 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from 60dedfb

@yomybaby yomybaby force-pushed the feat/user-list-page branch from 747bd07 to 11e7f67 Compare December 11, 2024 03:33
@yomybaby yomybaby changed the title feat: migrate user list in user credential page to react component feat: migrate users and credentials page to react component Dec 11, 2024
@ironAiken2 ironAiken2 force-pushed the feat/user-list-page branch 2 times, most recently from b375e78 to 59b79b0 Compare December 11, 2024 07:10
@yomybaby yomybaby force-pushed the feat/user-list-page branch 2 times, most recently from 682b18e to 0559656 Compare December 13, 2024 03:09
@yomybaby yomybaby changed the title feat: migrate users and credentials page to react component feat: migrate /credentials page to react component Dec 16, 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.

The UserList.tsx will be replaced with UserNodeList.tsx in PR #2934. With the changes in PR #2934, this looks good to me (LGTM).

@yomybaby yomybaby marked this pull request as ready for review December 16, 2024 01:56
Copy link

graphite-app bot commented Dec 16, 2024

Merge activity

### This PR is about migrating User Credential page and User List to react component.

>! This PR should be merged after the implementation is complete up to the Credential Tab [#2758](#2758). !

Since the existing user and credential tabs are not composed of separate code, I decided to migrate the user list to react and the credential list to web components at once, as it would be too laborious to configure them as both react and web components.

**Changes:**

- Created a new `UserCredentialsPage` component in React
- Implemented `UserList` component to display user information
- Updated `UserInfoModal` and `UserSettingModal` to work with the new React components
- Removed legacy web components for user credentials and settings
- Added new translations for "Created At" in multiple languages
- Updated routing in `App.tsx` to include the new `UserCredentialsPage`

**How to test:**

1. Navigate to the User Credentials page
2. Verify that the user list is displayed correctly
3. Test filtering and pagination functionality
4. Check that user info and settings modals open and function properly
5. Confirm that creating, modifying, and deleting users work as expected

|before|after|
|---|---|
|![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lSyr8xXz1wdXALkJKzVx/6997ae0b-3fca-4353-bf24-77f164521971.png)|![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lSyr8xXz1wdXALkJKzVx/a2338d3c-bb1c-41af-b8b2-201b3a963a89.png)|
|![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lSyr8xXz1wdXALkJKzVx/86a3b51c-996e-451e-97d6-50b7de832a3e.png)|![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lSyr8xXz1wdXALkJKzVx/4126770a-fdfa-4e83-866e-76e259f4e320.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
@yomybaby yomybaby force-pushed the feat/user-list-page branch from de17251 to 60dedfb Compare December 16, 2024 02:07
@graphite-app graphite-app bot merged commit 60dedfb into main Dec 16, 2024
8 checks passed
@graphite-app graphite-app bot deleted the feat/user-list-page branch December 16, 2024 02:10
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. size:XL 500~ LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants