mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Themed MediaViewerComponent
This commit is contained in:
@@ -27,6 +27,7 @@ import { ResearchEntitiesModule } from '../entity-groups/research-entities/resea
|
||||
import { ThemedItemPageComponent } from './simple/themed-item-page.component';
|
||||
import { ThemedFullItemPageComponent } from './full/themed-full-item-page.component';
|
||||
import { MediaViewerComponent } from './media-viewer/media-viewer.component';
|
||||
import { ThemedMediaViewerComponent } from './media-viewer/themed-media-viewer.component';
|
||||
import { MediaViewerVideoComponent } from './media-viewer/media-viewer-video/media-viewer-video.component';
|
||||
import { MediaViewerImageComponent } from './media-viewer/media-viewer-image/media-viewer-image.component';
|
||||
import { NgxGalleryModule } from '@kolkov/ngx-gallery';
|
||||
@@ -35,7 +36,6 @@ import { VersionPageComponent } from './version-page/version-page/version-page.c
|
||||
import { VersionedItemComponent } from './simple/item-types/versioned-item/versioned-item.component';
|
||||
import { ThemedFileSectionComponent } from './simple/field-components/file-section/themed-file-section.component';
|
||||
|
||||
|
||||
const ENTRY_COMPONENTS = [
|
||||
// put only entry components that use custom decorator
|
||||
PublicationComponent,
|
||||
@@ -63,6 +63,7 @@ const DECLARATIONS = [
|
||||
UploadBitstreamComponent,
|
||||
AbstractIncrementalListComponent,
|
||||
MediaViewerComponent,
|
||||
ThemedMediaViewerComponent,
|
||||
MediaViewerVideoComponent,
|
||||
MediaViewerImageComponent,
|
||||
MiradorViewerComponent,
|
||||
|
@@ -135,7 +135,7 @@ describe('MediaViewerComponent', () => {
|
||||
|
||||
it('should display a default, thumbnail', () => {
|
||||
const defaultThumbnail = fixture.debugElement.query(
|
||||
By.css('ds-media-viewer-image')
|
||||
By.css('ds-themed-media-viewer-image')
|
||||
);
|
||||
expect(defaultThumbnail.nativeElement).toBeDefined();
|
||||
});
|
||||
|
@@ -13,9 +13,8 @@ import { hasValue } from '../../shared/empty.util';
|
||||
import { followLink } from '../../shared/utils/follow-link-config.model';
|
||||
|
||||
/**
|
||||
* This componenet renders the media viewers
|
||||
* This component renders the media viewers
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'ds-media-viewer',
|
||||
templateUrl: './media-viewer.component.html',
|
||||
|
@@ -0,0 +1,36 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { ThemedComponent } from '../../shared/theme-support/themed.component';
|
||||
import { MediaViewerComponent } from './media-viewer.component';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
|
||||
/**
|
||||
* Themed wrapper for {@link MediaViewerComponent}.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-themed-media-viewer',
|
||||
styleUrls: [],
|
||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||
})
|
||||
export class ThemedMediaViewerComponent extends ThemedComponent<MediaViewerComponent> {
|
||||
|
||||
@Input() item: Item;
|
||||
@Input() videoOptions: boolean;
|
||||
|
||||
protected inAndOutputNames: (keyof MediaViewerComponent & keyof this)[] = [
|
||||
'item',
|
||||
'videoOptions',
|
||||
];
|
||||
|
||||
protected getComponentName(): string {
|
||||
return 'MediaViewerComponent';
|
||||
}
|
||||
|
||||
protected importThemedComponent(themeName: string): Promise<any> {
|
||||
return import(`../../../themes/${themeName}/app/item-page/media-viewer/media-viewer.component`);
|
||||
}
|
||||
|
||||
protected importUnthemedComponent(): Promise<any> {
|
||||
return import('./media-viewer.component');
|
||||
}
|
||||
|
||||
}
|
@@ -23,7 +23,7 @@
|
||||
</ds-metadata-field-wrapper>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="mediaViewer.image">
|
||||
<ds-media-viewer [item]="object" [videoOptions]="mediaViewer.video"></ds-media-viewer>
|
||||
<ds-themed-media-viewer [item]="object" [videoOptions]="mediaViewer.video"></ds-themed-media-viewer>
|
||||
</ng-container>
|
||||
<ds-themed-item-page-file-section [item]="object"></ds-themed-item-page-file-section>
|
||||
<ds-item-page-date-field [item]="object"></ds-item-page-date-field>
|
||||
|
@@ -26,7 +26,7 @@
|
||||
</ds-metadata-field-wrapper>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="mediaViewer.image">
|
||||
<ds-media-viewer [item]="object" [videoOptions]="mediaViewer.video"></ds-media-viewer>
|
||||
<ds-themed-media-viewer [item]="object" [videoOptions]="mediaViewer.video"></ds-themed-media-viewer>
|
||||
</ng-container>
|
||||
<ds-themed-item-page-file-section [item]="object"></ds-themed-item-page-file-section>
|
||||
<ds-item-page-date-field [item]="object"></ds-item-page-date-field>
|
||||
|
@@ -0,0 +1 @@
|
||||
|
@@ -0,0 +1,14 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
MediaViewerComponent as BaseComponent
|
||||
} from '../../../../../app/item-page/media-viewer/media-viewer.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-media-viewer',
|
||||
// templateUrl: './media-viewer.component.html',
|
||||
templateUrl: '../../../../../app/item-page/media-viewer/media-viewer.component.html',
|
||||
// styleUrls: ['./media-viewer.component.scss'],
|
||||
styleUrls: ['../../../../../app/item-page/media-viewer/media-viewer.component.scss'],
|
||||
})
|
||||
export class MediaViewerComponent extends BaseComponent {
|
||||
}
|
@@ -84,6 +84,8 @@ import { SearchModule } from '../../app/shared/search/search.module';
|
||||
import { ResourcePoliciesModule } from '../../app/shared/resource-policies/resource-policies.module';
|
||||
import { ComcolModule } from '../../app/shared/comcol/comcol.module';
|
||||
import { FeedbackComponent } from './app/info/feedback/feedback.component';
|
||||
import { MediaViewerComponent } from './app/item-page/media-viewer/media-viewer.component';
|
||||
import { NgxGalleryModule } from '@kolkov/ngx-gallery';
|
||||
|
||||
const DECLARATIONS = [
|
||||
FileSectionComponent,
|
||||
@@ -126,7 +128,8 @@ const DECLARATIONS = [
|
||||
NavbarComponent,
|
||||
HeaderNavbarWrapperComponent,
|
||||
BreadcrumbsComponent,
|
||||
FeedbackComponent
|
||||
FeedbackComponent,
|
||||
MediaViewerComponent,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
@@ -176,7 +179,8 @@ const DECLARATIONS = [
|
||||
SearchModule,
|
||||
FormsModule,
|
||||
ResourcePoliciesModule,
|
||||
ComcolModule
|
||||
ComcolModule,
|
||||
NgxGalleryModule,
|
||||
],
|
||||
declarations: DECLARATIONS
|
||||
})
|
||||
|
Reference in New Issue
Block a user