-
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
Kibana Home page - phase one #14673
Kibana Home page - phase one #14673
Conversation
@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. |
I can do a cleanup whenever this is close. |
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", |
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 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.
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.
All my visual design feedback and comments have been implemented now, so LGTM 👍
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.
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"> |
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.
file isn't used, should we add a timelion box to the directory?
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.
Do a fresh pull. It should be used. Its the icon for timelion. https://github.com/nreese/kibana/blob/home_phase_one/src/core_plugins/timelion/public/register_feature.js#L8
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', |
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.
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', |
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.
we have a LANDING_PAGE_PATH constant we should probably use to create this url.
|
||
renderDirectories = () => { | ||
return this.props.directories.inTitleOrder | ||
.filter((directory) => { |
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.
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, |
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 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, |
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 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?
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.
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'
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 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?
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.
no reason at all. I will update to just bring these in with an include
Looks good @nreese! A couple of comments, feedback and questions below.
I'll keep digging to provide feedback. I still need to try this out in X-Pack to see how it works. |
Agreed. Who has the final list? I can bug marketing to make them for us.
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.
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.
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'; |
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.
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.
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.
ah, yes it was the latter step I was missing. Forgot to restart the sever. All good!
@nreese Just spotted a minor bug in the directory button link; 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)) { |
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 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)) { |
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.
Might be overkill to make these conditional. I don't think we'd ever not have stuff in ADMIN and DATA. Up to you.
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; |
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.
any reason not to just do this.tabs = [...
above and remove this line?
|
||
HomeApp.propTypes = { | ||
addBasePath: PropTypes.func.isRequired, | ||
directories: PropTypes.arrayOf(PropTypes.shape({ |
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 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).
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! Nice work on making this happen in such short time.
background-color: @globalColorLightestGray; | ||
min-height: 100vh; | ||
|
||
.kuiPanelBody { |
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.
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.
ee8f4b9
to
aaf4956
Compare
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.
Minor changes. Looks-wise you've got my OK after you make the changes. Nice work.
.featureCategoryTab { | ||
background-color: @globalColorLightestGray; | ||
|
||
&.kuiTab-isSelected { |
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.
Here's another one. Don't overwrite through inheritance.
margin-top: 12px; | ||
} | ||
|
||
.center { |
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.
Believe bootstrap has a .text-center
you can use here.
background-color: @white; | ||
} | ||
|
||
.topFeatures { |
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'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; |
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.
Make this 16px. You're already getting 8px from the inner cards themselves, which will add up to 24px.
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.
Should I update homePanel class as well?
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.
Nope. You're padding is fine there.
… uiExports to home
dad31bc
to
470f34e
Compare
return { | ||
id: 'dashboard', | ||
title: 'Dashboards', | ||
description: 'Create visual landing pages made up of content from other apps', |
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 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"> |
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 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"> |
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.
Same button inside link as above
let img; | ||
if (iconUrl) { | ||
img = ( | ||
<img |
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 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).
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:
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 :-) |
@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. |
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.
Besides the wordings, @alexfrancoeur wants to take care of, this looks good to me 👍
* 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
* 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
Adds phase one of Kibana home page - kibana feature directory