mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Added thumbs to mydspace and enviroment component injection.
This commit is contained in:
@@ -13,6 +13,8 @@ import { RouterTestingModule } from '@angular/router/testing';
|
|||||||
import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths';
|
import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
|
||||||
describe('CollectionAdminSearchResultListElementComponent', () => {
|
describe('CollectionAdminSearchResultListElementComponent', () => {
|
||||||
let component: CollectionAdminSearchResultListElementComponent;
|
let component: CollectionAdminSearchResultListElementComponent;
|
||||||
@@ -36,7 +38,8 @@ describe('CollectionAdminSearchResultListElementComponent', () => {
|
|||||||
],
|
],
|
||||||
declarations: [CollectionAdminSearchResultListElementComponent],
|
declarations: [CollectionAdminSearchResultListElementComponent],
|
||||||
providers: [{ provide: TruncatableService, useValue: {} },
|
providers: [{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }],
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
@@ -13,6 +13,8 @@ import { Community } from '../../../../../core/shared/community.model';
|
|||||||
import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths';
|
import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
|
||||||
describe('CommunityAdminSearchResultListElementComponent', () => {
|
describe('CommunityAdminSearchResultListElementComponent', () => {
|
||||||
let component: CommunityAdminSearchResultListElementComponent;
|
let component: CommunityAdminSearchResultListElementComponent;
|
||||||
@@ -36,7 +38,8 @@ describe('CommunityAdminSearchResultListElementComponent', () => {
|
|||||||
],
|
],
|
||||||
declarations: [CommunityAdminSearchResultListElementComponent],
|
declarations: [CommunityAdminSearchResultListElementComponent],
|
||||||
providers: [{ provide: TruncatableService, useValue: {} },
|
providers: [{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }],
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
@@ -10,6 +10,8 @@ import { ItemAdminSearchResultListElementComponent } from './item-admin-search-r
|
|||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
|
||||||
describe('ItemAdminSearchResultListElementComponent', () => {
|
describe('ItemAdminSearchResultListElementComponent', () => {
|
||||||
let component: ItemAdminSearchResultListElementComponent;
|
let component: ItemAdminSearchResultListElementComponent;
|
||||||
@@ -33,7 +35,8 @@ describe('ItemAdminSearchResultListElementComponent', () => {
|
|||||||
],
|
],
|
||||||
declarations: [ItemAdminSearchResultListElementComponent],
|
declarations: [ItemAdminSearchResultListElementComponent],
|
||||||
providers: [{ provide: TruncatableService, useValue: {} },
|
providers: [{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }],
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
@@ -18,6 +18,8 @@ import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-
|
|||||||
import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock';
|
import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
|
||||||
describe('WorkflowItemAdminWorkflowListElementComponent', () => {
|
describe('WorkflowItemAdminWorkflowListElementComponent', () => {
|
||||||
let component: WorkflowItemSearchResultAdminWorkflowListElementComponent;
|
let component: WorkflowItemSearchResultAdminWorkflowListElementComponent;
|
||||||
@@ -51,7 +53,8 @@ describe('WorkflowItemAdminWorkflowListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { Context } from '../../../../../core/shared/context.model';
|
import { Context } from '../../../../../core/shared/context.model';
|
||||||
@@ -13,6 +13,7 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l
|
|||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
@listableObjectComponent(WorkflowItemSearchResult, ViewMode.ListElement, Context.AdminWorkflowSearch)
|
@listableObjectComponent(WorkflowItemSearchResult, ViewMode.ListElement, Context.AdminWorkflowSearch)
|
||||||
@Component({
|
@Component({
|
||||||
@@ -32,9 +33,10 @@ export class WorkflowItemSearchResultAdminWorkflowListElementComponent extends S
|
|||||||
|
|
||||||
constructor(private linkService: LinkService,
|
constructor(private linkService: LinkService,
|
||||||
protected truncatableService: TruncatableService,
|
protected truncatableService: TruncatableService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -10,6 +10,7 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl
|
|||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
let journalIssueListElementComponent: JournalIssueSearchResultListElementComponent;
|
let journalIssueListElementComponent: JournalIssueSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<JournalIssueSearchResultListElementComponent>;
|
let fixture: ComponentFixture<JournalIssueSearchResultListElementComponent>;
|
||||||
@@ -64,7 +65,8 @@ describe('JournalIssueSearchResultListElementComponent', () => {
|
|||||||
declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe],
|
declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
@@ -152,7 +154,8 @@ describe('JournalIssueSearchResultListElementComponent', () => {
|
|||||||
declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe],
|
declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{provide: TruncatableService, useValue: {}},
|
{provide: TruncatableService, useValue: {}},
|
||||||
{provide: DSONameService, useClass: DSONameServiceMock}
|
{provide: DSONameService, useClass: DSONameServiceMock},
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
|||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
|
||||||
|
|
||||||
@listableObjectComponent('JournalIssueSearchResult', ViewMode.ListElement)
|
@listableObjectComponent('JournalIssueSearchResult', ViewMode.ListElement)
|
||||||
@Component({
|
@Component({
|
||||||
@@ -22,7 +21,7 @@ export class JournalIssueSearchResultListElementComponent extends ItemSearchResu
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.showThumbnails = environment.browseBy.showItemThumbnails;
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl
|
|||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
let journalVolumeListElementComponent: JournalVolumeSearchResultListElementComponent;
|
let journalVolumeListElementComponent: JournalVolumeSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<JournalVolumeSearchResultListElementComponent>;
|
let fixture: ComponentFixture<JournalVolumeSearchResultListElementComponent>;
|
||||||
@@ -64,6 +65,7 @@ describe('JournalVolumeSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
@@ -150,7 +152,8 @@ describe('JournalVolumeSearchResultListElementComponent', () => {
|
|||||||
declarations: [JournalVolumeSearchResultListElementComponent, TruncatePipe],
|
declarations: [JournalVolumeSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{provide: TruncatableService, useValue: {}},
|
{provide: TruncatableService, useValue: {}},
|
||||||
{provide: DSONameService, useClass: DSONameServiceMock}
|
{provide: DSONameService, useClass: DSONameServiceMock},
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
|||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
|
||||||
|
|
||||||
@listableObjectComponent('JournalVolumeSearchResult', ViewMode.ListElement)
|
@listableObjectComponent('JournalVolumeSearchResult', ViewMode.ListElement)
|
||||||
@Component({
|
@Component({
|
||||||
@@ -22,7 +21,7 @@ export class JournalVolumeSearchResultListElementComponent extends ItemSearchRes
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.showThumbnails = environment.browseBy.showItemThumbnails;
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import { ItemSearchResult } from '../../../../../shared/object-collection/shared
|
|||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
let journalListElementComponent: JournalSearchResultListElementComponent;
|
let journalListElementComponent: JournalSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<JournalSearchResultListElementComponent>;
|
let fixture: ComponentFixture<JournalSearchResultListElementComponent>;
|
||||||
@@ -60,6 +61,7 @@ describe('JournalSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
@@ -122,7 +124,8 @@ describe('JournalSearchResultListElementComponent', () => {
|
|||||||
declarations: [JournalSearchResultListElementComponent, TruncatePipe],
|
declarations: [JournalSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{provide: TruncatableService, useValue: {}},
|
{provide: TruncatableService, useValue: {}},
|
||||||
{provide: DSONameService, useClass: DSONameServiceMock}
|
{provide: DSONameService, useClass: DSONameServiceMock},
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
|||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
|
||||||
|
|
||||||
@listableObjectComponent('JournalSearchResult', ViewMode.ListElement)
|
@listableObjectComponent('JournalSearchResult', ViewMode.ListElement)
|
||||||
@Component({
|
@Component({
|
||||||
@@ -22,7 +21,7 @@ export class JournalSearchResultListElementComponent extends ItemSearchResultLis
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.showThumbnails = environment.browseBy.showItemThumbnails;
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import { ItemSearchResult } from '../../../../../shared/object-collection/shared
|
|||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
let orgUnitListElementComponent: OrgUnitSearchResultListElementComponent;
|
let orgUnitListElementComponent: OrgUnitSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<OrgUnitSearchResultListElementComponent>;
|
let fixture: ComponentFixture<OrgUnitSearchResultListElementComponent>;
|
||||||
@@ -57,7 +58,8 @@ describe('OrgUnitSearchResultListElementComponent', () => {
|
|||||||
declarations: [ OrgUnitSearchResultListElementComponent , TruncatePipe],
|
declarations: [ OrgUnitSearchResultListElementComponent , TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [ NO_ERRORS_SCHEMA ]
|
schemas: [ NO_ERRORS_SCHEMA ]
|
||||||
@@ -120,7 +122,8 @@ describe('OrgUnitSearchResultListElementComponent', () => {
|
|||||||
declarations: [OrgUnitSearchResultListElementComponent, TruncatePipe],
|
declarations: [OrgUnitSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{provide: TruncatableService, useValue: {}},
|
{provide: TruncatableService, useValue: {}},
|
||||||
{provide: DSONameService, useClass: DSONameServiceMock}
|
{provide: DSONameService, useClass: DSONameServiceMock},
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
|||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
|
||||||
|
|
||||||
@listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement)
|
@listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement)
|
||||||
@Component({
|
@Component({
|
||||||
@@ -22,7 +21,7 @@ export class OrgUnitSearchResultListElementComponent extends ItemSearchResultLis
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.showThumbnails = environment.browseBy.showItemThumbnails;
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl
|
|||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
let personListElementComponent: PersonSearchResultListElementComponent;
|
let personListElementComponent: PersonSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<PersonSearchResultListElementComponent>;
|
let fixture: ComponentFixture<PersonSearchResultListElementComponent>;
|
||||||
@@ -57,7 +58,8 @@ describe('PersonSearchResultListElementComponent', () => {
|
|||||||
declarations: [PersonSearchResultListElementComponent, TruncatePipe],
|
declarations: [PersonSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
@@ -120,7 +122,8 @@ describe('PersonSearchResultListElementComponent', () => {
|
|||||||
declarations: [PersonSearchResultListElementComponent, TruncatePipe],
|
declarations: [PersonSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{provide: TruncatableService, useValue: {}},
|
{provide: TruncatableService, useValue: {}},
|
||||||
{provide: DSONameService, useClass: DSONameServiceMock}
|
{provide: DSONameService, useClass: DSONameServiceMock},
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
listableObjectComponent
|
listableObjectComponent
|
||||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
@listableObjectComponent('PersonSearchResult', ViewMode.ListElement)
|
@listableObjectComponent('PersonSearchResult', ViewMode.ListElement)
|
||||||
@Component({
|
@Component({
|
||||||
@@ -21,8 +22,10 @@ import { environment } from '../../../../../../environments/environment';
|
|||||||
*/
|
*/
|
||||||
export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent {
|
export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent {
|
||||||
|
|
||||||
public constructor(protected truncatableService: TruncatableService, protected dsoNameService: DSONameService) {
|
public constructor(protected truncatableService: TruncatableService,
|
||||||
super(truncatableService, dsoNameService);
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig ) {
|
||||||
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,7 +35,7 @@ export class PersonSearchResultListElementComponent extends ItemSearchResultList
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.showThumbnails = environment.browseBy.showItemThumbnails;
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -10,6 +10,7 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service
|
|||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
let projectListElementComponent: ProjectSearchResultListElementComponent;
|
let projectListElementComponent: ProjectSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<ProjectSearchResultListElementComponent>;
|
let fixture: ComponentFixture<ProjectSearchResultListElementComponent>;
|
||||||
@@ -58,7 +59,8 @@ describe('ProjectSearchResultListElementComponent', () => {
|
|||||||
declarations: [ProjectSearchResultListElementComponent, TruncatePipe],
|
declarations: [ProjectSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
@@ -121,7 +123,9 @@ describe('ProjectSearchResultListElementComponent', () => {
|
|||||||
declarations: [ProjectSearchResultListElementComponent, TruncatePipe],
|
declarations: [ProjectSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{provide: TruncatableService, useValue: {}},
|
{provide: TruncatableService, useValue: {}},
|
||||||
{provide: DSONameService, useClass: DSONameServiceMock}
|
{provide: DSONameService, useClass: DSONameServiceMock},
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
|||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
|
||||||
|
|
||||||
@listableObjectComponent('ProjectSearchResult', ViewMode.ListElement)
|
@listableObjectComponent('ProjectSearchResult', ViewMode.ListElement)
|
||||||
@Component({
|
@Component({
|
||||||
@@ -22,7 +21,7 @@ export class ProjectSearchResultListElementComponent extends ItemSearchResultLis
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.showThumbnails = environment.browseBy.showItemThumbnails;
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,8 @@ import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe';
|
|||||||
import { OrgUnitSearchResultListSubmissionElementComponent } from './org-unit-search-result-list-submission-element.component';
|
import { OrgUnitSearchResultListSubmissionElementComponent } from './org-unit-search-result-list-submission-element.component';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
|
||||||
let personListElementComponent: OrgUnitSearchResultListSubmissionElementComponent;
|
let personListElementComponent: OrgUnitSearchResultListSubmissionElementComponent;
|
||||||
let fixture: ComponentFixture<OrgUnitSearchResultListSubmissionElementComponent>;
|
let fixture: ComponentFixture<OrgUnitSearchResultListSubmissionElementComponent>;
|
||||||
@@ -117,7 +119,8 @@ describe('OrgUnitSearchResultListSubmissionElementComponent', () => {
|
|||||||
{ provide: DSOChangeAnalyzer, useValue: {} },
|
{ provide: DSOChangeAnalyzer, useValue: {} },
|
||||||
{ provide: DefaultChangeAnalyzer, useValue: {} },
|
{ provide: DefaultChangeAnalyzer, useValue: {} },
|
||||||
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
||||||
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||||
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
||||||
@@ -17,6 +17,7 @@ import { ItemDataService } from '../../../../../core/data/item-data.service';
|
|||||||
import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
import { NameVariantModalComponent } from '../../name-variant-modal/name-variant-modal.component';
|
import { NameVariantModalComponent } from '../../name-variant-modal/name-variant-modal.component';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
@listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.EntitySearchModal)
|
@listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.EntitySearchModal)
|
||||||
@listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.EntitySearchModalWithNameVariants)
|
@listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.EntitySearchModalWithNameVariants)
|
||||||
@@ -35,6 +36,11 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes
|
|||||||
alternativeField = 'dc.title.alternative';
|
alternativeField = 'dc.title.alternative';
|
||||||
useNameVariants = false;
|
useNameVariants = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display thumbnail if required by configuration
|
||||||
|
*/
|
||||||
|
showThumbnails: boolean;
|
||||||
|
|
||||||
constructor(protected truncatableService: TruncatableService,
|
constructor(protected truncatableService: TruncatableService,
|
||||||
private relationshipService: RelationshipService,
|
private relationshipService: RelationshipService,
|
||||||
private notificationsService: NotificationsService,
|
private notificationsService: NotificationsService,
|
||||||
@@ -43,9 +49,10 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes
|
|||||||
private itemDataService: ItemDataService,
|
private itemDataService: ItemDataService,
|
||||||
private bitstreamDataService: BitstreamDataService,
|
private bitstreamDataService: BitstreamDataService,
|
||||||
private selectableListService: SelectableListService,
|
private selectableListService: SelectableListService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -65,6 +72,7 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
select(value) {
|
select(value) {
|
||||||
|
@@ -1,6 +1,20 @@
|
|||||||
<div class="d-flex">
|
<div class="row">
|
||||||
|
<div *ngIf="showThumbnails" class="col-md-2">
|
||||||
|
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'"
|
||||||
|
rel="noopener noreferrer" class="dont-break-out">
|
||||||
|
<ds-thumbnail [thumbnail]="dso?.thumbnail | async"
|
||||||
|
[defaultImage]="'assets/images/person-placeholder.svg'"
|
||||||
|
[alt]="'thumbnail.person.alt'"
|
||||||
|
[placeholder]="'thumbnail.person.placeholder'">
|
||||||
|
</ds-thumbnail>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div [ngClass]="showThumbnails ? 'col-md-10' : 'col-md-12'">
|
||||||
|
<div class="d-flex">
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<ds-person-input-suggestions [suggestions]="allSuggestions" [(ngModel)]="selectedName" (clickSuggestion)="select($event)" (submitSuggestion)="selectCustom($event)"></ds-person-input-suggestions>
|
<ds-person-input-suggestions [suggestions]="allSuggestions" [(ngModel)]="selectedName"
|
||||||
|
(clickSuggestion)="select($event)"
|
||||||
|
(submitSuggestion)="selectCustom($event)"></ds-person-input-suggestions>
|
||||||
<span class="text-muted">
|
<span class="text-muted">
|
||||||
<span *ngIf="dso.allMetadata(['person.jobTitle']).length > 0"
|
<span *ngIf="dso.allMetadata(['person.jobTitle']).length > 0"
|
||||||
class="item-list-job-title">
|
class="item-list-job-title">
|
||||||
@@ -10,4 +24,6 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -27,6 +27,8 @@ import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-
|
|||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe';
|
import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe';
|
||||||
import { PersonSearchResultListSubmissionElementComponent } from './person-search-result-list-submission-element.component';
|
import { PersonSearchResultListSubmissionElementComponent } from './person-search-result-list-submission-element.component';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
|
||||||
let personListElementComponent: PersonSearchResultListSubmissionElementComponent;
|
let personListElementComponent: PersonSearchResultListSubmissionElementComponent;
|
||||||
let fixture: ComponentFixture<PersonSearchResultListSubmissionElementComponent>;
|
let fixture: ComponentFixture<PersonSearchResultListSubmissionElementComponent>;
|
||||||
@@ -109,6 +111,7 @@ describe('PersonSearchResultListElementSubmissionComponent', () => {
|
|||||||
{ provide: DSOChangeAnalyzer, useValue: {} },
|
{ provide: DSOChangeAnalyzer, useValue: {} },
|
||||||
{ provide: DefaultChangeAnalyzer, useValue: {} },
|
{ provide: DefaultChangeAnalyzer, useValue: {} },
|
||||||
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
||||||
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||||
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
||||||
@@ -17,6 +17,7 @@ import { MetadataValue } from '../../../../../core/shared/metadata.models';
|
|||||||
import { ItemDataService } from '../../../../../core/data/item-data.service';
|
import { ItemDataService } from '../../../../../core/data/item-data.service';
|
||||||
import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
@listableObjectComponent('PersonSearchResult', ViewMode.ListElement, Context.EntitySearchModalWithNameVariants)
|
@listableObjectComponent('PersonSearchResult', ViewMode.ListElement, Context.EntitySearchModalWithNameVariants)
|
||||||
@Component({
|
@Component({
|
||||||
@@ -33,6 +34,11 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu
|
|||||||
selectedName: string;
|
selectedName: string;
|
||||||
alternativeField = 'dc.title.alternative';
|
alternativeField = 'dc.title.alternative';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display thumbnail if required by configuration
|
||||||
|
*/
|
||||||
|
showThumbnails: boolean;
|
||||||
|
|
||||||
constructor(protected truncatableService: TruncatableService,
|
constructor(protected truncatableService: TruncatableService,
|
||||||
private relationshipService: RelationshipService,
|
private relationshipService: RelationshipService,
|
||||||
private notificationsService: NotificationsService,
|
private notificationsService: NotificationsService,
|
||||||
@@ -41,9 +47,10 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu
|
|||||||
private itemDataService: ItemDataService,
|
private itemDataService: ItemDataService,
|
||||||
private bitstreamDataService: BitstreamDataService,
|
private bitstreamDataService: BitstreamDataService,
|
||||||
private selectableListService: SelectableListService,
|
private selectableListService: SelectableListService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -58,6 +65,7 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu
|
|||||||
this.selectedName = nameVariant || defaultValue;
|
this.selectedName = nameVariant || defaultValue;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
select(value) {
|
select(value) {
|
||||||
|
@@ -17,6 +17,8 @@ import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/s
|
|||||||
import { ClaimedApprovedSearchResultListElementComponent } from './claimed-approved-search-result-list-element.component';
|
import { ClaimedApprovedSearchResultListElementComponent } from './claimed-approved-search-result-list-element.component';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
|
||||||
let component: ClaimedApprovedSearchResultListElementComponent;
|
let component: ClaimedApprovedSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<ClaimedApprovedSearchResultListElementComponent>;
|
let fixture: ComponentFixture<ClaimedApprovedSearchResultListElementComponent>;
|
||||||
@@ -67,7 +69,8 @@ describe('ClaimedApprovedSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(ClaimedApprovedSearchResultListElementComponent, {
|
}).overrideComponent(ClaimedApprovedSearchResultListElementComponent, {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/shared/claimed-approved-task-search-result.model';
|
import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/shared/claimed-approved-task-search-result.model';
|
||||||
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
@@ -13,6 +13,7 @@ import { SearchResultListElementComponent } from '../../../search-result-list-el
|
|||||||
import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model';
|
import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model';
|
||||||
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders claimed task approved object for the search result in the list view.
|
* This component renders claimed task approved object for the search result in the list view.
|
||||||
@@ -43,9 +44,10 @@ export class ClaimedApprovedSearchResultListElementComponent extends SearchResul
|
|||||||
public constructor(
|
public constructor(
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected truncatableService: TruncatableService,
|
protected truncatableService: TruncatableService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -17,6 +17,8 @@ import { LinkService } from '../../../../../core/cache/builders/link.service';
|
|||||||
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
|
||||||
let component: ClaimedDeclinedSearchResultListElementComponent;
|
let component: ClaimedDeclinedSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<ClaimedDeclinedSearchResultListElementComponent>;
|
let fixture: ComponentFixture<ClaimedDeclinedSearchResultListElementComponent>;
|
||||||
@@ -67,7 +69,8 @@ describe('ClaimedDeclinedSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(ClaimedDeclinedSearchResultListElementComponent, {
|
}).overrideComponent(ClaimedDeclinedSearchResultListElementComponent, {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
|
|
||||||
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ClaimedDeclinedTaskSearchResult } from '../../../../object-collection/shared/claimed-declined-task-search-result.model';
|
import { ClaimedDeclinedTaskSearchResult } from '../../../../object-collection/shared/claimed-declined-task-search-result.model';
|
||||||
@@ -14,6 +14,7 @@ import { SearchResultListElementComponent } from '../../../search-result-list-el
|
|||||||
import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model';
|
import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model';
|
||||||
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders claimed task declined object for the search result in the list view.
|
* This component renders claimed task declined object for the search result in the list view.
|
||||||
@@ -44,9 +45,10 @@ export class ClaimedDeclinedSearchResultListElementComponent extends SearchResul
|
|||||||
public constructor(
|
public constructor(
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected truncatableService: TruncatableService,
|
protected truncatableService: TruncatableService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -18,6 +18,8 @@ import { getMockLinkService } from '../../../mocks/link-service.mock';
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
let component: ClaimedSearchResultListElementComponent;
|
let component: ClaimedSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<ClaimedSearchResultListElementComponent>;
|
let fixture: ComponentFixture<ClaimedSearchResultListElementComponent>;
|
||||||
@@ -68,7 +70,8 @@ describe('ClaimedSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(ClaimedSearchResultListElementComponent, {
|
}).overrideComponent(ClaimedSearchResultListElementComponent, {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
|
|
||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
@@ -13,6 +13,7 @@ import { followLink } from '../../../utils/follow-link-config.model';
|
|||||||
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
||||||
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-claimed-search-result-list-element',
|
selector: 'ds-claimed-search-result-list-element',
|
||||||
@@ -40,9 +41,10 @@ export class ClaimedSearchResultListElementComponent extends SearchResultListEle
|
|||||||
public constructor(
|
public constructor(
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected truncatableService: TruncatableService,
|
protected truncatableService: TruncatableService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,10 @@
|
|||||||
<div *ngIf="item" @fadeInOut>
|
<div class="row">
|
||||||
|
<div *ngIf="showThumbnails" class="col-md-2">
|
||||||
|
<ds-thumbnail [thumbnail]="item?.thumbnail | async" [limitWidth]="true">
|
||||||
|
</ds-thumbnail>
|
||||||
|
</div>
|
||||||
|
<div [ngClass]="showThumbnails ? 'col-md-10' : 'col-md-12'">
|
||||||
|
<div *ngIf="item" @fadeInOut>
|
||||||
<ng-container *ngIf="status">
|
<ng-container *ngIf="status">
|
||||||
<ds-mydspace-item-status [status]="status"></ds-mydspace-item-status>
|
<ds-mydspace-item-status [status]="status"></ds-mydspace-item-status>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
@@ -7,17 +13,21 @@
|
|||||||
<ds-access-status-badge [item]="item" class="pl-1"></ds-access-status-badge>
|
<ds-access-status-badge [item]="item" class="pl-1"></ds-access-status-badge>
|
||||||
</div>
|
</div>
|
||||||
<ds-truncatable [id]="item.id">
|
<ds-truncatable [id]="item.id">
|
||||||
<h3 [innerHTML]="item.firstMetadataValue('dc.title') || ('mydspace.results.no-title' | translate)" [ngClass]="{'lead': true,'text-muted': !item.firstMetadataValue('dc.title')}"></h3>
|
<h3 [innerHTML]="item.firstMetadataValue('dc.title') || ('mydspace.results.no-title' | translate)"
|
||||||
|
[ngClass]="{'lead': true,'text-muted': !item.firstMetadataValue('dc.title')}"></h3>
|
||||||
<div>
|
<div>
|
||||||
<span class="text-muted">
|
<span class="text-muted">
|
||||||
<ds-truncatable-part [id]="item.id" [minLines]="1">
|
<ds-truncatable-part [id]="item.id" [minLines]="1">
|
||||||
(<span *ngIf="item.hasMetadata('dc.publisher')" class="item-list-publisher"
|
(<span *ngIf="item.hasMetadata('dc.publisher')" class="item-list-publisher"
|
||||||
[innerHTML]="item.firstMetadataValue('dc.publisher') + ', '"></span>
|
[innerHTML]="item.firstMetadataValue('dc.publisher') + ', '"></span>
|
||||||
<span class="item-list-date" [innerHTML]="item.firstMetadataValue('dc.date.issued') || ('mydspace.results.no-date' | translate)"></span>)
|
<span class="item-list-date"
|
||||||
|
[innerHTML]="item.firstMetadataValue('dc.date.issued') || ('mydspace.results.no-date' | translate)"></span>)
|
||||||
<span *ngIf="item.hasMetadata(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']);"
|
<span *ngIf="item.hasMetadata(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']);"
|
||||||
class="item-list-authors">
|
class="item-list-authors">
|
||||||
<span *ngIf="item.allMetadataValues(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']).length === 0">{{'mydspace.results.no-authors' | translate}}</span>
|
<span
|
||||||
<span *ngFor="let author of item.allMetadataValues(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']); let last=last;">
|
*ngIf="item.allMetadataValues(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']).length === 0">{{'mydspace.results.no-authors' | translate}}</span>
|
||||||
|
<span
|
||||||
|
*ngFor="let author of item.allMetadataValues(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']); let last=last;">
|
||||||
<span [innerHTML]="author"><span [innerHTML]="author"></span></span>
|
<span [innerHTML]="author"><span [innerHTML]="author"></span></span>
|
||||||
<span *ngIf="!last">; </span>
|
<span *ngIf="!last">; </span>
|
||||||
</span>
|
</span>
|
||||||
@@ -34,4 +44,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</ds-truncatable>
|
</ds-truncatable>
|
||||||
<ds-item-submitter *ngIf="showSubmitter" [object]="object.indexableObject"></ds-item-submitter>
|
<ds-item-submitter *ngIf="showSubmitter" [object]="object.indexableObject"></ds-item-submitter>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -10,6 +10,8 @@ import { ItemListPreviewComponent } from './item-list-preview.component';
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
let component: ItemListPreviewComponent;
|
let component: ItemListPreviewComponent;
|
||||||
let fixture: ComponentFixture<ItemListPreviewComponent>;
|
let fixture: ComponentFixture<ItemListPreviewComponent>;
|
||||||
@@ -80,8 +82,8 @@ describe('ItemListPreviewComponent', () => {
|
|||||||
],
|
],
|
||||||
declarations: [ItemListPreviewComponent, TruncatePipe],
|
declarations: [ItemListPreviewComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate } }
|
{ provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate }},
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
import { Component, Input } from '@angular/core';
|
import { Component, Inject, Input, OnInit } from '@angular/core';
|
||||||
|
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { fadeInOut } from '../../../animations/fade';
|
import { fadeInOut } from '../../../animations/fade';
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
||||||
import { SearchResult } from '../../../search/models/search-result.model';
|
import { SearchResult } from '../../../search/models/search-result.model';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component show metadata for the given item object in the list view.
|
* This component show metadata for the given item object in the list view.
|
||||||
@@ -14,7 +15,7 @@ import { SearchResult } from '../../../search/models/search-result.model';
|
|||||||
templateUrl: 'item-list-preview.component.html',
|
templateUrl: 'item-list-preview.component.html',
|
||||||
animations: [fadeInOut]
|
animations: [fadeInOut]
|
||||||
})
|
})
|
||||||
export class ItemListPreviewComponent {
|
export class ItemListPreviewComponent implements OnInit{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The item to display
|
* The item to display
|
||||||
@@ -35,4 +36,17 @@ export class ItemListPreviewComponent {
|
|||||||
* A boolean representing if to show submitter information
|
* A boolean representing if to show submitter information
|
||||||
*/
|
*/
|
||||||
@Input() showSubmitter = false;
|
@Input() showSubmitter = false;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display thumbnails if required by configuration
|
||||||
|
*/
|
||||||
|
showThumbnails: boolean;
|
||||||
|
|
||||||
|
constructor(@Inject(APP_CONFIG) protected appConfig: AppConfig) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@ export class ThemedItemListPreviewComponent extends ThemedComponent<ItemListPrev
|
|||||||
|
|
||||||
@Input() showSubmitter = false;
|
@Input() showSubmitter = false;
|
||||||
|
|
||||||
|
|
||||||
protected getComponentName(): string {
|
protected getComponentName(): string {
|
||||||
return 'ItemListPreviewComponent';
|
return 'ItemListPreviewComponent';
|
||||||
}
|
}
|
||||||
|
@@ -2,4 +2,9 @@
|
|||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status"></ds-themed-item-list-preview>
|
[status]="status"></ds-themed-item-list-preview>
|
||||||
|
|
||||||
<ds-item-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-item-actions>
|
<div class="row">
|
||||||
|
<div [ngClass]="showThumbnails ? 'offset-md-2 pl-3' : ''">
|
||||||
|
<ds-item-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-item-actions>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@@ -12,6 +12,8 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
let component: ItemSearchResultListElementSubmissionComponent;
|
let component: ItemSearchResultListElementSubmissionComponent;
|
||||||
let fixture: ComponentFixture<ItemSearchResultListElementSubmissionComponent>;
|
let fixture: ComponentFixture<ItemSearchResultListElementSubmissionComponent>;
|
||||||
@@ -56,7 +58,8 @@ describe('ItemMyDSpaceResultListElementComponent', () => {
|
|||||||
declarations: [ItemSearchResultListElementSubmissionComponent],
|
declarations: [ItemSearchResultListElementSubmissionComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(ItemSearchResultListElementSubmissionComponent, {
|
}).overrideComponent(ItemSearchResultListElementSubmissionComponent, {
|
||||||
|
@@ -25,7 +25,13 @@ export class ItemSearchResultListElementSubmissionComponent extends SearchResult
|
|||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.ARCHIVED;
|
public status = MyDspaceItemStatusType.ARCHIVED;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display thumbnails if required by configuration
|
||||||
|
*/
|
||||||
|
showThumbnails: boolean;
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,8 @@ import { getMockLinkService } from '../../../mocks/link-service.mock';
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
let component: PoolSearchResultListElementComponent;
|
let component: PoolSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<PoolSearchResultListElementComponent>;
|
let fixture: ComponentFixture<PoolSearchResultListElementComponent>;
|
||||||
@@ -68,7 +70,8 @@ describe('PoolSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(PoolSearchResultListElementComponent, {
|
}).overrideComponent(PoolSearchResultListElementComponent, {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@@ -14,6 +14,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
|
|||||||
import { followLink } from '../../../utils/follow-link-config.model';
|
import { followLink } from '../../../utils/follow-link-config.model';
|
||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders pool task object for the search result in the list view.
|
* This component renders pool task object for the search result in the list view.
|
||||||
@@ -50,9 +51,10 @@ export class PoolSearchResultListElementComponent extends SearchResultListElemen
|
|||||||
constructor(
|
constructor(
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected truncatableService: TruncatableService,
|
protected truncatableService: TruncatableService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -3,9 +3,13 @@
|
|||||||
[item]="item$ | async"
|
[item]="item$ | async"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status"></ds-themed-item-list-preview>
|
[status]="status"></ds-themed-item-list-preview>
|
||||||
|
<div class="row">
|
||||||
|
<div [ngClass]="showThumbnails ? 'offset-md-2 pl-3' : ''">
|
||||||
<ds-workflowitem-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-workflowitem-actions>
|
<ds-workflowitem-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-workflowitem-actions>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ds-themed-loading
|
<ds-themed-loading
|
||||||
*ngIf="!(item$ | async)"
|
*ngIf="!(item$ | async)"
|
||||||
[showMessage]="false"></ds-themed-loading>
|
[showMessage]="false"></ds-themed-loading>
|
||||||
|
@@ -18,6 +18,8 @@ import { WorkflowItemSearchResultListElementComponent } from './workflow-item-se
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
let component: WorkflowItemSearchResultListElementComponent;
|
let component: WorkflowItemSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<WorkflowItemSearchResultListElementComponent>;
|
let fixture: ComponentFixture<WorkflowItemSearchResultListElementComponent>;
|
||||||
@@ -69,7 +71,8 @@ describe('WorkflowItemSearchResultListElementComponent', () => {
|
|||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: ItemDataService, useValue: {} },
|
{ provide: ItemDataService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(WorkflowItemSearchResultListElementComponent, {
|
}).overrideComponent(WorkflowItemSearchResultListElementComponent, {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { find, map } from 'rxjs/operators';
|
import { find, map } from 'rxjs/operators';
|
||||||
@@ -16,6 +16,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
|
|||||||
import { followLink } from '../../../utils/follow-link-config.model';
|
import { followLink } from '../../../utils/follow-link-config.model';
|
||||||
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders workflowitem object for the search result in the list view.
|
* This component renders workflowitem object for the search result in the list view.
|
||||||
@@ -39,12 +40,18 @@ export class WorkflowItemSearchResultListElementComponent extends SearchResultLi
|
|||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.WORKFLOW;
|
public status = MyDspaceItemStatusType.WORKFLOW;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display thumbnails if required by configuration
|
||||||
|
*/
|
||||||
|
showThumbnails: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected truncatableService: TruncatableService,
|
protected truncatableService: TruncatableService,
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,6 +61,7 @@ export class WorkflowItemSearchResultListElementComponent extends SearchResultLi
|
|||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.linkService.resolveLink(this.dso, followLink('item'));
|
this.linkService.resolveLink(this.dso, followLink('item'));
|
||||||
this.initItem(this.dso.item as Observable<RemoteData<Item>> );
|
this.initItem(this.dso.item as Observable<RemoteData<Item>> );
|
||||||
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -4,7 +4,11 @@
|
|||||||
[object]="object"
|
[object]="object"
|
||||||
[status]="status"></ds-themed-item-list-preview>
|
[status]="status"></ds-themed-item-list-preview>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div [ngClass]="showThumbnails ? 'offset-md-2 pl-3' : ''">
|
||||||
<ds-workspaceitem-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-workspaceitem-actions>
|
<ds-workspaceitem-actions [object]="dso" (processCompleted)="reloadedObject.emit($event.reloadedObject)"></ds-workspaceitem-actions>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ds-themed-loading
|
<ds-themed-loading
|
||||||
*ngIf="!(item$ | async)"
|
*ngIf="!(item$ | async)"
|
||||||
|
@@ -18,6 +18,8 @@ import { WorkspaceItemSearchResultListElementComponent } from './workspace-item-
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
let component: WorkspaceItemSearchResultListElementComponent;
|
let component: WorkspaceItemSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<WorkspaceItemSearchResultListElementComponent>;
|
let fixture: ComponentFixture<WorkspaceItemSearchResultListElementComponent>;
|
||||||
@@ -68,7 +70,8 @@ describe('WorkspaceItemSearchResultListElementComponent', () => {
|
|||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: ItemDataService, useValue: {} },
|
{ provide: ItemDataService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(WorkspaceItemSearchResultListElementComponent, {
|
}).overrideComponent(WorkspaceItemSearchResultListElementComponent, {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { find, map } from 'rxjs/operators';
|
import { find, map } from 'rxjs/operators';
|
||||||
@@ -16,6 +16,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
|
|||||||
import { followLink } from '../../../utils/follow-link-config.model';
|
import { followLink } from '../../../utils/follow-link-config.model';
|
||||||
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders workspaceitem object for the search result in the list view.
|
* This component renders workspaceitem object for the search result in the list view.
|
||||||
@@ -39,12 +40,18 @@ export class WorkspaceItemSearchResultListElementComponent extends SearchResultL
|
|||||||
*/
|
*/
|
||||||
status = MyDspaceItemStatusType.WORKSPACE;
|
status = MyDspaceItemStatusType.WORKSPACE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display thumbnails if required by configuration
|
||||||
|
*/
|
||||||
|
showThumbnails: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected truncatableService: TruncatableService,
|
protected truncatableService: TruncatableService,
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig: AppConfig
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,6 +61,7 @@ export class WorkspaceItemSearchResultListElementComponent extends SearchResultL
|
|||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.linkService.resolveLink(this.dso, followLink('item'));
|
this.linkService.resolveLink(this.dso, followLink('item'));
|
||||||
this.initItem(this.dso.item as Observable<RemoteData<Item>>);
|
this.initItem(this.dso.item as Observable<RemoteData<Item>>);
|
||||||
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -9,6 +9,8 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
|
|||||||
import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model';
|
import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
let collectionSearchResultListElementComponent: CollectionSearchResultListElementComponent;
|
let collectionSearchResultListElementComponent: CollectionSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<CollectionSearchResultListElementComponent>;
|
let fixture: ComponentFixture<CollectionSearchResultListElementComponent>;
|
||||||
@@ -49,7 +51,8 @@ describe('CollectionSearchResultListElementComponent', () => {
|
|||||||
declarations: [CollectionSearchResultListElementComponent, TruncatePipe],
|
declarations: [CollectionSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(CollectionSearchResultListElementComponent, {
|
}).overrideComponent(CollectionSearchResultListElementComponent, {
|
||||||
|
@@ -4,7 +4,6 @@ import { Collection } from '../../../../core/shared/collection.model';
|
|||||||
import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model';
|
import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model';
|
||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { environment } from '../../../../../environments/environment';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-collection-search-result-list-element',
|
selector: 'ds-collection-search-result-list-element',
|
||||||
@@ -24,7 +23,7 @@ export class CollectionSearchResultListElementComponent extends SearchResultList
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.showThumbnails = environment.browseBy.showItemThumbnails;
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,8 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
|
|||||||
import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model';
|
import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
let communitySearchResultListElementComponent: CommunitySearchResultListElementComponent;
|
let communitySearchResultListElementComponent: CommunitySearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<CommunitySearchResultListElementComponent>;
|
let fixture: ComponentFixture<CommunitySearchResultListElementComponent>;
|
||||||
@@ -49,7 +51,8 @@ describe('CommunitySearchResultListElementComponent', () => {
|
|||||||
declarations: [CommunitySearchResultListElementComponent, TruncatePipe],
|
declarations: [CommunitySearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -4,7 +4,6 @@ import { Community } from '../../../../core/shared/community.model';
|
|||||||
import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model';
|
import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model';
|
||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { environment } from '../../../../../environments/environment';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-community-search-result-list-element',
|
selector: 'ds-community-search-result-list-element',
|
||||||
@@ -24,6 +23,6 @@ export class CommunitySearchResultListElementComponent extends SearchResultListE
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.showThumbnails = environment.browseBy.showItemThumbnails;
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import { ItemSearchResult } from '../../../../../object-collection/shared/item-s
|
|||||||
import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock, UNDEFINED_NAME } from '../../../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock, UNDEFINED_NAME } from '../../../../../mocks/dso-name.service.mock';
|
||||||
import { environment } from '../../../../../../../environments/environment';
|
import { environment } from '../../../../../../../environments/environment';
|
||||||
|
import { APP_CONFIG } from '../../../../../../../config/app-config.interface';
|
||||||
|
|
||||||
let publicationListElementComponent: ItemSearchResultListElementComponent;
|
let publicationListElementComponent: ItemSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<ItemSearchResultListElementComponent>;
|
let fixture: ComponentFixture<ItemSearchResultListElementComponent>;
|
||||||
@@ -67,7 +68,8 @@ describe('ItemSearchResultListElementComponent', () => {
|
|||||||
declarations: [ItemSearchResultListElementComponent, TruncatePipe],
|
declarations: [ItemSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock }
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
@@ -214,7 +216,8 @@ describe('ItemSearchResultListElementComponent', () => {
|
|||||||
declarations: [ItemSearchResultListElementComponent, TruncatePipe],
|
declarations: [ItemSearchResultListElementComponent, TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{provide: TruncatableService, useValue: {}},
|
{provide: TruncatableService, useValue: {}},
|
||||||
{provide: DSONameService, useClass: DSONameServiceMock}
|
{provide: DSONameService, useClass: DSONameServiceMock},
|
||||||
|
{ provide: APP_CONFIG, useValue: environment }
|
||||||
],
|
],
|
||||||
|
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -5,7 +5,6 @@ import { ItemSearchResult } from '../../../../../object-collection/shared/item-s
|
|||||||
import { SearchResultListElementComponent } from '../../../search-result-list-element.component';
|
import { SearchResultListElementComponent } from '../../../search-result-list-element.component';
|
||||||
import { Item } from '../../../../../../core/shared/item.model';
|
import { Item } from '../../../../../../core/shared/item.model';
|
||||||
import { getItemPageRoute } from '../../../../../../item-page/item-page-routing-paths';
|
import { getItemPageRoute } from '../../../../../../item-page/item-page-routing-paths';
|
||||||
import { environment } from '../../../../../../../environments/environment';
|
|
||||||
|
|
||||||
@listableObjectComponent('PublicationSearchResult', ViewMode.ListElement)
|
@listableObjectComponent('PublicationSearchResult', ViewMode.ListElement)
|
||||||
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement)
|
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement)
|
||||||
@@ -30,7 +29,7 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.showThumbnails = environment.browseBy.showItemThumbnails;
|
this.showThumbnails = this.appConfig.browseBy.showItemThumbnails;
|
||||||
this.itemPageRoute = getItemPageRoute(this.dso);
|
this.itemPageRoute = getItemPageRoute(this.dso);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { SearchResult } from '../../search/models/search-result.model';
|
import { SearchResult } from '../../search/models/search-result.model';
|
||||||
@@ -8,6 +8,7 @@ import { AbstractListableElementComponent } from '../../object-collection/shared
|
|||||||
import { TruncatableService } from '../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../truncatable/truncatable.service';
|
||||||
import { Metadata } from '../../../core/shared/metadata.utils';
|
import { Metadata } from '../../../core/shared/metadata.utils';
|
||||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-search-result-list-element',
|
selector: 'ds-search-result-list-element',
|
||||||
@@ -20,7 +21,9 @@ export class SearchResultListElementComponent<T extends SearchResult<K>, K exten
|
|||||||
dso: K;
|
dso: K;
|
||||||
dsoTitle: string;
|
dsoTitle: string;
|
||||||
|
|
||||||
public constructor(protected truncatableService: TruncatableService, protected dsoNameService: DSONameService) {
|
public constructor(protected truncatableService: TruncatableService,
|
||||||
|
protected dsoNameService: DSONameService,
|
||||||
|
@Inject(APP_CONFIG) protected appConfig?: AppConfig) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { SearchResult } from '../../search/models/search-result.model';
|
import { SearchResult } from '../../search/models/search-result.model';
|
||||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||||
import { SearchResultListElementComponent } from '../search-result-list-element/search-result-list-element.component';
|
import { SearchResultListElementComponent } from '../search-result-list-element/search-result-list-element.component';
|
||||||
import { Component } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { hasValue, isNotEmpty } from '../../empty.util';
|
import { hasValue, isNotEmpty } from '../../empty.util';
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
import { TruncatableService } from '../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../truncatable/truncatable.service';
|
||||||
@@ -12,6 +12,7 @@ import { followLink } from '../../utils/follow-link-config.model';
|
|||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { Context } from '../../../core/shared/context.model';
|
import { Context } from '../../../core/shared/context.model';
|
||||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-sidebar-search-list-element',
|
selector: 'ds-sidebar-search-list-element',
|
||||||
@@ -42,7 +43,7 @@ export class SidebarSearchListElementComponent<T extends SearchResult<K>, K exte
|
|||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected dsoNameService: DSONameService
|
protected dsoNameService: DSONameService
|
||||||
) {
|
) {
|
||||||
super(truncatableService, dsoNameService);
|
super(truncatableService, dsoNameService, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -142,6 +142,10 @@ ds-dynamic-form-control-container.d-none {
|
|||||||
.thumb-font-1 {
|
.thumb-font-1 {
|
||||||
.thumbnail-placeholder {
|
.thumbnail-placeholder {
|
||||||
font-size: 0.7rem !important;
|
font-size: 0.7rem !important;
|
||||||
|
@media screen and (max-width: map-get($grid-breakpoints, sm)) {
|
||||||
|
font-size: 1.1rem !important;
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
visibility: inherit;
|
visibility: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -154,6 +158,7 @@ ds-dynamic-form-control-container.d-none {
|
|||||||
.thumb-font-3 {
|
.thumb-font-3 {
|
||||||
.thumbnail-placeholder {
|
.thumbnail-placeholder {
|
||||||
font-size: 1.25rem !important;
|
font-size: 1.25rem !important;
|
||||||
|
padding: 0.5rem;
|
||||||
visibility: inherit;
|
visibility: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user