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

Navbar refactor #883

Merged
merged 23 commits into from
Apr 5, 2017
Merged

Conversation

millayr
Copy link
Contributor

@millayr millayr commented Mar 23, 2017

Trying to take over #826

Copy link
Member

@garrensmith garrensmith left a comment

Choose a reason for hiding this comment

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

This is looking great. Nice work. One thing I have noticed is when the navbar is minimized, the couchdb version is not aligned with the v
https://www.dropbox.com/s/kpx3isesbrj9lmp/Screenshot%202017-03-28%2009.51.31.png?dl=1

} else if (session.isLoggedIn()) {
link = {
const link = {
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem correct, the link variable is declared twice and then used outside its scope

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

}

render () {
const mainClass = classNames(
Copy link
Member

Choose a reason for hiding this comment

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

Nice, this is very cool idea

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 :D

}

.faux-navbar__brand-logo--wide {
background: url(../../../../../assets/img/CouchDB-negative-logo.png) no-repeat 23px 0px;
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to set these logo's via our settings.json file. I know the pouchdb team would like to override these

@@ -19,5 +19,9 @@ export default {
NAVBAR_SET_VERSION_INFO: 'NAVBAR_SET_VERSION_INFO',
NAVBAR_ACTIVE_LINK: 'NAVBAR_ACTIVE_LINK',
NAVBAR_HIDE: 'NAVBAR_HIDE',
NAVBAR_SHOW: 'NAVBAR_SHOW'
NAVBAR_SHOW: 'NAVBAR_SHOW',

Copy link
Member

Choose a reason for hiding this comment

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

Minor, but no space is needed here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

createLinks (links) {
const { activeLink, isMinimized } = this.props;

return _.map(links, (link, i) => {
Copy link
Member

Choose a reason for hiding this comment

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

Can you rather do links.map. We don't need to use lodash for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

},

setMenuState () {
FauxtonAPI.Events.trigger(FauxtonAPI.constants.EVENTS.NAVBAR_SIZE_CHANGED, this.state.isMinimized);
Copy link
Member

Choose a reason for hiding this comment

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

Is this trigger event still needed. Could we rather use a store instead. I would like to remove all our trigger events as much as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@@ -94,8 +107,7 @@ Stores.NavBarStore = FauxtonAPI.Store.extend({
},

toggleMenu () {
app.utils.localStorageSet(FauxtonAPI.constants.LOCAL_STORAGE.SIDEBAR_MINIMIZED,
!this.isMinimized());
this._isMinimized = !this._isMinimized;
Copy link
Member

Choose a reason for hiding this comment

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

This means we are no longer keeping state of what the user preferred in terms of minimized or open navbar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks that way, yeah. @justin-mcdavid-ibm: did you discuss this with @robertkowalski during the initial design phase for this?

Copy link

@justinmcdavid justinmcdavid Mar 28, 2017

Choose a reason for hiding this comment

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

We made the decision to open the dashboard with main-nav collapsed, and a clearer trigger for expanding it back out. I don't think preferences need to be maintained across sessions, especially if the default state is the one providing more screen real estate.

These decisions came out of user feedback regarding confusion on the "hamburger" icon's functionality, and requests for more visual space to work with.

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 think I'd prefer to leave this as-is. The new logic forces the sidebar to be minimized by default, showing users that they have much more screen real estate to work with, which is inline with the user research and feedback.


import _ from 'lodash';
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@garrensmith
Copy link
Member

garrensmith commented Mar 31, 2017 via email

@@ -47,7 +51,9 @@
"dest": "dist/debug/index.html",
"variables": {
"title": "Project Fauxton",
"generationLabel": "Fauxton Couchapp"
"generationLabel": "Fauxton Couchapp",
Copy link
Member

Choose a reason for hiding this comment

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

This is so awesome.

@garrensmith
Copy link
Member

This is coming along nicely. I'm seeing two issues.

https://www.dropbox.com/s/428id1nw7yw2svw/Screenshot%202017-04-03%2013.00.08.png?dl=1 My accounts/reset password block is hidden.

Then if I make my screen narrow. The navbar struggles a bit:
https://www.dropbox.com/s/apoj4o790xfuy3o/Screenshot%202017-04-03%2013.01.59.png?dl=1

@millayr millayr closed this Apr 4, 2017
@millayr millayr reopened this Apr 4, 2017
Copy link
Member

@garrensmith garrensmith left a comment

Choose a reason for hiding this comment

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

This is great work. Nice one @millayr

<div className={navClasses}>
<nav>
<Burger isMinimized={isMinimized} toggleMenu={this.toggleMenu}/>
<div className="faux-navbar__flex">
Copy link
Member

Choose a reason for hiding this comment

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

This is really minor. But the name faux-navbar__flex doesn't feel right. I think something more to describe what it does in relation to the navbar would make more sense.

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 worries. I renamed it to faux-navbar__linkcontainer

@garrensmith garrensmith mentioned this pull request Apr 5, 2017
@garrensmith garrensmith merged commit b212dd5 into apache:master Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants