-
Notifications
You must be signed in to change notification settings - Fork 40
Feature/New OSF Navbar [EOSF-511] #188
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
Feature/New OSF Navbar [EOSF-511] #188
Conversation
…is navigation will not collapse on xs screen. Should behave normally.
…avbar-auth-dropdown opened.
…d of a unit test.
…er-osf into feature/new-osf-navbar
| /* 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%); |
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'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.
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
…ber-osf into feature/new-osf-navbar
… new page instead.
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.
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; |
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 is the advantage of using a computed vs setting this as the property value directly? (serviceLinks: serviceLinks)
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.
None :)
| hideSearch: false, | ||
|
|
||
| osfServices: Ember.computed(function() { | ||
| return osfServices; |
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.
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 |
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 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.
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.
Good point about the ember apps merging.
| this.send('closeSecondaryNavigation'); | ||
| }, | ||
| closeSecondaryNavigation() { | ||
| Ember.$('.navbar-collapse').collapse('hide'); |
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 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" |
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.
Reminder to final reviewers; this will need to be changed before merge.
addon/const/osf-services.js
Outdated
| } | ||
| ]; | ||
|
|
||
| export default osfServices; |
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.
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.
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 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({ |
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.
Very nice use of stubbed services here!
|
Changes made @abought. |
|
Closing in favor of #204 |
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
Preprints primary navigation selected
Service dropdown
Auth dropdown