-
Notifications
You must be signed in to change notification settings - Fork 367
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
upcoming: [M3-7580] - Add search field to Create Linode UIs #10088
upcoming: [M3-7580] - Add search field to Create Linode UIs #10088
Conversation
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.
This component was reworked to allow externally managing the state of the TextField
. This is necessary for pre-filling the text field. This component is used in the following, which need to be tested for regressions:
TransferTable
FirewallDeviceLanding
FromAppsContent
LongviewClients
StackScriptBase
VPCSubnetsTable
/* | ||
This `didCancel` business is to prevent a warning from React. | ||
See: https://github.com/facebook/react/issues/14369#issuecomment-468267798 | ||
*/ | ||
let didCancel = false; | ||
/* | ||
don't run the search if the query hasn't changed. | ||
This is mostly to prevent this effect from running on first mount | ||
*/ |
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.
Need to test to make sure this behavior is preserved.
<DebouncedSearchTextField | ||
sx={{ | ||
marginBottom: theme.spacing(1), | ||
width: '330px', |
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.
Coverage Report: ✅ |
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.
Behavior looks good, just have a few comments/questions!
const [preselectedLinodeID] = React.useState( | ||
flags.linodeCloneUIChanges && selectedLinodeID | ||
); |
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.
Does this piece of state need to exist? Should we add a comment explaining why this is needed as opposed to using selectedLinodeID
directly?
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.
This is to prevent the search term from changing whenever the user selects a different linode.
Good idea to include this as a comment.
packages/manager/src/components/DebouncedSearchTextField/DebouncedSearchTextField.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/components/DebouncedSearchTextField/DebouncedSearchTextField.tsx
Outdated
Show resolved
Hide resolved
Thanks for the suggestion. I will check with UX. |
Description 📝
Adds a search field to the Clone Linode and Create Linode from Backup flows to allow users to filter Linodes based on their labels.
These changes are gated behind the
linodeCloneUIChanges
feature flag.Changes 🔄
DebouncedSearchTextField
to allow field state to be externally managedPreview 📷
Screen.Recording.2024-01-19.at.6.30.35.PM.mov
Screen.Recording.2024-01-19.at.6.24.13.PM.mov
How to test 🧪
DebouncedSearchTextField
continue to work as expectedAs an Author I have considered 🤔
Check all that apply