-
Notifications
You must be signed in to change notification settings - Fork 76
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
refactor(FR-357): NEO configurations page using Setting List #3077
base: main
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
Coverage report for
|
…o refactor/configurations-react
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a several requests to change before this PR is merged.
-
Update on-the-fly
I'm not sure update on blur event is a good choice or not.
In both "overlay network" setting and "scheduler". I think is better to have "update" button to click so that they know what they've been changed, explicitly. Besides, everytime input field is on blur, update happens; which makes continuous update requests with snackbar, which seems a bit distracted. Therefore I guess It's better to have "update" button in the modal for user to request explicitly. If you have any other options, please tell us.
Screen Recording 2025-02-13 at 5.44.59 PM.mov (uploaded via Graphite) -
Would Snackbar notification is the best option?
I'm not sure about this either...probably after updating the request from above will make it okay, but I think we should make the height of notification(snack bar) little bit shortened than current status. I think is too big to distract the changes.
I think so. Previously, a warning modal would appear when user doesn't save the value and close it, but I removed that modal and changed it to save on-the-fly using I used that notification due to the previous legacy. How about using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nowgnuesLee It would be nice to fix the conflict so that I can review this :)
@@ -354,7 +357,11 @@ const router = createBrowserRouter([ | |||
}, | |||
{ | |||
path: '/settings', | |||
handle: { labelKey: 'webui.menu.Configurations' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please recover handle. It's for display breadcrumb title.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm sorry. I'll recover it.
); | ||
if (result === 'ok') { | ||
updatePulling(); | ||
message.success(t('notification.SuccessfullyUpdated')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a good idea to call a function to render the UI (e.g., message.success
). My suggestion is to remove useBAIConfigurationSettings
and move all the logic from this file to each item in ConfigurationSettingList.tsx
. Since the logic for each item is neither lengthy nor dependent, it would be better to keep the related code close together to enhance readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had been thinking about it as well, but your suggestion has made it clearer. Thank you.
react/src/components/SettingItem.tsx
Outdated
...selectProps?.style, | ||
marginTop: token.marginXS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The style from the prop should have higher priority. More specifically defined styles should take precedence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I'll fix it up.
<Flex> | ||
{labels[key]} | ||
<Tooltip title={tooltipText[key]}> | ||
<Button type="link" icon={<InfoCircleOutlined />} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Form.Item has 'tooltip` prop. Please use it. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't know about it. Thank you for pointing that out. :)
<Form.Item | ||
label={ | ||
<Flex> | ||
{labels[key]} | ||
<Tooltip title={tooltipText[key]}> | ||
<Button type="link" icon={<InfoCircleOutlined />} /> | ||
</Tooltip> | ||
</Flex> | ||
} | ||
required | ||
rules={[ | ||
{ | ||
required: true, | ||
message: t('data.explorer.ValueRequired'), | ||
}, | ||
]} | ||
name={key} | ||
key={key} | ||
> | ||
<InputNumber | ||
min={optionRange[key].min} | ||
max={optionRange[key].max} | ||
style={{ | ||
width: '100%', | ||
}} | ||
/> | ||
</Form.Item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem necessary to manage networkOptions
as a separate array and use the map function to create the UI. It looks like you did this considering the possibility of adding more options in the future. However, currently, there's only one option, and there's no guarantee that future additions will follow the same rule or use InputNumber
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I will modify everything that was managed as an array. Thank you! :)
resolves #3015 (FR-357)
changes
SettingList
componentnotification
tomessage
Save
button and validate.note
component on upside.Checklist: (if applicable)