-
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
[ES|QL] Improves the authoring of the query and charts #186875
Conversation
Hi @stratoula, a very nice addition to our ES|QL Dashboard UX here! As requested by @teresaalvarezsoler here's a first round of design feedback I wanted to share. a) I don’t think we should be offering the entire power of Discover in such a small area. Therefore, I suggest we provide a simplified version of Discover here.
b) If I make any changes to the table, including resizing the columns, and then I edit and re-run the query, my changes to the table should not be altered. This is not the behavior currently. See:
c) Other suggestions and/or findings |
@andreadelrio thanx, not sure when I will find the time to work with this PR again but some comments:
This is true but as the same happens for viz changes I suggest to tackle them together. (I have a task for this in 8.17)
My guess is that this is how Discover works in small spaces but I will take a look |
That's a part of kibana/packages/kbn-unified-data-table/src/components/custom_toolbar/render_custom_toolbar.tsx Line 51 in 339379e
|
@andreadelrio thanx a lot for your review As I mention above I have addressed everything except from the b. This is something which also works like that currently for the vis configuration settings and we are going to handle it most possibly in 8.17. One note: I added the Open In Discover link but next to the columns sort button as the Discover toolbar has already a setting to add a new control there. Are you ok with it? Otherwise I will need to create a new position and will make the component a little bit more complicated. |
Thanx @andreadelrio, yes is not at the scope of this PR (lovely idea btw). I am going to return to this PR hopefully this week. I am dealing with other tasks with greater priority so this is mostly a PR I am working on my free time. @andreadelrio can you create an issue with the above comment for the presentation team (I assume it is their territory) if there is not one already? |
@andreadelrio about this:
|
@andreadelrio I addressed your comments, can you give another look? 🙏 @elastic/kibana-visualizations same, I addressed Marco's comments, I know his out but I would appreciate a followup review 🙇♀️ |
@@ -47,7 +59,8 @@ const DataGrid: React.FC<ESQLDataGridProps> = (props) => { | |||
const [activeColumns, setActiveColumns] = useState<string[]>( | |||
(props.initialColumns || (props.isTableView ? props.columns : [])).map((c) => c.name) | |||
); | |||
const [rowHeight, setRowHeight] = useState<number>(5); | |||
const [rowHeight, setRowHeight] = useState<number>(props.initialRowHeight ?? 5); | |||
const [rowsPerPage, setRowsPerPage] = useState(10); |
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 constant is used here and then again in line 212. Could we export it to the variable? The one above too:
const DEFAULT_INITIAL_ROW_HEIGHT = 5
const DEFAULT_ROWS_PER_PAGE = 10
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.
Sure e5f0fdc
@@ -128,6 +135,30 @@ export function LensEditConfigurationFlyout({ | |||
return () => s?.unsubscribe(); | |||
}, [dispatch, output$, layers]); | |||
|
|||
useEffect(() => { |
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.
why is this needed here?
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 is because you need to initialize it, otherwise the accordion is not visible, only runs in the initialization btw
@@ -479,6 +508,78 @@ export function LensEditConfigurationFlyout({ | |||
/> | |||
</EuiFlexItem> | |||
)} | |||
{isOfAggregateQueryType(query) && canEditTextBasedQuery && dataGridAttrs && ( |
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.
Is it worth to extract this to a component?
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.
Hmmm, we don't do it for the other accordion items 🤔 I don't think we will gain a lot, on the contrary you will need to pass a lot of properties to the component. The ESQLDatagrid is already a reusable component.
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.
Done here b64dc30. As I said you don't gain a lot but it is not bad either!
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.
LGTM, tested in Chrome 👌🏼
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.
@stratoula 🚀 Amazing work here! Thanks for working on all the UI polish tasks. Just one nit, let's make the icon in the Open in Discover
blue as well (right now it shows in teal and black). Approving now assuming you can take care of that.
Related task (improve Preview
) is already being tracked here.
#187864 (comment)
@andreadelrio thanx a lot for your help with the design here! |
/ci |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
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.
ES|QL code changes LGTM.
Summary
It makes the authoring of the ES|QL query easier by:
Checklist