-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Enterprise Search] Added the InlineEditableTable component #107208
[Enterprise Search] Added the InlineEditableTable component #107208
Conversation
// TODO This could likely be a selector | ||
isEditing: boolean; | ||
// TODO we should editingItemValue have editingItemValue and editingItemId should be a selector |
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.
Just to check, I'm seeing 7 TODO type comments in the full diff - were they left in intentionally for a future PR or did you want to address them before merge?
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 left them in as something we could do later at some point. Not critical though. I'm not doing them in this PR in any case, so if you'd prefer I'm happy to just remove them.
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.
Nope, I think they serve well as future TODOs!
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 still need to QA this but it looks good. There are a bunch of todos as @constancecchen pointed out, is the plan to address those in a future PR for GenericEndpointInlineEditableTable
or as tech debt down the road?
/> | ||
); | ||
const bindLogic = wrapper.find(BindLogic); | ||
expect(bindLogic.props()).toEqual( |
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.
🤯
>; | ||
|
||
export const InlineEditableTableLogic = kea<InlineEditableTableLogicType<ItemWithAnID>>({ | ||
path: (key: string) => ['enterprise_search', 'inline_editable_table_logic', key], |
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 remember losing so much time before realizing I had to use a function for the path
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 remember Byron swooping in like an eagle and solving this for me! 🎉
import { Column } from '../reorderable_table/types'; | ||
|
||
export interface FormErrors { | ||
[key: string]: string | undefined; |
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 wonder if this needs the | undefined
. This should be equivalent to
export interface FormErrors {
[key: string]: string;
}
I think?
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.
Good point
@elasticmachine merge upstream |
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.
Thanks @JasonStoltz!
💚 Build SucceededMetrics [docs]Module Count
Async chunks
To update your PR or re-run it, just comment with: |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
Summary
This is a component required by the Crawler view. It is a wrapper around the ReorderableTable component. It adds CRUD operations for the items in the table.
This commit history in this PR is NOT very coherent. This PR unfortunately will likely need to be reviewed as one big diff.
While this is mostly a port from the component of the same name from
ent-search
, there are a few key changes that I made along the way:Item
acted as the unique "id" field of that item. I dropped that and instead we are requiring that all items used with this component have an "id" field. This was for simplicity.BindLogic
so that we can use the logic in sub-components without having to pass through the key (and other props) down through the component tree.To get an idea of what all of the scenarios that this component can be used for, please check out both the unit tests and the component library.
Checklist
Delete any items that are not applicable to this PR.
For maintainers