Skip to content

Commit

Permalink
Merge pull request #3720 from alexandrevryghem/w2p-117573_remove-obse…
Browse files Browse the repository at this point in the history
…rvable-function-calls-from-template_contribute-main

Embed the community/collection on the edit EPerson page
  • Loading branch information
tdonohue authored Dec 17, 2024
2 parents 5a71902 + 11626e2 commit c1aabf6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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') : '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
import {
Component,
Input,
OnChanges,
SimpleChanges,
} from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { Observable } from 'rxjs';
Expand All @@ -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';
Expand All @@ -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
*/
Expand Down Expand Up @@ -80,6 +83,12 @@ export class ItemDetailPreviewComponent {
) {
}

ngOnChanges(changes: SimpleChanges): void {
if (hasValue(changes.item)) {
this.bitstreams$ = this.getFiles();
}
}

/**
* Perform bitstream download
*/
Expand Down

0 comments on commit c1aabf6

Please sign in to comment.