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

Kibana Home page - phase one #14673

Merged
merged 38 commits into from
Nov 2, 2017
Merged

Kibana Home page - phase one #14673

merged 38 commits into from
Nov 2, 2017

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Oct 30, 2017

Adds phase one of Kibana home page - kibana feature directory

screen shot 2017-10-30 at 1 41 28 pm

@formgeist
Copy link
Contributor

@nreese Hope this format is alright. I made a quick visual design feedback screenshot with notes (hover on the dots) – https://redpen.io/vt41e4ce3e14ef316a

I know that a lot of it might be custom styling certain fundamental KUI elements, but hoping we can make it work. Let me know if you have any comments or questions.

cc @snide @alexfrancoeur

@snide
Copy link
Contributor

snide commented Oct 31, 2017

I can do a cleanup whenever this is close.

@snide
Copy link
Contributor

snide commented Oct 31, 2017

Did a quick pair session with @nreese this morning for some cleanup.

package.json Outdated
"react-router": "2.0.0",
"react-router-redux": "4.0.4",
"react-router-dom": "^4.2.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want to leave out the ^ part to match the other packages. I think the @elastic/kibana-operations team has a flow for updating these packages.

@formgeist
Copy link
Contributor

@nreese @snide The Home page looks great! Had a glance at the Directory pages, and my only suggestion would be to remove the kuiViewContent--constrainedWidth class on the content here too to make it consistent with the Home page.

Copy link
Contributor

@formgeist formgeist left a comment

Choose a reason for hiding this comment

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

All my visual design feedback and comments have been implemented now, so LGTM 👍

Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

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

nice job!! Code and UI look great, just some minor style comments.

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
Copy link
Contributor

Choose a reason for hiding this comment

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

file isn't used, should we add a timelion box to the directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

title: 'Dashboards',
description: 'Create visual landing pages made up of content from other apps',
icon: '/plugins/kibana/assets/app_dashboard.svg',
path: '/app/kibana#/dashboard',
Copy link
Contributor

Choose a reason for hiding this comment

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

What about creating this url in dashboard_constants? we already have a createDashboardEditUrl and then you can take advantage of the constant LANDING_PAGE_PATH which I think is what we want here instead of the singular dashboard, the plural. If you use the singular it may sometimes direct to the last opened dashboard. That's not terrible, but it's inconsistent with visualize because visualize specifically links to the landing page path.

The reason this is so confusing, the singular vs the plural, is due to BWC issues. heres a comment left on the kibana index registering dashboard as an app:

        }, {
          id: 'kibana:dashboard',
          title: 'Dashboard',
          order: -1001,
          url: `${kbnBaseUrl}#/dashboards`,
          // The subUrlBase is the common substring of all urls for this app. If not given, it defaults to the url
          // above. This app has to use a different subUrlBase, in addition to the url above, because "#/dashboard"
          // routes to a page that creates a new dashboard. When we introduced a landing page, we needed to change
          // the url above in order to preserve the original url for BWC. The subUrlBase helps the Chrome api nav
          // to determine what url to use for the app link.
          subUrlBase: `${kbnBaseUrl}#/dashboard`,
          description: 'compose visualizations for much win',
          icon: 'plugins/kibana/assets/dashboard.svg',
        }

So what we are using for the other links is the url, which is probably what we should be using here too.

title: 'Visualize',
description: 'Build a variety of graphs for your data.',
icon: '/plugins/kibana/assets/app_visualize.svg',
path: '/app/kibana#/visualize',
Copy link
Contributor

Choose a reason for hiding this comment

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

we have a LANDING_PAGE_PATH constant we should probably use to create this url.


renderDirectories = () => {
return this.props.directories.inTitleOrder
.filter((directory) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, think the .filter and .map functions should be indented by two because it's a line continuation.


Home.propTypes = {
addBasePath: PropTypes.func.isRequired,
directories: PropTypes.object.isRequired,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think what might help decouple this from our angular registry format is to pass directories.inTitleOrder into all these components, and have them just take an array instead of an object.

e.g. down in index.js change
$scope.directories = Private(FeatureCatalogueRegistryProvider);
to
$scope.directories = Private(FeatureCatalogueRegistryProvider).inTitleOrder;

What do you think? Then it'd be easier to express the shape better and you could change PropTypes.object to

PropTypes.arrayOf(PropTypes.shape({
  id: PropTypes.string.isRequired,
  title: PropTypes.string.isRequired,
  description: PropTypes.string.isRequired,
  icon...
  showOnHomePage...
  category.....
  })),

HomeApp.propTypes = {
addBasePath: PropTypes.func.isRequired,
directories: PropTypes.object.isRequired,
directoryCategories: PropTypes.object.isRequired,
Copy link
Contributor

Choose a reason for hiding this comment

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

I like how this is dynamic so you can easily add categories but I don't think having it as an object will play nicely when typescript comes along (eventually). If you make it an array of strings it would be less flexible in terms of what could get passed and clearer to the reader what the requirements are. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure an array will work. I need to have a named variable to access certain constants. For example, I need to get the directoryCategories.DATA to filter the featureCatalogue by category 'data'

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking something like this:

      $scope.directoryCategories = [
        FeatureCatalogueCategory.ADMIN,
        FeatureCatalogueCategory.DATA,
        FeatureCatalogueCategory.OTHER,
      ];

But now that I look again, the dynamic aspect of doing it this way wouldn't even work because in FeatureDirectory you check for these three values specifically. I was originally thinking, well if a plugin wants to add a new category, so they register an app with category 'foo' and then you'd pass in 'foo' here, it would automatically create a new tab filled with those categories. Though if you really wanted it dynamic you'd have to have a category name, and id, for display purposes. And now I think I'm just overcomplicating it with these thoughts.

To make it simpler, why pass this as a prop at all, and not just access FeatureCatalogueCategory enum directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no reason at all. I will update to just bring these in with an include

@alexfrancoeur
Copy link

Looks good @nreese! A couple of comments, feedback and questions below.

  • We should probably get some icons from design for each feature before merging. We're currently using the dashboards icon for saved objects, index patterns, etc. (as per the mocks)

screen shot 2017-10-31 at 4 05 30 pm

  • What was the expectation for clicking into a feature? It looks as if navigation is via a link. I would have expected clicking into a full card here to navigate. Thoughts @snide @formgeist?

oct-31-2017 16-11-45

This
screen shot 2017-10-31 at 4 15 10 pm

vs this
screen shot 2017-10-31 at 4 15 18 pm

  • How difficult is it to add search to the feature directory? During usability testing the feature aspect received a lot of positive feedback from the power users. Search would need to support both the title and short descriptions and filter on the cards that contain them. For example, search for "alerts" would filter on Watcher in X-Pack.

screen shot 2017-10-31 at 4 19 17 pm

  • We'll need to finalize the descriptive text for each feature. This was not done for the mockups. I can take this as an action item to provide better descriptions for each feature if it's helpful.

  • Should we handle responsiveness with the feature directory and force a cell size for each feature? As the window resizes, things get weird. Maybe not a priority for the first phase but thought it'd be something we get out of react for free.

oct-31-2017 16-04-47

I'll keep digging to provide feedback. I still need to try this out in X-Pack to see how it works.

@snide
Copy link
Contributor

snide commented Oct 31, 2017

@alexfrancoeur

We should probably get some icons from design for each feature before merging.

Agreed. Who has the final list? I can bug marketing to make them for us.

What was the expectation for clicking into a feature?

As cards I would have had the whole "card" clickable. In the presentation here I think at least the icon + title should be clickable. If you do make the surrounding div clickable here, make sure to add proper hover / active states.

I had always thought these would be represented as "cards" rather than providing the full white space as seen in the directory here.

Part of this is due to K6ifying the layout with the components we have. While probably no one more than me would love to use the K7 styling for some of these elements (ex: carding things out), I don't know that we want to maintain two tab styles in the short term to get there. The silver lining is the styling shown in the mocks will be a 5-minute transition once the K7 components are available.

Should we handle responsiveness with the feature directory and force a cell size for each feature?

Yes. @cjcenizal and I have talked a bit about setting min/max sizing to the underlying component used here. SInce @nreese is using the components here, he shouldn't need to do that work now, we'll take care of it in a separate PR.

@@ -0,0 +1,13 @@
import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue';
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, I have this code pulled down locally, but no timelion app is showing up

screen shot 2017-11-01 at 9 15 21 am

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have the latest? There was a commit or two that had problems with registering timelion but those have been resolved. Let me know if a fresh pull and kibana restart do not fix these.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, yes it was the latter step I was missing. Forgot to restart the sever. All good!

@formgeist
Copy link
Contributor

@nreese Just spotted a minor bug in the directory button link;

kapture 2017-11-01 at 14 48 21

Seems the link doesn't work on the button but only on the text link inside it.

name: 'Administrative',
});
}
if (props.directories.some(directory => directory.category === props.directoryCategories.OTHER)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should consider apps for the 'OTHER' tab as anything not in ADMIN or DATA, so if a plugin registers a directory in category 'stuff', it'll show up under the 'OTHER' tab. Right now it would only show up under the 'All' tab.

name: 'Explore & Visualize'
});
}
if (props.directories.some(directory => directory.category === props.directoryCategories.ADMIN)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be overkill to make these conditional. I don't think we'd ever not have stuff in ADMIN and DATA. Up to you.

@alexfrancoeur
Copy link

Thanks for the quick feedback @snide, I'm starting a list for the feature directory and will share with the group.

After speaking with @nreese & @stacey-gammon, we'll push search functionality for both the feature directory and add data list view to another issue (#14701)

});
}

this.tabs = tabs;
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason not to just do this.tabs = [... above and remove this line?


HomeApp.propTypes = {
addBasePath: PropTypes.func.isRequired,
directories: PropTypes.arrayOf(PropTypes.shape({
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there is a way to refactor these shapes out. I'm curious because I'm running into something similar and want to do like a custom jsDoc type rather than redefine the shape everywhere. Maybe I'll ask around to see if anyone has any ideas. (no changes required, just thinking out loud).

Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work on making this happen in such short time.

background-color: @globalColorLightestGray;
min-height: 100vh;

.kuiPanelBody {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we specify custom class names, e.g. .homePanel to create these "overrides"? This way we don't couple these selectors to the classes used in the UI Framework. If possible, I think we should try to avoid referring to UI Framework classes in any of our selectors.

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

Minor changes. Looks-wise you've got my OK after you make the changes. Nice work.

.featureCategoryTab {
background-color: @globalColorLightestGray;

&.kuiTab-isSelected {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here's another one. Don't overwrite through inheritance.

margin-top: 12px;
}

.center {
Copy link
Contributor

Choose a reason for hiding this comment

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

Believe bootstrap has a .text-center you can use here.

background-color: @white;
}

.topFeatures {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest prefixing your css with the module name. In this case, it seems to be home, so everything should be prefixed home to avoid collisions. Or if this is a separate thing, make feature its own file.

border-left: 1px solid @globalColorLightGray;
border-right: 1px solid @globalColorLightGray;
border-bottom: 1px solid @globalColorLightGray;
padding: 24px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this 16px. You're already getting 8px from the inner cards themselves, which will add up to 24px.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I update homePanel class as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope. You're padding is fine there.

return {
id: 'dashboard',
title: 'Dashboards',
description: 'Create visual landing pages made up of content from other apps',
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the only description not ending with a period. I would either let all end with a period or none.


<KuiFlexItem grow={false}>
<a href={addBasePath('/app/kibana#/management/kibana/index')}>
<KuiButton buttonType="secondary">
Copy link
Contributor

Choose a reason for hiding this comment

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

This will render a <button> inside an <a>, which is not quite the desired result (e.g. for accessibility reasons, but I could imagine some other stuff might also be broken (or close to it) with that).

You should apply the CSS classes directly:

<a href=".." class="kuiButton kuiButton--secondary">
  <span class="kuiButton__inner">
    Set up index pattern
  </span>
</a>

{`Didn't find what you were looking for?`}
</h4>

<a href="#/home/feature_directory">
Copy link
Contributor

Choose a reason for hiding this comment

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

Same button inside link as above

let img;
if (iconUrl) {
img = (
<img
Copy link
Contributor

Choose a reason for hiding this comment

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

This img should have an alt attribute for screen readers (otherwise the file path will be announced). Since these images are purely decorative and don't provide additional information for vision impaired users, you can just add an empty alt="" attribute to it, so it will be ignored by assistive technologies (like screen readers).

@timroes
Copy link
Contributor

timroes commented Nov 2, 2017

I totally like the new home page. Great thanks to everybody involved already! ❤

I've added some code considerations, and I have a few more questions:

The ordering of the items on the home page is currently done alphabetically. I wonder if we might want to change this to a more logical order regarding the "work flow" of users, which wouldn't put Dashboards in the first place, since you usually need to create some visualizations in Timelion or Visualize before working with Dashboards.

I think we should have a consistent casing of Kibana. Currently it's written uppercase in the heading and the button, but lowercase in nearly every description. I think we currently try to use uppercase in all places.

I have some concerns regarding the wording of the descriptions:

  • Can we rely on "ES" being a common enough abbreviation among users, or should we rather spell out "Elasticsearch"?
  • "Import / export your kibana objects for later reuse." → Is it clear to the user, what "objects" are in this case? Should we maybe say "objects (visualizations, dashboards, etc.)"?
  • "Index Patterns" → The only one that is written uppercase in the second word. "Advanced settings" and "Saved objects" are written lowercase in the second word.

I think most of these points can be discussed upon and I would like to hear more opinions on it.

/cc @snide @cjcenizal

EDIT: I've just seen some comments above already mention the descriptions not to be final at the moment, so I guess we can ignore that point :-)

@alexfrancoeur
Copy link

@timroes content and casing of the cards are still being finalized, I'll share the current doc in just a moment. I plan to have marketing review as well.

@nreese
Copy link
Contributor Author

nreese commented Nov 2, 2017

@timroes @snide I have made the requested changes. Take a look and update review to approve if everything looks good

Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

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

Besides the wordings, @alexfrancoeur wants to take care of, this looks good to me 👍

@nreese nreese merged commit ffcd5da into elastic:master Nov 2, 2017
nreese added a commit to nreese/kibana that referenced this pull request Nov 2, 2017
* make kibana home app default when defaultAppId not set

* make kibana icon link to home page, add react-router for routing within home app

* directory registry

* add href to directory listings

* add tabs to directory page

* add promo section to home page

* home page styling

* use kuiFlex components to display directory in columns

* fix react array missing key warning

* add icons

* remove feature directory title from home page, change data sources to integrations

* add tutorials registry

* fix rebase mistake

* start tutorial component

* wrap tutorial registration in helper function to hide implemenation details

* add constants for categry and instruction variant ids

* filter tutorial directory by tab category

* remove later phase stuff

* clean-up feature directory styling

* add kbnDirectory to uiExports

* remove unused file

* cleanup timelion plugin definition

* fix lint errors

* css work recommended by formgeist review

* cleanup from pairing session with snide

* rename kbnDirectory registry to featureCatalogue, rename kbnDirectory uiExports to home

* update kibana index uses name to match ui-exports name

* remove carot from package versions

* remove kuiViewContent--constrainedWidth from feature directory view

* updates from Stacey-Gammon review

* import FeatureCatalogueCategory instead of passing as parameter

* wrap KuiButton in href to fix button click bug

* remove conditional check for ADMIN and DATA feature category tabs

* consider apps for the 'OTHER' tab as anything not in ADMIN or DATA

* remove temp variable tabs and just store in this

* avoid overwriting kui class styles

* prefix class names with home

* updates from timroes review
nreese added a commit that referenced this pull request Nov 2, 2017
* make kibana home app default when defaultAppId not set

* make kibana icon link to home page, add react-router for routing within home app

* directory registry

* add href to directory listings

* add tabs to directory page

* add promo section to home page

* home page styling

* use kuiFlex components to display directory in columns

* fix react array missing key warning

* add icons

* remove feature directory title from home page, change data sources to integrations

* add tutorials registry

* fix rebase mistake

* start tutorial component

* wrap tutorial registration in helper function to hide implemenation details

* add constants for categry and instruction variant ids

* filter tutorial directory by tab category

* remove later phase stuff

* clean-up feature directory styling

* add kbnDirectory to uiExports

* remove unused file

* cleanup timelion plugin definition

* fix lint errors

* css work recommended by formgeist review

* cleanup from pairing session with snide

* rename kbnDirectory registry to featureCatalogue, rename kbnDirectory uiExports to home

* update kibana index uses name to match ui-exports name

* remove carot from package versions

* remove kuiViewContent--constrainedWidth from feature directory view

* updates from Stacey-Gammon review

* import FeatureCatalogueCategory instead of passing as parameter

* wrap KuiButton in href to fix button click bug

* remove conditional check for ADMIN and DATA feature category tabs

* consider apps for the 'OTHER' tab as anything not in ADMIN or DATA

* remove temp variable tabs and just store in this

* avoid overwriting kui class styles

* prefix class names with home

* updates from timroes review
@nreese nreese deleted the home_phase_one branch February 13, 2018 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants