Skip to content

Conversation

@pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Feb 28, 2017

Ticket

https://openscience.atlassian.net/browse/EOSF-511

Companion PR ❗️ Styles have been moved to osf-style guide CenterForOpenScience/osf-style#95

Purpose

Ember-OSF component that is a redesign of the navbar. For use in preprints and registries. Ensures that navigation within services is easy and clear without needing two stacked navigation bars, so that visitors to the site can easily orient themselves.

Screenshots

Home primary navigation selected

screen shot 2017-04-03 at 2 54 11 pm

Preprints primary navigation selected

screen shot 2017-04-03 at 2 55 05 pm

Service dropdown

screen shot 2017-04-03 at 3 06 09 pm

Auth dropdown

screen shot 2017-04-03 at 3 06 15 pm

…is navigation will not collapse on xs screen. Should behave normally.
/* Overrides color of dropdown list hover (applies to both service and auth dropdowns) */
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
background-image: -webkit-linear-gradient(top, $osf-highlight-navbar 0%, $osf-highlight-navbar 100%);
Copy link
Member

Choose a reason for hiding this comment

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

There's an ember-cli addon that helps with this. The benefit is that over time, we can eliminate the prefixes for unsupported browsers and not have to think about it.

pattisdr added 11 commits April 3, 2017 14:02
Simplify CSS.

Get rid of teal background.

Inject session into helper rather than passing it in.

Tweak styles.

Turn search link into search button that looks like a link.

Use session.get(...).

Correct home service link.
…er-osf into feature/new-osf-navbar

# Conflicts:
#	addon/components/osf-footer/template.hbs
Copy link
Contributor

@abought abought left a comment

Choose a reason for hiding this comment

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

A few small notes and questions in this round, but overall positive steps forward; this is looking really nice. The updated design for the service selector feels cleaner and makes good use of space; it also seems to work nicely on mobile.

Pending your triage of a few notes, I wouldn't necessarily need to return to this in another round of review myself, so long as we expect QA will have access to the new navbar for an extended round of functional review.

signupUrl: config.OSF.url + 'register',

serviceLinks: Ember.computed(function() {
return serviceLinks;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the advantage of using a computed vs setting this as the property value directly? (serviceLinks: serviceLinks)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None :)

hideSearch: false,

osfServices: Ember.computed(function() {
return osfServices;
Copy link
Contributor

Choose a reason for hiding this comment

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

Lines 30 and 33 here, similar to above: what is the advantage of using a computed here instead of setting the value of the property directly?

}),
host: config.OSF.url,

currentService: Ember.computed(function() { // Pulls current service name from consuming service's config file
Copy link
Contributor

Choose a reason for hiding this comment

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

This computed relies on the property hostAppName; it's good practice for a computed to specify (and watch) the values it depends on.

In general I don't expect this value to change while the app is loaded- but it's possible ember apps could merge in the future. Recommend the change as some cheap, easy future proofing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point about the ember apps merging.

this.send('closeSecondaryNavigation');
},
closeSecondaryNavigation() {
Ember.$('.navbar-collapse').collapse('hide');
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to refer to an element within the same component. For performance and to make the selector more specific, consider usingthis.$() instead.

bower.json Outdated
"devDependencies": {
"bootstrap": "~3.3.5",
"osf-style": "https://github.com/CenterForOpenScience/osf-style.git#48197d234baf07c321c56edfd9f48b5624374453"
"osf-style": "https://github.com/pattisdr/osf-style.git#32b2584d0087db6895645a5c58518861cbe7d004"
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to final reviewers; this will need to be changed before merge.

}
];

export default osfServices;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is so tightly connected to serviceLinks, would it make sense to combine osf-services and service-links in the same file, as a logically related grouping? Remember that a single module can export more than one thing.

While I realize this seems pedantic, all ember-osf PRs get reviewed under the assumption that we don't control addon users, and therefore breaking changes become much harder to coordinate once a feature is merged.

Copy link
Contributor Author

@pattisdr pattisdr Apr 20, 2017

Choose a reason for hiding this comment

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

I don't think they should be combined. osf-services is mainly going to be used on this new navbar. Thinking about it more, I will combine them.

import tHelper from "ember-i18n/helper";

// Stub i18n service
const i18nStub = Ember.Service.extend({
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice use of stubbed services here!

@pattisdr
Copy link
Contributor Author

Changes made @abought.

@pattisdr
Copy link
Contributor Author

pattisdr commented May 2, 2017

Closing in favor of #204

@pattisdr pattisdr closed this May 2, 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