From 49e0f69c67582ffe4ec6d53077bdbf898ea32ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Chaco=CC=81n?= Date: Tue, 18 Feb 2025 00:21:00 -0600 Subject: [PATCH 1/6] added alternative content tag and controls on bitstreams --- .../edit-bitstream-page.component.ts | 29 +++++++++++++++++-- .../file-section/file-section.component.html | 3 +- src/app/shared/mocks/submission.mock.ts | 1 + ...section-upload-file-edit.component.spec.ts | 13 +++++++-- .../section-upload-file-edit.component.ts | 21 ++++++++++++++ .../edit/section-upload-file-edit.model.ts | 13 +++++++++ .../file/section-upload-file.component.ts | 7 +++++ .../themed-section-upload-file.component.ts | 7 +++++ .../upload/section-upload.component.html | 1 + src/assets/i18n/en.json5 | 4 +++ src/assets/i18n/es.json5 | 6 ++++ 11 files changed, 100 insertions(+), 5 deletions(-) diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index 9f1a84c19dc..1d53d68044f 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -198,6 +198,15 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { }, ); + /** + * The Dynamic Switch Model for set as alternative content + */ + alternativeContentModel = new DynamicCustomSwitchModel({ + id: 'alternativeContent', + name: 'alternativeContent', + }, + ); + /** * The Dynamic TextArea Model for the file's description */ @@ -316,7 +325,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { /** * All input models in a simple array for easier iterations */ - inputModels = [this.primaryBitstreamModel, this.fileNameModel, this.descriptionModel, this.selectedFormatModel, + inputModels = [this.primaryBitstreamModel, this.alternativeContentModel, this.fileNameModel, this.descriptionModel, this.selectedFormatModel, this.newFormatModel]; /** @@ -328,6 +337,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { id: 'fileNamePrimaryContainer', group: [ this.primaryBitstreamModel, + this.alternativeContentModel, this.fileNameModel, ], }, { @@ -372,6 +382,14 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { container: 'text-right', }, }, + alternativeContent: { + grid: { + container: 'col-12 mt-2', + }, + element: { + container: 'text-right', + }, + }, description: { grid: { host: 'col-12 d-inline-block', @@ -548,6 +566,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { fileNamePrimaryContainer: { fileName: bitstream.name, primaryBitstream: this.primaryBitstreamUUID === bitstream.uuid, + alternativeContent: bitstream.firstMetadataValue('dc.type') === "alternative content" }, descriptionContainer: { description: bitstream.firstMetadataValue('dc.description'), @@ -614,7 +633,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { */ private updateFieldTranslation(fieldModel) { fieldModel.label = this.translate.instant(this.KEY_PREFIX + fieldModel.id + this.LABEL_KEY_SUFFIX); - if (fieldModel.id !== this.primaryBitstreamModel.id) { + if (fieldModel.id !== this.primaryBitstreamModel.id && fieldModel.id !== this.alternativeContentModel.id) { fieldModel.hint = this.translate.instant(this.KEY_PREFIX + fieldModel.id + this.HINT_KEY_SUFFIX); } } @@ -640,6 +659,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { const isNewFormat = this.selectedFormat.id !== this.originalFormat.id; const isPrimary = updatedValues.fileNamePrimaryContainer.primaryBitstream; const wasPrimary = this.primaryBitstreamUUID === this.bitstream.uuid; + const isAlternativeContent = updatedValues.fileNamePrimaryContainer.alternativeContent; let bitstream$; let bundle$: Observable; @@ -705,6 +725,11 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { } else { bitstream$ = observableOf(this.bitstream); } + if (isAlternativeContent) { + updatedBitstream.setMetadata('dc.type', undefined, ...['alternative content']); + } else { + updatedBitstream.removeMetadata('dc.type'); + } combineLatest([bundle$, bitstream$]).pipe( tap(([bundle]) => this.bundle = bundle), diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.html b/src/app/item-page/simple/field-components/file-section/file-section.component.html index 44c83b86267..931fe7536cd 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.html +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.html @@ -3,7 +3,8 @@
- {{ 'item.page.bitstreams.primary' | translate }} + {{ 'item.page.bitstreams.primary' | translate }} + {{ 'item.page.bitstreams.alternativeContent' | translate }} {{ dsoNameService.getName(file) }} ({{(file?.sizeBytes) | dsFileSize }}) diff --git a/src/app/shared/mocks/submission.mock.ts b/src/app/shared/mocks/submission.mock.ts index df31dc96f32..d7284b290f7 100644 --- a/src/app/shared/mocks/submission.mock.ts +++ b/src/app/shared/mocks/submission.mock.ts @@ -1622,6 +1622,7 @@ export const mockUploadFilesData = { export const mockFileFormData = { primary: [true], + alternativeContent: [true], metadata: { 'dc.title': [ { diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts index 015ccd4ae41..288d8e77bfb 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts @@ -232,7 +232,7 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => { comp.formModel = compAsAny.buildFileEditForm(); - const models = [DynamicCustomSwitchModel, DynamicFormGroupModel, DynamicFormArrayModel]; + const models = [DynamicCustomSwitchModel, DynamicCustomSwitchModel, DynamicFormGroupModel, DynamicFormArrayModel]; expect(comp.formModel).toBeDefined(); expect(comp.formModel.length).toBe(models.length); @@ -240,7 +240,7 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => { expect(comp.formModel[i] instanceof model).toBeTruthy(); }); - expect((comp.formModel[2] as DynamicFormArrayModel).groups.length).toBe(2); + expect((comp.formModel[3] as DynamicFormArrayModel).groups.length).toBe(2); const startDateModel = formbuilderService.findById('startDate', comp.formModel); expect(startDateModel.max).toEqual(maxStartDate); const endDateModel = formbuilderService.findById('endDate', comp.formModel); @@ -305,6 +305,7 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => { compAsAny.fileData = fileData; compAsAny.pathCombiner = pathCombiner; compAsAny.isPrimary = null; + compAsAny.isAlternativeContent = null; formService.validateAllFormFields.and.callFake(() => null); formService.isValid.and.returnValue(of(true)); formService.getFormData.and.returnValue(of(mockFileFormData)); @@ -334,6 +335,14 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => { const pathFragment = ['files', fileIndex]; + path = 'alternativecontent'; + expect(operationsBuilder.add).toHaveBeenCalledWith( + pathCombiner.getPath([...pathFragment, path]), + true, + false, + true, + ); + path = 'metadata/dc.title'; expect(operationsBuilder.add).toHaveBeenCalledWith( pathCombiner.getPath([...pathFragment, path]), diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts index 79b3d3a5652..8b773d429d7 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts @@ -64,6 +64,8 @@ import { BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_LAYOUT, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_CONFIG, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT, + BITSTREAM_FORM_ALTERNATIVE_CONTENT, + BITSTREAM_FORM_ALTERNATIVE_CONTENT_LAYOUT, BITSTREAM_FORM_PRIMARY, BITSTREAM_FORM_PRIMARY_LAYOUT, BITSTREAM_METADATA_FORM_GROUP_CONFIG, @@ -100,6 +102,12 @@ implements OnInit, OnDestroy { */ isPrimary: boolean; + /** + * The indicator if is alternative content bitstream + * @type {boolean, null} + */ + isAlternativeContent: boolean; + /** * The list of available access condition * @type {Array} @@ -221,6 +229,9 @@ implements OnInit, OnDestroy { const primaryBitstreamModel: any = this.formBuilderService.findById('primary', formModel, this.fileIndex); primaryBitstreamModel.value = this.isPrimary || false; + const alternativeContentBitstreamModel: any = this.formBuilderService.findById('alternativeContent', formModel, this.fileIndex); + alternativeContentBitstreamModel.value = this.isAlternativeContent || false; + this.fileData.accessConditions.forEach((accessCondition, index) => { Array.of('name', 'startDate', 'endDate') .filter((key) => accessCondition.hasOwnProperty(key) && isNotEmpty(accessCondition[key])) @@ -324,6 +335,8 @@ implements OnInit, OnDestroy { formModel.push(new DynamicCustomSwitchModel(BITSTREAM_FORM_PRIMARY, BITSTREAM_FORM_PRIMARY_LAYOUT)); + formModel.push(new DynamicCustomSwitchModel(BITSTREAM_FORM_ALTERNATIVE_CONTENT, BITSTREAM_FORM_ALTERNATIVE_CONTENT_LAYOUT)); + const metadataGroupModelConfig = Object.assign({}, BITSTREAM_METADATA_FORM_GROUP_CONFIG); metadataGroupModelConfig.group = this.formBuilderService.modelFromConfiguration( this.submissionId, @@ -437,6 +450,14 @@ implements OnInit, OnDestroy { mergeMap((formData: any) => { this.uploadService.updatePrimaryBitstreamOperation(this.pathCombiner.getPath('primary'), this.isPrimary, formData.primary[0], this.fileId); + //Set operations to bitstream alternative content flag + const alternativeContentPath = 'alternativecontent'; + if (formData.alternativeContent[0]) { + this.operationsBuilder.add(this.pathCombiner.getPath([...pathFragment, alternativeContentPath]), true, false, true); + } else { + this.operationsBuilder.remove(this.pathCombiner.getPath([...pathFragment, alternativeContentPath])); + } + // collect bitstream metadata Object.keys((formData.metadata)) .filter((key) => isNotEmpty(formData.metadata[key])) diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.model.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.model.ts index 4a39dfcfc8e..2499465f869 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.model.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.model.ts @@ -70,6 +70,19 @@ export const BITSTREAM_FORM_PRIMARY: DynamicSwitchModelConfig = { label: 'bitstream.edit.form.primaryBitstream.label', }; +export const BITSTREAM_FORM_ALTERNATIVE_CONTENT_LAYOUT: DynamicFormControlLayout = { + element: { + host: 'col-12', + container: 'text-right', + }, +}; + +export const BITSTREAM_FORM_ALTERNATIVE_CONTENT: DynamicSwitchModelConfig = { + id: 'alternativeContent', + name: 'alternativeContent', + label: 'bitstream.edit.form.alternativeContent.label', +}; + export const BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CONFIG: DynamicDatePickerModelConfig = { id: 'startDate', diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.ts b/src/app/submission/sections/upload/file/section-upload-file.component.ts index 09ea3cb1122..e400359933a 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/section-upload-file.component.ts @@ -67,6 +67,12 @@ export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit, */ @Input() isPrimary: boolean | null; + /** + * The indicator if is alternative content bitstream + * @type {boolean, null} + */ + @Input() isAlternativeContent: boolean | null; + /** * The list of available access condition * @type {Array} @@ -287,6 +293,7 @@ export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit, activeModal.componentInstance.pathCombiner = this.pathCombiner; activeModal.componentInstance.submissionId = this.submissionId; activeModal.componentInstance.isPrimary = this.isPrimary; + activeModal.componentInstance.isAlternativeContent = this.isAlternativeContent; } togglePrimaryBitstream(event) { diff --git a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts index 39de40d85c7..079e58320c7 100644 --- a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts @@ -30,6 +30,12 @@ export class ThemedSubmissionSectionUploadFileComponent */ @Input() isPrimary: boolean | null; + /** + * The indicator if is alternative content bitstream + * @type {boolean, null} + */ + @Input() isAlternativeContent: boolean | null; + /** * The submission id * @type {string} @@ -83,6 +89,7 @@ export class ThemedSubmissionSectionUploadFileComponent protected inAndOutputNames: (keyof SubmissionSectionUploadFileComponent & keyof this)[] = [ 'availableAccessConditionOptions', 'isPrimary', + 'isAlternativeContent', 'collectionId', 'collectionPolicyType', 'configMetadataForm', diff --git a/src/app/submission/sections/upload/section-upload.component.html b/src/app/submission/sections/upload/section-upload.component.html index 9d916a4f982..330f220c79b 100644 --- a/src/app/submission/sections/upload/section-upload.component.html +++ b/src/app/submission/sections/upload/section-upload.component.html @@ -31,6 +31,7 @@ select \"format not in list\" above and describe it under \"Describe new format\".", "bitstream.edit.form.selectedFormat.label": "Selected Format", @@ -2792,6 +2794,8 @@ "item.page.bitstreams.primary": "Primary", + "item.page.bitstreams.alternativeContent": "Alternative Content", + "item.page.filesection.original.bundle": "Original bundle", "item.page.filesection.license.bundle": "License bundle", diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index c67bed6a4db..71033323f58 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -1391,6 +1391,9 @@ // "bitstream.edit.form.primaryBitstream.label": "Primary File", "bitstream.edit.form.primaryBitstream.label": "Archivo principal", + //"bitstream.edit.form.alternativeContent.label": "Alternative Content File", + "bitstream.edit.form.alternativeContent.label": "Archivo con contenido alternativo", + // "bitstream.edit.form.selectedFormat.hint": "If the format is not in the above list, select \"format not in list\" above and describe it under \"Describe new format\".", "bitstream.edit.form.selectedFormat.hint": "Si el formato no está en la lista anterior, seleccione \"el formato no está en la lista\" arriba y descríbalo en \"Describir el nuevo formato\".", @@ -4172,6 +4175,9 @@ // "item.page.bitstreams.primary": "Primary", "item.page.bitstreams.primary": "Principal", + //"item.page.bitstreams.alternativeContent": "Alternative Content", + "item.page.bitstreams.alternativeContent": "Contenido alternativo", + // "item.page.filesection.original.bundle": "Original bundle", "item.page.filesection.original.bundle": "Bloque original", From 70936e3c0d409ba219760997800ca44154924dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Chaco=CC=81n?= Date: Wed, 19 Feb 2025 13:28:09 -0600 Subject: [PATCH 2/6] fix lint errors --- .../edit-bitstream-page/edit-bitstream-page.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index 1d53d68044f..597e59494b5 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -566,7 +566,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { fileNamePrimaryContainer: { fileName: bitstream.name, primaryBitstream: this.primaryBitstreamUUID === bitstream.uuid, - alternativeContent: bitstream.firstMetadataValue('dc.type') === "alternative content" + alternativeContent: bitstream.firstMetadataValue('dc.type') === 'alternative content', }, descriptionContainer: { description: bitstream.firstMetadataValue('dc.description'), From 64b1e327bc480791f168a3fc0992c2f9fdd3ed69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Chaco=CC=81n?= Date: Wed, 12 Mar 2025 19:06:24 -0600 Subject: [PATCH 3/6] change function to work with existing methods on backend --- src/app/shared/mocks/submission.mock.ts | 2 +- ...section-upload-file-edit.component.spec.ts | 8 ------- .../section-upload-file-edit.component.ts | 24 ++++++++++++++----- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/app/shared/mocks/submission.mock.ts b/src/app/shared/mocks/submission.mock.ts index d7284b290f7..ba74c0c1ebf 100644 --- a/src/app/shared/mocks/submission.mock.ts +++ b/src/app/shared/mocks/submission.mock.ts @@ -1622,7 +1622,7 @@ export const mockUploadFilesData = { export const mockFileFormData = { primary: [true], - alternativeContent: [true], + alternativeContent: [false], metadata: { 'dc.title': [ { diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts index 288d8e77bfb..bc497b17737 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts @@ -335,14 +335,6 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => { const pathFragment = ['files', fileIndex]; - path = 'alternativecontent'; - expect(operationsBuilder.add).toHaveBeenCalledWith( - pathCombiner.getPath([...pathFragment, path]), - true, - false, - true, - ); - path = 'metadata/dc.title'; expect(operationsBuilder.add).toHaveBeenCalledWith( pathCombiner.getPath([...pathFragment, path]), diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts index 8b773d429d7..90eaa8cfa00 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts @@ -28,6 +28,7 @@ import { mergeMap, take, } from 'rxjs/operators'; +import { MetadataValue } from 'src/app/core/shared/metadata.models'; import { SubmissionObject } from 'src/app/core/submission/models/submission-object.model'; import { WorkspaceitemSectionUploadObject } from 'src/app/core/submission/models/workspaceitem-section-upload.model'; import { DynamicCustomSwitchModel } from 'src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; @@ -331,6 +332,7 @@ implements OnInit, OnDestroy { configDescr, ]), }); + configForm.rows = configForm.rows.filter((row: any) => row.fields[0].selectableMetadata[0].metadata !== 'dc.type'); const formModel: DynamicFormControlModel[] = []; formModel.push(new DynamicCustomSwitchModel(BITSTREAM_FORM_PRIMARY, BITSTREAM_FORM_PRIMARY_LAYOUT)); @@ -451,9 +453,15 @@ implements OnInit, OnDestroy { this.uploadService.updatePrimaryBitstreamOperation(this.pathCombiner.getPath('primary'), this.isPrimary, formData.primary[0], this.fileId); //Set operations to bitstream alternative content flag - const alternativeContentPath = 'alternativecontent'; + const alternativeContentPath = 'metadata/dc.type'; if (formData.alternativeContent[0]) { - this.operationsBuilder.add(this.pathCombiner.getPath([...pathFragment, alternativeContentPath]), true, false, true); + const metadata = Object.assign(new MetadataValue(), { + language: null, + value: 'alternative content', + authority: null, + place: 0, + }); + this.operationsBuilder.add(this.pathCombiner.getPath([...pathFragment, alternativeContentPath]), metadata, true); } else { this.operationsBuilder.remove(this.pathCombiner.getPath([...pathFragment, alternativeContentPath])); } @@ -463,8 +471,10 @@ implements OnInit, OnDestroy { .filter((key) => isNotEmpty(formData.metadata[key])) .forEach((key) => { const metadataKey = key.replace(/_/g, '.'); - const path = `metadata/${metadataKey}`; - this.operationsBuilder.add(this.pathCombiner.getPath([...pathFragment, path]), formData.metadata[key], true); + if (metadataKey !== 'dc.type') { + const path = `metadata/${metadataKey}`; + this.operationsBuilder.add(this.pathCombiner.getPath([...pathFragment, path]), formData.metadata[key], true); + } }); Object.keys((this.fileData.metadata)) .filter((key) => isNotEmpty(this.fileData.metadata[key])) @@ -472,8 +482,10 @@ implements OnInit, OnDestroy { .filter((key) => this.formMetadata.includes(key)) .forEach((key) => { const metadataKey = key.replace(/_/g, '.'); - const path = `metadata/${metadataKey}`; - this.operationsBuilder.remove(this.pathCombiner.getPath([...pathFragment, path])); + if (metadataKey !== 'dc.type') { + const path = `metadata/${metadataKey}`; + this.operationsBuilder.remove(this.pathCombiner.getPath([...pathFragment, path])); + } }); const accessConditionsToSave = []; if (formData.hasOwnProperty('accessConditions')) { From 9a7d420ede3d2a5554008216108225794234dd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Chaco=CC=81n?= Date: Tue, 18 Mar 2025 10:30:34 -0600 Subject: [PATCH 4/6] fix missing bracket --- .../field-components/file-section/file-section.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.html b/src/app/item-page/simple/field-components/file-section/file-section.component.html index 0afaefe4e9f..56594d73330 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.html +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.html @@ -8,7 +8,7 @@ @if (primaryBitsreamId === file.id) { {{ 'item.page.bitstreams.primary' | translate }} } - @if (file.metadata['dc.type']?.[0]?.value === 'alternative content') + @if (file.metadata['dc.type']?.[0]?.value === 'alternative content') { {{ 'item.page.bitstreams.alternativeContent' | translate }} } {{ dsoNameService.getName(file) }} From 43ea4622d1bab0b8f86efe1a0ffe3e5aef1de1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Chaco=CC=81n?= Date: Fri, 20 Feb 2026 15:09:41 -0600 Subject: [PATCH 5/6] hotfix: lint errors --- config/config.yml | 4 ++-- .../edit-bitstream-page/edit-bitstream-page.component.ts | 2 +- .../field-components/file-section/file-section.component.ts | 2 +- .../upload/file/edit/section-upload-file-edit.component.ts | 5 ++++- .../submission/sections/upload/section-upload-constants.ts | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/config/config.yml b/config/config.yml index 5215eca3a9a..109db60ca92 100644 --- a/config/config.yml +++ b/config/config.yml @@ -1,5 +1,5 @@ rest: ssl: true - host: colmex-dev.conocimientovirtual.org + host: sandbox.dspace.org port: 443 - nameSpace: /colmex_server + nameSpace: /server diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index 5e41cfb4e36..97129d94800 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -64,6 +64,7 @@ import { take, tap, } from 'rxjs/operators'; +import { ALTERNATIVE_CONTENT_TAG } from 'src/app/submission/sections/upload/section-upload-constants'; import { getEntityEditRoute } from '../../item-page/item-page-routing-paths'; import { ErrorComponent } from '../../shared/error/error.component'; @@ -76,7 +77,6 @@ import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.comp import { FileSizePipe } from '../../shared/utils/file-size-pipe'; import { VarDirective } from '../../shared/utils/var.directive'; import { ThemedThumbnailComponent } from '../../thumbnail/themed-thumbnail.component'; -import { ALTERNATIVE_CONTENT_TAG } from 'src/app/submission/sections/upload/section-upload-constants'; @Component({ selector: 'ds-base-edit-bitstream-page', diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.ts index 9059f374d0c..6282b9a26a1 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.ts @@ -24,13 +24,13 @@ import { TranslateService, } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; +import { ALTERNATIVE_CONTENT_TAG } from 'src/app/submission/sections/upload/section-upload-constants'; import { ThemedFileDownloadLinkComponent } from '../../../../shared/file-download-link/themed-file-download-link.component'; import { ThemedLoadingComponent } from '../../../../shared/loading/themed-loading.component'; import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; import { VarDirective } from '../../../../shared/utils/var.directive'; -import { ALTERNATIVE_CONTENT_TAG } from 'src/app/submission/sections/upload/section-upload-constants'; /** * This component renders the file section of the item diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts index 88df32aaa2f..59d4d8a2a97 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts @@ -52,7 +52,10 @@ import { FormComponent } from '../../../../../shared/form/form.component'; import { FormService } from '../../../../../shared/form/form.service'; import { SubmissionService } from '../../../../submission.service'; import { SectionUploadService } from '../../section-upload.service'; -import { ALTERNATIVE_CONTENT_TAG, POLICY_DEFAULT_WITH_LIST } from '../../section-upload-constants'; +import { + ALTERNATIVE_CONTENT_TAG, + POLICY_DEFAULT_WITH_LIST, +} from '../../section-upload-constants'; import { BITSTREAM_ACCESS_CONDITION_GROUP_CONFIG, BITSTREAM_ACCESS_CONDITION_GROUP_LAYOUT, diff --git a/src/app/submission/sections/upload/section-upload-constants.ts b/src/app/submission/sections/upload/section-upload-constants.ts index 8a2120cd669..06da4b8745a 100644 --- a/src/app/submission/sections/upload/section-upload-constants.ts +++ b/src/app/submission/sections/upload/section-upload-constants.ts @@ -1,3 +1,3 @@ export const POLICY_DEFAULT_NO_LIST = 1; // Banner1 export const POLICY_DEFAULT_WITH_LIST = 2; // Banner2 -export const ALTERNATIVE_CONTENT_TAG = 'alternative content'; // Alternative content tag \ No newline at end of file +export const ALTERNATIVE_CONTENT_TAG = 'alternative content'; // Alternative content tag From 6a7123511316db6cc6ca31b1d92ce0d21bf8cb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Chaco=CC=81n?= Date: Fri, 6 Mar 2026 17:58:00 -0600 Subject: [PATCH 6/6] fix test issues --- package-lock.json | 324 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 324 insertions(+) diff --git a/package-lock.json b/package-lock.json index 0d70a670782..2ebfd6f8190 100644 --- a/package-lock.json +++ b/package-lock.json @@ -474,6 +474,40 @@ } } }, + "node_modules/@angular-builders/common/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@angular-builders/common/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-builders/common/node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", @@ -584,6 +618,40 @@ } } }, + "node_modules/@angular-builders/custom-webpack/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@angular-builders/custom-webpack/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-devkit/architect": { "version": "0.2003.15", "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.2003.15.tgz", @@ -628,6 +696,40 @@ } } }, + "node_modules/@angular-devkit/architect/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@angular-devkit/architect/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-devkit/build-angular": { "version": "20.3.16", "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-20.3.16.tgz", @@ -1304,6 +1406,40 @@ } } }, + "node_modules/@angular-devkit/build-webpack/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@angular-devkit/build-webpack/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-devkit/schematics": { "version": "20.3.15", "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-20.3.15.tgz", @@ -1377,6 +1513,24 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/@angular-devkit/schematics/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-devkit/schematics/node_modules/cli-cursor": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", @@ -1496,6 +1650,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@angular-devkit/schematics/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-devkit/schematics/node_modules/restore-cursor": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", @@ -1590,6 +1760,40 @@ } } }, + "node_modules/@angular-eslint/builder/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@angular-eslint/builder/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-eslint/bundled-angular-compiler": { "version": "20.7.0", "resolved": "https://registry.npmjs.org/@angular-eslint/bundled-angular-compiler/-/bundled-angular-compiler-20.7.0.tgz", @@ -1678,6 +1882,40 @@ } } }, + "node_modules/@angular-eslint/schematics/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@angular-eslint/schematics/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-eslint/template-parser": { "version": "20.7.0", "resolved": "https://registry.npmjs.org/@angular-eslint/template-parser/-/template-parser-20.7.0.tgz", @@ -2052,6 +2290,24 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/@angular/build/node_modules/yaml": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "dev": true, + "license": "ISC", + "optional": true, + "peer": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, "node_modules/@angular/cdk": { "version": "20.2.14", "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-20.2.14.tgz", @@ -2156,6 +2412,24 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/@angular/cli/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular/cli/node_modules/cliui": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", @@ -2178,6 +2452,22 @@ "dev": true, "license": "MIT" }, + "node_modules/@angular/cli/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular/cli/node_modules/semver": { "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", @@ -9107,6 +9397,40 @@ } } }, + "node_modules/@schematics/angular/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@schematics/angular/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@sigstore/bundle": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-4.0.0.tgz",