Merge remote-tracking branch 'remotes/origin/main' into upgrade_angular10

# Conflicts:
#	package.json
#	server.ts
#	src/app/+admin/admin-access-control/epeople-registry/epeople-registry.component.ts
#	src/app/+admin/admin-access-control/group-registry/group-form/group-form.component.ts
#	src/app/+admin/admin-access-control/group-registry/groups-registry.component.spec.ts
#	src/app/+admin/admin-access-control/group-registry/groups-registry.component.ts
#	src/app/+collection-page/collection-page.component.ts
#	src/app/+item-page/edit-item-page/item-page-reinstate.guard.ts
#	src/app/+item-page/edit-item-page/item-page-withdraw.guard.ts
#	src/app/+item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts
#	src/app/+item-page/edit-item-page/item-relationships/item-relationships.component.ts
#	src/app/+item-page/item-page-administrator.guard.ts
#	src/app/app-routing.module.ts
#	src/app/community-list-page/community-list-service.ts
#	src/app/core/data/entity-type.service.ts
#	src/app/core/data/feature-authorization/feature-authorization-guard/dso-page-feature.guard.spec.ts
#	src/app/core/data/feature-authorization/feature-authorization-guard/feature-authorization.guard.spec.ts
#	src/app/core/data/feature-authorization/feature-authorization-guard/feature-authorization.guard.ts
#	src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts
#	src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts
#	src/app/core/data/object-updates/object-updates.reducer.ts
#	src/app/core/shared/operators.ts
#	src/app/process-page/detail/process-detail.component.ts
#	src/app/shared/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts
#	src/app/shared/dso-selector/dso-selector/dso-selector.component.ts
#	src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts
#	src/app/shared/object-grid/grid-thumbnail/grid-thumbnail.component.ts
#	src/app/shared/shared.module.ts
#	yarn.lock
This commit is contained in:
Giuseppe Digilio
2020-12-04 11:36:48 +01:00
254 changed files with 4580 additions and 1029 deletions

View File

@@ -1,10 +1,10 @@
<div class="card">
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="['/collections/', dso.id]" class="card-img-top">
<ds-grid-thumbnail [thumbnail]="dso.logo">
<ds-grid-thumbnail [thumbnail]="(dso.logo | async)?.payload">
</ds-grid-thumbnail>
</a>
<span *ngIf="linkType == linkTypes.None" class="card-img-top">
<ds-grid-thumbnail [thumbnail]="dso.logo">
<ds-grid-thumbnail [thumbnail]="(dso.logo | async)?.payload">
</ds-grid-thumbnail>
</span>
<div class="card-body">

View File

@@ -19,6 +19,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
import { TruncatePipe } from '../../../utils/truncate.pipe';
import { CollectionSearchResultGridElementComponent } from './collection-search-result-grid-element.component';
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
import { LinkService } from '../../../../core/cache/builders/link.service';
let collectionSearchResultGridElementComponent: CollectionSearchResultGridElementComponent;
let fixture: ComponentFixture<CollectionSearchResultGridElementComponent>;
@@ -52,6 +53,9 @@ mockCollectionWithoutAbstract.indexableObject = Object.assign(new Collection(),
]
}
});
const linkService = jasmine.createSpyObj('linkService', {
resolveLink: mockCollectionWithAbstract
});
describe('CollectionSearchResultGridElementComponent', () => {
beforeEach(async(() => {
@@ -72,6 +76,7 @@ describe('CollectionSearchResultGridElementComponent', () => {
{ provide: DSOChangeAnalyzer, useValue: {} },
{ provide: DefaultChangeAnalyzer, useValue: {} },
{ provide: BitstreamFormatDataService, useValue: {} },
{ provide: LinkService, useValue: linkService}
],
schemas: [ NO_ERRORS_SCHEMA ]

View File

@@ -1,10 +1,14 @@
import { Component } from '@angular/core';
import { Component, Input } from '@angular/core';
import { SearchResultGridElementComponent } from '../search-result-grid-element.component';
import { Collection } from '../../../../core/shared/collection.model';
import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model';
import { ViewMode } from '../../../../core/shared/view-mode.model';
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
import { hasNoValue, hasValue } from '../../../empty.util';
import { followLink } from '../../../utils/follow-link-config.model';
import { LinkService } from '../../../../core/cache/builders/link.service';
import { TruncatableService } from '../../../truncatable/truncatable.service';
import { BitstreamDataService } from '../../../../core/data/bitstream-data.service';
@Component({
selector: 'ds-collection-search-result-grid-element',
@@ -15,4 +19,28 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
* Component representing a grid element for a collection search result
*/
@listableObjectComponent(CollectionSearchResult, ViewMode.GridElement)
export class CollectionSearchResultGridElementComponent extends SearchResultGridElementComponent<CollectionSearchResult, Collection> {}
export class CollectionSearchResultGridElementComponent extends SearchResultGridElementComponent< CollectionSearchResult, Collection > {
private _dso: Collection;
constructor(
private linkService: LinkService,
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService
) {
super(truncatableService, bitstreamDataService);
}
@Input() set dso(dso: Collection) {
this._dso = dso;
if (hasValue(this._dso) && hasNoValue(this._dso.logo)) {
this.linkService.resolveLink<Collection>(
this._dso,
followLink('logo')
);
}
}
get dso(): Collection {
return this._dso;
}
}

View File

@@ -1,10 +1,10 @@
<div class="card">
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="['/communities/', dso.id]" class="card-img-top">
<ds-grid-thumbnail [thumbnail]="dso.logo">
<ds-grid-thumbnail [thumbnail]="(dso.logo | async)?.payload">
</ds-grid-thumbnail>
</a>
<span *ngIf="linkType == linkTypes.None" class="card-img-top">
<ds-grid-thumbnail [thumbnail]="dso.logo">
<ds-grid-thumbnail [thumbnail]="(dso.logo | async)?.payload">
</ds-grid-thumbnail>
</span>
<div class="card-body">

View File

@@ -19,6 +19,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
import { TruncatePipe } from '../../../utils/truncate.pipe';
import { CommunitySearchResultGridElementComponent } from './community-search-result-grid-element.component';
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
import { LinkService } from '../../../../core/cache/builders/link.service';
let communitySearchResultGridElementComponent: CommunitySearchResultGridElementComponent;
let fixture: ComponentFixture<CommunitySearchResultGridElementComponent>;
@@ -52,6 +53,9 @@ mockCommunityWithoutAbstract.indexableObject = Object.assign(new Community(), {
]
}
});
const linkService = jasmine.createSpyObj('linkService', {
resolveLink: mockCommunityWithAbstract
});
describe('CommunitySearchResultGridElementComponent', () => {
beforeEach(async(() => {
@@ -72,6 +76,7 @@ describe('CommunitySearchResultGridElementComponent', () => {
{ provide: DSOChangeAnalyzer, useValue: {} },
{ provide: DefaultChangeAnalyzer, useValue: {} },
{ provide: BitstreamFormatDataService, useValue: {} },
{ provide: LinkService, useValue: linkService}
],
schemas: [ NO_ERRORS_SCHEMA ]

View File

@@ -1,18 +1,46 @@
import { Component } from '@angular/core';
import { Component, Input } from '@angular/core';
import { Community } from '../../../../core/shared/community.model';
import { SearchResultGridElementComponent } from '../search-result-grid-element.component';
import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model';
import { ViewMode } from '../../../../core/shared/view-mode.model';
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
import { LinkService } from '../../../../core/cache/builders/link.service';
import { TruncatableService } from '../../../truncatable/truncatable.service';
import { BitstreamDataService } from '../../../../core/data/bitstream-data.service';
import { hasNoValue, hasValue } from '../../../empty.util';
import { followLink } from '../../../utils/follow-link-config.model';
@Component({
selector: 'ds-community-search-result-grid-element',
styleUrls: ['../search-result-grid-element.component.scss', 'community-search-result-grid-element.component.scss'],
templateUrl: 'community-search-result-grid-element.component.html'
styleUrls: [
'../search-result-grid-element.component.scss',
'community-search-result-grid-element.component.scss',
],
templateUrl: 'community-search-result-grid-element.component.html',
})
/**
* Component representing a grid element for a community search result
*/
@listableObjectComponent(CommunitySearchResult, ViewMode.GridElement)
export class CommunitySearchResultGridElementComponent extends SearchResultGridElementComponent<CommunitySearchResult, Community> {
export class CommunitySearchResultGridElementComponent extends SearchResultGridElementComponent<CommunitySearchResult,Community> {
private _dso: Community;
constructor(
private linkService: LinkService,
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService
) {
super(truncatableService, bitstreamDataService);
}
@Input() set dso(dso: Community) {
this._dso = dso;
if (hasValue(this._dso) && hasNoValue(this._dso.logo)) {
this.linkService.resolveLink<Community>(this._dso, followLink('logo'));
}
}
get dso(): Community {
return this._dso;
}
}

View File

@@ -10,7 +10,7 @@
</a>
<span *ngIf="linkType == linkTypes.None" class="card-img-top full-width">
<div>
<ds-grid-thumbnail [thumbnail]="getThumbnail() | async">
<ds-grid-thumbnail [thumbnail]="getThumbnail() | async">
</ds-grid-thumbnail>
</div>
</span>

View File

@@ -6,10 +6,10 @@ import { BitstreamDataService } from '../../../core/data/bitstream-data.service'
import { Bitstream } from '../../../core/shared/bitstream.model';
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
import { Metadata } from '../../../core/shared/metadata.utils';
import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators';
import { hasValue } from '../../empty.util';
import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component';
import { TruncatableService } from '../../truncatable/truncatable.service';
import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators';
@Component({
selector: 'ds-search-result-grid-element',