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] Engine overview layout stub #83504

Merged
merged 11 commits into from
Nov 18, 2020

Conversation

cee-chen
Copy link
Contributor

Summary

This PR stubs out the Engine Overview layout. It is still currently missing the following components, which will be added next:

  • CodeExample
  • DocumentCreationButtons & DocumentCreationModal
  • Analytics chart (high lift)
  • API Logs Table (this will likely be done significantly later / we migrate the API table view, although I also might give this a shot over the quieter December holidays, we'll see)

Screencaps

Populated Engine Metrics

Empty Engine

Engine data unavailable/still indexing

(not sure I've ever seen this personally)

Checklist

@cee-chen cee-chen added Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.11.0 labels Nov 16, 2020
@cee-chen cee-chen requested review from JasonStoltz and a team November 16, 2020 23:20
export const TOTAL_CLICKS = i18n.translate(
'xpack.enterpriseSearch.appSearch.engine.analytics.totalClicks',
{ defaultMessage: 'Total Clicks' }
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These constants are also used in the Analytics view so I figured I'd do myself a favor and start a constants file early.

export const RECENT_API_EVENTS = i18n.translate(
'xpack.enterpriseSearch.appSearch.engine.apiLogs.recent',
{ defaultMessage: 'Recent API Events' }
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above, this title is also used in the API Logs view

export { UnavailablePrompt } from './unavailable_prompt';
export { TotalStats } from './total_stats';
export { TotalCharts } from './total_charts';
export { RecentLogs } from './recent_logs';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went back and forth a little on whether I should split out the metrics view into sub-components, and I'm very happy I did in the end. The code feels much easier to test and reason about in smaller bite-sized files.

I left the empty engine view as one piece/component but definitely open to splitting that up as well if folks think that will help readability.

Comment on lines +61 to +66
TODO: Analytics chart
{/* <EngineAnalytics
data={[queriesPerDay]}
startDate={new Date(startDate)}
endDate={new Date(endDate)}
/> */}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be clear I'm not 100% on if this will translate perfectly to EuiChart as I haven't spiked that out much, I'm just leaving this in as reference from our old code


export const UnavailablePrompt: React.FC = () => (
<EuiEmptyPrompt
iconType="clock"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've never actually seen this prompt before, so this was my best guesstimate on migrating a STUI icon to EUI

@cee-chen cee-chen force-pushed the engine-overview branch 2 times, most recently from 2644fa9 to fdf1a4d Compare November 17, 2020 01:21
- They're repeated/reused by the DocumentCreationPopover component
</EuiPageContentHeader>
<EuiPageContentBody>
<EuiText color="subdued">
<p>{DOCUMENT_CREATION_DESCRIPTION}</p>
Copy link
Contributor Author

@cee-chen cee-chen Nov 17, 2020

Choose a reason for hiding this comment

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

I just discovered this (and the API indexing title/description) is reused word for word in the Index Documents modal, so I pulled it out to a constants file:

It makes the page a tad hard to "read" without looking at the actual compiled app, but what can you do 🤷

Copy link
Member

@JasonStoltz JasonStoltz left a comment

Choose a reason for hiding this comment

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

I had some comments and questions, but none of it's blocking. Feel free to merge as is, or address as you see fit.

const engineRoute = getEngineRoute(engineName);

return (
<EuiPageContent>
Copy link
Member

Choose a reason for hiding this comment

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

Semantically, are pages meant to have multiple EuiPageContent in EUI? Or is there some other tag available for page sections?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Semantically I don't see a reason why not as they're not using <main> components under the hood (which is what we're using for EuiPageBody) - they're just plain <div>s which carry no extra meaning to web crawlers or screen readers.

title={
<h2>
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.overview.unavailableTitle', {
defaultMessage: 'Dashboard metrics are currently unavailable',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
defaultMessage: 'Dashboard metrics are currently unavailable',
defaultMessage: 'Dashboard metrics are currently unavailable.',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 For a lot of these casing comments, I was copying these over from ent-search as-is, but I think it makes a lot of sense to update them as we migrate. Will do so going forward!

Copy link
Contributor Author

@cee-chen cee-chen Nov 18, 2020

Choose a reason for hiding this comment

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

I went back and looked at some of EuiEmptyPrompt examples and I think the headings are actually not supposed to have punctuation: https://elastic.github.io/eui/#/display/empty-prompt and

Screen Shot 2020-11-18 at 10 55 35 AM

So going to leave this one as-is 🤷

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense 👍

<EuiTitle size="l">
<h1>
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.overview.empty.heading', {
defaultMessage: 'Engine Setup',
Copy link
Member

Choose a reason for hiding this comment

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

Per the Kibana writing guidelines, I think stuff like this should not be Title Cased. I'm actually unsure of this one.

Suggested change
defaultMessage: 'Engine Setup',
defaultMessage: 'Engine setup',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chriscressman Do you mind weighing in on this here? Should we be updating various headings and buttons to use sentence case over title case as we migrate to Kibana?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we should consistently use sentence case in all our UIs. This is a company-wide style rule. The Kibana migration is a great opportunity to align. Thanks for checking!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also @JasonStoltz - should Engine overview also be sentence cased vs title cased in that case? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think ideally we would change all heading and button text within these screens to use sentence case.

@gchaps is the expert on Kibana (and Elastic) UI text. Can you confirm Gail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Chris! I think my confusion is what's considered a "Feature Title" vs not. "Overview" is technically the title of the page and is capitalized in the navigation, does that make it a feature that should remain capitalized?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for opening this can of worms 😬

Copy link
Contributor

@chriscressman chriscressman left a comment

Choose a reason for hiding this comment

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

Set up the "empty" Engine

I'd change this to:

Setting up the "empty" engine

since the text in that section is explaining the process rather than providing a step-by-step procedure. The second form is also consistent with the next heading on the page.

Other than the suggestion above, and the suggestion to use title casing, this looks good to me.

@cee-chen
Copy link
Contributor Author

Re: copy - I'll definitely make an effort to grab any low-hanging fruit going forward, but App Search definitely has a lot of scenarios where it's unclear what's a Feature Title/proper noun vs over-enthusiastic title casing. We also have a lot of code to shift and a tight release deadline without much wiggle-room, and we can't necessarily afford to wait for extra reviews to merge PRs. My proposal going forward is:

  1. Schedule a one-off session w/ Chris and/or Gail and go over the current standalone App Search app and have them point out examples of correct vs incorrect casing so we have a consistent set of rules to draw from going forward

or

  1. Postpone copy changes for after 7.13 FF, at which point we have between then and 7.14 FF to do a copy sweep of the app

Let me know your thoughts and what you have time for, Chris and Gail! ❤️

@chriscressman
Copy link
Contributor

@constancecchen

Postpone copy changes for after 7.13 FF, at which point we have between then and 7.14 FF to do a copy sweep of the app

I think this might be better for everyone. Personally, I prefer to work in an async flow. I tend to structure my day, so I ignore notifications during large chunks. I don't want copy changes to block progress.

But for reference, Elastic feature names should not be capitalized:

Features of the Elastic Stack (anomaly detection, index lifecycle management, etc.) are not capitalized.

-- from the Elastic naming guide

So feature names like engine and analytics should be lowercase, except when the first word in a sentence. I corrected my earlier comment, where I wrote Engine instead of engine.

@cee-chen
Copy link
Contributor Author

That is super helpful, thank you Chris!! I think I'm starting to get it now 🎉

I've updated copy in this PR, will be doing another quick pass of the rest of our current app, and have created a follow-up icebox ticket to remind myself to come back and you amazing copy folks in 7.13 / April 2021 when the full app is ready. Until then!! 🙇‍♀️

@gchaps
Copy link
Contributor

gchaps commented Nov 18, 2020

@chriscressman, @constancecchen Agree that it will be good to do a copy review in a single swoop. That way, we can make sure that the text flows from one page to the next.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 468 482 +14

Async chunks

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

id before after diff
enterpriseSearch 692.0KB 710.3KB +18.3KB

History

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

@cee-chen cee-chen merged commit 71f972d into elastic:master Nov 18, 2020
@cee-chen cee-chen deleted the engine-overview branch November 18, 2020 23:53
cee-chen pushed a commit to cee-chen/kibana that referenced this pull request Nov 18, 2020
* Set up Overview file

* Finish Overview page logic, stub out empty/metric views

* Stub in basic empty engine overview
- Minus document creation button & API code example

* Stub out EngineOverviewMetrics and unavailable empty prompt

* Stub out EngineOverMetrics components (stats, charts, logs)

* [Refactor] Pull out some document creation i18n strings to constants

- They're repeated/reused by the DocumentCreationPopover component

* PR feedback: Drop the regex

* PR feedback: RecentLogs -> RecentApiLogs

* PR feedback: Copy

* PR feedback: Copy, sentence-casing
spalger added a commit that referenced this pull request Nov 19, 2020
@spalger
Copy link
Contributor

spalger commented Nov 19, 2020

Sorry, this started to fail as soon as it was merged into master. I've reverted it for now to leave master broken for as little time as possible. Please resubmit with master merged, thanks! I also suggest closing the backport and backporting the resubmit-PR instead.

gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 19, 2020
* master: (60 commits)
  Forward any registry cache-control header for files (elastic#83680)
  Revert "[Alerting] Add `alert.updatedAt` field to represent date of last user edit (elastic#83578)"
  [Security Solution][Detections] Fix adding an action to detection rules (elastic#83722)
  Make expectSnapshot available in all functional test runs (elastic#82932)
  Skip failing cypress test
  Increase bulk request timeout during esArchiver load (elastic#83657)
  [data.search] Server-side background session service (elastic#81099)
  [maps] convert VectorStyleEditor to TS (elastic#83582)
  Revert "[App Search] Engine overview layout stub (elastic#83504)"
  Adding documentation for global action configuration options (elastic#83557)
  [Metrics UI] Optimizations for Snapshot and Inventory Metadata (elastic#83596)
  chore(NA): update lmdb store to v0.8.15 (elastic#83726)
  [App Search] Engine overview layout stub (elastic#83504)
  [Workplace Search] Update SourceIcon to match latest changes in ent-search (elastic#83714)
  [Enterprise Search] Rename React Router helpers (elastic#83718)
  [Maps] Add 'crossed' & 'exited' events to tracking alert (elastic#82463)
  Updating code-owners to use new core/app-services team names (elastic#83731)
  Add Managed label to data streams and a view switch for the table (elastic#83049)
  [Maps] Add query bar inputs to geo threshold alerts tracked points & boundaries (elastic#80871)
  fix(NA): search examples kibana version declaration (elastic#83182)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 19, 2020
* master: (60 commits)
  Forward any registry cache-control header for files (elastic#83680)
  Revert "[Alerting] Add `alert.updatedAt` field to represent date of last user edit (elastic#83578)"
  [Security Solution][Detections] Fix adding an action to detection rules (elastic#83722)
  Make expectSnapshot available in all functional test runs (elastic#82932)
  Skip failing cypress test
  Increase bulk request timeout during esArchiver load (elastic#83657)
  [data.search] Server-side background session service (elastic#81099)
  [maps] convert VectorStyleEditor to TS (elastic#83582)
  Revert "[App Search] Engine overview layout stub (elastic#83504)"
  Adding documentation for global action configuration options (elastic#83557)
  [Metrics UI] Optimizations for Snapshot and Inventory Metadata (elastic#83596)
  chore(NA): update lmdb store to v0.8.15 (elastic#83726)
  [App Search] Engine overview layout stub (elastic#83504)
  [Workplace Search] Update SourceIcon to match latest changes in ent-search (elastic#83714)
  [Enterprise Search] Rename React Router helpers (elastic#83718)
  [Maps] Add 'crossed' & 'exited' events to tracking alert (elastic#82463)
  Updating code-owners to use new core/app-services team names (elastic#83731)
  Add Managed label to data streams and a view switch for the table (elastic#83049)
  [Maps] Add query bar inputs to geo threshold alerts tracked points & boundaries (elastic#80871)
  fix(NA): search examples kibana version declaration (elastic#83182)
  ...
phillipb added a commit to phillipb/kibana that referenced this pull request Nov 19, 2020
…ode-details

* 'master' of github.com:elastic/kibana:
  fixed pagination in connectors list (elastic#83638)
  Forward any registry cache-control header for files (elastic#83680)
  Revert "[Alerting] Add `alert.updatedAt` field to represent date of last user edit (elastic#83578)"
  [Security Solution][Detections] Fix adding an action to detection rules (elastic#83722)
  Make expectSnapshot available in all functional test runs (elastic#82932)
  Skip failing cypress test
  Increase bulk request timeout during esArchiver load (elastic#83657)
  [data.search] Server-side background session service (elastic#81099)
  [maps] convert VectorStyleEditor to TS (elastic#83582)
  Revert "[App Search] Engine overview layout stub (elastic#83504)"
  Adding documentation for global action configuration options (elastic#83557)
  [Metrics UI] Optimizations for Snapshot and Inventory Metadata (elastic#83596)
  chore(NA): update lmdb store to v0.8.15 (elastic#83726)
  [App Search] Engine overview layout stub (elastic#83504)
  [Workplace Search] Update SourceIcon to match latest changes in ent-search (elastic#83714)
  [Enterprise Search] Rename React Router helpers (elastic#83718)
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Nov 19, 2020
* Set up Overview file

* Finish Overview page logic, stub out empty/metric views

* Stub in basic empty engine overview
- Minus document creation button & API code example

* Stub out EngineOverviewMetrics and unavailable empty prompt

* Stub out EngineOverMetrics components (stats, charts, logs)

* [Refactor] Pull out some document creation i18n strings to constants

- They're repeated/reused by the DocumentCreationPopover component

* PR feedback: Drop the regex

* PR feedback: RecentLogs -> RecentApiLogs

* PR feedback: Copy

* PR feedback: Copy, sentence-casing
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes reverted v7.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants