Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions app/styles/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -799,11 +799,6 @@
font-size: 24px;
}
}

/* Decreases distance between "OSF" and current service "PREPRINTS", for example */
.current-service {
margin-left: -4px;
}
}

/* Overrides the color, relative position, and font size of dropdown menus (both service and auth) */
Expand All @@ -813,11 +808,15 @@
&.service-dropdown {
top: 17px;
left: -120px;
width: 200px;
width: auto;

li>a {
font-size: 18px;
}

@media (max-width: 767px) {
left: -54px;
}
}

&.auth-dropdown {
Expand Down Expand Up @@ -849,6 +848,10 @@
content: '';
top: -8px;
left: 126px;

@media (max-width: 767px) {
left: 61px;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions config/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ declare const config: {
backend: string;
redirectUri?: string;
url: string;
oasysUrl: string;
webApiNamespace: string;
apiUrl: string;
apiVersion: string;
Expand Down
2 changes: 2 additions & 0 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const {
OSF_STATUS_COOKIE: statusCookie = 'osf_status',
OSF_COOKIE_DOMAIN: cookieDomain = 'localhost',
OSF_URL: url = 'http://localhost:5000/',
OASYS_URL: oasysUrl = '',
OSF_API_URL: apiUrl = 'http://localhost:8000',
OSF_API_VERSION: apiVersion = '2.20',
OSF_RENDER_URL: renderUrl = 'http://localhost:7778/render',
Expand Down Expand Up @@ -167,6 +168,7 @@ module.exports = function(environment) {
backend,
redirectUri,
url,
oasysUrl,
webApiNamespace: 'api/v1',
apiUrl,
apiVersion,
Expand Down
19 changes: 6 additions & 13 deletions lib/osf-components/addon/components/osf-navbar/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,28 @@ import defaultTo from 'ember-osf-web/utils/default-to';
import styles from './styles';
import template from './template';

const osfURL = config.OSF.url;
const oasysURL = config.OSF.oasysUrl;
const { pageName } = config.OSF;

export enum OSFService {
HOME = 'HOME',
PREPRINTS = 'PREPRINTS',
REGISTRIES = 'REGISTRIES',
MEETINGS = 'MEETINGS',
INSTITUTIONS = 'INSTITUTIONS',
JAIRO_CLOUD = 'JAIRO Cloud公開支援機能',
}

interface ServiceLink {
name: string;
label: string;
route?: string;
href?: string;
disabled?: boolean;
}

export const OSF_SERVICES: ServiceLink[] = [
{ name: OSFService.HOME, route: 'home' },
{ name: OSFService.PREPRINTS, href: `${osfURL}preprints/` },
{ name: OSFService.REGISTRIES, route: 'registries', disabled: true },
{ name: OSFService.MEETINGS, route: 'meetings' },
{ name: OSFService.INSTITUTIONS, route: 'institutions' },
{ name: OSFService.HOME, label: pageName, route: 'home' },
...(oasysURL ? [{ name: OSFService.JAIRO_CLOUD, label: OSFService.JAIRO_CLOUD, href: oasysURL }] : []),
];

const {
OSF: {
pageName,
},
navbar: {
useDropdown,
},
Expand Down
5 changes: 1 addition & 4 deletions lib/osf-components/addon/components/osf-navbar/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
@href={{this._activeService.href}}
>
<span class='hidden-xs'> {{t 'general.OSF' title=this.title}} </span>
{{#if this.useNavDropdown}}
<span class='current-service'><strong>{{this._activeService.name}}</strong></span>
{{/if}}
</OsfLink>
</div>

Expand All @@ -50,7 +47,7 @@
@route={{service.route}}
@href={{service.href}}
>
{{t 'general.OSF' title=this.title}}<b>{{service.name}}</b>
{{service.label}}
</OsfLink>
</ddm.item>
{{/each}}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/dashboard-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module('Acceptance | dashboard', hooks => {

assert.equal(currentURL(), '/dashboard', 'We stayed on the proper page');
assert.dom('nav.navbar').exists();
assert.dom('nav.navbar .service-name').hasText('OSF HOME');
assert.dom('nav.navbar .service-name').hasText('OSF');
assert.dom('nav.navbar .secondary-nav-dropdown .nav-profile-name')
.hasText(currentUser.fullName, 'User\'s name is in navbar');

Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/guid-user/quickfiles-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module('Acceptance | Guid User Quickfiles', hooks => {
'Should have element after visit (guid routing / visit helper problem)',
);
assert.dom('nav.navbar').exists();
assert.dom('nav.navbar .service-name').hasText('OSF HOME');
assert.dom('nav.navbar .service-name').hasText('OSF');
assert.dom('nav.navbar .secondary-nav-dropdown').doesNotExist('Should not have user menu if not logged in');
const files = this.element.querySelectorAll('[data-test-file-item-link]');
assert.equal(files.length, 5, `Check for proper number of files in list. Found ${files.length}`);
Expand All @@ -42,7 +42,7 @@ module('Acceptance | Guid User Quickfiles', hooks => {
server.createList('file', 5, { user });
await visit(`/--user/${user.id}/quickfiles`);
assert.dom('nav.navbar').exists();
assert.dom('nav.navbar .service-name').hasText('OSF HOME');
assert.dom('nav.navbar .service-name').hasText('OSF');
assert.dom('nav.navbar .secondary-nav-dropdown .nav-profile-name')
.hasText(currentUser.fullName, 'User\'s name is in navbar');
const files = this.element.querySelectorAll('[data-test-file-item-link]');
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/osf-navbar/component-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module('Integration | Component | osf-navbar', hooks => {
test('it renders', async assert => {
await render(hbs`{{osf-navbar}}`);
assert.dom('.service-name').includesText('OSF');
assert.dom('.current-service').hasText('HOME');
assert.dom('.current-service').doesNotExist();
});

test('service-dropdown: logged in', async function(assert) {
Expand Down
Loading