Skip to content

Commit

Permalink
Merge pull request DSpace#2421 from hugo-escire/issue/2105
Browse files Browse the repository at this point in the history
🚸remove thumbnail from file-upload section and show bitstream format …
  • Loading branch information
tdonohue authored Sep 8, 2023
2 parents 45b0f16 + 01c8a4d commit f7ce1a5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ export class WorkspaceitemSectionUploadFileObject {
value: string;
};

/**
* The file format information
*/
format: {
shortDescription: string,
description: string,
mimetype: string,
supportLevel: string,
internal: boolean,
type: string
};

/**
* The file url
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<ng-container *ngIf="fileData">
<div class="row">
<div class="col-md-2">
<!--ds-themed-thumbnail [thumbnail]="bitstreamsList[bitstreamKey].url | async"></ds-themed-thumbnail-->
<ds-themed-thumbnail [thumbnail]="fileData?.thumbnail"></ds-themed-thumbnail>
</div>
<div class="col-md-10">
<div class="col-md-12">
<div class="float-left w-75">
<h3>{{fileName}} <span class="text-muted">({{fileData?.sizeBytes | dsFileSize}})</span></h3>
</div>
<div class="float-right w-15">
<ng-container>
<ds-themed-file-download-link [cssClasses]="'btn btn-link-focus'" [isBlank]="true" [bitstream]="getBitstream()" [enableRequestACopy]="false">
<ds-themed-file-download-link [cssClasses]="'btn btn-link-focus'" [isBlank]="true"
[bitstream]="getBitstream()" [enableRequestACopy]="false">
<i class="fa fa-download fa-2x text-normal" aria-hidden="true"></i>
</ds-themed-file-download-link>
<button class="btn btn-link-focus"
Expand Down Expand Up @@ -46,7 +43,9 @@ <h4 class="modal-title text-danger">{{ 'submission.sections.upload.delete.confir
<p>{{ 'submission.sections.upload.delete.confirm.info' | translate }}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" (click)="c('cancel')">{{ 'submission.sections.upload.delete.confirm.cancel' | translate }}</button>
<button type="button" class="btn btn-danger" (click)="c('ok')">{{ 'submission.sections.upload.delete.confirm.submit' | translate }}</button>
<button type="button" class="btn btn-secondary"
(click)="c('cancel')">{{ 'submission.sections.upload.delete.confirm.cancel' | translate }}</button>
<button type="button" class="btn btn-danger"
(click)="c('ok')">{{ 'submission.sections.upload.delete.confirm.submit' | translate }}</button>
</div>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@ <h5 *ngIf="metadata[fileTitleKey].indexOf(entry) === 0">
</ng-container>
<ng-container *ngFor="let entry of getAllMetadataValue(fileDescrKey)">
<ng-container *ngIf="entry.value !== ''">
{{entry.value | dsTruncate:['150']}}
{{entry.value | dsTruncate:['150']}}
</ng-container>
<ng-container *ngIf="entry.value === ''">
<span *ngIf="metadata[fileDescrKey].indexOf(entry) === 0" class="text-muted">{{'submission.sections.upload.no-entry' | translate}} {{fileDescrKey}}</span>
<span *ngIf="metadata[fileDescrKey].indexOf(entry) === 0"
class="text-muted">{{'submission.sections.upload.no-entry' | translate}} {{fileDescrKey}}</span>
</ng-container>
<span class="clearfix"></span>
</ng-container>
</ng-container>


<div class="mt-1" *ngIf="fileFormat">
{{'admin.registries.bitstream-formats.edit.head' | translate:{format: fileFormat} }}
</div>
<div class="mt-1" *ngIf="fileCheckSum">
Checksum {{fileCheckSum.checkSumAlgorithm}}: {{fileCheckSum.value}}
</div>
<span class="clearfix"></span>
<ds-submission-section-upload-access-conditions [accessConditions]="fileData.accessConditions"></ds-submission-section-upload-access-conditions>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ export class SubmissionSectionUploadFileViewComponent implements OnInit {
*/
public fileDescrKey = 'Description';

public fileFormat!: string;

public fileCheckSum!: {
checkSumAlgorithm: string;
value: string;
};

/**
* Initialize instance variables
*/
Expand All @@ -46,6 +53,8 @@ export class SubmissionSectionUploadFileViewComponent implements OnInit {
this.metadata[this.fileTitleKey] = Metadata.all(this.fileData.metadata, 'dc.title');
this.metadata[this.fileDescrKey] = Metadata.all(this.fileData.metadata, 'dc.description');
}
this.fileCheckSum = this.fileData.checkSum;
this.fileFormat = this.fileData.format.shortDescription;
}

/**
Expand Down

0 comments on commit f7ce1a5

Please sign in to comment.