Skip to content
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

App Search - Polishing Analytics Views #92939

Merged

Conversation

daveyholler
Copy link
Contributor

Summary

Makes some visual adjustments to the Analytics views.

Screenshot from 2021-02-25 15-31-07
Screenshot from 2021-02-25 15-31-15
Screenshot from 2021-02-25 15-31-22

Checklist

Delete any items that are not applicable to this PR.

For maintainers

Comment on lines 30 to 34
{iconType ? (
<EuiFlexItem grow={false}>
<EuiIcon type={iconType} size="l" />
</EuiFlexItem>
) : null}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds the ability for an icon to be passed into the header

Comment on lines 1 to 5
.entSearch__table--noBackground {
.euiTable {
background-color: transparent;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of a workaround right now to use the tables on the subdued panels for amsterdam. Until this is officially supported in EUI, this should suffice.

</EuiBadgeGroup>
);

return displayCountOnly ? <TagToolTip /> : <TagList />;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces a way to render only a tooltip with a total tag count. Works well for cases where the tables are small and compact.

Copy link
Contributor

@cee-chen cee-chen Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused by this because it looks like none of the tables are rendering a <TagList /> now, even though it feels like the RecentQueriesTable and the QueryClicksTable could:

From the code I think I see why and what we need to change, but just want to check with you first that we even still even want the <TagToolTip /> component - it would be much simpler code-wise to only have one way of displaying tags.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed now in 5e1fc00:

tags

<EuiSpacer />
{children}
</EuiPanel>
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a new component called DataPanel that supports rendering things like tables and charts with a title, subtitle, and action

Comment on lines 30 to 52
<DataPanel
data-test-subj="TotalQueriesChart"
title={TOTAL_QUERIES}
subtitle={LAST_7_DAYS}
action={
<EuiButtonEmptyTo
iconType="eye"
to={generateEnginePath(ENGINE_ANALYTICS_PATH)}
size="s"
>
{VIEW_ANALYTICS}
</EuiButtonEmptyTo>
}
>
<AnalyticsChart
lines={[
{
id: TOTAL_QUERIES,
data: convertToChartData({ startDate, data: queriesPerDay }),
},
]}
/>
</DataPanel>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses the new DataPanel component. Eventually (in later updates of Amsterdam) this will support 2 basic versions of panels... a subdued version and a bordered version. Charts will use the bordered version.

Comment on lines +40 to +47
<EuiFlexGroup>
<EuiFlexItem grow={1}>
<TotalStats />
</EuiFlexItem>
<EuiFlexItem grow={3}>
<TotalCharts />
</EuiFlexItem>
</EuiFlexGroup>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renders the stats and charts in a row, rather than stacked vertically.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to adjust/reduce the chart height the charts at all as a result? They look a little squashed on a laptop screen:

Also there's some extra space that the current height is causing on the stat cards which we could easily lose:

Screen Shot 2021-03-01 at 4 34 00 PM

Example with a height={240} passed into both AnalyticsCharts in the TotalCharts component:

The above looks slightly more balanced to me - what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call 👍🏼

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,22 @@
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a new icon. This directory will also include our icons for engines and meta_engines and all other app search specific icons we'll have. (Like on the relevance tuning pages)

@daveyholler daveyholler marked this pull request as ready for review February 25, 2021 23:45
@daveyholler daveyholler requested review from a team February 25, 2021 23:45
@daveyholler daveyholler added release_note:skip Skip the PR/issue when compiling release notes v7.13.0 labels Feb 25, 2021
@byronhulcher byronhulcher self-requested a review March 1, 2021 16:46
@byronhulcher
Copy link
Contributor

Hey @daveyholler I'm going to take a look at this tomorrow (Tuesday)!

@daveyholler
Copy link
Contributor Author

@elasticmachine merge upstream

1 similar comment
@cee-chen
Copy link
Contributor

cee-chen commented Mar 1, 2021

@elasticmachine merge upstream

@cee-chen
Copy link
Contributor

cee-chen commented Mar 1, 2021

@daveyholler just FYI I think there was a space in the front of your comment which caused elasticmachine to ignore you, it's very picky that way 😬

</EuiBadgeGroup>
);

return displayCountOnly ? <TagToolTip /> : <TagList />;
Copy link
Contributor

@cee-chen cee-chen Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused by this because it looks like none of the tables are rendering a <TagList /> now, even though it feels like the RecentQueriesTable and the QueryClicksTable could:

From the code I think I see why and what we need to change, but just want to check with you first that we even still even want the <TagToolTip /> component - it would be much simpler code-wise to only have one way of displaying tags.

Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to stop here for the night, my brain is pretty fried, but I still have DataPanel and tables/charts to look at - I'll continue reviewing tomorrow.

I do strongly want to say that I think this PR could have been broken up into much smaller and more atomic PRs and that would have personally made reviewing significantly easier for me in terms of QA and code review. For example, InlineTagsList could have been its own PR, DataPanel could have been its own PR, icons in AnalyticsHeader could have been separate, and so on and so forth.

I'd really appreciate discussing that approach more if we're going to continue doing polish PRs throughout the migration - smaller and more contained PRs are almost always going to be way more manageable and easier for reviewers to set aside time for, and I honestly think you'll have a better experience as well (in terms of getting help/review sooner, CI issues, and not having a ton of change requests per PR).

cee-chen added 9 commits March 2, 2021 10:50
- Remove unused svg file
- Add TODO comment
- Add test coverage
TotalCharts
- adjust chart height
- tests: simplify / convert back to shallow

RecentApiLogs
- switch to DataPanel
Component
- move CSS table bg override out from being an AnalyticsTable concern to a DataPanel concern
  + bem naming, todo comment
- add responsive={false} for better mobile UX
- add className and data-test-subj prop passing
- change title to pass full heading tags rather than a string
- move subtitle below title for better screen reader order
- add index.ts export

Tests
- capitalization for consistency, ordering/describe
- remove data-test-subjs on source code (simpler to grab & inspect tags directly so we can more easily call .text() on passed content)
- add new tests for props (fliled/className/data-test-subj)

Usage
- update other files using DataPanel to start passing heading tags + use index export
- fix RecentApiLogs tests
- change RecentQueries section to use a DataPanel (per Davey)
Tags
- Rename to more general tags.tsx file
- Add CSS limiting width of variable length tags
- Break up into two separate components for easier readability & testing
- Split up tags column constants so that the wider tables can use the old tags list component

Tables
- add isSmall flag to AnalyticsTable to use new tag count  component
- reduce actions column width
- revert unnecessary table test changes

Analytics
- add custom CSS that switches tables/panels into full-width earlier
- fix responsive behavior with icon
- add missing AnalyticsSection branch coverage
Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Various responsive before/after screencaps

gutterSize="xs"
alignItems="center"
justifyContent="flexStart"
responsive={false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before (no responsive={false}):

After:


return (
<EuiPanel {...props} color={filled ? 'subdued' : 'plain'} className={classes} hasShadow={false}>
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center" responsive={false}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before (no responsive={false}):

After:

Comment on lines +1 to +5
.analyticsOverviewTables {
@include euiBreakpoint('xs', 's', 'm', 'l') {
flex-direction: column; // Force full width on table panels earlier to ensure content stays legible
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:

After:
responsive

@cee-chen
Copy link
Contributor

cee-chen commented Mar 3, 2021

@daveyholler That's the last of my changes for now! Thanks for letting me push directly to your branch - hopefully this was a faster experience for both of us :) Please do pull down the latest commits and test them out locally and let me know if everything looks good to you or if you see any issues. I've tested at various responsive widths and am fairly satisfied the new changes look functional on all of them.

If any specific changes in any commits look odd to you or you're not sure why a change was made, definitely let me know and I'm happy to dive into it!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1322 1353 +31

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 2.1MB 2.1MB +14.8KB
triggersActionsUi 1.6MB 1.5MB -23.9KB
total -9.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 104.0KB 104.1KB +82.0B
Unknown metric groups

async chunk count

id before after diff
triggersActionsUi 41 42 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@daveyholler
Copy link
Contributor Author

daveyholler commented Mar 3, 2021

@constancecchen this stuff looks so good. Thanks a million for helping out.


@byronhulcher FYI: The DataPanel component we chatted about will land with this PR.

@cee-chen
Copy link
Contributor

cee-chen commented Mar 3, 2021

No problem! Let me know whenever you've pulled down and vetted/QA's all the changes and if you don't see any issues/change requests, I can approve and we can merge after if that sounds good

Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looked good just now during demos, so I'm gonna go ahead and approve :trollface:

@daveyholler daveyholler merged commit c0aa199 into elastic:master Mar 3, 2021
@cee-chen
Copy link
Contributor

cee-chen commented Mar 3, 2021

@daveyholler shoot, I forgot to remind you to add the auto-backport label - without it, you'll have to manually run yarn backport and babysit/merge your backport PR. LMK if I can answer any q's about that!

daveyholler added a commit that referenced this pull request Mar 4, 2021
* WIP analytics polish

* Working on tests.

* Finishing up tests.

* Updating the engine overview page.

* eslint fixes

* i18n fixes

* Icons feedback

- Remove unused svg file
- Add TODO comment
- Add test coverage

* linting - unnecessary ternaries

* EnginesOverview feedback

TotalCharts
- adjust chart height
- tests: simplify / convert back to shallow

RecentApiLogs
- switch to DataPanel

* DataPanel feedback

Component
- move CSS table bg override out from being an AnalyticsTable concern to a DataPanel concern
  + bem naming, todo comment
- add responsive={false} for better mobile UX
- add className and data-test-subj prop passing
- change title to pass full heading tags rather than a string
- move subtitle below title for better screen reader order
- add index.ts export

Tests
- capitalization for consistency, ordering/describe
- remove data-test-subjs on source code (simpler to grab & inspect tags directly so we can more easily call .text() on passed content)
- add new tests for props (fliled/className/data-test-subj)

Usage
- update other files using DataPanel to start passing heading tags + use index export
- fix RecentApiLogs tests
- change RecentQueries section to use a DataPanel (per Davey)

* Analytics tags - updates & responsive tweaks

Tags
- Rename to more general tags.tsx file
- Add CSS limiting width of variable length tags
- Break up into two separate components for easier readability & testing
- Split up tags column constants so that the wider tables can use the old tags list component

Tables
- add isSmall flag to AnalyticsTable to use new tag count  component
- reduce actions column width
- revert unnecessary table test changes

Analytics
- add custom CSS that switches tables/panels into full-width earlier

* AnalyticsSection fixes

- fix responsive behavior with icon
- add missing AnalyticsSection branch coverage

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Constance Chen <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Constance Chen <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 4, 2021
* master: (48 commits)
  Fix wrong import in data plugin causing 100kB bundle increase (elastic#93448)
  [Fleet] Correctly track install status of an integration (elastic#93464)
  Reviews data frame analytics UI text (elastic#93033)
  Display multiple copyable fields for process.args in resolver node detail panel (elastic#93280)
  [Security Solution][Detections] ML Popover overflow fix (elastic#93525)
  chore(NA): do not use execa on bazel workspace status update script (elastic#93532)
  Bump dependencies (elastic#93511)
  [dev/build_ts_refs] support disabling the ts-refs build completely (elastic#93529)
  [Security Solution] fix data provider cypress test (elastic#93465)
  Fix service map for All environment single service (elastic#93517)
  [Fleet] Fix package version comparaison in the UI (elastic#93498)
  [alerting] adds doc on JSON-expanded action variables and task manager max_workers (elastic#92720)
  [dev/build_ts_refs] ignore type checking failures when building ts refs (elastic#93473)
  [core-new-docs] Adds a dev-doc for core documentation (elastic#92976)
  remove opacity from maps legacy style (elastic#93456)
  [Security Solution][Lists] Escape quotes in list ids and quote the id in KQL query (elastic#93176)
  Revert "Make tests deterministic by providing unique timestamps (elastic#93350)"
  [Discover] Fix link from dashboard saved search to Discover (elastic#92937)
  update public api docs
  App Search - Polishing Analytics Views (elastic#92939)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants