diff --git a/src/app/+search-page/configuration-search-page.component.ts b/src/app/+search-page/configuration-search-page.component.ts index befac7f331..e6bb10f293 100644 --- a/src/app/+search-page/configuration-search-page.component.ts +++ b/src/app/+search-page/configuration-search-page.component.ts @@ -1,3 +1,4 @@ +import { switchMap } from 'rxjs/operators'; import { HostWindowService } from '../shared/host-window.service'; import { SidebarService } from '../shared/sidebar/sidebar.service'; import { SearchComponent } from './search.component'; diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.html b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.html index ce1d32c3a7..0f9b5894f9 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.html +++ b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.html @@ -1,39 +1,43 @@ - -
- - -
- - -
-
- +
+ + + +
+ + +
+
+
-
- - -

-
-

- - - -

-

- - - -

-
- View -
-
- +
+ + +

+
+

+ + + +

+

+ + + +

+
+ View +
-
+ + +
diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.html b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.html index 261d6dc004..16e2a8b847 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.html +++ b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.html @@ -1,39 +1,43 @@ - -
- - -
- - -
-
- +
+ + + +
+ + +
+
+
-
- - -

-
-

- - - -

-

- - - -

-
- View -
-
- +
+ + +

+
+

+ + + +

+

+ + + +

+
+ View +
-
+ + +
diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.html b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.html index 435d9194c4..4902eec71e 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.html +++ b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.html @@ -1,44 +1,47 @@ - -
- - -
- - -
-
- +
+ + + +
+ + +
+
+
-
- - -

-
-

- - {{firstMetadataValue('creativework.editor')}} - +

+ + +

+
+

+ + {{firstMetadataValue('creativework.editor')}} + , - {{firstMetadataValue('creativework.publisher')}} + {{firstMetadataValue('creativework.publisher')}} - -

-

- - - -

-
- View -
-
- + +

+

+ + + +

+
+ View +
-
+ + +
diff --git a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.html b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.html index 2a2e71b8ca..1f64856583 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.html +++ b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.html @@ -1,44 +1,49 @@ - -
- - -
- - -
-
- +
+ + + +
+ + +
+
+
-
- - -

-
-

- - - -

-

- - {{firstMetadataValue('organization.address.addressCountry')}} - +

+ + +

+
+

+ + + +

+

+ + {{firstMetadataValue('organization.address.addressCountry')}} + , - {{firstMetadataValue('organization.address.addressLocality')}} + {{firstMetadataValue('organization.address.addressLocality')}} - -

-
- View -
-
- + +

+
+ View +
-
+ + +
diff --git a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.html b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.html index 93de2fd28e..cbe93b2545 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.html +++ b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.html @@ -1,39 +1,43 @@ - -
- - -
- - -
-
- +
+ + + +
+ + +
+
+
-
- - -

-
- -

- - - -

-
- View -
-
- +
+ + +

+
+ +

+ + + +

+
+ View +
-
+ + +
diff --git a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.html b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.html index 55aa9d5f0f..22182d50be 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.html +++ b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.html @@ -1,34 +1,37 @@ - -
- - -
- - -
-
- +
+ + + +
+ + +
+
+
-
- - -

-
-

- - - -

-
- View -
-
- +
+ + +

+
+

+ + + +

+
+ View +
-
+ + +
diff --git a/src/app/shared/mocks/mock-trucatable.service.ts b/src/app/shared/mocks/mock-trucatable.service.ts new file mode 100644 index 0000000000..0acb0b4c76 --- /dev/null +++ b/src/app/shared/mocks/mock-trucatable.service.ts @@ -0,0 +1,19 @@ +import { of as observableOf } from 'rxjs/internal/observable/of'; + +export const mockTruncatableService: any = { + /* tslint:disable:no-empty */ + isCollapsed: (id: string) => { + if (id === '1') { + return observableOf(true) + } else { + return observableOf(false); + } + }, + expand: (id: string) => { + }, + collapse: (id: string) => { + }, + toggle: (id: string) => { + } + /* tslint:enable:no-empty */ +}; diff --git a/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.html b/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.html index db41da7c2c..8aa75df7dd 100644 --- a/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.html +++ b/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.html @@ -2,10 +2,12 @@ [index]="index" [linkType]="linkType" [listID]="listID"> - + diff --git a/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts index bd7aa841b8..268ede777c 100644 --- a/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts @@ -1,6 +1,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; +import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; +import { SharedModule } from '../../../shared.module'; import { CollectionAdminSearchResultGridElementComponent } from './collection-admin-search-result-grid-element.component'; import { TranslateModule } from '@ngx-translate/core'; import { TruncatableService } from '../../../truncatable/truncatable.service'; @@ -12,7 +16,7 @@ import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { getCollectionEditPath } from '../../../../+collection-page/collection-page-routing.module'; -describe('CollectionAdminSearchResultListElementComponent', () => { +describe('CollectionAdminSearchResultGridElementComponent', () => { let component: CollectionAdminSearchResultGridElementComponent; let fixture: ComponentFixture; let id; @@ -28,12 +32,15 @@ describe('CollectionAdminSearchResultListElementComponent', () => { init(); TestBed.configureTestingModule({ imports: [ + NoopAnimationsModule, TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), + SharedModule ], - declarations: [CollectionAdminSearchResultGridElementComponent], - providers: [{ provide: TruncatableService, useValue: {} }], - schemas: [NO_ERRORS_SCHEMA] + providers: [ + { provide: TruncatableService, useValue: mockTruncatableService }, + { provide: BitstreamDataService, useValue: {} }, + ] }) .compileComponents(); })); @@ -53,7 +60,7 @@ describe('CollectionAdminSearchResultListElementComponent', () => { }); it('should render an edit button with the correct link', () => { - const a = fixture.debugElement.query(By.css('a')); + const a = fixture.debugElement.query(By.css('a.edit-link')); const link = a.nativeElement.href; expect(link).toContain(getCollectionEditPath(id)); }) diff --git a/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts b/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts index 8730c98b0e..a43e6782e7 100644 --- a/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts @@ -17,11 +17,10 @@ import { SearchResultGridElementComponent } from '../../search-result-grid-eleme * The component for displaying a list element for a collection search result on the admin search page */ export class CollectionAdminSearchResultGridElementComponent extends SearchResultGridElementComponent { + editPath: string; - /** - * Returns the path to the edit page of this collection - */ - getEditPath(): string { - return getCollectionEditPath(this.dso.uuid) + ngOnInit() { + super.ngOnInit(); + this.editPath = getCollectionEditPath(this.dso.uuid); } } diff --git a/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.html b/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.html index ca38804592..4f6d80c43b 100644 --- a/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.html +++ b/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.html @@ -2,10 +2,12 @@ [index]="index" [linkType]="linkType" [listID]="listID"> - + diff --git a/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts index 4d39d52017..fc8257289c 100644 --- a/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts @@ -1,7 +1,11 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; +import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; +import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; +import { SharedModule } from '../../../shared.module'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { CollectionElementLinkType } from '../../../object-collection/collection-element-link.type'; import { ViewMode } from '../../../../core/shared/view-mode.model'; @@ -12,7 +16,7 @@ import { CommunityAdminSearchResultGridElementComponent } from './community-admi import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; import { getCommunityEditPath } from '../../../../+community-page/community-page-routing.module'; -describe('CommunityAdminSearchResultListElementComponent', () => { +describe('CommunityAdminSearchResultGridElementComponent', () => { let component: CommunityAdminSearchResultGridElementComponent; let fixture: ComponentFixture; let id; @@ -28,11 +32,15 @@ describe('CommunityAdminSearchResultListElementComponent', () => { init(); TestBed.configureTestingModule({ imports: [ + NoopAnimationsModule, TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), + SharedModule + ], + providers: [ + { provide: TruncatableService, useValue: mockTruncatableService }, + { provide: BitstreamDataService, useValue: {} }, ], - declarations: [CommunityAdminSearchResultGridElementComponent], - providers: [{ provide: TruncatableService, useValue: {} }], schemas: [NO_ERRORS_SCHEMA] }) .compileComponents(); @@ -53,7 +61,7 @@ describe('CommunityAdminSearchResultListElementComponent', () => { }); it('should render an edit button with the correct link', () => { - const a = fixture.debugElement.query(By.css('a')); + const a = fixture.debugElement.query(By.css('a.edit-link')); const link = a.nativeElement.href; expect(link).toContain(getCommunityEditPath(id)); }) diff --git a/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts b/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts index becf0bc887..ae3221896e 100644 --- a/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts @@ -17,11 +17,10 @@ import { SearchResultGridElementComponent } from '../../search-result-grid-eleme * The component for displaying a list element for a community search result on the admin search page */ export class CommunityAdminSearchResultGridElementComponent extends SearchResultGridElementComponent { + editPath: string; - /** - * Returns the path to the edit page of this community - */ - getEditPath(): string { - return getCommunityEditPath(this.dso.uuid) + ngOnInit() { + super.ngOnInit(); + this.editPath = getCommunityEditPath(this.dso.uuid); } } diff --git a/src/app/shared/object-grid/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.html b/src/app/shared/object-grid/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.html index 54cbe7603a..1394d49154 100644 --- a/src/app/shared/object-grid/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.html +++ b/src/app/shared/object-grid/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.html @@ -8,32 +8,34 @@ {{ "admin.search.item.withdrawn" | translate }}
- + + diff --git a/src/app/shared/object-grid/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts index d9edb410c0..92110c4735 100644 --- a/src/app/shared/object-grid/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts @@ -1,7 +1,16 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; +import { Observable } from 'rxjs/internal/Observable'; +import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; +import { RemoteData } from '../../../../core/data/remote-data'; +import { Bitstream } from '../../../../core/shared/bitstream.model'; +import { Item } from '../../../../core/shared/item.model'; +import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; +import { SharedModule } from '../../../shared.module'; +import { createSuccessfulRemoteDataObject$ } from '../../../testing/utils'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { CollectionElementLinkType } from '../../../object-collection/collection-element-link.type'; import { ViewMode } from '../../../../core/shared/view-mode.model'; @@ -20,6 +29,12 @@ describe('ItemAdminSearchResultListElementComponent', () => { let id; let searchResult; + const mockBitstreamDataService = { + getThumbnailFor(item: Item): Observable> { + return createSuccessfulRemoteDataObject$(new Bitstream()); + } + }; + function init() { id = '780b2588-bda5-4112-a1cd-0b15000a5339'; searchResult = new ItemSearchResult(); @@ -30,11 +45,15 @@ describe('ItemAdminSearchResultListElementComponent', () => { init(); TestBed.configureTestingModule({ imports: [ + NoopAnimationsModule, TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) + RouterTestingModule.withRoutes([]), + SharedModule + ], + providers: [ + { provide: TruncatableService, useValue: mockTruncatableService }, + { provide: BitstreamDataService, useValue: mockBitstreamDataService }, ], - declarations: [ItemAdminSearchResultGridElementComponent], - providers: [{ provide: TruncatableService, useValue: {} }], schemas: [NO_ERRORS_SCHEMA] }) .compileComponents(); diff --git a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts index c14e3f6df1..de19f5b74a 100644 --- a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts @@ -6,6 +6,7 @@ import { Store } from '@ngrx/store'; import { of as observableOf } from 'rxjs'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; +import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; import { CommunityDataService } from '../../../../core/data/community-data.service'; import { DefaultChangeAnalyzer } from '../../../../core/data/default-change-analyzer.service'; import { DSOChangeAnalyzer } from '../../../../core/data/dso-change-analyzer.service'; @@ -62,6 +63,7 @@ describe('CollectionSearchResultGridElementComponent', () => { { provide: UUIDService, useValue: {} }, { provide: Store, useValue: {} }, { provide: RemoteDataBuildService, useValue: {} }, + { provide: BitstreamDataService, useValue: {} }, { provide: CommunityDataService, useValue: {} }, { provide: HALEndpointService, useValue: {} }, { provide: NotificationsService, useValue: {} }, diff --git a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts index 0ea72b52d5..b97c574970 100644 --- a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts @@ -6,6 +6,7 @@ import { Store } from '@ngrx/store'; import { of as observableOf } from 'rxjs'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; +import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; import { CommunityDataService } from '../../../../core/data/community-data.service'; import { DefaultChangeAnalyzer } from '../../../../core/data/default-change-analyzer.service'; import { DSOChangeAnalyzer } from '../../../../core/data/dso-change-analyzer.service'; @@ -62,6 +63,7 @@ describe('CommunitySearchResultGridElementComponent', () => { { provide: UUIDService, useValue: {} }, { provide: Store, useValue: {} }, { provide: RemoteDataBuildService, useValue: {} }, + { provide: BitstreamDataService, useValue: {} }, { provide: CommunityDataService, useValue: {} }, { provide: HALEndpointService, useValue: {} }, { provide: NotificationsService, useValue: {} }, diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.html b/src/app/shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.html index 0dfa7b8d34..ec0b792e34 100644 --- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.html +++ b/src/app/shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.html @@ -1,43 +1,44 @@ - -
- - -
- - -
-
- -
- - -
-
-
- - -

-
-

- - {{firstMetadataValue('dc.date.issued')}} - , - - - -

-

- - - -

-
- View -
-
- -
-
+
+ + + +
+ + +
+
+ +
+ + +
+
+
+ + +

+
+

+ + {{firstMetadataValue('dc.date.issued')}} + , + + + +

+

+ + + +

+
+ View +
+
+
+ +
+ diff --git a/src/app/shared/object-list/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.html b/src/app/shared/object-list/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.html index 78bb8a3e67..e51e207bbe 100644 --- a/src/app/shared/object-list/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.html +++ b/src/app/shared/object-list/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.html @@ -3,7 +3,7 @@ [linkType]="linkType" [listID]="listID"> diff --git a/src/app/shared/object-list/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts b/src/app/shared/object-list/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts index 6077db58b3..5adb12cf77 100644 --- a/src/app/shared/object-list/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts +++ b/src/app/shared/object-list/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts @@ -17,11 +17,10 @@ import { getCollectionEditPath } from '../../../../+collection-page/collection-p * The component for displaying a list element for a collection search result on the admin search page */ export class CollectionAdminSearchResultListElementComponent extends SearchResultListElementComponent { + editPath: string; - /** - * Returns the path to the edit page of this collection - */ - getEditPath(): string { - return getCollectionEditPath(this.dso.uuid) + ngOnInit() { + super.ngOnInit(); + this.editPath = getCollectionEditPath(this.dso.uuid); } } diff --git a/src/app/shared/object-list/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.html b/src/app/shared/object-list/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.html index 9333edbc55..8938c316f4 100644 --- a/src/app/shared/object-list/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.html +++ b/src/app/shared/object-list/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.html @@ -3,7 +3,7 @@ [linkType]="linkType" [listID]="listID"> diff --git a/src/app/shared/object-list/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts b/src/app/shared/object-list/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts index 2ba298e596..c835f02062 100644 --- a/src/app/shared/object-list/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts +++ b/src/app/shared/object-list/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts @@ -17,11 +17,10 @@ import { getCommunityEditPath } from '../../../../+community-page/community-page * The component for displaying a list element for a community search result on the admin search page */ export class CommunityAdminSearchResultListElementComponent extends SearchResultListElementComponent { + editPath: string; - /** - * Returns the path to the edit page of this community - */ - getEditPath(): string { - return getCommunityEditPath(this.dso.uuid) + ngOnInit() { + super.ngOnInit(); + this.editPath = getCommunityEditPath(this.dso.uuid); } } diff --git a/src/app/shared/object-list/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.html b/src/app/shared/object-list/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.html index 83c769ae0a..6c9d422a06 100644 --- a/src/app/shared/object-list/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.html +++ b/src/app/shared/object-list/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.html @@ -15,11 +15,11 @@ - {{"admin.search.item.withdraw" | translate}} + {{"admin.search.item.withdraw" | translate}} - {{"admin.search.item.reinstate" | translate}} + {{"admin.search.item.reinstate" | translate}} diff --git a/src/app/shared/search/paginated-search-options.model.spec.ts b/src/app/shared/search/paginated-search-options.model.spec.ts index 2702c3ff01..1739fd54fb 100644 --- a/src/app/shared/search/paginated-search-options.model.spec.ts +++ b/src/app/shared/search/paginated-search-options.model.spec.ts @@ -27,9 +27,9 @@ describe('PaginatedSearchOptions', () => { 'query=search query&' + 'scope=0fde1ecb-82cc-425a-b600-ac3576d76b47&' + 'dsoType=ITEM&' + - 'f.test=value,query&' + - 'f.example=another value,query&' + - 'f.example=second value,query' + 'f.test=value&' + + 'f.example=another value&' + + 'f.example=second value' ); }); diff --git a/src/app/shared/search/search-options.model.spec.ts b/src/app/shared/search/search-options.model.spec.ts index 3b047b578f..3195ec3660 100644 --- a/src/app/shared/search/search-options.model.spec.ts +++ b/src/app/shared/search/search-options.model.spec.ts @@ -21,9 +21,9 @@ describe('SearchOptions', () => { 'query=search query&' + 'scope=0fde1ecb-82cc-425a-b600-ac3576d76b47&' + 'dsoType=ITEM&' + - 'f.test=value,query&' + - 'f.example=another value,query&' + - 'f.example=second value,query' + 'f.test=value&' + + 'f.example=another value&' + + 'f.example=second value' ); }); diff --git a/src/app/shared/truncatable/truncatable.component.spec.ts b/src/app/shared/truncatable/truncatable.component.spec.ts index d083c27d07..176beb0f15 100644 --- a/src/app/shared/truncatable/truncatable.component.spec.ts +++ b/src/app/shared/truncatable/truncatable.component.spec.ts @@ -1,5 +1,6 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { of as observableOf } from 'rxjs'; +import { mockTruncatableService } from '../mocks/mock-trucatable.service'; import { TruncatableComponent } from './truncatable.component'; import { TruncatableService } from './truncatable.service'; import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; @@ -10,29 +11,12 @@ describe('TruncatableComponent', () => { let fixture: ComponentFixture; const identifier = '1234567890'; let truncatableService; - const truncatableServiceStub: any = { - /* tslint:disable:no-empty */ - isCollapsed: (id: string) => { - if (id === '1') { - return observableOf(true) - } else { - return observableOf(false); - } - }, - expand: (id: string) => { - }, - collapse: (id: string) => { - }, - toggle: (id: string) => { - } - /* tslint:enable:no-empty */ - }; beforeEach(async(() => { TestBed.configureTestingModule({ imports: [NoopAnimationsModule], declarations: [TruncatableComponent], providers: [ - { provide: TruncatableService, useValue: truncatableServiceStub }, + { provide: TruncatableService, useValue: mockTruncatableService }, ], schemas: [NO_ERRORS_SCHEMA] }).overrideComponent(TruncatableComponent, {