Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
@if (attachment) {
<div class="d-flex flex-row flex-wrap flex-lg-nowrap card-container mt-1 mb-3 gap-3" data-test="attachment-info">

<div class="order-lg-1 thumbnail-wrapper">
<ds-thumbnail [thumbnail]="thumbnail$ | async"></ds-thumbnail>
</div>

<div class="order-lg-3 ml-auto">
<div class="d-flex flex-column align-items-end gap-3">
<div class="text-nowrap">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ i.custom-icon {
vertical-align: middle;
}

.thumbnail-wrapper {
min-width: 120px;
}

.word-break {
word-break: break-word;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
TranslateModule,
} from '@ngx-translate/core';
import { of } from 'rxjs';
import { ThemedThumbnailComponent } from 'src/app/thumbnail/themed-thumbnail.component';

import { environment } from '../../../environments/environment';
import { TruncatableComponent } from '../truncatable/truncatable.component';
Expand All @@ -34,7 +33,6 @@ describe('BitstreamAttachmentComponent', () => {
checkSumAlgorithm: 'MD5',
value: 'checksum',
},
thumbnail: createSuccessfulRemoteDataObject$(new Bitstream()),
},
);
const languageList = ['en;q=1', 'de;q=0.8'];
Expand Down Expand Up @@ -63,7 +61,7 @@ describe('BitstreamAttachmentComponent', () => {
],
schemas: [NO_ERRORS_SCHEMA],
})
.overrideComponent(BitstreamAttachmentComponent, { remove: { imports: [ThemedThumbnailComponent, TruncatableComponent, TruncatablePartComponent, FileDownloadButtonComponent] } }).compileComponents();
.overrideComponent(BitstreamAttachmentComponent, { remove: { imports: [TruncatableComponent, TruncatablePartComponent, FileDownloadButtonComponent] } }).compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,16 @@ import {
} from '@dspace/core/shared/bitstream.model';
import { BitstreamFormat } from '@dspace/core/shared/bitstream-format.model';
import { Item } from '@dspace/core/shared/item.model';
import { getFirstCompletedRemoteData } from '@dspace/core/shared/operators';
import {
TranslateModule,
TranslateService,
} from '@ngx-translate/core';
import {
BehaviorSubject,
map,
Observable,
take,
} from 'rxjs';

import { ThemedThumbnailComponent } from '../../thumbnail/themed-thumbnail.component';
import { TruncatableComponent } from '../truncatable/truncatable.component';
import { TruncatablePartComponent } from '../truncatable/truncatable-part/truncatable-part.component';
import { FileSizePipe } from '../utils/file-size-pipe';
Expand All @@ -55,7 +52,6 @@ import { FileDownloadButtonComponent } from './attachment-render/types/file-down
AsyncPipe,
FileDownloadButtonComponent,
FileSizePipe,
ThemedThumbnailComponent,
TitleCasePipe,
TranslateModule,
TruncatableComponent,
Expand Down Expand Up @@ -108,8 +104,6 @@ export class BitstreamAttachmentComponent implements OnInit {
*/
checksumInfo: ChecksumInfo;

thumbnail$: BehaviorSubject<RemoteData<Bitstream>> = new BehaviorSubject<RemoteData<Bitstream>>(null);

/**
* Configuration type enum
*/
Expand All @@ -126,11 +120,6 @@ export class BitstreamAttachmentComponent implements OnInit {
}

ngOnInit() {
this.attachment.thumbnail.pipe(
getFirstCompletedRemoteData(),
).subscribe((thumbnail: RemoteData<Bitstream>) => {
this.thumbnail$.next(thumbnail);
});
this.allAttachmentProviders = this.attachment?.allMetadataValues('bitstream.viewer.provider');
this.bitstreamFormat$ = this.getFormat(this.attachment);
this.bitstreamSize = this.getSize(this.attachment);
Expand Down
Loading