Skip to content

Re-implement sidebar resource selectors#1810

Merged
siggy merged 3 commits intomasterfrom
siggy/nav-res
Oct 26, 2018
Merged

Re-implement sidebar resource selectors#1810
siggy merged 3 commits intomasterfrom
siggy/nav-res

Conversation

@siggy
Copy link
Member

@siggy siggy commented Oct 25, 2018

Part of #1781

Signed-off-by: Andrew Seigner [email protected]

1st commit

nav-res

2nd commit

nav-res3

3rd commit

nav-res4

@siggy siggy added the area/web label Oct 25, 2018
@siggy siggy self-assigned this Oct 25, 2018
@siggy siggy requested a review from rmars October 25, 2018 02:00
Part of #1781

Signed-off-by: Andrew Seigner <[email protected]>
Copy link

@rmars rmars left a comment

Choose a reason for hiding this comment

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

🥇 I like this a lot! Thank you for separating out NavigationResource and NavigationResources!

<MenuList dense component="div" disablePadding>
<NavigationResource type="authorities" />
<NavigationResource type="deployments" metrics={allMetrics.deployment} />
<NavigationResource type="namespaces" metrics={nsMetrics.namespace} />
Copy link

Choose a reason for hiding this comment

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

if I click on the linkerd namespace, then click back and forth between emojivoto and linkerd, the uri changes, but the component doesn't actually re-render. It does for the other resource types though.

const { api, classes } = this.props;

return (
<MenuList dense component="div" disablePadding>
Copy link

Choose a reason for hiding this comment

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

what do you think about making the first subMenu Item "All Pods" (etc), rather than navigating to the pods list page when you click to expand the submenu? I find it a little disconcerting if I'm, for example, in the middle of a top page, and I just want to see what resources are available in the sidebar, but I get navigated off the current page.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rmars agree it's disorienting when navigating the resource tree causes the page to change. in the second commit, i tried adding a small button, visible on hover, that provides the "all" link you described, while keeping the rest of the menu item clickable for navigation only. let me know what you think.

Copy link

Choose a reason for hiding this comment

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

hmmm do you have objections to just adding an "All s" option as the first option in the list? I think it's weird to have another icon just pop up that you don't know what it does (even if it's the list icon that Resources uses). I feel like having an "All " option makes it very clear as to what is contained in the option.

Having options to click an adjacent icon as well as click a list item also feels weird in that it divides the actions you could take. This introduces more complication than the simple "I click on a menu and then a submenu" flow. What would be the motivations for breaking this flow?

Copy link
Member Author

Choose a reason for hiding this comment

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

@rmars Added an "All" list item as you suggested. You're right a random button appearing is a bit confusing. I was trying to avoid having a list item at the top of the menu that's different from the individual resources below it, as I haven't seen that pattern in a tree navigation UI before. That said, this makes the code way simpler, and is the most explicit for the user. Thanks for the thorough eyes!

Copy link

Choose a reason for hiding this comment

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

yeah, I do wonder how most people actually do this! thanks for adding!

Copy link

Choose a reason for hiding this comment

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

Looking around for examples:

Copy link
Member Author

Choose a reason for hiding this comment

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

ooh, thanks for finding these! pop-up style is pretty cool. something to consider down the road.

<Grid item>{metricToFormatter["SUCCESS_RATE"](sr)}</Grid>
<Grid item>{_.isNil(sr) ? null :
<div className={classNames("success-rate-dot", classes[getSuccessRateClassification(sr)])} />}
<SuccessRateDot sr={sr} />
Copy link

Choose a reason for hiding this comment

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

sweet, thanks for DRYing this!

Copy link
Contributor

@dadjeibaah dadjeibaah left a comment

Choose a reason for hiding this comment

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

The sidebar is looking great @siggy! I had one comment regarding the "replication controller" menu item

<NavigationResource type="deployments" metrics={allMetrics.deployment} />
<NavigationResource type="namespaces" metrics={nsMetrics.namespace} />
<NavigationResource type="pods" metrics={allMetrics.pod} />
<NavigationResource type="replicationcontrollers" metrics={allMetrics.replicationcontroller} />
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the Replication Controllers submenu doesn't expand when I am trying to view replication controllers in my Kubernetes cluster. Running the booksapps example should highlights this.

Signed-off-by: Andrew Seigner <[email protected]>
Copy link

@rmars rmars left a comment

Choose a reason for hiding this comment

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

🐑 🐑 🐕 sweeeeet! thanks for adding this!

Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

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

⭐️ Nice improvement! Looks good to me.

@siggy siggy merged commit c661b00 into master Oct 26, 2018
@siggy siggy deleted the siggy/nav-res branch October 26, 2018 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants