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
53 changes: 33 additions & 20 deletions src/app/admin/admin-sidebar/admin-sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,19 +265,32 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
},

/* Statistics */
// TODO: enable this menu item once the feature has been implemented
// {
// id: 'statistics_task',
// active: false,
// visible: true,
// model: {
// type: MenuItemType.LINK,
// text: 'menu.section.statistics_task',
// link: ''
// } as LinkMenuItemModel,
// icon: 'chart-bar',
// index: 8
// },
{
id: 'site-stat',
active: false,
visible: true,
model: {
type: MenuItemType.LINK,
text: 'menu.section.statistics',
link: '/statistics'
} as LinkMenuItemModel,
icon: 'chart-bar',
index: 14
},

/* Workflow tasks */
{
id: 'submissions',
active: false,
visible: true,
model: {
type: MenuItemType.LINK,
text: 'menu.section.submissions',
link: '/mydspace'
} as LinkMenuItemModel,
icon: 'upload',
index: 2
},

/* Control Panel */
// TODO: enable this menu item once the feature has been implemented
Expand Down Expand Up @@ -324,7 +337,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
{
id: 'licenses',
active: false,
visible: true,
visible: isSiteAdmin,
model: {
type: MenuItemType.LINK,
text: 'menu.section.licenses',
Expand Down Expand Up @@ -356,7 +369,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
text: 'menu.section.export'
} as TextMenuItemModel,
icon: 'file-export',
index: 3,
index: 4,
shouldPersistOnRouteChange: true
},
// TODO: enable this menu item once the feature has been implemented
Expand Down Expand Up @@ -442,7 +455,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
text: 'menu.section.import'
} as TextMenuItemModel,
icon: 'file-import',
index: 2
index: 3
},
// TODO: enable this menu item once the feature has been implemented
// {
Expand Down Expand Up @@ -501,7 +514,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
link: '/admin/search'
} as LinkMenuItemModel,
icon: 'search',
index: 5
index: 6
},
/* Registries */
{
Expand All @@ -513,7 +526,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
text: 'menu.section.registries'
} as TextMenuItemModel,
icon: 'list',
index: 6
index: 7
},
{
id: 'registries_metadata',
Expand Down Expand Up @@ -549,7 +562,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
link: 'admin/curation-tasks'
} as LinkMenuItemModel,
icon: 'filter',
index: 7
index: 8
},

/* Workflow */
Expand Down Expand Up @@ -627,7 +640,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
text: 'menu.section.access_control'
} as TextMenuItemModel,
icon: 'key',
index: 4
index: 5
},
];

Expand Down
10 changes: 5 additions & 5 deletions src/app/clarin-navbar-top/clarin-navbar-top.component.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="clarin-top-header">
<div class="d-flex">
<div class="ds-language-selection pl-1">
<a href="/home">
<span class="language-icon" (click)="setLanguage('en')">
<img src="./assets/images/en.png" alt="{{'language.english' | translate}}" title="{{'language.english' | translate}}">
</a>
<a href="/home">
</span>
<span class="language-icon" (click)="setLanguage('cs')">
<img src="./assets/images/cs.png" alt="{{'language.czech' | translate}}" title="{{'language.czech' | translate}}">
</a>
</span>
</div>
<div class="ml-auto pr-3">
<div *ngIf="authenticatedUser == null" class="badge clarin-login-badge px-2 py-1">
Expand All @@ -19,7 +19,7 @@
<a class="hidden" id="repository_path" [href]="repositoryPath"></a>
<div *ngIf="authenticatedUser != null" class="badge clarin-logout-badge px-2 py-1">
<span>
<a style="color: #FFF;" href="/mydspace">
<a style="color: #FFF;" href="/profile">
<i class="fa fa-user pr-1 fa-lg"></i>{{authenticatedUser.name}}
</a>
</span>
Expand Down
6 changes: 6 additions & 0 deletions src/app/clarin-navbar-top/clarin-navbar-top.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
border-top-left-radius: unset;
border-top-right-radius: unset;
display: inherit;
position: relative;
z-index: 2;
}

.clarin-login-badge {
Expand All @@ -22,3 +24,7 @@
cursor: pointer;
text-decoration: underline !important;
}

.language-icon {
cursor: pointer;
}
11 changes: 10 additions & 1 deletion src/app/clarin-navbar-top/clarin-navbar-top.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils';
import { EPersonMock } from '../shared/testing/eperson.mock';
import { HALEndpointService } from '../core/shared/hal-endpoint.service';
import { ScriptLoaderService } from './script-loader-service';
import { LocaleService } from '../core/locale/locale.service';

describe('ClarinNavbarTopComponent', () => {
let component: ClarinNavbarTopComponent;
Expand Down Expand Up @@ -40,7 +41,8 @@ describe('ClarinNavbarTopComponent', () => {
providers: [
{ provide: AuthService, useValue: authService },
{ provide: HALEndpointService, useValue: halService },
{ provide: ScriptLoaderService, useValue: scriptLoader }
{ provide: ScriptLoaderService, useValue: scriptLoader },
{ provide: LocaleService, useValue: getMockLocaleService() }
]
})
.compileComponents();
Expand All @@ -62,4 +64,11 @@ describe('ClarinNavbarTopComponent', () => {
expect(user).toEqual(component.authenticatedUser);
});
});

function getMockLocaleService(): LocaleService {
return jasmine.createSpyObj('LocaleService', {
setCurrentLanguageCode: jasmine.createSpy('setCurrentLanguageCode'),
refreshAfterChangeLanguage: jasmine.createSpy('refreshAfterChangeLanguage')
});
}
});
9 changes: 8 additions & 1 deletion src/app/clarin-navbar-top/clarin-navbar-top.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { take } from 'rxjs/operators';
import { EPerson } from '../core/eperson/models/eperson.model';
import { ScriptLoaderService } from './script-loader-service';
import { HALEndpointService } from '../core/shared/hal-endpoint.service';
import { LocaleService } from '../core/locale/locale.service';

/**
* The component which wraps `language` and `login`/`logout + profile` operations in the top navbar.
Expand All @@ -17,7 +18,8 @@ export class ClarinNavbarTopComponent implements OnInit {

constructor(private authService: AuthService,
private halService: HALEndpointService,
private scriptLoader: ScriptLoaderService) { }
private scriptLoader: ScriptLoaderService,
private localeService: LocaleService) { }

/**
* The current authenticated user. It is null if the user is not authenticated.
Expand Down Expand Up @@ -69,4 +71,9 @@ export class ClarinNavbarTopComponent implements OnInit {
private loadRepositoryPath() {
this.repositoryPath = this.halService.getRootHref();
}

setLanguage(language) {
this.localeService.setCurrentLanguageCode(language);
this.localeService.refreshAfterChangeLanguage();
}
}
4 changes: 2 additions & 2 deletions src/app/home-page/home-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import { SearchObjects } from '../shared/search/models/search-objects.model';
export class HomePageComponent implements OnInit {

slides = [
{name: 'Citation', short: 'Citation'},
{name: 'Linguistic Data', short: 'LData'},
{name: 'Deposit Free And Save', short: 'Free Deposit'},
{name: 'Linguistic Data', short: 'LData'}
{name: 'Citation', short: 'Citation'}
];

site$: Observable<Site>;
Expand Down
7 changes: 7 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -2782,12 +2782,17 @@

"menu.section.icon.statistics_task": "Statistics Task menu section",

"menu.section.icon.statistics": "Show site statistics",

"menu.section.icon.submissions": "Show my submissions",

"menu.section.icon.workflow": "Administer workflow menu section",

"menu.section.icon.unpin": "Unpin sidebar",




"menu.section.import": "Import",

"menu.section.import_batch": "Batch Import (ZIP)",
Expand Down Expand Up @@ -2832,6 +2837,8 @@

"menu.section.statistics_task": "Statistics Task",

"menu.section.submissions": "Submissions",



"menu.section.toggle.access_control": "Toggle Access Control section",
Expand Down
2 changes: 2 additions & 0 deletions src/themes/dspace/app/header/header.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@
flex-basis: 100%;
flex-grow: 1;
align-items: center;
background-color: var(--navbar-background-color);
padding-left: 8px;
}
.lindat-common2 .lindat-navbar-toggler {
padding: 0.25rem 0.75em;
Expand Down