Merge branch 'w2p-117573_remove-observable-function-calls-from-template-7.6'

# Conflicts:
#	src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts
#	src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts
This commit is contained in:
Alexandre Vryghem
2024-12-06 18:31:00 +01:00
3 changed files with 12 additions and 3 deletions

View File

@@ -343,7 +343,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
this.groups$ = this.groupsDataService.findListByHref(eperson._links.groups.href, {
currentPage: 1,
elementsPerPage: this.config.pageSize,
});
}, undefined, undefined, followLink('object'));
}
this.formGroup.patchValue({
firstName: eperson != null ? eperson.firstMetadataValue('eperson.firstname') : '',

View File

@@ -8,7 +8,7 @@
<ds-metadata-field-wrapper [hideIfNoTextContent]="false">
<ds-thumbnail [thumbnail]="item?.thumbnail | async"></ds-thumbnail>
</ds-metadata-field-wrapper>
<ng-container *ngVar="(getFiles() | async) as bitstreams">
<ng-container *ngIf="(bitstreams$ | async) as bitstreams">
<ds-metadata-field-wrapper [label]="('item.page.files' | translate)">
<div *ngIf="bitstreams?.length > 0" class="file-section">
<button class="btn btn-link" *ngFor="let file of bitstreams; let last=last;" (click)="downloadBitstreamFile(file?.uuid)">

View File

@@ -6,6 +6,8 @@ import {
import {
Component,
Input,
OnChanges,
SimpleChanges,
} from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { Observable } from 'rxjs';
@@ -22,6 +24,7 @@ import { getFirstSucceededRemoteListPayload } from '../../../../core/shared/oper
import { ThemedItemPageTitleFieldComponent } from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component';
import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component';
import { fadeInOut } from '../../../animations/fade';
import { hasValue } from '../../../empty.util';
import { MetadataFieldWrapperComponent } from '../../../metadata-field-wrapper/metadata-field-wrapper.component';
import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component';
import { ItemSubmitterComponent } from '../../../object-collection/shared/mydspace-item-submitter/item-submitter.component';
@@ -41,7 +44,7 @@ import { ThemedItemDetailPreviewFieldComponent } from './item-detail-preview-fie
standalone: true,
imports: [NgIf, ThemedBadgesComponent, ThemedItemPageTitleFieldComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, VarDirective, NgFor, ThemedItemDetailPreviewFieldComponent, ItemSubmitterComponent, AsyncPipe, FileSizePipe, TranslateModule],
})
export class ItemDetailPreviewComponent {
export class ItemDetailPreviewComponent implements OnChanges {
/**
* The item to display
*/
@@ -80,6 +83,12 @@ export class ItemDetailPreviewComponent {
) {
}
ngOnChanges(changes: SimpleChanges): void {
if (hasValue(changes.item)) {
this.bitstreams$ = this.getFiles();
}
}
/**
* Perform bitstream download
*/