Skip to content

Commit d4c7fd2

Browse files
jr-rkclaude
andcommitted
feat: show file checksum instead of format in full item view
Replace the per-file "Format" line in the full item view file listing with a "File checksum" line (algorithm + value). Add the checkSum field to the Bitstream model so the REST value deserializes, and add the item.page.filesection.checksum i18n key. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 50e0d31 commit d4c7fd2

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/app/core/shared/bitstream.model.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ export class Bitstream extends DSpaceObject implements ChildHALResource {
3232
@autoserialize
3333
sizeBytes: number;
3434

35+
/**
36+
* The checksum of this Bitstream, including the algorithm used to calculate it
37+
*/
38+
@autoserialize
39+
checkSum: {
40+
checkSumAlgorithm: string;
41+
value: string;
42+
};
43+
3544
/**
3645
* The description of this Bitstream
3746
*/

src/app/item-page/full/field-components/file-section/full-file-section.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ <h3 class="h5 simple-view-element-header">{{"item.page.filesection.original.bund
2323
<dd class="col-md-8">{{(file.sizeBytes) | dsFileSize }}</dd>
2424

2525

26-
<dt class="col-md-4">{{"item.page.filesection.format" | translate}}</dt>
27-
<dd class="col-md-8">{{(file.format | async)?.payload?.description}}</dd>
26+
<dt class="col-md-4">{{"item.page.filesection.checksum" | translate}}</dt>
27+
<dd class="col-md-8">{{ file?.checkSum?.checkSumAlgorithm }}: {{ file?.checkSum?.value }}</dd>
2828

2929
<ng-container *ngIf="file.hasMetadata('dc.description')">
3030
<dt class="col-md-4">{{"item.page.filesection.description" | translate}}</dt>
@@ -64,8 +64,8 @@ <h3 class="h5 simple-view-element-header">{{"item.page.filesection.license.bundl
6464
<dt class="col-md-4">{{"item.page.filesection.size" | translate}}</dt>
6565
<dd class="col-md-8">{{(file.sizeBytes) | dsFileSize }}</dd>
6666

67-
<dt class="col-md-4">{{"item.page.filesection.format" | translate}}</dt>
68-
<dd class="col-md-8">{{(file.format | async)?.payload?.description}}</dd>
67+
<dt class="col-md-4">{{"item.page.filesection.checksum" | translate}}</dt>
68+
<dd class="col-md-8">{{ file?.checkSum?.checkSumAlgorithm }}: {{ file?.checkSum?.value }}</dd>
6969

7070

7171
<dt class="col-md-4">{{"item.page.filesection.description" | translate}}</dt>

src/assets/i18n/en.json5

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2806,6 +2806,8 @@
28062806

28072807
"item.page.files": "Files",
28082808

2809+
"item.page.filesection.checksum": "File checksum:",
2810+
28092811
"item.page.filesection.description": "Description:",
28102812

28112813
"item.page.filesection.download": "Download",

0 commit comments

Comments
 (0)