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: Introduce SettingList component for setting page UI #2212

Merged
merged 15 commits into from
Feb 29, 2024

Conversation

ironAiken2
Copy link
Contributor

@ironAiken2 ironAiken2 commented Feb 14, 2024

This PR Resolves #2209 issue, revamping Setting-related components.

The modifications to the UserSettingPage component serve as an example of how to use the SettingList component. If the PR is approved, will roll back these changes.

Features

Edit tasklist title
Beta Give feedback Tasklist Features, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Separate components into SettingPage and SettingPageItem to manage each option item through the settingOption array.
    Options
  2. Added function to filter for specific options via search.
    Options
  3. Show and reset icons for non-default settings
    Options
  4. Filter to show only overridden items
    Options
  5. Display the number of filtered option items
    Options

UI Changes

Edit tasklist title
Beta Give feedback Tasklist UI Changes, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Modified to place each option item in a single horizontal column.
    Options
  2. Add an Input component for search
    Options
  3. Use the Antd badge to distinguish changed options.
    Options

Checklist: (if applicable)

How to use

/parents component

  1. Define each option (type : { title: string; options: SettingItemProps[]}[] )
  2. Pass that data to the SettingList component as a property.
  • 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

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2212.d3g9cs6u59b8lw.amplifyapp.com

settingOptions: [string, SettingItemProps[]][];
}

const SettingPage: React.FC<SettingPageProps> = ({

This comment was marked as resolved.

/>
</Flex>
<Flex direction="column" align="start">
<List

This comment was marked as resolved.

@yomybaby yomybaby changed the title feat: adapting the new UI and implementing features feat: Introduce SettingList component for setting page UI Feb 19, 2024
@github-actions github-actions bot added size:L 100~500 LoC and removed size:XL 500~ LoC labels Feb 20, 2024
@ironAiken2 ironAiken2 marked this pull request as ready for review February 20, 2024 05:21
@agatha197
Copy link
Contributor

@ironAiken2 please resolve the conflicts :)

@github-actions github-actions bot added size:XL 500~ LoC and removed size:L 100~500 LoC labels Feb 28, 2024
Copy link

github-actions bot commented Feb 28, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
2.93% (-0.04% 🔻)
102/3486
🔴 Branches
3.1% (-0.05% 🔻)
69/2229
🔴 Functions
1.45% (-0.02% 🔻)
17/1175
🔴 Lines
2.98% (-0.04% 🔻)
102/3422
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / SettingItem.tsx
0% 0% 0% 0%
🔴
... / SettingList.tsx
0% 0% 0% 0%

Test suite run success

20 tests passing in 4 suites.

Report generated by 🧪jest coverage report action from 517439a

@yomybaby
Copy link
Member

Thank you for your contribution. I pushed several commits to improve layout and composability. Now, the setting components introduced in this PR are ready to be merged. We need to convert backend-ai-settings-store.ts into a React hook while maintaining compatibility before using these components for the User setting page.

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.

I rolled back UserSettingsPage and renamed the new version to UserSettingsPage2. After the setting React hook is ready, let's apply UserSettingsPage2. Therefore, this PR does not have any impact on the WebUI yet. @agatha197 @ironAiken2

I approve this PR and merge.

@yomybaby yomybaby merged commit eb65870 into main Feb 29, 2024
8 checks passed
@yomybaby yomybaby deleted the feat/revamp-setting-page branch February 29, 2024 01:06
@yomybaby
Copy link
Member

🤯 Oh! I forgot to push a commit for rollback. I'll make another PR to fix it and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting List UI React components
3 participants