-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Added a SuggestionsTable to Curations view #113123
Conversation
@elasticmachine merge upstream |
}} | ||
onChange={handlePageChange(onPaginate)} | ||
/> | ||
<DataPanel |
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'm using DataPanel
for both this new table AND I've updated the curations table to use it as well.
It seems to match exactly what the designs call for and it keep our code consistent.
|
||
return ( | ||
<DataPanel | ||
icon={<LightbulbIcon />} |
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 lightbulb Icon is not yet part of EUI. For that reason, I created a new component ( thanks to @daveyholler ), and added a new optional icon
property to DataPanel
that takes an element (as opposed to the existing option that just takes an iconType
property).
// TODO wire up this data | ||
const items: CurationSuggestion[] = [ | ||
{ | ||
query: 'foo', | ||
updated_at: '2021-07-08T14:35:50Z', | ||
promoted: ['1', '2'], | ||
}, | ||
]; | ||
const meta = { | ||
page: { | ||
current: 1, | ||
size: 10, | ||
total_results: 100, | ||
total_pages: 10, | ||
}, | ||
}; | ||
const totalSuggestions = meta.page.total_results; | ||
// TODO | ||
// @ts-ignore | ||
const onPaginate = (...params) => { | ||
// eslint-disable-next-line no-console | ||
console.log('paging...'); | ||
// eslint-disable-next-line no-console | ||
console.log(params); | ||
}; | ||
const isLoading = false; |
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 entire section is what will be wired up in a subsequent PR.
) : ( | ||
<EmptyState /> | ||
// TODO | ||
const shouldShowSuggestions = true; |
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 will be wired up in a subsequent PR
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 looks good but small feedback on adding the icon
prop to the DataPanel
component.
@@ -30,6 +30,7 @@ interface Props { | |||
titleSize?: EuiTitleProps['size']; | |||
subtitle?: React.ReactNode; | |||
iconType?: EuiIconProps['type']; | |||
icon?: React.ReactElement; |
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 don’t think you actually need to add an icon prop to DataPanel . The type property of an EuiIcon component already accepts a ReactElement, for instance here we’re already using that functionality to pass a custom SVG icon into a DataPanel.
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 nice! I had no idea, I appreciate that. I will make the change.
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.
Thanks for making that change, let's merge!
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
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 PR implements the Suggestions Table view only. It is not wired up. I will wire it up in a subsequent PR.
Checklist
For maintainers