mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 20:43:08 +00:00
Merge remote-tracking branch 'remotes/origin/main' into upgrade_angular10
# Conflicts: # src/app/+item-page/item-page.module.ts # src/app/core/shared/item.model.ts # src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts # src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts # src/app/shared/shared.module.ts
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<ds-item-search-result-grid-element [showLabel]="showLabel" [object]="{ indexableObject: object, hitHighlights: {} }" [linkType]="linkType">
|
||||
<ng-content></ng-content>
|
||||
<ng-content></ng-content>
|
||||
</ds-item-search-result-grid-element>
|
@@ -4,7 +4,7 @@ import { TruncatePipe } from '../../../../utils/truncate.pipe';
|
||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { PublicationGridElementComponent } from './publication-grid-element.component';
|
||||
import { ItemGridElementComponent } from './item-grid-element.component';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { Item } from '../../../../../core/shared/item.model';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils';
|
||||
@@ -41,7 +41,7 @@ const mockItem = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('PublicationGridElementComponent', () => {
|
||||
describe('ItemGridElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
@@ -52,18 +52,18 @@ describe('PublicationGridElementComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [PublicationGridElementComponent, TruncatePipe],
|
||||
declarations: [ItemGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PublicationGridElementComponent, {
|
||||
}).overrideComponent(ItemGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PublicationGridElementComponent);
|
||||
fixture = TestBed.createComponent(ItemGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('PublicationGridElementComponent', () => {
|
||||
});
|
||||
|
||||
it(`should contain a PublicationGridElementComponent`, () => {
|
||||
const publicationGridElement = fixture.debugElement.query(By.css(`ds-publication-search-result-grid-element`));
|
||||
const publicationGridElement = fixture.debugElement.query(By.css(`ds-item-search-result-grid-element`));
|
||||
expect(publicationGridElement).not.toBeNull();
|
||||
});
|
||||
});
|
@@ -8,13 +8,13 @@ import { Item } from '../../../../../core/shared/item.model';
|
||||
@listableObjectComponent('Publication', ViewMode.GridElement)
|
||||
@listableObjectComponent(Item, ViewMode.GridElement)
|
||||
@Component({
|
||||
selector: 'ds-publication-grid-element',
|
||||
styleUrls: ['./publication-grid-element.component.scss'],
|
||||
templateUrl: './publication-grid-element.component.html',
|
||||
selector: 'ds-item-grid-element',
|
||||
styleUrls: ['./item-grid-element.component.scss'],
|
||||
templateUrl: './item-grid-element.component.html',
|
||||
animations: [focusShadow]
|
||||
})
|
||||
/**
|
||||
* The component for displaying a grid element for an item of the type Publication
|
||||
*/
|
||||
export class PublicationGridElementComponent extends AbstractListableElementComponent<Item> {
|
||||
export class ItemGridElementComponent extends AbstractListableElementComponent<Item> {
|
||||
}
|
@@ -1,4 +0,0 @@
|
||||
<ds-publication-search-result-grid-element [showLabel]="showLabel" [object]="{ indexableObject: object, hitHighlights: {} }" [linkType]="linkType">
|
||||
<ng-content></ng-content>
|
||||
<ng-content></ng-content>
|
||||
</ds-publication-search-result-grid-element>
|
@@ -8,6 +8,7 @@
|
||||
</ds-grid-thumbnail>
|
||||
</span>
|
||||
<div class="card-body">
|
||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
||||
<h4 class="card-title">{{dso.name}}</h4>
|
||||
<p *ngIf="dso.shortDescription" class="card-text">{{dso.shortDescription}}</p>
|
||||
<div *ngIf="linkType != linkTypes.None" class="text-center">
|
||||
|
@@ -8,6 +8,7 @@
|
||||
</ds-grid-thumbnail>
|
||||
</span>
|
||||
<div class="card-body">
|
||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
||||
<h4 class="card-title">{{dso.name}}</h4>
|
||||
<p *ngIf="dso.shortDescription" class="card-text">{{dso.shortDescription}}</p>
|
||||
<div *ngIf="linkType != linkTypes.None" class="text-center">
|
||||
|
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
</span>
|
||||
<div class="card-body">
|
||||
<ds-item-type-badge *ngIf="showLabel" [object]="dso"></ds-item-type-badge>
|
||||
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
|
||||
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
|
||||
<h4 class="card-title" [innerHTML]="firstMetadataValue('dc.title')"></h4>
|
||||
</ds-truncatable-part>
|
@@ -23,7 +23,7 @@ import { ItemSearchResult } from '../../../../object-collection/shared/item-sear
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils';
|
||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||
import { TruncatePipe } from '../../../../utils/truncate.pipe';
|
||||
import { PublicationSearchResultGridElementComponent } from './publication-search-result-grid-element.component';
|
||||
import { ItemSearchResultGridElementComponent } from './item-search-result-grid-element.component';
|
||||
|
||||
const mockItemWithMetadata: ItemSearchResult = new ItemSearchResult();
|
||||
mockItemWithMetadata.hitHighlights = {};
|
||||
@@ -71,7 +71,7 @@ mockItemWithoutMetadata.indexableObject = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('PublicationGridElementComponent', getEntityGridElementTestComponent(PublicationSearchResultGridElementComponent, mockItemWithMetadata, mockItemWithoutMetadata, ['authors', 'date', 'abstract']));
|
||||
describe('ItemGridElementComponent', getEntityGridElementTestComponent(ItemSearchResultGridElementComponent, mockItemWithMetadata, mockItemWithoutMetadata, ['authors', 'date', 'abstract']));
|
||||
|
||||
/**
|
||||
* Create test cases for a grid component of an entity.
|
@@ -9,13 +9,13 @@ import { ItemSearchResult } from '../../../../object-collection/shared/item-sear
|
||||
@listableObjectComponent('PublicationSearchResult', ViewMode.GridElement)
|
||||
@listableObjectComponent(ItemSearchResult, ViewMode.GridElement)
|
||||
@Component({
|
||||
selector: 'ds-publication-search-result-grid-element',
|
||||
styleUrls: ['./publication-search-result-grid-element.component.scss'],
|
||||
templateUrl: './publication-search-result-grid-element.component.html',
|
||||
selector: 'ds-item-search-result-grid-element',
|
||||
styleUrls: ['./item-search-result-grid-element.component.scss'],
|
||||
templateUrl: './item-search-result-grid-element.component.html',
|
||||
animations: [focusShadow]
|
||||
})
|
||||
/**
|
||||
* The component for displaying a grid element for an item search result of the type Publication
|
||||
*/
|
||||
export class PublicationSearchResultGridElementComponent extends SearchResultGridElementComponent<ItemSearchResult, Item> {
|
||||
export class ItemSearchResultGridElementComponent extends SearchResultGridElementComponent<ItemSearchResult, Item> {
|
||||
}
|
Reference in New Issue
Block a user