Merge branch 'main' into feature/CST-9636

# Conflicts:
#	src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts
This commit is contained in:
Enea Jahollari
2023-05-23 15:51:46 +02:00
359 changed files with 5845 additions and 4991 deletions

View File

@@ -1,14 +1,14 @@
<div class="card">
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="['/collections/', object.id]" class="card-img-top" [attr.title]="'search.results.view-result' | translate">
<ds-thumbnail [thumbnail]="(object.logo | async)?.payload" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="(object.logo | async)?.payload" [limitWidth]="false">
</ds-themed-thumbnail>
</a>
<span *ngIf="linkType == linkTypes.None" class="card-img-top">
<ds-thumbnail [thumbnail]="(object.logo | async)?.payload" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="(object.logo | async)?.payload" [limitWidth]="false">
</ds-themed-thumbnail>
</span>
<div class="card-body">
<h4 class="card-title">{{object.name}}</h4>
<h4 class="card-title">{{ dsoNameService.getName(object) }}</h4>
<p *ngIf="object.shortDescription" class="card-text">{{object.shortDescription}}</p>
<div *ngIf="linkType != linkTypes.None" class="text-center">
<a [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="['/collections/', object.id]" class="lead btn btn-primary viewButton">{{ 'search.results.view-result' | translate}}</a>

View File

@@ -6,6 +6,7 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
import { hasNoValue, hasValue } from '../../empty.util';
import { followLink } from '../../utils/follow-link-config.model';
import { LinkService } from '../../../core/cache/builders/link.service';
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
/**
* Component representing a grid element for collection
@@ -21,8 +22,11 @@ export class CollectionGridElementComponent extends AbstractListableElementCompo
> {
private _object: Collection;
constructor(private linkService: LinkService) {
super();
constructor(
public dsoNameService: DSONameService,
private linkService: LinkService,
) {
super(dsoNameService);
}
// @ts-ignore

View File

@@ -1,14 +1,14 @@
<div class="card">
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="['/communities/', object.id]" class="card-img-top" [attr.title]="'search.results.view-result' | translate">
<ds-thumbnail [thumbnail]="(object.logo | async)?.payload" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="(object.logo | async)?.payload" [limitWidth]="false">
</ds-themed-thumbnail>
</a>
<span *ngIf="linkType == linkTypes.None" class="card-img-top">
<ds-thumbnail [thumbnail]="(object.logo | async)?.payload" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="(object.logo | async)?.payload" [limitWidth]="false">
</ds-themed-thumbnail>
</span>
<div class="card-body">
<h4 class="card-title">{{object.name}}</h4>
<h4 class="card-title">{{ dsoNameService.getName(object) }}</h4>
<p *ngIf="object.shortDescription" class="card-text">{{object.shortDescription}}</p>
<div *ngIf="linkType != linkTypes.None" class="text-center">
<a [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="['/communities/', object.id]" class="lead btn btn-primary viewButton">{{ 'search.results.view-result' | translate}}</a>

View File

@@ -6,6 +6,7 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
import { followLink } from '../../utils/follow-link-config.model';
import { LinkService } from '../../../core/cache/builders/link.service';
import { hasNoValue, hasValue } from '../../empty.util';
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
/**
* Component representing a grid element for a community
@@ -20,8 +21,11 @@ import { hasNoValue, hasValue } from '../../empty.util';
export class CommunityGridElementComponent extends AbstractListableElementComponent<Community> {
private _object: Community;
constructor( private linkService: LinkService) {
super();
constructor(
public dsoNameService: DSONameService,
private linkService: LinkService,
) {
super(dsoNameService);
}
// @ts-ignore

View File

@@ -10,6 +10,8 @@ import { Item } from '../../../../../core/shared/item.model';
import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils';
import { buildPaginatedList } from '../../../../../core/data/paginated-list.model';
import { PageInfo } from '../../../../../core/shared/page-info.model';
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock';
const mockItem = Object.assign(new Item(), {
bundles: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])),
@@ -54,6 +56,7 @@ describe('ItemGridElementComponent', () => {
imports: [NoopAnimationsModule],
declarations: [ItemGridElementComponent, TruncatePipe],
providers: [
{ provide: DSONameService, useValue: new DSONameServiceMock() },
{ provide: TruncatableService, useValue: truncatableServiceStub },
],
schemas: [NO_ERRORS_SCHEMA]

View File

@@ -1,15 +1,15 @@
<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" [attr.title]="'search.results.view-result' | translate">
<ds-thumbnail [thumbnail]="(dso.logo | async)?.payload" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="(dso.logo | async)?.payload" [limitWidth]="false">
</ds-themed-thumbnail>
</a>
<span *ngIf="linkType == linkTypes.None" class="card-img-top">
<ds-thumbnail [thumbnail]="(dso.logo | async)?.payload" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="(dso.logo | async)?.payload" [limitWidth]="false">
</ds-themed-thumbnail>
</span>
<div class="card-body">
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
<h4 class="card-title">{{dso.name}}</h4>
<h4 class="card-title">{{ dsoNameService.getName(dso) }}</h4>
<p *ngIf="dso.shortDescription" class="card-text">{{dso.shortDescription}}</p>
<div *ngIf="linkType != linkTypes.None" class="text-center">
<a [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="['/collections/', dso.id]" class="lead btn btn-primary viewButton">{{ 'search.results.view-result' | translate}}</a>

View File

@@ -9,6 +9,7 @@ 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';
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
@Component({
selector: 'ds-collection-search-result-grid-element',
@@ -23,11 +24,12 @@ export class CollectionSearchResultGridElementComponent extends SearchResultGrid
private _dso: Collection;
constructor(
public dsoNameService: DSONameService,
private linkService: LinkService,
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService
) {
super(truncatableService, bitstreamDataService);
super(dsoNameService, truncatableService, bitstreamDataService);
}
// @ts-ignore

View File

@@ -1,15 +1,15 @@
<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" [attr.title]="'search.results.view-result' | translate">
<ds-thumbnail [thumbnail]="(dso.logo | async)?.payload" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="(dso.logo | async)?.payload" [limitWidth]="false">
</ds-themed-thumbnail>
</a>
<span *ngIf="linkType == linkTypes.None" class="card-img-top">
<ds-thumbnail [thumbnail]="(dso.logo | async)?.payload" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="(dso.logo | async)?.payload" [limitWidth]="false">
</ds-themed-thumbnail>
</span>
<div class="card-body">
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
<h4 class="card-title">{{dso.name}}</h4>
<h4 class="card-title">{{ dsoNameService.getName(dso) }}</h4>
<p *ngIf="dso.shortDescription" class="card-text">{{dso.shortDescription}}</p>
<div *ngIf="linkType != linkTypes.None" class="text-center">
<a [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="['/communities/', dso.id]" class="lead btn btn-primary viewButton">{{ 'search.results.view-result' | translate}}</a>

View File

@@ -9,6 +9,7 @@ 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';
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
@Component({
selector: 'ds-community-search-result-grid-element',
@@ -26,11 +27,12 @@ export class CommunitySearchResultGridElementComponent extends SearchResultGridE
private _dso: Community;
constructor(
public dsoNameService: DSONameService,
private linkService: LinkService,
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService
) {
super(truncatableService, bitstreamDataService);
super(dsoNameService, truncatableService, bitstreamDataService);
}
// @ts-ignore

View File

@@ -5,14 +5,14 @@
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="[itemPageRoute]"
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate">
<div>
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
</ds-themed-thumbnail>
</div>
</a>
<span *ngIf="linkType == linkTypes.None" class="card-img-top full-width">
<div>
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
</ds-thumbnail>
<ds-themed-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
</ds-themed-thumbnail>
</div>
</span>
<div class="card-body">

View File

@@ -32,11 +32,11 @@ export class ItemSearchResultGridElementComponent extends SearchResultGridElemen
dsoTitle: string;
constructor(
public dsoNameService: DSONameService,
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService,
private dsoNameService: DSONameService,
) {
super(truncatableService, bitstreamDataService);
super(dsoNameService, truncatableService, bitstreamDataService);
}
ngOnInit(): void {

View File

@@ -8,6 +8,7 @@ import { Metadata } from '../../../core/shared/metadata.utils';
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 { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
@Component({
selector: 'ds-search-result-grid-element',
@@ -25,10 +26,11 @@ export class SearchResultGridElementComponent<T extends SearchResult<K>, K exten
isCollapsed$: Observable<boolean>;
public constructor(
public dsoNameService: DSONameService,
protected truncatableService: TruncatableService,
protected bitstreamDataService: BitstreamDataService
) {
super();
super(dsoNameService);
}
/**