diff --git a/resources/i18n/en.json b/resources/i18n/en.json
index 906da27286..f4ef2741c4 100644
--- a/resources/i18n/en.json
+++ b/resources/i18n/en.json
@@ -213,6 +213,7 @@
},
"sidebar": {
"section": {
+ "toggle": "Toggle sidebar",
"new": "New",
"new_community": "Community",
"new_collection": "Collection",
@@ -244,13 +245,16 @@
"curation_task": "Curation Task",
"statistics_task": "Statistics Task",
"control_panel": "Control Panel",
-
-
"browse_global": "All of DSpace",
"browse_global_communities_and_collections": "Communities & Collections",
"browse_global_by_issue_date": "By Issue Date",
"browse_global_by_author": "By Author",
- "statistics": "Statistics"
+ "browse_global_by_title": "By Title",
+ "statistics": "Statistics",
+ "browse_community": "This Community",
+ "browse_community_by_issue_date": "By Issue Date",
+ "browse_community_by_author": "By Author",
+ "browse_community_by_title": "By Title"
}
}
},
diff --git a/src/app/+admin/admin-sidebar/admin-sidebar.component.html b/src/app/+admin/admin-sidebar/admin-sidebar.component.html
index b59c1db829..9ddf2500e8 100644
--- a/src/app/+admin/admin-sidebar/admin-sidebar.component.html
+++ b/src/app/+admin/admin-sidebar/admin-sidebar.component.html
@@ -3,7 +3,9 @@
[@slideSidebar]="{
value: (!(sidebarExpanded | async) ? 'collapsed' : 'expanded'),
params: {sidebarWidth: (sidebarWidth | async)}
- }" (@slideSidebar.done)="finishSlide($event)" (@slideSidebar.start)="startSlide($event)" *ngIf="menuVisible | async" (mouseenter)="expandPreview($event)" (mouseleave)="collapsePreview($event)">
+ }" (@slideSidebar.done)="finishSlide($event)" (@slideSidebar.start)="startSlide($event)"
+ *ngIf="menuVisible | async" (mouseenter)="expandPreview($event)"
+ (mouseleave)="collapsePreview($event)">
diff --git a/src/app/+admin/admin-sidebar/admin-sidebar.component.ts b/src/app/+admin/admin-sidebar/admin-sidebar.component.ts
index 804680bdf6..69aa9158b2 100644
--- a/src/app/+admin/admin-sidebar/admin-sidebar.component.ts
+++ b/src/app/+admin/admin-sidebar/admin-sidebar.component.ts
@@ -392,7 +392,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
model: {
type: MenuItemType.LINK,
text: 'admin.sidebar.section.registries_metadata',
- link: '/registries/metadata'
+ link: 'admin/registries/metadata'
} as LinkMenuItemModel,
},
{
@@ -403,7 +403,7 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
model: {
type: MenuItemType.LINK,
text: 'admin.sidebar.section.registries_format',
- link: '/registries/format'
+ link: 'admin/registries/bitstream-formats'
} as LinkMenuItemModel,
},
diff --git a/src/app/+search-page/search-filters/search-filters.component.ts b/src/app/+search-page/search-filters/search-filters.component.ts
index 7f1eb513ea..f16faff1f3 100644
--- a/src/app/+search-page/search-filters/search-filters.component.ts
+++ b/src/app/+search-page/search-filters/search-filters.component.ts
@@ -58,7 +58,6 @@ export class SearchFiltersComponent {
* @returns {Observable} Emits true whenever a given filter config should be shown
*/
isActive(filterConfig: SearchFilterConfig): Observable {
- // console.log(filter.name);
return this.filterService.getSelectedValuesForFilter(filterConfig).pipe(
mergeMap((isActive) => {
if (isNotEmpty(isActive)) {
diff --git a/src/app/core/auth/server-auth.service.ts b/src/app/core/auth/server-auth.service.ts
index 089cbd0ba2..5022a3b165 100644
--- a/src/app/core/auth/server-auth.service.ts
+++ b/src/app/core/auth/server-auth.service.ts
@@ -41,7 +41,6 @@ export class ServerAuthService extends AuthService {
// TODO this should be cleaned up, AuthStatus could be parsed by the RemoteDataService as a whole...
const person$ = this.rdbService.buildSingle(status.eperson.toString());
- // person$.subscribe(() => console.log('test'));
return person$.pipe(map((eperson) => eperson.payload));
} else {
throw(new Error('Not authenticated'));
diff --git a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html
index be09c687f3..258c8b6c11 100644
--- a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html
+++ b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html
@@ -7,7 +7,7 @@
-
this.menuService.addSection(this.menuID, menuSection));
diff --git a/src/app/navbar/navbar.effects.spec.ts b/src/app/navbar/navbar.effects.spec.ts
index 39960d90d5..897fc15be7 100644
--- a/src/app/navbar/navbar.effects.spec.ts
+++ b/src/app/navbar/navbar.effects.spec.ts
@@ -7,16 +7,20 @@ import { cold, hot } from 'jasmine-marbles';
import * as fromRouter from '@ngrx/router-store';
import { CollapseMenuAction } from '../shared/menu/menu.actions';
import { MenuID } from '../shared/menu/initial-menus-state';
+import { MenuService } from '../shared/menu/menu.service';
+import { MenuServiceStub } from '../shared/testing/menu-service-stub';
describe('NavbarEffects', () => {
let navbarEffects: NavbarEffects;
let actions: Observable;
+ const menuService = new MenuServiceStub();
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
NavbarEffects,
provideMockActions(() => actions),
+ { provide: MenuService, useValue: menuService },
// other providers
],
});
diff --git a/src/app/navbar/navbar.effects.ts b/src/app/navbar/navbar.effects.ts
index fea6406854..9868b67e34 100644
--- a/src/app/navbar/navbar.effects.ts
+++ b/src/app/navbar/navbar.effects.ts
@@ -1,11 +1,17 @@
-import { map } from 'rxjs/operators';
+import { first, map, switchMap } from 'rxjs/operators';
import { Injectable } from '@angular/core';
import { Actions, Effect, ofType } from '@ngrx/effects'
import * as fromRouter from '@ngrx/router-store';
import { HostWindowActionTypes } from '../shared/host-window.actions';
-import { CollapseMenuAction } from '../shared/menu/menu.actions';
+import {
+ CollapseMenuAction,
+ ExpandMenuPreviewAction,
+ MenuActionTypes
+} from '../shared/menu/menu.actions';
import { MenuID } from '../shared/menu/initial-menus-state';
+import { MenuService } from '../shared/menu/menu.service';
+import { MenuState } from '../shared/menu/menu.reducer';
@Injectable()
export class NavbarEffects {
@@ -29,8 +35,27 @@ export class NavbarEffects {
ofType(fromRouter.ROUTER_NAVIGATION),
map(() => new CollapseMenuAction(this.menuID))
);
-
- constructor(private actions$: Actions) {
+ /**
+ * Effect that collapses the public menu when the admin sidebar opens
+ * @type {Observable}
+ */
+ @Effect() openAdminSidebar$ = this.actions$
+ .pipe(
+ ofType(MenuActionTypes.EXPAND_MENU_PREVIEW),
+ switchMap((action: ExpandMenuPreviewAction) => {
+ return this.menuService.getMenu(action.menuID).pipe(
+ first(),
+ map((menu: MenuState) => {
+ if (menu.id === MenuID.ADMIN) {
+ if (!menu.previewCollapsed && menu.collapsed) {
+ return new CollapseMenuAction(MenuID.PUBLIC)
+ }
+ }
+ return { type: 'NO_ACTION' };
+ }));
+ })
+ );
+ constructor(private actions$: Actions, private menuService: MenuService) {
}
diff --git a/src/app/shared/animations/rotate.ts b/src/app/shared/animations/rotate.ts
index a04b790586..d6337d4b3d 100644
--- a/src/app/shared/animations/rotate.ts
+++ b/src/app/shared/animations/rotate.ts
@@ -36,4 +36,4 @@ export const rotate = trigger('rotate',
animate('200ms')
])
- ]);
\ No newline at end of file
+ ]);
diff --git a/src/app/shared/animations/slide.ts b/src/app/shared/animations/slide.ts
index 3b65e30d3b..f64bdb0e35 100644
--- a/src/app/shared/animations/slide.ts
+++ b/src/app/shared/animations/slide.ts
@@ -66,4 +66,4 @@ export const slideSidebarPadding = trigger('slideSidebarPadding', [
transition('hidden <=> shown', [animate('200ms')]),
transition('hidden <=> expanded', [animate('200ms')]),
transition('shown <=> expanded', [animate('200ms')]),
-]);
\ No newline at end of file
+]);
diff --git a/src/app/shared/menu/menu-item/link-menu-item.component.html b/src/app/shared/menu/menu-item/link-menu-item.component.html
index adfb4fffbf..76856e57ef 100644
--- a/src/app/shared/menu/menu-item/link-menu-item.component.html
+++ b/src/app/shared/menu/menu-item/link-menu-item.component.html
@@ -1 +1 @@
-{{item.text | translate}}
\ No newline at end of file
+{{item.text | translate}}
\ No newline at end of file
diff --git a/src/app/shared/menu/menu-item/link-menu-item.component.spec.ts b/src/app/shared/menu/menu-item/link-menu-item.component.spec.ts
index 6b50ec6788..f24ca86661 100644
--- a/src/app/shared/menu/menu-item/link-menu-item.component.spec.ts
+++ b/src/app/shared/menu/menu-item/link-menu-item.component.spec.ts
@@ -4,6 +4,7 @@ import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';
import { LinkMenuItemComponent } from './link-menu-item.component';
import { RouterLinkDirectiveStub } from '../../testing/router-link-directive-stub';
+import { GLOBAL_CONFIG } from '../../../../config';
describe('LinkMenuItemComponent', () => {
let component: LinkMenuItemComponent;
@@ -11,12 +12,19 @@ describe('LinkMenuItemComponent', () => {
let debugElement: DebugElement;
const text = 'HELLO';
const link = 'http://google.com';
+ const nameSpace = 'dspace.com/';
+ const globalConfig = {
+ ui: {
+ nameSpace: nameSpace
+ }
+ } as any;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [TranslateModule.forRoot()],
declarations: [LinkMenuItemComponent, RouterLinkDirectiveStub],
providers: [
{ provide: 'itemModelProvider', useValue: { text: text, link: link } },
+ { provide: GLOBAL_CONFIG, useValue: globalConfig },
],
schemas: [NO_ERRORS_SCHEMA]
})
@@ -41,10 +49,9 @@ describe('LinkMenuItemComponent', () => {
it('should have the right routerLink attribute', () => {
const linkDes = fixture.debugElement.queryAll(By.directive(RouterLinkDirectiveStub));
-
const routerLinkQuery = linkDes.map((de) => de.injector.get(RouterLinkDirectiveStub));
expect(routerLinkQuery.length).toBe(1);
- expect(routerLinkQuery[0].routerLink).toBe(link);
+ expect(routerLinkQuery[0].routerLink).toBe(nameSpace + link);
});
});
diff --git a/src/app/shared/menu/menu-item/link-menu-item.component.ts b/src/app/shared/menu/menu-item/link-menu-item.component.ts
index 37acabb74b..02ce31843c 100644
--- a/src/app/shared/menu/menu-item/link-menu-item.component.ts
+++ b/src/app/shared/menu/menu-item/link-menu-item.component.ts
@@ -2,6 +2,7 @@ import { Component, Inject, Input } from '@angular/core';
import { LinkMenuItemModel } from './models/link.model';
import { MenuItemType } from '../initial-menus-state';
import { rendersMenuItemForType } from '../menu-item.decorator';
+import { GLOBAL_CONFIG, GlobalConfig } from '../../../../config';
/**
* Component that renders a menu section of type LINK
@@ -13,7 +14,11 @@ import { rendersMenuItemForType } from '../menu-item.decorator';
@rendersMenuItemForType(MenuItemType.LINK)
export class LinkMenuItemComponent {
item: LinkMenuItemModel;
- constructor(@Inject('itemModelProvider') item: LinkMenuItemModel) {
+ constructor(@Inject('itemModelProvider') item: LinkMenuItemModel, @Inject(GLOBAL_CONFIG) private EnvConfig: GlobalConfig) {
this.item = item;
}
+
+ getRouterLink() {
+ return this.EnvConfig.ui.nameSpace + this.item.link;
+ }
}
diff --git a/src/app/shared/testing/component-injector-stub.ts b/src/app/shared/testing/component-injector-stub.ts
deleted file mode 100644
index 3e3d75d731..0000000000
--- a/src/app/shared/testing/component-injector-stub.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { ComponentFactory } from '@angular/core';
-import { create } from 'domain';
-
-export class ComponentInjectorStub {
- resolveComponentFactory(): ComponentFactory {
- return {
- create() {
- return { hostView: {}, viewContainerParent: {}, }
- }
- } as any;
- }
-}
\ No newline at end of file
diff --git a/src/app/shared/testing/css-variable-service-stub.ts b/src/app/shared/testing/css-variable-service-stub.ts
index 3bf021eb36..0dbae758cd 100644
--- a/src/app/shared/testing/css-variable-service-stub.ts
+++ b/src/app/shared/testing/css-variable-service-stub.ts
@@ -20,4 +20,3 @@ export class CSSVariableServiceStub {
/**/
}
}
-