From d0a257f1a9ae1f36585c0b263d5f7fef0b130926 Mon Sep 17 00:00:00 2001 From: Florent POITTEVIN <poittevin.florent@gmail.com> Date: Wed, 21 Apr 2021 16:34:18 +0200 Subject: [PATCH] feat(deposit schema): [AOU-416] update fields form according to pivotal format updates --- package-lock.json | 6 +- package.json | 2 +- src/app/enums/index.ts | 8 +- ...posit-abstract-form-list.presentational.ts | 2 +- .../deposit-abstract-form.presentational.ts | 9 + ...ption-academic-structure.presentational.ts | 8 +- ...-container-identifiers.presentational.html | 53 --- ...-container-identifiers.presentational.scss | 27 -- ...on-container-identifiers.presentational.ts | 83 ---- ...-description-container.presentational.html | 32 +- ...-description-container.presentational.scss | 4 +- ...rm-description-container.presentational.ts | 22 +- ...rm-description-dataset.presentational.html | 38 +- ...rm-description-dataset.presentational.scss | 10 - ...form-description-dataset.presentational.ts | 59 +-- ...it-form-description-date.presentational.ts | 4 +- ...-form-description-dois.presentational.html | 31 -- ...-form-description-dois.presentational.scss | 4 - ...m-description-language.presentational.html | 35 ++ ...m-description-language.presentational.scss | 9 + ...rm-description-language.presentational.ts} | 52 +-- ...-form-description-link.presentational.html | 2 + ...it-form-description-page.presentational.ts | 4 +- ...publication-identifier.presentational.html | 66 +++- ...n-publication-identifier.presentational.ts | 41 +- ...rm-description-publisher.presentational.ts | 4 +- ...escription-text-language.presentational.ts | 4 +- ...t-form-first-step-type.presentational.html | 22 -- ...t-form-first-step-type.presentational.scss | 20 - ...sit-form-first-step-type.presentational.ts | 8 +- ...ourth-step-description.presentational.html | 56 +-- ...-fourth-step-description.presentational.ts | 16 +- ...t-form-second-step-files.presentational.ts | 6 +- ...-third-step-contributors.presentational.ts | 10 +- .../deposit-form.presentational.ts | 59 ++- ...osit-repeatable-fields.presentational.html | 6 + ...osit-repeatable-fields.presentational.scss | 4 + ...eposit-repeatable-fields.presentational.ts | 32 +- .../deposit-summary.presentational.html | 6 +- .../deposit-summary.presentational.ts | 88 ++--- .../deposit-list/deposit-list.routable.ts | 4 +- src/app/features/deposit/deposit.module.ts | 9 +- .../helpers/deposit-form-rule.helper.ts | 364 ++++++------------ .../models/deposit-form-definition.model.ts | 69 ++-- .../shared-structure-tree.presentational.ts | 5 - src/app/shared/enums/label-translate.enum.ts | 9 +- src/assets/i18n/de.json | 11 +- src/assets/i18n/en.json | 9 +- src/assets/i18n/fr.json | 9 +- 49 files changed, 545 insertions(+), 896 deletions(-) delete mode 100644 src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.html delete mode 100644 src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.scss delete mode 100644 src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.ts delete mode 100644 src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.html delete mode 100644 src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.scss create mode 100644 src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.html create mode 100644 src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.scss rename src/app/features/deposit/components/presentationals/{deposit-form-description-dois/deposit-form-description-dois.presentational.ts => deposit-form-description-language/deposit-form-description-language.presentational.ts} (52%) diff --git a/package-lock.json b/package-lock.json index 441f54878..70ab3ec1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14836,9 +14836,9 @@ } }, "solidify-frontend": { - "version": "1.2.18", - "resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-1.2.18.tgz", - "integrity": "sha512-3EmnabjABs9it1vAXUUISxTsj5k0lpBXT1ecogjzhYEwmrx4/e8cKLEQkqyovGqDWhAS5FG2wCout9UQPmTfsw==", + "version": "1.2.19", + "resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-1.2.19.tgz", + "integrity": "sha512-GT1Pi0ftZJRakNDdpezEp1k3d/5f9S/hsB7kRXSuhGx4/WIVnlYVpgmTkowaOOmMhOO1You4Iqu2UvUXy7XwVA==", "requires": { "tslib": "^2.0.0" } diff --git a/package.json b/package.json index 14df177dc..e8abf72a0 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "normalize.css": "8.0.1", "patch-package": "6.2.2", "rxjs": "6.6.0", - "solidify-frontend": "1.2.18", + "solidify-frontend": "1.2.19", "streamsaver": "2.0.4", "sync-pom-version-to-package": "1.5.0", "ts-key-enum": "2.0.3", diff --git a/src/app/enums/index.ts b/src/app/enums/index.ts index 6e02ab45f..58db3ff7c 100644 --- a/src/app/enums/index.ts +++ b/src/app/enums/index.ts @@ -637,14 +637,12 @@ export namespace Enums { "PUBLICATION" | "FIRST_ONLINE" | "IMPRIMATUR" - | "DEFENSE" - | "PRESENTATION"; + | "DEFENSE"; export const DateTypesEnum = { PUBLICATION: "PUBLICATION" as DateTypesEnum, FIRST_ONLINE: "FIRST_ONLINE" as DateTypesEnum, IMPRIMATUR: "IMPRIMATUR" as DateTypesEnum, DEFENSE: "DEFENSE" as DateTypesEnum, - PRESENTATION: "PRESENTATION" as DateTypesEnum, }; export const DateTypesEnumTranslate: KeyValue[] = [ { @@ -663,10 +661,6 @@ export namespace Enums { key: DateTypesEnum.DEFENSE, value: MARK_AS_TRANSLATABLE("enum.dateTypes.defense"), }, - { - key: DateTypesEnum.PRESENTATION, - value: MARK_AS_TRANSLATABLE("enum.dateTypes.presentation"), - }, ]; } diff --git a/src/app/features/deposit/components/presentationals/deposit-abstract-form-list/deposit-abstract-form-list.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-abstract-form-list/deposit-abstract-form-list.presentational.ts index e2b4279dc..547910239 100644 --- a/src/app/features/deposit/components/presentationals/deposit-abstract-form-list/deposit-abstract-form-list.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-abstract-form-list/deposit-abstract-form-list.presentational.ts @@ -36,7 +36,7 @@ export abstract class DepositAbstractFormListPresentational extends DepositAbstr protected readonly _changeDetector: ChangeDetectorRef, protected readonly _actions$: Actions, protected readonly _notificationService: NotificationService) { - super(); + super(_changeDetector); } abstract formGroupFactory(fb: FormBuilder, ...formDefinition: BaseFormDefinition[]): FormGroup; diff --git a/src/app/features/deposit/components/presentationals/deposit-abstract-form/deposit-abstract-form.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-abstract-form/deposit-abstract-form.presentational.ts index 230767dd3..6fac56ca7 100644 --- a/src/app/features/deposit/components/presentationals/deposit-abstract-form/deposit-abstract-form.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-abstract-form/deposit-abstract-form.presentational.ts @@ -1,4 +1,5 @@ import { + ChangeDetectorRef, Directive, HostBinding, Input, @@ -70,6 +71,10 @@ export abstract class DepositAbstractFormPresentational extends SharedAbstractPr return Enums.Deposit.DepositSubTypeEnum; } + constructor(protected readonly _changeDetector: ChangeDetectorRef) { + super(); + } + getPath(fieldName: string): string { return this.path + (isNonEmptyString(fieldName) ? (SOLIDIFY_CONSTANTS.DOT + fieldName) : SOLIDIFY_CONSTANTS.STRING_EMPTY); } @@ -83,6 +88,10 @@ export abstract class DepositAbstractFormPresentational extends SharedAbstractPr return isNullOrUndefined(errors) ? false : errors.required; } + externalDetectChanges(): void { + this._changeDetector.detectChanges(); + } + registerOnChange(fn: any): void { } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-academic-structure/deposit-form-description-academic-structure.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-academic-structure/deposit-form-description-academic-structure.presentational.ts index 193860be9..db02e34c3 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-academic-structure/deposit-form-description-academic-structure.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-academic-structure/deposit-form-description-academic-structure.presentational.ts @@ -120,10 +120,10 @@ export class DepositFormDescriptionAcademicStructurePresentational extends Depos private translate: TranslateService, private _store: Store, private readonly _fb: FormBuilder, - private readonly _changeDetector: ChangeDetectorRef, + protected readonly _changeDetector: ChangeDetectorRef, private readonly _actions$: Actions, private readonly _notificationService: NotificationService) { - super(); + super(_changeDetector); } addAcademicStructure(): void { @@ -164,7 +164,6 @@ export class DepositFormDescriptionAcademicStructurePresentational extends Depos const form = _fb.group({ [formDefinition.name]: [undefined, [Validators.required, SolidifyValidator]], [formDefinition.code]: [undefined, [Validators.required, SolidifyValidator]], - [formDefinition.oldCode]: [undefined, [SolidifyValidator]], }); if (isNotNullNorUndefined(group)) { @@ -185,8 +184,7 @@ export class DepositFormDescriptionAcademicStructurePresentational extends Depos isADefaultValue(structure: DepositFormAcademicStructure): boolean { if (isNonEmptyArray(this.defaultValue)) { return this.defaultValue.findIndex(d => d.code === structure[this.formDefinition.code] - && d.name === structure[this.formDefinition.name] - && d.oldCode === structure[this.formDefinition.oldCode]) !== -1; + && d.name === structure[this.formDefinition.name]) !== -1; } return false; } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.html b/src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.html deleted file mode 100644 index 770d976b6..000000000 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.html +++ /dev/null @@ -1,53 +0,0 @@ -<solidify-panel-expandable [isOpen]="true" - [titleToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, path)" - class="panel" -> - <ng-container *ngIf="formDefinition.dois as fieldName"> - <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <aou-deposit-form-description-dois *ngIf="getFormControl(fieldName) as fd" - [formArray]="fd" - [path]="getPath(fieldName)" - [mainFormGroup]="mainFormGroup" - ></aou-deposit-form-description-dois> - </ng-template> - </ng-container> - - <div class="isbn-and-issn"> - <ng-container *ngIf="formDefinition.isbn as fieldName"> - <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <mat-form-field *ngIf="getFormControl(fieldName) as fd" - [appearance]="appearanceInputMaterial" - [floatLabel]="positionLabelInputMaterial" - solidifyTooltipOnEllipsis - > - <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> - <input [formControl]="fd" - [required]="formValidationHelper.hasRequiredField(fd)" - [solidifyValidation]="errors" - matInput - > - <mat-error #errors></mat-error> - </mat-form-field> - </ng-template> - </ng-container> - - <ng-container *ngIf="formDefinition.issn as fieldName"> - <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <mat-form-field *ngIf="getFormControl(fieldName) as fd" - [appearance]="appearanceInputMaterial" - [floatLabel]="positionLabelInputMaterial" - solidifyTooltipOnEllipsis - > - <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> - <input [formControl]="fd" - [required]="formValidationHelper.hasRequiredField(fd)" - [solidifyValidation]="errors" - matInput - > - <mat-error #errors></mat-error> - </mat-form-field> - </ng-template> - </ng-container> - </div> - -</solidify-panel-expandable> diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.scss b/src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.scss deleted file mode 100644 index 275008ab4..000000000 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.scss +++ /dev/null @@ -1,27 +0,0 @@ -@import "../../../../../../sass/abstracts/abstracts"; - -:host { - .panel { - &::ng-deep { - > .header { - .title { - font-size: 12px; - } - } - - > .content { - display: grid; - grid-template-columns: 1fr; - grid-gap: 0 20px; - align-items: center; - - .isbn-and-issn { - display: grid; - grid-template-columns: 1fr 1fr max-content; - grid-gap: 0 20px; - align-items: center; - } - } - } - } -} diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.ts deleted file mode 100644 index 26bb58b9b..000000000 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, -} from "@angular/core"; -import { - FormArray, - FormBuilder, - FormGroup, - NG_VALUE_ACCESSOR, -} from "@angular/forms"; -import {DepositAbstractFormPresentational} from "@app/features/deposit/components/presentationals/deposit-abstract-form/deposit-abstract-form.presentational"; -import {DepositFormDescriptionDoisPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational"; -import { - DepositFormContainerIdentifiers, - FormComponentFormDefinitionDepositFormContainerIdentifiers, - FormComponentFormDefinitionDepositFormDoi, - FormComponentFormDefinitionFourthStepDescription, -} from "@app/features/deposit/models/deposit-form-definition.model"; -import {TranslateService} from "@ngx-translate/core"; -import { - Actions, - Store, -} from "@ngxs/store"; -import { - BreakpointService, - isNotNullNorUndefined, - isNullOrUndefined, - NotificationService, - SolidifyValidator, -} from "solidify-frontend"; - -@Component({ - selector: "aou-deposit-form-description-container-identifiers", - templateUrl: "./deposit-form-description-container-identifiers.presentational.html", - styleUrls: ["./deposit-form-description-container-identifiers.presentational.scss"], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [ - { - provide: NG_VALUE_ACCESSOR, - multi: true, - useExisting: DepositFormDescriptionContainerIdentifiersPresentational, - }, - ], -}) -export class DepositFormDescriptionContainerIdentifiersPresentational extends DepositAbstractFormPresentational { - formDefinition: FormComponentFormDefinitionDepositFormContainerIdentifiers = new FormComponentFormDefinitionDepositFormContainerIdentifiers(); - - constructor(private translate: TranslateService, - private _store: Store, - private readonly _fb: FormBuilder, - private readonly _changeDetector: ChangeDetectorRef, - private readonly _actions$: Actions, - private readonly _notificationService: NotificationService, - public readonly breakpointService: BreakpointService) { - super(); - } - - static createOrBindContainerIdentifier(_fb: FormBuilder, - form: FormGroup | undefined = undefined, - formDefinition: FormComponentFormDefinitionDepositFormContainerIdentifiers, - formDefinitionDepositFormDoi: FormComponentFormDefinitionDepositFormDoi, - containerIdentifier: DepositFormContainerIdentifiers | undefined = undefined): FormGroup { - if (isNullOrUndefined(form)) { - form = _fb.group({ - [formDefinition.dois]: _fb.array([], [SolidifyValidator]), - [formDefinition.isbn]: [undefined, [SolidifyValidator]], - [formDefinition.issn]: [undefined, [SolidifyValidator]], - }); - } - - if (isNotNullNorUndefined(containerIdentifier)) { - containerIdentifier.dois?.forEach(doi => { - (form.get(formDefinition.dois) as FormArray) - .push(DepositFormDescriptionDoisPresentational.createDoi(_fb, formDefinitionDepositFormDoi, doi)); - }); - form.get(formDefinition.isbn).setValue(containerIdentifier.isbn); - form.get(formDefinition.issn).setValue(containerIdentifier.issn); - } - - return form; - } -} diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.html b/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.html index 30c24366d..a7984e5be 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.html +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.html @@ -13,17 +13,7 @@ </ng-template> </ng-container> - <ng-container *ngIf="formDefinition.identifiers as fieldName"> - <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <aou-deposit-form-description-container-identifiers *ngIf="getFormControl(fieldName) as fd" - [formGroup]="fd" - [path]="getPath(fieldName)" - [mainFormGroup]="mainFormGroup" - ></aou-deposit-form-description-container-identifiers> - </ng-template> - </ng-container> - - <div class="three-column"> + <div class="four-column"> <ng-container *ngIf="formDefinition.editor as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <mat-form-field *ngIf="getFormControl(fieldName) as fd" @@ -42,7 +32,25 @@ </ng-template> </ng-container> - <ng-container *ngIf="formDefinition.place as fieldName"> + <ng-container *ngIf="formDefinition.conferenceTitle as fieldName"> + <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> + <mat-form-field *ngIf="getFormControl(fieldName) as fd" + [appearance]="appearanceInputMaterial" + [floatLabel]="positionLabelInputMaterial" + solidifyTooltipOnEllipsis + > + <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> + <input [formControl]="fd" + [required]="formValidationHelper.hasRequiredField(fd)" + [solidifyValidation]="errors" + matInput + > + <mat-error #errors></mat-error> + </mat-form-field> + </ng-template> + </ng-container> + + <ng-container *ngIf="formDefinition.conferencePlace as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <mat-form-field *ngIf="getFormControl(fieldName) as fd" [appearance]="appearanceInputMaterial" diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.scss b/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.scss index 60704940a..7ff2976d9 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.scss +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.scss @@ -14,9 +14,9 @@ grid-template-columns: 1fr; grid-gap: 20px; - .three-column { + .four-column { display: grid; - grid-template-columns: 1fr 1fr 1fr; + grid-template-columns: 1fr 1fr 1fr 1fr; grid-gap: 0 20px; } } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.ts index 664fba1f7..1523cd7e1 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational.ts @@ -9,14 +9,11 @@ import { FormGroup, NG_VALUE_ACCESSOR, } from "@angular/forms"; +import {DepositAbstractFormListPresentational} from "@app/features/deposit/components/presentationals/deposit-abstract-form-list/deposit-abstract-form-list.presentational"; import {DepositAbstractFormPresentational} from "@app/features/deposit/components/presentationals/deposit-abstract-form/deposit-abstract-form.presentational"; -import {DepositFormDescriptionContainerIdentifiersPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational"; import { DepositFormContainer, FormComponentFormDefinitionDepositFormContainer, - FormComponentFormDefinitionDepositFormContainerIdentifiers, - FormComponentFormDefinitionDepositFormDoi, - FormComponentFormDefinitionFourthStepDescription, } from "@app/features/deposit/models/deposit-form-definition.model"; import {Language} from "@models"; import {TranslateService} from "@ngx-translate/core"; @@ -53,18 +50,16 @@ export class DepositFormDescriptionContainerPresentational extends DepositAbstra constructor(private translate: TranslateService, private _store: Store, private readonly _fb: FormBuilder, - private readonly _changeDetector: ChangeDetectorRef, + protected readonly _changeDetector: ChangeDetectorRef, private readonly _actions$: Actions, private readonly _notificationService: NotificationService, public readonly breakpointService: BreakpointService) { - super(); + super(_changeDetector); } static bindContainer(_fb: FormBuilder, form: FormGroup | undefined = undefined, formDefinition: FormComponentFormDefinitionDepositFormContainer, - formDefinitionDepositFormContainerIdentifiers: FormComponentFormDefinitionDepositFormContainerIdentifiers, - formDefinitionDepositFormDoi: FormComponentFormDefinitionDepositFormDoi, containerContainer: DepositFormContainer | undefined = undefined): FormGroup { if (isNullOrUndefined(form)) { return form; @@ -72,16 +67,9 @@ export class DepositFormDescriptionContainerPresentational extends DepositAbstra if (isNotNullNorUndefined(containerContainer)) { form.get(formDefinition.title).setValue(containerContainer.title); - - DepositFormDescriptionContainerIdentifiersPresentational.createOrBindContainerIdentifier( - _fb, - form.get(formDefinition.identifiers) as FormGroup, - formDefinitionDepositFormContainerIdentifiers, - formDefinitionDepositFormDoi, - containerContainer.identifiers, - ); form.get(formDefinition.editor).setValue(containerContainer.editor); - form.get(formDefinition.place).setValue(containerContainer.place); + form.get(formDefinition.conferenceTitle).setValue(containerContainer.conferenceTitle); + form.get(formDefinition.conferencePlace).setValue(containerContainer.conferencePlace); form.get(formDefinition.volume).setValue(containerContainer.volume); form.get(formDefinition.issue).setValue(containerContainer.issue); form.get(formDefinition.conferenceDate).setValue(containerContainer.conferenceDate); diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.html b/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.html index a29ef7fe6..4a6382894 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.html +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.html @@ -1,32 +1,24 @@ -<solidify-panel-expandable [isOpen]="true" - [titleToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, path)" - class="panel" +<aou-deposit-repeatable-fields [labelSectionToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, path)" + [fieldsTemplate]="fieldsTemplate" + [formGroupFactory]="formGroupFactory" + [formArray]="formArray" + [readonly]="readonly" + [listFormDefinitions]="listFormDefinitions" +></aou-deposit-repeatable-fields> + + +<ng-template #fieldsTemplate + let-formGroup="formGroup" > <ng-container *ngIf="formDefinition.url as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <solidify-url-input-navigator *ngIf="getFormControl(fieldName) as fd" + <solidify-url-input-navigator *ngIf="formValidationHelper.getFormControl(formGroup, fieldName) as fd" [formControl]="fd" + [positionLabel]="positionLabelInputMaterial" + [appearance]="appearanceInputMaterial" [placeholderToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName))" > </solidify-url-input-navigator> </ng-template> </ng-container> - - <ng-container *ngIf="formDefinition.doi as fieldName"> - <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <mat-form-field *ngIf="getFormControl(fieldName) as fd" - [appearance]="appearanceInputMaterial" - [floatLabel]="positionLabelInputMaterial" - solidifyTooltipOnEllipsis - > - <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> - <input [formControl]="fd" - [required]="formValidationHelper.hasRequiredField(fd)" - [solidifyValidation]="errors" - matInput - > - <mat-error #errors></mat-error> - </mat-form-field> - </ng-template> - </ng-container> -</solidify-panel-expandable> +</ng-template> diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.scss b/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.scss index c21668d19..1c396b7cd 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.scss +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.scss @@ -3,16 +3,6 @@ :host { .panel { &::ng-deep { - > .header { - .title { - font-size: 12px; - } - } - > .content { - display: grid; - grid-template-columns: 1fr 1fr; - grid-gap: 20px; - } } } } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.ts index 3b1c5bfca..03dbac314 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational.ts @@ -2,19 +2,14 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, - HostBinding, - Input, - OnInit, - Output, } from "@angular/core"; import { - AbstractControl, ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, } from "@angular/forms"; -import {DepositAbstractFormPresentational} from "@app/features/deposit/components/presentationals/deposit-abstract-form/deposit-abstract-form.presentational"; +import {DepositAbstractFormListPresentational} from "@app/features/deposit/components/presentationals/deposit-abstract-form-list/deposit-abstract-form-list.presentational"; import { DepositFormDataset, FormComponentFormDefinitionDepositFormDataset, @@ -24,16 +19,11 @@ import { Actions, Store, } from "@ngxs/store"; -import {SharedAbstractPresentational} from "@shared/components/presentationals/shared-abstract/shared-abstract.presentational"; import { - BehaviorSubject, - Observable, -} from "rxjs"; -import { - FormValidationHelper, - isNullOrUndefined, + BaseFormDefinition, + isNotNullNorUndefined, NotificationService, - ObservableUtil, + SolidifyValidator, } from "solidify-frontend"; @Component({ @@ -49,15 +39,40 @@ import { }, ], }) -export class DepositFormDescriptionDatasetPresentational extends DepositAbstractFormPresentational { +export class DepositFormDescriptionDatasetPresentational extends DepositAbstractFormListPresentational implements ControlValueAccessor { formDefinition: FormComponentFormDefinitionDepositFormDataset = new FormComponentFormDefinitionDepositFormDataset(); - constructor(private translate: TranslateService, - private _store: Store, - private readonly _fb: FormBuilder, - private readonly _changeDetector: ChangeDetectorRef, - private readonly _actions$: Actions, - private readonly _notificationService: NotificationService) { - super(); + listFormDefinitions: BaseFormDefinition[] = [this.formDefinition]; + + constructor(protected readonly _translate: TranslateService, + protected readonly _store: Store, + protected readonly _fb: FormBuilder, + protected readonly _changeDetector: ChangeDetectorRef, + protected readonly _actions$: Actions, + protected readonly _notificationService: NotificationService) { + super(_translate, + _store, + _fb, + _changeDetector, + _actions$, + _notificationService); + } + + static createDataset(_fb: FormBuilder, + formDefinition: FormComponentFormDefinitionDepositFormDataset, + dataset: DepositFormDataset | undefined = undefined): FormGroup { + const form = _fb.group({ + [formDefinition.url]: [undefined, [SolidifyValidator]], + }); + + if (isNotNullNorUndefined(dataset)) { + form.setValue(dataset); + } + + return form; + } + + formGroupFactory(fb: FormBuilder, formDefinition: FormComponentFormDefinitionDepositFormDataset): FormGroup { + return DepositFormDescriptionDatasetPresentational.createDataset(fb, formDefinition); } } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-date/deposit-form-description-date.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-date/deposit-form-description-date.presentational.ts index bf1d7fc7d..f969a8a74 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-date/deposit-form-description-date.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-date/deposit-form-description-date.presentational.ts @@ -78,11 +78,11 @@ export class DepositFormDescriptionDatePresentational extends DepositAbstractFor constructor(private translate: TranslateService, private _store: Store, private readonly _fb: FormBuilder, - private readonly _changeDetector: ChangeDetectorRef, + protected readonly _changeDetector: ChangeDetectorRef, private readonly _actions$: Actions, private readonly _notificationService: NotificationService, public readonly breakpointService: BreakpointService) { - super(); + super(_changeDetector); } static createDate(_fb: FormBuilder, diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.html b/src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.html deleted file mode 100644 index c5753bedf..000000000 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.html +++ /dev/null @@ -1,31 +0,0 @@ -<aou-deposit-repeatable-fields [labelSectionToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, path)" - [fieldsTemplate]="fieldsTemplate" - [formGroupFactory]="formGroupFactory" - [formArray]="formArray" - [readonly]="readonly" - [listFormDefinitions]="listFormDefinitions" -></aou-deposit-repeatable-fields> - -<ng-template #fieldsTemplate - let-formGroup="formGroup" -> - <div class="container"> - <ng-container *ngIf="formDefinition.doi as fieldName"> - <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <mat-form-field *ngIf="formValidationHelper.getFormControl(formGroup, fieldName) as fd" - [appearance]="appearanceInputMaterial" - [floatLabel]="positionLabelInputMaterial" - solidifyTooltipOnEllipsis - > - <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> - <input [formControl]="fd" - [required]="formValidationHelper.hasRequiredField(fd)" - [solidifyValidation]="errors" - matInput - > - <mat-error #errors></mat-error> - </mat-form-field> - </ng-template> - </ng-container> - </div> -</ng-template> diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.scss b/src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.scss deleted file mode 100644 index 3700a325d..000000000 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.scss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../deposit-abstract-form-list/deposit-abstract-form-list.presentational"; - -:host { -} diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.html b/src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.html new file mode 100644 index 000000000..25be5ffae --- /dev/null +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.html @@ -0,0 +1,35 @@ +<aou-deposit-repeatable-fields [labelSectionToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, path)" + [fieldsTemplate]="fieldsTemplate" + [formGroupFactory]="formGroupFactory" + [formArray]="formArray" + [readonly]="readonly" + [listFormDefinitions]="listFormDefinitions" +></aou-deposit-repeatable-fields> + + +<ng-template #fieldsTemplate + let-formGroup="formGroup" +> + <ng-container *ngIf="formDefinition.language as fieldName"> + <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> + <mat-form-field *ngIf="formValidationHelper.getFormControl(formGroup, fieldName) as fd" + [appearance]="appearanceInputMaterial" + [floatLabel]="positionLabelInputMaterial" + solidifyTooltipOnEllipsis + > + <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> + <mat-select [formControl]="fd" + [required]="formValidationHelper.hasRequiredField(fd)" + [solidifyValidation]="errors" + > + <mat-option *ngFor="let language of listLanguages" + [value]="language.resId" + > + {{language.labels | backtranslate}} + </mat-option> + </mat-select> + <mat-error #errors></mat-error> + </mat-form-field> + </ng-template> + </ng-container> +</ng-template> diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.scss b/src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.scss new file mode 100644 index 000000000..10ca9d08a --- /dev/null +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.scss @@ -0,0 +1,9 @@ +@import "../../../../../../sass/abstracts/abstracts"; + +:host { + ::ng-deep { + .form-group-wrapper { + display: grid; + } + } +} diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.ts similarity index 52% rename from src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.ts rename to src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.ts index 1e3c60ceb..a6c12dbdc 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational.ts @@ -2,62 +2,50 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, - HostBinding, Input, - OnInit, - Output, } from "@angular/core"; import { - AbstractControl, ControlValueAccessor, - FormArray, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, - Validators, } from "@angular/forms"; import {DepositAbstractFormListPresentational} from "@app/features/deposit/components/presentationals/deposit-abstract-form-list/deposit-abstract-form-list.presentational"; import { - DepositFormClassification, - DepositFormDoi, - FormComponentFormDefinitionDepositFormClassification, - FormComponentFormDefinitionDepositFormDoi, + DepositFormLanguage, + FormComponentFormDefinitionDepositFormLanguage, } from "@app/features/deposit/models/deposit-form-definition.model"; +import {Language} from "@models"; import {TranslateService} from "@ngx-translate/core"; import { Actions, Store, } from "@ngxs/store"; -import {SharedAbstractPresentational} from "@shared/components/presentationals/shared-abstract/shared-abstract.presentational"; -import { - BehaviorSubject, - Observable, -} from "rxjs"; import { BaseFormDefinition, - FormValidationHelper, isNotNullNorUndefined, - isNullOrUndefined, NotificationService, - ObservableUtil, SolidifyValidator, } from "solidify-frontend"; @Component({ - selector: "aou-deposit-form-description-dois", - templateUrl: "./deposit-form-description-dois.presentational.html", - styleUrls: ["./deposit-form-description-dois.presentational.scss"], + selector: "aou-deposit-form-description-language", + templateUrl: "./deposit-form-description-language.presentational.html", + styleUrls: ["./deposit-form-description-language.presentational.scss"], changeDetection: ChangeDetectionStrategy.OnPush, providers: [ { provide: NG_VALUE_ACCESSOR, multi: true, - useExisting: DepositFormDescriptionDoisPresentational, + useExisting: DepositFormDescriptionLanguagePresentational, }, ], }) -export class DepositFormDescriptionDoisPresentational extends DepositAbstractFormListPresentational implements ControlValueAccessor { - formDefinition: FormComponentFormDefinitionDepositFormDoi = new FormComponentFormDefinitionDepositFormDoi(); +export class DepositFormDescriptionLanguagePresentational extends DepositAbstractFormListPresentational implements ControlValueAccessor { + formDefinition: FormComponentFormDefinitionDepositFormLanguage = new FormComponentFormDefinitionDepositFormLanguage(); + + @Input() + listLanguages: Language[]; listFormDefinitions: BaseFormDefinition[] = [this.formDefinition]; @@ -75,21 +63,21 @@ export class DepositFormDescriptionDoisPresentational extends DepositAbstractFor _notificationService); } - static createDoi(_fb: FormBuilder, - formDefinition: FormComponentFormDefinitionDepositFormDoi, - doi: DepositFormDoi | undefined = undefined): FormGroup { + static createLanguage(_fb: FormBuilder, + formDefinition: FormComponentFormDefinitionDepositFormLanguage, + dataset: DepositFormLanguage | undefined = undefined): FormGroup { const form = _fb.group({ - [formDefinition.doi]: [undefined, [SolidifyValidator]], + [formDefinition.language]: [undefined, [SolidifyValidator]], }); - if (isNotNullNorUndefined(doi)) { - form.setValue(doi); + if (isNotNullNorUndefined(dataset)) { + form.setValue(dataset); } return form; } - formGroupFactory(fb: FormBuilder, formDefinition: FormComponentFormDefinitionDepositFormDoi): FormGroup { - return DepositFormDescriptionDoisPresentational.createDoi(fb, formDefinition); + formGroupFactory(fb: FormBuilder, formDefinition: FormComponentFormDefinitionDepositFormLanguage): FormGroup { + return DepositFormDescriptionLanguagePresentational.createLanguage(fb, formDefinition); } } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-link/deposit-form-description-link.presentational.html b/src/app/features/deposit/components/presentationals/deposit-form-description-link/deposit-form-description-link.presentational.html index 572089c45..1f6940126 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-link/deposit-form-description-link.presentational.html +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-link/deposit-form-description-link.presentational.html @@ -14,6 +14,8 @@ <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <solidify-url-input-navigator *ngIf="formValidationHelper.getFormControl(formGroup, fieldName) as fd" [formControl]="fd" + [positionLabel]="positionLabelInputMaterial" + [appearance]="appearanceInputMaterial" [placeholderToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName))" > </solidify-url-input-navigator> diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-page/deposit-form-description-page.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-page/deposit-form-description-page.presentational.ts index 19fb480d0..a1ef56791 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-page/deposit-form-description-page.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-page/deposit-form-description-page.presentational.ts @@ -35,9 +35,9 @@ export class DepositFormDescriptionPagePresentational extends DepositAbstractFor constructor(private translate: TranslateService, private _store: Store, private readonly _fb: FormBuilder, - private readonly _changeDetector: ChangeDetectorRef, + protected readonly _changeDetector: ChangeDetectorRef, private readonly _actions$: Actions, private readonly _notificationService: NotificationService) { - super(); + super(_changeDetector); } } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational.html b/src/app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational.html index 9aa661c41..c344e7354 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational.html +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational.html @@ -2,17 +2,25 @@ [titleToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, path)" class="panel" > - <ng-container *ngIf="formDefinition.dois as fieldName"> - <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <aou-deposit-form-description-dois *ngIf="getFormControl(fieldName) as fd" - [formArray]="fd" - [path]="getPath(fieldName)" - [mainFormGroup]="mainFormGroup" - ></aou-deposit-form-description-dois> - </ng-template> - </ng-container> - <div class="container"> + <ng-container *ngIf="formDefinition.doi as fieldName"> + <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> + <mat-form-field *ngIf="getFormControl(fieldName) as fd" + [appearance]="appearanceInputMaterial" + [floatLabel]="positionLabelInputMaterial" + solidifyTooltipOnEllipsis + > + <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> + <input [formControl]="fd" + [required]="formValidationHelper.hasRequiredField(fd)" + [solidifyValidation]="errors" + matInput + > + <mat-error #errors></mat-error> + </mat-form-field> + </ng-template> + </ng-container> + <ng-container *ngIf="formDefinition.pmid as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <mat-form-field *ngIf="getFormControl(fieldName) as fd" @@ -31,6 +39,24 @@ </ng-template> </ng-container> + <ng-container *ngIf="formDefinition.pmcid as fieldName"> + <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> + <mat-form-field *ngIf="getFormControl(fieldName) as fd" + [appearance]="appearanceInputMaterial" + [floatLabel]="positionLabelInputMaterial" + solidifyTooltipOnEllipsis + > + <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> + <input [formControl]="fd" + [required]="formValidationHelper.hasRequiredField(fd)" + [solidifyValidation]="errors" + matInput + > + <mat-error #errors></mat-error> + </mat-form-field> + </ng-template> + </ng-container> + <ng-container *ngIf="formDefinition.isbn as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <mat-form-field *ngIf="getFormControl(fieldName) as fd" @@ -49,6 +75,24 @@ </ng-template> </ng-container> + <ng-container *ngIf="formDefinition.issn as fieldName"> + <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> + <mat-form-field *ngIf="getFormControl(fieldName) as fd" + [appearance]="appearanceInputMaterial" + [floatLabel]="positionLabelInputMaterial" + solidifyTooltipOnEllipsis + > + <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> + <input [formControl]="fd" + [required]="formValidationHelper.hasRequiredField(fd)" + [solidifyValidation]="errors" + matInput + > + <mat-error #errors></mat-error> + </mat-form-field> + </ng-template> + </ng-container> + <ng-container *ngIf="formDefinition.arxiv as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <mat-form-field *ngIf="getFormControl(fieldName) as fd" @@ -67,7 +111,7 @@ </ng-template> </ng-container> - <ng-container *ngIf="formDefinition.rero as fieldName"> + <ng-container *ngIf="formDefinition.mmsid as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <mat-form-field *ngIf="getFormControl(fieldName) as fd" [appearance]="appearanceInputMaterial" diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational.ts index f0b011db7..0eb0b7524 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational.ts @@ -2,25 +2,16 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, - HostBinding, - Input, - OnInit, - Output, } from "@angular/core"; import { AbstractControl, - ControlValueAccessor, - FormArray, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, } from "@angular/forms"; import {DepositAbstractFormPresentational} from "@app/features/deposit/components/presentationals/deposit-abstract-form/deposit-abstract-form.presentational"; -import {DepositFormDescriptionDoisPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational"; import { DepositFormPublicationIdentifiers, - DepositFormPublisher, - FormComponentFormDefinitionDepositFormDoi, FormComponentFormDefinitionDepositFormPublicationIdentifiers, } from "@app/features/deposit/models/deposit-form-definition.model"; import {TranslateService} from "@ngx-translate/core"; @@ -28,17 +19,10 @@ import { Actions, Store, } from "@ngxs/store"; -import {SharedAbstractPresentational} from "@shared/components/presentationals/shared-abstract/shared-abstract.presentational"; import { - BehaviorSubject, - Observable, -} from "rxjs"; -import { - FormValidationHelper, isNotNullNorUndefined, isNullOrUndefined, NotificationService, - ObservableUtil, SolidifyValidator, } from "solidify-frontend"; @@ -57,7 +41,6 @@ import { }) export class DepositFormDescriptionPublicationIdentifierPresentational extends DepositAbstractFormPresentational { formDefinition: FormComponentFormDefinitionDepositFormPublicationIdentifiers = new FormComponentFormDefinitionDepositFormPublicationIdentifiers(); - formDefinitionDepositFormDoi: FormComponentFormDefinitionDepositFormDoi = new FormComponentFormDefinitionDepositFormDoi(); isRequired(formControl: AbstractControl, key: string): boolean { const errors = formControl.get(key).errors; @@ -67,26 +50,25 @@ export class DepositFormDescriptionPublicationIdentifierPresentational extends D constructor(private translate: TranslateService, private _store: Store, private readonly _fb: FormBuilder, - private readonly _changeDetector: ChangeDetectorRef, + protected readonly _changeDetector: ChangeDetectorRef, private readonly _actions$: Actions, private readonly _notificationService: NotificationService) { - super(); + super(_changeDetector); } static createOrBindPublicationIdentifier(_fb: FormBuilder, form: FormGroup | undefined = undefined, formDefinition: FormComponentFormDefinitionDepositFormPublicationIdentifiers, - formDefinitionDepositFormDoi: FormComponentFormDefinitionDepositFormDoi, publicationIdentifier: DepositFormPublicationIdentifiers | undefined = undefined): FormGroup { if (isNullOrUndefined(form)) { form = _fb.group({ - [formDefinition.dois]: _fb.array([ - DepositFormDescriptionDoisPresentational.createDoi(_fb, formDefinitionDepositFormDoi), - ], [SolidifyValidator]), + [formDefinition.doi]: [undefined, [SolidifyValidator]], [formDefinition.pmid]: [undefined, [SolidifyValidator]], + [formDefinition.pmcid]: [undefined, [SolidifyValidator]], [formDefinition.isbn]: [undefined, [SolidifyValidator]], + [formDefinition.issn]: [undefined, [SolidifyValidator]], [formDefinition.arxiv]: [undefined, [SolidifyValidator]], - [formDefinition.rero]: [undefined, [SolidifyValidator]], + [formDefinition.mmsid]: [undefined, [SolidifyValidator]], [formDefinition.repec]: [undefined, [SolidifyValidator]], [formDefinition.dblp]: [undefined, [SolidifyValidator]], [formDefinition.urn]: [undefined, [SolidifyValidator]], @@ -95,20 +77,17 @@ export class DepositFormDescriptionPublicationIdentifierPresentational extends D } if (isNotNullNorUndefined(publicationIdentifier)) { - publicationIdentifier.dois?.forEach(doi => { - (form.get(formDefinition.dois) as FormArray) - .push(DepositFormDescriptionDoisPresentational.createDoi(_fb, formDefinitionDepositFormDoi, doi)); - }); + form.get(formDefinition.doi).setValue(publicationIdentifier.doi); form.get(formDefinition.pmid).setValue(publicationIdentifier.pmid); + form.get(formDefinition.pmcid).setValue(publicationIdentifier.pmcid); form.get(formDefinition.isbn).setValue(publicationIdentifier.isbn); + form.get(formDefinition.issn).setValue(publicationIdentifier.issn); form.get(formDefinition.arxiv).setValue(publicationIdentifier.arxiv); - form.get(formDefinition.rero).setValue(publicationIdentifier.rero); + form.get(formDefinition.mmsid).setValue(publicationIdentifier.mmsid); form.get(formDefinition.repec).setValue(publicationIdentifier.repec); form.get(formDefinition.dblp).setValue(publicationIdentifier.dblp); form.get(formDefinition.urn).setValue(publicationIdentifier.urn); form.get(formDefinition.localNumber).setValue(publicationIdentifier.localNumber); - } else { - DepositFormDescriptionDoisPresentational.createDoi(_fb, formDefinitionDepositFormDoi); } return form; diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-publisher/deposit-form-description-publisher.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-publisher/deposit-form-description-publisher.presentational.ts index e8c36b9a3..43a6e9b22 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-publisher/deposit-form-description-publisher.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-publisher/deposit-form-description-publisher.presentational.ts @@ -55,9 +55,9 @@ export class DepositFormDescriptionPublisherPresentational extends DepositAbstra constructor(private translate: TranslateService, private _store: Store, private readonly _fb: FormBuilder, - private readonly _changeDetector: ChangeDetectorRef, + protected readonly _changeDetector: ChangeDetectorRef, private readonly _actions$: Actions, private readonly _notificationService: NotificationService) { - super(); + super(_changeDetector); } } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-description-text-language/deposit-form-description-text-language.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-description-text-language/deposit-form-description-text-language.presentational.ts index 201565ba0..a6865d85e 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-description-text-language/deposit-form-description-text-language.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-description-text-language/deposit-form-description-text-language.presentational.ts @@ -57,9 +57,9 @@ export class DepositFormDescriptionTextLanguagePresentational extends DepositAbs constructor(private translate: TranslateService, private _store: Store, private readonly _fb: FormBuilder, - private readonly _changeDetector: ChangeDetectorRef, + protected readonly _changeDetector: ChangeDetectorRef, private readonly _actions$: Actions, private readonly _notificationService: NotificationService) { - super(); + super(_changeDetector); } } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.html b/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.html index 268b1d0f5..947d082c7 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.html +++ b/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.html @@ -147,28 +147,6 @@ </ng-template> </ng-template> </ng-container> - - <ng-container *ngIf="formDefinition.isUnige as fieldName"> - <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <div *ngIf="getFormControl(fieldName) as fd" - class="is-unige" - > - <mat-label class="label">{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> - <span class="hint">{{labelTranslateEnum.thisPublicationHadAtLeastOneAuthorMemberOfUnige | translate}}</span> - <mat-radio-group *ngIf="fd" - [formControl]="fd" - class="radio-vertical" - color="primary" - > - <mat-radio-button [value]="true" - >{{labelTranslateEnum.yes | translate}}</mat-radio-button> - <mat-radio-button [value]="false" - >{{labelTranslateEnum.no | translate}}</mat-radio-button> - </mat-radio-group> - </div> - </ng-template> - </ng-container> - </div> </form> diff --git a/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.scss b/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.scss index aff9d754b..0083b1ded 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.scss +++ b/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.scss @@ -28,24 +28,4 @@ padding-top: 8px; } } - - .is-unige { - .label { - display: block; - margin-bottom: 10px; - } - - .hint { - color: $light-grey; - margin-top: -5px; - display: block; - margin-bottom: 6px; - } - - .radio-vertical { - display: grid; - grid-template-columns: 1fr; - grid-gap: 6px; - } - } } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.ts index e9f6415a9..85177aaa7 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational.ts @@ -208,12 +208,12 @@ export class DepositFormFirstStepTypePresentational extends DepositAbstractFormP return this.listRetrieveReferencesServices.find(r => !r.isGroupedInOtherMethod && r.name === importMode); } - constructor(protected readonly _changeDetectorRef: ChangeDetectorRef, + constructor(protected readonly _changeDetector: ChangeDetectorRef, protected readonly _elementRef: ElementRef, protected readonly _injector: Injector, private readonly _fb: FormBuilder, ) { - super(); + super(_changeDetector); } ngOnInit(): void { @@ -264,10 +264,6 @@ export class DepositFormFirstStepTypePresentational extends DepositAbstractFormP ); } - externalDetectChanges(): void { - this._changeDetectorRef.detectChanges(); - } - getMetadataFromService(): void { const identifier: string = this.formRetrieveReferences.get(this.formDefinitionRetrieveReferences.identifier).value; this._getMetadataFromServiceBS.next({ diff --git a/src/app/features/deposit/components/presentationals/deposit-form-fourth-step-description/deposit-form-fourth-step-description.presentational.html b/src/app/features/deposit/components/presentationals/deposit-form-fourth-step-description/deposit-form-fourth-step-description.presentational.html index e52dbbd1a..0dbcfbf4e 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-fourth-step-description/deposit-form-fourth-step-description.presentational.html +++ b/src/app/features/deposit/components/presentationals/deposit-form-fourth-step-description/deposit-form-fourth-step-description.presentational.html @@ -6,26 +6,15 @@ [titleToTranslate]="labelTranslateEnum.mainBibliographicMetadata | translate" class="panel" > - <ng-container *ngIf="formDefinition.language as fieldName"> + <ng-container *ngIf="formDefinition.languages as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <mat-form-field *ngIf="getFormControl(fieldName) as fd" - [appearance]="appearanceInputMaterial" - [floatLabel]="positionLabelInputMaterial" - solidifyTooltipOnEllipsis - > - <mat-label>{{depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName)) | translate}}</mat-label> - <mat-select [formControl]="fd" - [required]="formValidationHelper.hasRequiredField(fd)" - [solidifyValidation]="errors" - > - <mat-option *ngFor="let language of listLanguages" - [value]="language.resId" - > - {{language.labels | backtranslate}} - </mat-option> - </mat-select> - <mat-error #errors></mat-error> - </mat-form-field> + <aou-deposit-form-description-language *ngIf="getFormControl(fieldName) as fd" + #depositDescriptionLanguagePresentational + [formArray]="fd" + [listLanguages]="listLanguages" + [path]="getPath(fieldName)" + [mainFormGroup]="mainFormGroup" + ></aou-deposit-form-description-language> </ng-template> </ng-container> @@ -86,9 +75,10 @@ [formControl]="fd" [placeholderToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName))" [spaceDelimiter]="false" + [appearance]="appearanceInputMaterial" + [positionLabel]="positionLabelInputMaterial" class="keywords" > - <!-- TODO ADD LABEL FLOATING--> </solidify-keyword-input> </ng-template> </ng-container> @@ -150,10 +140,10 @@ </ng-template> </ng-container> - <ng-container *ngIf="formDefinition.dataset as fieldName"> + <ng-container *ngIf="formDefinition.datasets as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <aou-deposit-form-description-dataset *ngIf="getFormControl(fieldName) as fd" - [formGroup]="fd" + [formArray]="fd" [path]="getPath(fieldName)" [mainFormGroup]="mainFormGroup" ></aou-deposit-form-description-dataset> @@ -162,9 +152,10 @@ <ng-container *ngIf="formDefinition.publisherVersionUrl as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <!-- TODO Find rule --> <solidify-url-input-navigator *ngIf="getFormControl(fieldName) as fd" [formControl]="fd" + [positionLabel]="positionLabelInputMaterial" + [appearance]="appearanceInputMaterial" [placeholderToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName))" > </solidify-url-input-navigator> @@ -192,22 +183,6 @@ </ng-template> </ng-container> - - <ng-container *ngIf="formDefinition.citations as fieldName"> - <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <!-- TODO Find rule --> - <aou-deposit-form-description-text-language-list *ngIf="getFormControl(fieldName) as fd" - [formArray]="fd" - [labelSectionToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, getPath(fieldName))" - [labelTextToTranslate]="depositFormRuleHelper.getLabel(mainFormGroup, (getPath(fieldName) + - '.' + formDefinitionText.text))" - [listLanguages]="listLanguages" - [path]="getPath(fieldName)" - [mainFormGroup]="mainFormGroup" - ></aou-deposit-form-description-text-language-list> - </ng-template> - </ng-container> - <ng-container *ngIf="formDefinition.discipline as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <mat-form-field *ngIf="getFormControl(fieldName) as fd" @@ -262,7 +237,7 @@ </ng-template> </ng-container> - <ng-container *ngIf="formDefinition.awards as fieldName"> + <ng-container *ngIf="formDefinition.award as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> <mat-form-field *ngIf="getFormControl(fieldName) as fd" [appearance]="appearanceInputMaterial" @@ -282,7 +257,6 @@ <ng-container *ngIf="formDefinition.classifications as fieldName"> <ng-template [ngIf]="depositFormRuleHelper.shouldDisplayField(mainFormGroup, getPath(fieldName))"> - <!-- TODO Find rule --> <aou-deposit-form-description-classification *ngIf="getFormControl(fieldName) as fd" [formArray]="fd" [path]="getPath(fieldName)" diff --git a/src/app/features/deposit/components/presentationals/deposit-form-fourth-step-description/deposit-form-fourth-step-description.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-fourth-step-description/deposit-form-fourth-step-description.presentational.ts index 6f1a03127..0d51b2289 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-fourth-step-description/deposit-form-fourth-step-description.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-fourth-step-description/deposit-form-fourth-step-description.presentational.ts @@ -13,6 +13,7 @@ import { } from "@angular/forms"; import {DepositAbstractFormPresentational} from "@app/features/deposit/components/presentationals/deposit-abstract-form/deposit-abstract-form.presentational"; import {DepositFormDescriptionDatePresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-date/deposit-form-description-date.presentational"; +import {DepositFormDescriptionLanguagePresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational"; import { FormComponentFormDefinitionDepositFormTextLanguage, FormComponentFormDefinitionFirstStepType, @@ -20,7 +21,10 @@ import { FormComponentFormDefinitionMain, } from "@app/features/deposit/models/deposit-form-definition.model"; import {Language} from "@models"; -import {isNullOrUndefined} from "solidify-frontend"; +import { + isNullOrUndefined, + Override, +} from "solidify-frontend"; @Component({ selector: "aou-deposit-form-fourth-step-description", @@ -60,16 +64,20 @@ export class DepositFormFourthStepDescriptionPresentational extends DepositAbstr @ViewChild("depositDescriptionDatePresentational") readonly depositDescriptionDatePresentational: DepositFormDescriptionDatePresentational; - constructor(protected readonly _changeDetectorRef: ChangeDetectorRef, + @ViewChild("depositDescriptionLanguagePresentational") + readonly depositDescriptionLanguagePresentational: DepositFormDescriptionLanguagePresentational; + + constructor(protected readonly _changeDetector: ChangeDetectorRef, protected readonly _elementRef: ElementRef, protected readonly _injector: Injector, private readonly _fb: FormBuilder, ) { - super(); + super(_changeDetector); } + @Override() externalDetectChanges(): void { - this._changeDetectorRef.detectChanges(); + this._changeDetector.detectChanges(); this.depositDescriptionDatePresentational?.externalDetectChanges(); } } diff --git a/src/app/features/deposit/components/presentationals/deposit-form-second-step-files/deposit-form-second-step-files.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-second-step-files/deposit-form-second-step-files.presentational.ts index ef7512f52..4b5378e76 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-second-step-files/deposit-form-second-step-files.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-second-step-files/deposit-form-second-step-files.presentational.ts @@ -67,16 +67,16 @@ export class DepositFormSecondStepFilesPresentational extends DepositAbstractFor readonly ORDER_DATE_DEFAULT: Enums.Deposit.DateTypesEnum[] = [Enums.Deposit.DateTypesEnum.PUBLICATION, Enums.Deposit.DateTypesEnum.FIRST_ONLINE]; readonly ORDER_DATE_THESIS: Enums.Deposit.DateTypesEnum[] = [Enums.Deposit.DateTypesEnum.DEFENSE, Enums.Deposit.DateTypesEnum.IMPRIMATUR]; - constructor(protected readonly _changeDetectorRef: ChangeDetectorRef, + constructor(protected readonly _changeDetector: ChangeDetectorRef, protected readonly _elementRef: ElementRef, protected readonly _injector: Injector, private readonly _fb: FormBuilder, ) { - super(); + super(_changeDetector); } externalDetectChanges(): void { - this._changeDetectorRef.detectChanges(); + this._changeDetector.detectChanges(); } private computePublicationDate(): void { diff --git a/src/app/features/deposit/components/presentationals/deposit-form-third-step-contributors/deposit-form-third-step-contributors.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form-third-step-contributors/deposit-form-third-step-contributors.presentational.ts index 7c6ec71ad..6866b6fc1 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form-third-step-contributors/deposit-form-third-step-contributors.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form-third-step-contributors/deposit-form-third-step-contributors.presentational.ts @@ -28,9 +28,8 @@ import { tap, } from "rxjs/operators"; import { - isNonEmptyString, isNullOrUndefined, - SOLIDIFY_CONSTANTS, + Override, } from "solidify-frontend"; @Component({ @@ -101,16 +100,17 @@ export class DepositFormThirdStepContributorsPresentational extends DepositAbstr @ViewChild("collaborationMembersFrontendContainer") readonly collaborationMembersFrontendContainer: DepositTableContributorContainer; - constructor(protected readonly _changeDetectorRef: ChangeDetectorRef, + constructor(protected readonly _changeDetector: ChangeDetectorRef, protected readonly _elementRef: ElementRef, protected readonly _injector: Injector, private readonly _fb: FormBuilder, ) { - super(); + super(_changeDetector); } + @Override() externalDetectChanges(): void { - this._changeDetectorRef.detectChanges(); + this._changeDetector.detectChanges(); this.contributorMembersFrontendContainer?.externalDetectChanges(); this.collaborationMembersFrontendContainer?.externalDetectChanges(); } diff --git a/src/app/features/deposit/components/presentationals/deposit-form/deposit-form.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-form/deposit-form.presentational.ts index c4080b488..c092511d5 100644 --- a/src/app/features/deposit/components/presentationals/deposit-form/deposit-form.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-form/deposit-form.presentational.ts @@ -25,10 +25,11 @@ import {DepositFormDescriptionAcademicStructurePresentational} from "@app/featur import {DepositFormDescriptionClassificationPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-classification/deposit-form-description-classification.presentational"; import {DepositFormDescriptionCollectionPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-collection/deposit-form-description-collection.presentational"; import {DepositFormDescriptionContainerPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational"; +import {DepositFormDescriptionDatasetPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational"; import {DepositFormDescriptionDatePresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-date/deposit-form-description-date.presentational"; -import {DepositFormDescriptionDoisPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational"; import {DepositFormDescriptionFundingPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-funding/deposit-form-description-funding.presentational"; import {DepositFormDescriptionGroupPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-group/deposit-form-description-group.presentational"; +import {DepositFormDescriptionLanguagePresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational"; import {DepositFormDescriptionLinkPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-link/deposit-form-description-link.presentational"; import {DepositFormDescriptionPublicationIdentifierPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational"; import {DepositFormDescriptionTextLanguageListPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-text-language-list/deposit-form-description-text-language-list.presentational"; @@ -53,13 +54,12 @@ import { FormComponentFormDefinitionDepositFormClassification, FormComponentFormDefinitionDepositFormCollection, FormComponentFormDefinitionDepositFormContainer, - FormComponentFormDefinitionDepositFormContainerIdentifiers, FormComponentFormDefinitionDepositFormContributor, FormComponentFormDefinitionDepositFormDataset, FormComponentFormDefinitionDepositFormDate, - FormComponentFormDefinitionDepositFormDoi, FormComponentFormDefinitionDepositFormFunding, FormComponentFormDefinitionDepositFormGroup, + FormComponentFormDefinitionDepositFormLanguage, FormComponentFormDefinitionDepositFormLink, FormComponentFormDefinitionDepositFormPage, FormComponentFormDefinitionDepositFormPublicationIdentifiers, @@ -89,7 +89,6 @@ import { RoutesEnum, } from "@shared/enums/routes.enum"; import {Step} from "@shared/models/step.model"; -import {AouObjectUtil} from "@shared/utils/aou-object.util"; import { BehaviorSubject, Observable, @@ -139,7 +138,6 @@ export class DepositFormPresentational extends AbstractPresentational implements formDefinitionDepositFormPublisher: FormComponentFormDefinitionDepositFormPublisher = new FormComponentFormDefinitionDepositFormPublisher(); formDefinitionDepositFormDataset: FormComponentFormDefinitionDepositFormDataset = new FormComponentFormDefinitionDepositFormDataset(); formDefinitionDepositFormContainer: FormComponentFormDefinitionDepositFormContainer = new FormComponentFormDefinitionDepositFormContainer(); - formDefinitionDepositFormContainerIdentifiers: FormComponentFormDefinitionDepositFormContainerIdentifiers = new FormComponentFormDefinitionDepositFormContainerIdentifiers(); formDefinitionDepositFormLink: FormComponentFormDefinitionDepositFormLink = new FormComponentFormDefinitionDepositFormLink(); formDefinitionDepositFormFunding: FormComponentFormDefinitionDepositFormFunding = new FormComponentFormDefinitionDepositFormFunding(); formDefinitionDepositFormAcademicStructure: FormComponentFormDefinitionDepositFormAcademicStructure = new FormComponentFormDefinitionDepositFormAcademicStructure(); @@ -148,7 +146,7 @@ export class DepositFormPresentational extends AbstractPresentational implements formDefinitionDepositFormPage: FormComponentFormDefinitionDepositFormPage = new FormComponentFormDefinitionDepositFormPage(); formDefinitionDepositFormDate: FormComponentFormDefinitionDepositFormDate = new FormComponentFormDefinitionDepositFormDate(); formDefinitionDepositFormPublicationIdentifiers: FormComponentFormDefinitionDepositFormPublicationIdentifiers = new FormComponentFormDefinitionDepositFormPublicationIdentifiers(); - formDefinitionDepositFormDoi: FormComponentFormDefinitionDepositFormDoi = new FormComponentFormDefinitionDepositFormDoi(); + formDefinitionDepositFormLanguage: FormComponentFormDefinitionDepositFormLanguage = new FormComponentFormDefinitionDepositFormLanguage(); formDefinitionDepositFormContributor: FormComponentFormDefinitionDepositFormContributor = new FormComponentFormDefinitionDepositFormContributor(); form: FormGroup; @@ -366,7 +364,6 @@ export class DepositFormPresentational extends AbstractPresentational implements [this.formDefinitionFirstStepType.type]: ["", [Validators.required, SolidifyValidator]], [this.formDefinitionFirstStepType.subtype]: ["", [Validators.required, SolidifyValidator]], [this.formDefinitionFirstStepType.subSubtype]: ["", [SolidifyValidator]], - [this.formDefinitionFirstStepType.isUnige]: [undefined, [Validators.required, SolidifyValidator]], }); this.formGroupThirdStepContributors = this._fb.group({ [this.formDefinitionThirdStepContributors.contributorMembersFrontend]: this._fb.array([], [SolidifyValidator]), @@ -381,7 +378,9 @@ export class DepositFormPresentational extends AbstractPresentational implements ], [/*CustomFormValidator.minLengthArray(1), */SolidifyValidator]), }); this.formGroupFourthStepDescription = this._fb.group({ - [this.formDefinitionFourthStepDescription.language]: ["", [/*Validators.required*/, SolidifyValidator]], + [this.formDefinitionFourthStepDescription.languages]: this._fb.array([ + DepositFormDescriptionLanguagePresentational.createLanguage(this._fb, this.formDefinitionDepositFormLanguage), + ], [SolidifyValidator]), [this.formDefinitionFourthStepDescription.originalTitle]: this._fb.group({ [this.formDefinitionDepositFormTextLanguage.text]: ["", [SolidifyValidator]], [this.formDefinitionDepositFormTextLanguage.lang]: ["", [SolidifyValidator]], @@ -392,7 +391,7 @@ export class DepositFormPresentational extends AbstractPresentational implements [this.formDefinitionDepositFormPage.end]: ["", [SolidifyValidator]], [this.formDefinitionDepositFormPage.other]: ["", [SolidifyValidator]], }), - [this.formDefinitionFourthStepDescription.identifiers]: DepositFormDescriptionPublicationIdentifierPresentational.createOrBindPublicationIdentifier(this._fb, undefined, this.formDefinitionDepositFormPublicationIdentifiers, this.formDefinitionDepositFormDoi), + [this.formDefinitionFourthStepDescription.identifiers]: DepositFormDescriptionPublicationIdentifierPresentational.createOrBindPublicationIdentifier(this._fb, undefined, this.formDefinitionDepositFormPublicationIdentifiers), [this.formDefinitionFourthStepDescription.publisherVersionUrl]: ["", [SolidifyValidator]], [this.formDefinitionFourthStepDescription.abstracts]: this._fb.array([ DepositFormDescriptionTextLanguageListPresentational.createTextLanguage(this._fb, this.formDefinitionDepositFormTextLanguage), @@ -412,28 +411,18 @@ export class DepositFormPresentational extends AbstractPresentational implements DepositFormDescriptionCollectionPresentational.createCollection(this._fb, this.formDefinitionDepositFormCollection), ], [SolidifyValidator]), [this.formDefinitionFourthStepDescription.edition]: ["", [SolidifyValidator]], - [this.formDefinitionFourthStepDescription.awards]: ["", [SolidifyValidator]], - [this.formDefinitionFourthStepDescription.dataset]: this._fb.group({ - [this.formDefinitionDepositFormDataset.url]: ["", [SolidifyValidator]], - [this.formDefinitionDepositFormDataset.doi]: ["", [SolidifyValidator]], - }), - [this.formDefinitionFourthStepDescription.citations]: this._fb.array([ - DepositFormDescriptionTextLanguageListPresentational.createTextLanguage(this._fb, this.formDefinitionDepositFormTextLanguage), + [this.formDefinitionFourthStepDescription.award]: ["", [SolidifyValidator]], + [this.formDefinitionFourthStepDescription.datasets]: this._fb.array([ + DepositFormDescriptionDatasetPresentational.createDataset(this._fb, this.formDefinitionDepositFormDataset), ], [SolidifyValidator]), [this.formDefinitionFourthStepDescription.container]: this._fb.group({ [this.formDefinitionDepositFormContainer.title]: this._fb.group({ [this.formDefinitionDepositFormTextLanguage.text]: ["", [SolidifyValidator]], [this.formDefinitionDepositFormTextLanguage.lang]: ["", [SolidifyValidator]], }), - [this.formDefinitionDepositFormContainer.identifiers]: this._fb.group({ - [this.formDefinitionDepositFormContainerIdentifiers.dois]: this._fb.array([ - DepositFormDescriptionDoisPresentational.createDoi(this._fb, this.formDefinitionDepositFormDoi), - ], [SolidifyValidator]), - [this.formDefinitionDepositFormContainerIdentifiers.isbn]: ["", [SolidifyValidator]], - [this.formDefinitionDepositFormContainerIdentifiers.issn]: ["", [SolidifyValidator]], - }), [this.formDefinitionDepositFormContainer.editor]: ["", [SolidifyValidator]], - [this.formDefinitionDepositFormContainer.place]: ["", [SolidifyValidator]], + [this.formDefinitionDepositFormContainer.conferenceTitle]: ["", [SolidifyValidator]], + [this.formDefinitionDepositFormContainer.conferencePlace]: ["", [SolidifyValidator]], [this.formDefinitionDepositFormContainer.volume]: ["", [SolidifyValidator]], [this.formDefinitionDepositFormContainer.issue]: ["", [SolidifyValidator]], [this.formDefinitionDepositFormContainer.conferenceDate]: ["", [SolidifyValidator]], @@ -518,7 +507,11 @@ export class DepositFormPresentational extends AbstractPresentational implements }); } if (isNotNullNorUndefined(depositFormModel.description)) { - this.formGroupFourthStepDescription.get(this.formDefinitionFourthStepDescription.language).setValue(depositFormModel.description?.language); + depositFormModel.description?.languages?.forEach(language => { + (this.formGroupFourthStepDescription.get(this.formDefinitionFourthStepDescription.languages) as FormArray) + .push(DepositFormDescriptionLanguagePresentational.createLanguage(this._fb, this.formDefinitionDepositFormLanguage, language)); + }); + DepositFormPresentational.patchFormWithKey(this.formGroupFourthStepDescription, this.formDefinitionFourthStepDescription.originalTitle, depositFormModel.description?.originalTitle); depositFormModel.description?.dates?.forEach(date => { @@ -539,7 +532,6 @@ export class DepositFormPresentational extends AbstractPresentational implements this._fb, formControlIdentifiers, this.formDefinitionDepositFormPublicationIdentifiers, - this.formDefinitionDepositFormDoi, depositFormModel.description?.identifiers); } @@ -568,13 +560,11 @@ export class DepositFormPresentational extends AbstractPresentational implements }); this.formGroupFourthStepDescription.get(this.formDefinitionFourthStepDescription.edition).setValue(depositFormModel.description?.edition); - this.formGroupFourthStepDescription.get(this.formDefinitionFourthStepDescription.awards).setValue(depositFormModel.description?.awards); - - DepositFormPresentational.patchFormWithKey(this.formGroupFourthStepDescription, this.formDefinitionFourthStepDescription.dataset, depositFormModel.description?.dataset); + this.formGroupFourthStepDescription.get(this.formDefinitionFourthStepDescription.award).setValue(depositFormModel.description?.award); - depositFormModel.description?.citations?.forEach(citation => { - (this.formGroupFourthStepDescription.get(this.formDefinitionFourthStepDescription.citations) as FormArray) - .push(DepositFormDescriptionTextLanguageListPresentational.createTextLanguage(this._fb, this.formDefinitionDepositFormTextLanguage, citation)); + depositFormModel.description?.datasets?.forEach(dataset => { + (this.formGroupFourthStepDescription.get(this.formDefinitionFourthStepDescription.datasets) as FormArray) + .push(DepositFormDescriptionDatasetPresentational.createDataset(this._fb, this.formDefinitionDepositFormDataset, dataset)); }); if (isNotNullNorUndefined(depositFormModel.description?.container)) { @@ -583,8 +573,6 @@ export class DepositFormPresentational extends AbstractPresentational implements this._fb, formControlContainer, this.formDefinitionDepositFormContainer, - this.formDefinitionDepositFormContainerIdentifiers, - this.formDefinitionDepositFormDoi, depositFormModel.description.container); } @@ -643,7 +631,6 @@ export class DepositFormPresentational extends AbstractPresentational implements protected convertFormToDepositFormModel(): DepositFormModel { const contributors = {} as DepositFormStepContributors; contributors.isCollaboration = this.formGroupThirdStepContributors.get(this.formDefinitionThirdStepContributors.isCollaboration)?.value; - contributors.isUnige = this.formGroupThirdStepContributors.get(this.formDefinitionThirdStepContributors.isUnige)?.value; contributors.academicStructures = this.formGroupThirdStepContributors.get(this.formDefinitionThirdStepContributors.academicStructures)?.value; contributors.groups = this.formGroupThirdStepContributors.get(this.formDefinitionThirdStepContributors.groups)?.value; contributors.fundings = this.formGroupThirdStepContributors.get(this.formDefinitionThirdStepContributors.fundings)?.value; @@ -812,7 +799,7 @@ export class DepositFormPresentational extends AbstractPresentational implements if (contributors.length === 0 && collaborationsMembers.length === 0) { return ContributorUnigeCheck.NO_CONTRIBUTOR; } - const isUnigeAffiliation = this.formGroupFirstStepType.get(this.formDefinitionFirstStepType.isUnige)?.value; + const isUnigeAffiliation = true; // TODO FIND HOW TO DETEMINE THIS const isUnigeContributor = contributors.findIndex(c => isNonEmptyString(c.cnIndividu)) !== -1; const isUnigeCollaborationMember = collaborationsMembers.findIndex(c => isNonEmptyString(c.cnIndividu)) !== -1; diff --git a/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.html b/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.html index 3283a8c83..c543798e2 100644 --- a/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.html +++ b/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.html @@ -28,6 +28,12 @@ </button> </div> + <div *ngIf="(formArray.errors | isNotNullNorUndefined) && (formArray.errors['errorsFromBackend'] | isNonEmptyArray)" + class="errors" + > + <mat-error *ngFor="let error of formArray.errors['errorsFromBackend']">{{error}}</mat-error> + </div> + <button *ngIf="!readonly && !formArray.disabled" solidifyShortCuts (onEnter)="add()" diff --git a/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.scss b/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.scss index bda1c2700..b4eff513d 100644 --- a/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.scss +++ b/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.scss @@ -27,4 +27,8 @@ } } } + + .errors { + margin-bottom: 10px; + } } diff --git a/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.ts index d2ab430a0..47d642d3f 100644 --- a/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-repeatable-fields/deposit-repeatable-fields.presentational.ts @@ -1,7 +1,9 @@ import { ChangeDetectionStrategy, + ChangeDetectorRef, Component, Input, + OnInit, TemplateRef, } from "@angular/core"; import { @@ -10,6 +12,11 @@ import { FormGroup, } from "@angular/forms"; import {SharedAbstractPresentational} from "@shared/components/presentationals/shared-abstract/shared-abstract.presentational"; +import { + distinctUntilChanged, + filter, + tap, +} from "rxjs/operators"; import {BaseFormDefinition} from "solidify-frontend"; @Component({ @@ -18,7 +25,7 @@ import {BaseFormDefinition} from "solidify-frontend"; styleUrls: ["./deposit-repeatable-fields.presentational.scss"], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class DepositRepeatableFieldsPresentational extends SharedAbstractPresentational { +export class DepositRepeatableFieldsPresentational extends SharedAbstractPresentational implements OnInit { @Input() labelSectionToTranslate: string; @@ -40,10 +47,31 @@ export class DepositRepeatableFieldsPresentational extends SharedAbstractPresent @Input() fixAlignmentDeleteButton: boolean = true; - constructor(private readonly _fb: FormBuilder) { + constructor(private readonly _fb: FormBuilder, + private readonly _changeDetector: ChangeDetectorRef) { super(); } + ngOnInit(): void { + super.ngOnInit(); + + this.subscribe(this.formArray.statusChanges.pipe( + distinctUntilChanged(), + filter(status => status === "INVALID"), + tap(status => { + this._changeDetector.detectChanges(); + }), + )); + + this.subscribe(this.formArray.valueChanges.pipe( + distinctUntilChanged(), + filter(value => this.formArray.invalid), + tap(value => { + this.formArray.updateValueAndValidity(); + }), + )); + } + get getFormArrayControl(): FormGroup[] { return this.formArray.controls as FormGroup[]; } diff --git a/src/app/features/deposit/components/presentationals/deposit-summary/deposit-summary.presentational.html b/src/app/features/deposit/components/presentationals/deposit-summary/deposit-summary.presentational.html index 076264836..4e952b13f 100644 --- a/src/app/features/deposit/components/presentationals/deposit-summary/deposit-summary.presentational.html +++ b/src/app/features/deposit/components/presentationals/deposit-summary/deposit-summary.presentational.html @@ -7,10 +7,10 @@ <ng-container *ngTemplateOutlet="retrieveModelForTranslate; context: {info: typeInfo}"></ng-container> </div> - <div *ngIf="depositFormModel?.description?.language as lang" + <div *ngIf="depositFormModel?.description?.languages as languages" class="corner-info general-lang" > - {{lang}} + {{formatLanguages(languages)}} </div> <div class="title-wrapper"> @@ -20,7 +20,7 @@ ></h1> <ng-container *ngIf="depositFormModel?.type?.title?.lang as lang"> - <div *ngIf="(lang | isNonEmptyString) && lang !== depositFormModel?.description?.language" + <div *ngIf="lang | isNonEmptyString" class="corner-info title-lang" > {{lang}} diff --git a/src/app/features/deposit/components/presentationals/deposit-summary/deposit-summary.presentational.ts b/src/app/features/deposit/components/presentationals/deposit-summary/deposit-summary.presentational.ts index 3394c7bf3..f9ade1f61 100644 --- a/src/app/features/deposit/components/presentationals/deposit-summary/deposit-summary.presentational.ts +++ b/src/app/features/deposit/components/presentationals/deposit-summary/deposit-summary.presentational.ts @@ -14,8 +14,10 @@ import {DepositFormRuleHelper} from "@app/features/deposit/helpers/deposit-form- import {DocumentFileUploadHelper} from "@app/features/deposit/helpers/document-file-upload.helper"; import { DepositFormAbstractContributor, + DepositFormContainer, DepositFormDate, DepositFormFunding, + DepositFormLanguage, DepositFormModel, DepositFormText, } from "@app/features/deposit/models/deposit-form-definition.model"; @@ -222,11 +224,6 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme values: this.depositFormModel?.contributors?.groups?.map(c => (isNonEmptyString(c.name) ? c.name + " " : "") + (isNonEmptyString(c.code) ? "(" + c.code + ")" : SOLIDIFY_CONSTANTS.STRING_EMPTY)), type: TypeInfoEnum.list, }, - { - label: LabelTranslateEnum.unigeAffiliation, - value: this.depositFormModel?.contributors?.isUnige ? LabelTranslateEnum.yes : LabelTranslateEnum.no, - type: TypeInfoEnum.translate, - }, { label: LabelTranslateEnum.links, // tslint:disable-next-line:arrow-return-shorthand @@ -247,17 +244,6 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme ...this.getTranslator(this.depositFormModel?.contributors?.contributors), ...this.getCollaborationMembers(this.depositFormModel?.contributors?.contributors), ...this.getDate(this.depositFormModel?.description?.dates), - { - label: LabelTranslateEnum.citations, - // tslint:disable-next-line:arrow-return-shorthand - valuesLanguage: this.depositFormModel?.description?.citations?.map(c => { - return { - text: c.text, - lang: c.lang, - } as DepositSummaryValueLanguage; - }), - type: TypeInfoEnum.listLanguage, - }, ...this.getFundingsLists(this.depositFormModel?.contributors?.fundings), // { // label: LabelTranslateEnum.language, @@ -281,8 +267,8 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme value: this.depositFormModel?.description?.aouCollection, }, { - label: LabelTranslateEnum.awards, - value: this.depositFormModel?.description?.awards, + label: LabelTranslateEnum.award, + value: this.depositFormModel?.description?.award, }, { label: LabelTranslateEnum.edition, @@ -301,7 +287,7 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme // labelToTranslate: LabelTranslateEnum.contributors, // value: isNotNullNorUndefined(this.depositFormModel?.contributors?.collaborations) ? this.depositFormModel.contributors.collaborations?.join(", ") : SOLIDIFY_CONSTANTS.STRING_EMPTY, // }, - ...this.getDataset(), + ...this.getDatasets(), { label: LabelTranslateEnum.collections, values: this.depositFormModel?.description?.collections?.map(c => (isNonEmptyString(c.name) ? c.name + " " : "") + (isNonEmptyString(c.number) ? "(" + c.number + ")" : SOLIDIFY_CONSTANTS.STRING_EMPTY)), @@ -519,7 +505,7 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme value: publisher.name, }, { - label: LabelTranslateEnum.place, + label: LabelTranslateEnum.conferencePlace, value: publisher.place, }, ], @@ -541,25 +527,32 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme label: LabelTranslateEnum.identifier, valuesInfo: [ { - label: LabelTranslateEnum.dois, - values: identifiers?.dois?.map(d => d.doi), - type: TypeInfoEnum.list, + label: LabelTranslateEnum.doi, + values: identifiers.doi, }, { label: LabelTranslateEnum.pmid, value: identifiers.pmid, }, + { + label: LabelTranslateEnum.pmcid, + value: identifiers.pmcid, + }, { label: LabelTranslateEnum.isbn, value: identifiers.isbn, }, + { + label: LabelTranslateEnum.issn, + value: identifiers.issn, + }, { label: LabelTranslateEnum.arxiv, value: identifiers.arxiv, }, { label: LabelTranslateEnum.mmsId, - value: identifiers.rero, + value: identifiers.mmsid, }, { label: LabelTranslateEnum.repec, @@ -587,7 +580,7 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme return []; } - const container = AouObjectUtil.cleanEmptyAttributes(this.depositFormModel?.description?.container); + const container: DepositFormContainer = AouObjectUtil.cleanEmptyAttributes(this.depositFormModel?.description?.container); if (isNullOrUndefined(container)) { return []; } @@ -604,26 +597,17 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme label: LabelTranslateEnum.language, value: container.title?.lang, }, - { - label: LabelTranslateEnum.isbn, - value: container.identifiers?.isbn, - }, - { - label: LabelTranslateEnum.issn, - value: container.identifiers?.issn, - }, - { - label: LabelTranslateEnum.dois, - values: container.identifiers?.dois?.map(d => d.doi), - type: TypeInfoEnum.list, - }, { label: LabelTranslateEnum.volume, value: this.castNumberToStringIfNotUndefined(container.volume), }, { - label: LabelTranslateEnum.place, - value: container.place, + label: LabelTranslateEnum.conferenceTitle, + value: container.conferenceTitle, + }, + { + label: LabelTranslateEnum.conferencePlace, + value: container.conferencePlace, }, { label: LabelTranslateEnum.conferenceDate, @@ -662,24 +646,22 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme }]; } - private getDataset(): Info[] { - if (isNullOrUndefined(this.depositFormModel?.description?.dataset)) { + private getDatasets(): Info[] { + if (isNullOrUndefined(this.depositFormModel?.description?.datasets)) { return []; } - const dataset = AouObjectUtil.cleanEmptyAttributes(this.depositFormModel?.description?.dataset); - if (isNullOrUndefined(dataset)) { + const datasets = AouObjectUtil.cleanEmptyAttributes(this.depositFormModel?.description?.datasets); + if (isNullOrUndefined(datasets)) { return []; } - return [{ - label: LabelTranslateEnum.dataset, - link: { - text: dataset.doi, + return datasets.map(dataset => { + return { url: this._addHttpSuffixIfMissing(dataset.url), - }, - type: TypeInfoEnum.link, - }]; + text: dataset.url, + } as DepositSummaryLinkInfo; + }); } goToOrcid(orcid: string): void { @@ -697,6 +679,10 @@ export class DepositSummaryPresentational extends AbstractPresentational impleme return container + ""; } } + + formatLanguages(languages: DepositFormLanguage[]): string { + return languages.map(l => l.language).join(" | "); + } } interface Info { diff --git a/src/app/features/deposit/components/routables/deposit-list/deposit-list.routable.ts b/src/app/features/deposit/components/routables/deposit-list/deposit-list.routable.ts index f31ef97c5..12a449700 100644 --- a/src/app/features/deposit/components/routables/deposit-list/deposit-list.routable.ts +++ b/src/app/features/deposit/components/routables/deposit-list/deposit-list.routable.ts @@ -131,9 +131,7 @@ export class DepositListRoutable extends AbstractListRoutable<Deposit, DepositSt cloneDeposit.publicationYear = datePublication.map(date => this._extractYearFormDepositDate(date)).join(SOLIDIFY_CONSTANTS.COMMA + " "); } cloneDeposit.pmid = cloneDeposit?.depositFormModel?.description?.identifiers?.pmid; - if (cloneDeposit?.depositFormModel?.description?.identifiers?.dois?.length > 0) { - cloneDeposit.doi = cloneDeposit?.depositFormModel?.description?.identifiers?.dois[0].doi; - } + cloneDeposit.doi = cloneDeposit?.depositFormModel?.description?.identifiers?.doi; newList.push(cloneDeposit); } else { newList.push(deposit); diff --git a/src/app/features/deposit/deposit.module.ts b/src/app/features/deposit/deposit.module.ts index 691b6effd..3f6d42c4f 100644 --- a/src/app/features/deposit/deposit.module.ts +++ b/src/app/features/deposit/deposit.module.ts @@ -11,13 +11,12 @@ import {DepositDocumentFileUploadingPresentational} from "@app/features/deposit/ import {DepositFormDescriptionAcademicStructurePresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-academic-structure/deposit-form-description-academic-structure.presentational"; import {DepositFormDescriptionClassificationPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-classification/deposit-form-description-classification.presentational"; import {DepositFormDescriptionCollectionPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-collection/deposit-form-description-collection.presentational"; -import {DepositFormDescriptionContainerIdentifiersPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-container-identifiers/deposit-form-description-container-identifiers.presentational"; import {DepositFormDescriptionContainerPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-container/deposit-form-description-container.presentational"; import {DepositFormDescriptionDatasetPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-dataset/deposit-form-description-dataset.presentational"; import {DepositFormDescriptionDatePresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-date/deposit-form-description-date.presentational"; -import {DepositFormDescriptionDoisPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-dois/deposit-form-description-dois.presentational"; import {DepositFormDescriptionFundingPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-funding/deposit-form-description-funding.presentational"; import {DepositFormDescriptionGroupPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-group/deposit-form-description-group.presentational"; +import {DepositFormDescriptionLanguagePresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-language/deposit-form-description-language.presentational"; import {DepositFormDescriptionLinkPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-link/deposit-form-description-link.presentational"; import {DepositFormDescriptionPagePresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-page/deposit-form-description-page.presentational"; import {DepositFormDescriptionPublicationIdentifierPresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-publication-identifier/deposit-form-description-publication-identifier.presentational"; @@ -75,7 +74,6 @@ const presentationals = [ DepositFormDescriptionPublicationIdentifierPresentational, DepositFormDescriptionDatasetPresentational, DepositFormDescriptionContainerPresentational, - DepositFormDescriptionContainerIdentifiersPresentational, DepositFormDescriptionLinkPresentational, DepositFormDescriptionTextLanguageListPresentational, DepositFormDescriptionGroupPresentational, @@ -84,13 +82,12 @@ const presentationals = [ DepositFormDescriptionClassificationPresentational, DepositFormDescriptionPagePresentational, DepositFormDescriptionDatePresentational, - DepositFormDescriptionDoisPresentational, + DepositFormDescriptionLanguagePresentational, DepositContainerPresentational, DepositButtonApplyDefaultValuePresentational, DepositRepeatableFieldsPresentational, ]; -const directives = [ -]; +const directives = []; @NgModule({ declarations: [ diff --git a/src/app/features/deposit/helpers/deposit-form-rule.helper.ts b/src/app/features/deposit/helpers/deposit-form-rule.helper.ts index a2ed968e6..61b727576 100644 --- a/src/app/features/deposit/helpers/deposit-form-rule.helper.ts +++ b/src/app/features/deposit/helpers/deposit-form-rule.helper.ts @@ -5,13 +5,12 @@ import { FormComponentFormDefinitionDepositFormClassification, FormComponentFormDefinitionDepositFormCollection, FormComponentFormDefinitionDepositFormContainer, - FormComponentFormDefinitionDepositFormContainerIdentifiers, FormComponentFormDefinitionDepositFormContributor, FormComponentFormDefinitionDepositFormDataset, FormComponentFormDefinitionDepositFormDate, - FormComponentFormDefinitionDepositFormDoi, FormComponentFormDefinitionDepositFormFunding, FormComponentFormDefinitionDepositFormGroup, + FormComponentFormDefinitionDepositFormLanguage, FormComponentFormDefinitionDepositFormLink, FormComponentFormDefinitionDepositFormPage, FormComponentFormDefinitionDepositFormPublicationIdentifiers, @@ -48,10 +47,10 @@ export class DepositFormRuleHelper { private static fdFourthStepDescription: FormComponentFormDefinitionFourthStepDescription = new FormComponentFormDefinitionFourthStepDescription(); private static fdTextLanguage: FormComponentFormDefinitionDepositFormTextLanguage = new FormComponentFormDefinitionDepositFormTextLanguage(); private static fdGroup: FormComponentFormDefinitionDepositFormGroup = new FormComponentFormDefinitionDepositFormGroup(); + private static fdLanguage: FormComponentFormDefinitionDepositFormLanguage = new FormComponentFormDefinitionDepositFormLanguage(); private static fdPublisher: FormComponentFormDefinitionDepositFormPublisher = new FormComponentFormDefinitionDepositFormPublisher(); private static fdDataset: FormComponentFormDefinitionDepositFormDataset = new FormComponentFormDefinitionDepositFormDataset(); private static fdContainer: FormComponentFormDefinitionDepositFormContainer = new FormComponentFormDefinitionDepositFormContainer(); - private static fdContainerIdentifiers: FormComponentFormDefinitionDepositFormContainerIdentifiers = new FormComponentFormDefinitionDepositFormContainerIdentifiers(); private static fdLink: FormComponentFormDefinitionDepositFormLink = new FormComponentFormDefinitionDepositFormLink(); private static fdFunding: FormComponentFormDefinitionDepositFormFunding = new FormComponentFormDefinitionDepositFormFunding(); private static fdAcademicStructure: FormComponentFormDefinitionDepositFormAcademicStructure = new FormComponentFormDefinitionDepositFormAcademicStructure(); @@ -60,13 +59,12 @@ export class DepositFormRuleHelper { private static fdPage: FormComponentFormDefinitionDepositFormPage = new FormComponentFormDefinitionDepositFormPage(); private static fdDate: FormComponentFormDefinitionDepositFormDate = new FormComponentFormDefinitionDepositFormDate(); private static fdPublicationIdentifiers: FormComponentFormDefinitionDepositFormPublicationIdentifiers = new FormComponentFormDefinitionDepositFormPublicationIdentifiers(); - private static fdDoi: FormComponentFormDefinitionDepositFormDoi = new FormComponentFormDefinitionDepositFormDoi(); private static fdContributor: FormComponentFormDefinitionDepositFormContributor = new FormComponentFormDefinitionDepositFormContributor(); - static pathSusSubType: string = DepositFormRuleHelper.fdMain.type + dot + DepositFormRuleHelper.fdFirstStepType.subSubtype; // + static pathSusSubType: string = DepositFormRuleHelper.fdMain.type + dot + DepositFormRuleHelper.fdFirstStepType.subSubtype; static pathSubType: string = DepositFormRuleHelper.fdMain.type + dot + DepositFormRuleHelper.fdFirstStepType.subtype; - static pathIsUnige: string = DepositFormRuleHelper.fdMain.type + dot + DepositFormRuleHelper.fdFirstStepType.isUnige; // - static pathLanguageDocument: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.language; + static pathLanguages: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.languages; + static pathLanguagesLanguage: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.languages + dot + DepositFormRuleHelper.fdLanguage.language; static pathTitle: string = DepositFormRuleHelper.fdMain.type + dot + DepositFormRuleHelper.fdFirstStepType.title; static pathTitleText: string = DepositFormRuleHelper.fdMain.type + dot + DepositFormRuleHelper.fdFirstStepType.title + dot + DepositFormRuleHelper.fdTextLanguage.text; static pathTitleLanguage: string = DepositFormRuleHelper.fdMain.type + dot + DepositFormRuleHelper.fdFirstStepType.title + dot + DepositFormRuleHelper.fdTextLanguage.lang; @@ -78,31 +76,25 @@ export class DepositFormRuleHelper { static pathGroupName: string = DepositFormRuleHelper.fdMain.contributors + dot + DepositFormRuleHelper.fdThirdStepContributors.groups + dot + DepositFormRuleHelper.fdGroup.name; static pathGroupCode: string = DepositFormRuleHelper.fdMain.contributors + dot + DepositFormRuleHelper.fdThirdStepContributors.groups + dot + DepositFormRuleHelper.fdGroup.code; static pathIdentifier: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers; - static pathIdentifierDois: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.dois; - static pathIdentifierDoisDoi: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.dois + dot + DepositFormRuleHelper.fdDoi.doi; + static pathIdentifierDoi: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.doi; static pathIdentifierPmid: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.pmid; + static pathIdentifierPmcid: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.pmcid; static pathIdentifierIsbn: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.isbn; - static pathIdentifierIssn: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot; // + DepositFormRuleHelper.fdPublicationIdentifiers.issn; // TODO FIX moved - static pathIdentifierPmcid: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot; // + DepositFormRuleHelper.fdPublicationIdentifiers.; // TODO FIX moved + static pathIdentifierIssn: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.issn; static pathIdentifierArXiv: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.arxiv; static pathIdentifierDblp: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.dblp; static pathIdentifierRepEc: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.repec; static pathIdentifierLocalNumber: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.localNumber; - static pathIdentifierMmsid: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.rero; + static pathIdentifierMmsid: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.mmsid; static pathIdentifierUrn: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.identifiers + dot + DepositFormRuleHelper.fdPublicationIdentifiers.urn; static pathCommercialUrl: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.publisherVersionUrl; static pathContainer: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container; static pathContainerTitle: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.title; static pathContainerTitleText: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.title + dot + DepositFormRuleHelper.fdTextLanguage.text; static pathContainerTitleLanguage: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.title + dot + DepositFormRuleHelper.fdTextLanguage.lang; - static pathContainerIdentifier: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.identifiers; - static pathContainerIdentifierDois: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.identifiers + dot + DepositFormRuleHelper.fdContainerIdentifiers.dois; - static pathContainerIdentifierDoisDoi: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.identifiers + dot + DepositFormRuleHelper.fdContainerIdentifiers.dois + dot + DepositFormRuleHelper.fdDoi.doi; - static pathContainerIdentifierIsbn: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.identifiers + dot + DepositFormRuleHelper.fdContainerIdentifiers.isbn; - static pathContainerIdentifierIssn: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.identifiers + dot + DepositFormRuleHelper.fdContainerIdentifiers.issn; - static pathContainerConferenceTitle: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container; // + dot + DepositFormRuleHelper.fdContainer.title; // TODO FIX add new field + static pathContainerConferenceTitle: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.conferenceTitle; static pathContainerConferenceEditor: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.editor; - static pathContainerConferencePlace: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.place; + static pathContainerConferencePlace: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.conferencePlace; static pathContainerConferenceDate: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.conferenceDate; static pathContainerVolume: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.volume; static pathContainerIssue: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.container + dot + DepositFormRuleHelper.fdContainer.issue; @@ -128,26 +120,21 @@ export class DepositFormRuleHelper { static pathAbstractText: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.abstracts + dot + DepositFormRuleHelper.fdTextLanguage.text; static pathAbstractLanguage: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.abstracts + dot + DepositFormRuleHelper.fdTextLanguage.lang; static pathKeywords: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.keywords; - static pathJelCode: string = DepositFormRuleHelper.fdMain.description + dot; // + DepositFormRuleHelper.fdFourthStepDescription.originalTitle; // TODO Fix add new field static pathNote: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.note; - static pathAwards: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.awards; + static pathAward: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.award; static pathFunder: string = DepositFormRuleHelper.fdMain.contributors + dot + DepositFormRuleHelper.fdThirdStepContributors.fundings; static pathFunderFunder: string = DepositFormRuleHelper.fdMain.contributors + dot + DepositFormRuleHelper.fdThirdStepContributors.fundings + dot + DepositFormRuleHelper.fdFunding.funder; static pathFunderProjectName: string = DepositFormRuleHelper.fdMain.contributors + dot + DepositFormRuleHelper.fdThirdStepContributors.fundings + dot + DepositFormRuleHelper.fdFunding.name; static pathFunderProjectCode: string = DepositFormRuleHelper.fdMain.contributors + dot + DepositFormRuleHelper.fdThirdStepContributors.fundings + dot + DepositFormRuleHelper.fdFunding.code; static pathFunderProjectAcronym: string = DepositFormRuleHelper.fdMain.contributors + dot + DepositFormRuleHelper.fdThirdStepContributors.fundings + dot + DepositFormRuleHelper.fdFunding.acronym; - static pathDataset: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.dataset; - static pathDatasetUrl: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.dataset + dot + DepositFormRuleHelper.fdDataset.url; - static pathDatasetDoi: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.dataset + dot + DepositFormRuleHelper.fdDataset.doi; + static pathDatasets: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.datasets; + static pathDatasetsUrl: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.datasets + dot + DepositFormRuleHelper.fdDataset.url; static pathLinks: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.links; static pathLinksTarget: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.links + dot + DepositFormRuleHelper.fdLink.target; static pathLinksDescription: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.links + dot + DepositFormRuleHelper.fdLink.description; static pathLinksDescriptionText: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.links + dot + DepositFormRuleHelper.fdLink.description + dot + DepositFormRuleHelper.fdTextLanguage.text; static pathLinksDescriptionLanguage: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.links + dot + DepositFormRuleHelper.fdLink.description + dot + DepositFormRuleHelper.fdTextLanguage.lang; static pathLinksType: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.links + dot + DepositFormRuleHelper.fdLink.type; - static pathCitations: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.citations; - static pathCitationsText: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.citations + dot + DepositFormRuleHelper.fdTextLanguage.text; - static pathCitationsLanguage: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.citations + dot + DepositFormRuleHelper.fdTextLanguage.lang; static pathAouInternalCollection: string = DepositFormRuleHelper.fdMain.description + dot + DepositFormRuleHelper.fdFourthStepDescription.aouCollection; static pathContributorsContributors: string = DepositFormRuleHelper.fdMain.contributors + dot + DepositFormRuleHelper.fdThirdStepContributors.contributors; static pathContributorsIsCollaboration: string = DepositFormRuleHelper.fdMain.contributors + dot + DepositFormRuleHelper.fdThirdStepContributors.isCollaboration; @@ -165,8 +152,8 @@ export class DepositFormRuleHelper { return [ this.pathSubType, this.pathSusSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathTitleLanguage, @@ -178,8 +165,7 @@ export class DepositFormRuleHelper { this.pathGroupName, this.pathGroupCode, this.pathIdentifier, - this.pathIdentifierDois, - this.pathIdentifierDoisDoi, + this.pathIdentifierDoi, this.pathIdentifierPmid, this.pathIdentifierPmcid, this.pathIdentifierArXiv, @@ -206,33 +192,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.OTHER_ARTICLE: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathStructure, @@ -240,8 +221,7 @@ export class DepositFormRuleHelper { this.pathGroupName, this.pathGroupCode, this.pathIdentifier, - this.pathIdentifierDois, - this.pathIdentifierDoisDoi, + this.pathIdentifierDoi, this.pathIdentifierPmid, this.pathIdentifierPmcid, this.pathIdentifierArXiv, @@ -268,33 +248,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.JOURNAL_ISSUE: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathStructure, @@ -318,33 +293,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.COLLECTIVE_WORK: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathTitleLanguage, @@ -356,8 +326,7 @@ export class DepositFormRuleHelper { this.pathGroupName, this.pathGroupCode, this.pathIdentifier, - this.pathIdentifierDois, - this.pathIdentifierDoisDoi, + this.pathIdentifierDoi, this.pathIdentifierIsbn, this.pathIdentifierMmsid, this.pathCommercialUrl, @@ -372,33 +341,28 @@ export class DepositFormRuleHelper { this.pathPages, this.pathPagesNumberPagesArticleNumber, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.BOOK_CHAPTER: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathTitleLanguage, @@ -410,8 +374,7 @@ export class DepositFormRuleHelper { this.pathGroupName, this.pathGroupCode, this.pathIdentifier, - this.pathIdentifierDois, - this.pathIdentifierDoisDoi, + this.pathIdentifierDoi, this.pathCommercialUrl, this.pathContainer, this.pathContainerTitle, @@ -434,33 +397,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.CHAPTER_OF_PROCEEDINGS: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathTitleLanguage, @@ -472,8 +430,7 @@ export class DepositFormRuleHelper { this.pathGroupName, this.pathGroupCode, this.pathIdentifier, - this.pathIdentifierDois, - this.pathIdentifierDoisDoi, + this.pathIdentifierDoi, this.pathCommercialUrl, this.pathContainer, this.pathContainerTitle, @@ -499,33 +456,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.CONTRIBUTION_TO_A_DICTIONARY_ENCYCLOPAEDIA: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathStructure, @@ -533,8 +485,7 @@ export class DepositFormRuleHelper { this.pathGroupName, this.pathGroupCode, this.pathIdentifier, - this.pathIdentifierDois, - this.pathIdentifierDoisDoi, + this.pathIdentifierDoi, this.pathCommercialUrl, this.pathContainer, this.pathContainerTitle, @@ -557,33 +508,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.CONFERENCE_PROCEEDINGS: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathStructure, @@ -591,8 +537,7 @@ export class DepositFormRuleHelper { this.pathGroupName, this.pathGroupCode, this.pathIdentifier, - this.pathIdentifierDois, - this.pathIdentifierDoisDoi, + this.pathIdentifierDoi, this.pathIdentifierPmid, this.pathIdentifierPmcid, this.pathIdentifierArXiv, @@ -617,33 +562,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.PRESENTATION_SPEECH: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathStructure, @@ -665,34 +605,29 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, - this.pathAwards, + this.pathAward, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.POSTER: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathStructure, @@ -712,33 +647,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.THESIS: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathTitleLanguage, @@ -758,33 +688,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.PRIVATE_DOCTOR_THESIS: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathTitleLanguage, @@ -802,34 +727,29 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.MASTER_OF_ADVANCED_STUDIES: case Enums.Deposit.DepositFriendlyNameSubTypeEnum.MASTER_DEGREE: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathTitleLanguage, @@ -848,26 +768,21 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.RESEARCH_REPORT: @@ -875,8 +790,8 @@ export class DepositFormRuleHelper { case Enums.Deposit.DepositFriendlyNameSubTypeEnum.WORKING_PAPER: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathStructure, @@ -902,33 +817,28 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; case Enums.Deposit.DepositFriendlyNameSubTypeEnum.PREPRINT: return [ this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathStructure, @@ -951,34 +861,29 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectCode, this.pathFunderProjectName, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, ].indexOf(fieldPass) !== -1; default: return [ this.pathSusSubType, this.pathSubType, - this.pathIsUnige, - this.pathLanguageDocument, + this.pathLanguages, + this.pathLanguagesLanguage, this.pathTitle, this.pathTitleText, this.pathTitleLanguage, @@ -990,8 +895,7 @@ export class DepositFormRuleHelper { this.pathGroupName, this.pathGroupCode, this.pathIdentifier, - this.pathIdentifierDois, - this.pathIdentifierDoisDoi, + this.pathIdentifierDoi, this.pathIdentifierPmid, this.pathIdentifierIsbn, this.pathIdentifierPmcid, @@ -1007,11 +911,6 @@ export class DepositFormRuleHelper { this.pathContainerTitle, this.pathContainerTitleText, this.pathContainerTitleLanguage, - this.pathContainerIdentifier, - this.pathContainerIdentifierDois, - this.pathContainerIdentifierDoisDoi, - this.pathContainerIdentifierIsbn, - this.pathContainerIdentifierIssn, this.pathContainerConferenceTitle, this.pathContainerConferenceEditor, this.pathContainerConferencePlace, @@ -1037,26 +936,21 @@ export class DepositFormRuleHelper { this.pathAbstractText, this.pathAbstractLanguage, this.pathKeywords, - this.pathJelCode, this.pathNote, - this.pathAwards, + this.pathAward, this.pathFunder, this.pathFunderFunder, this.pathFunderProjectName, this.pathFunderProjectCode, this.pathFunderProjectAcronym, - this.pathDataset, - this.pathDatasetUrl, - this.pathDatasetDoi, + this.pathDatasets, + this.pathDatasetsUrl, this.pathLinks, this.pathLinksTarget, this.pathLinksDescription, this.pathLinksDescriptionText, this.pathLinksDescriptionLanguage, this.pathLinksType, - this.pathCitations, - this.pathCitationsText, - this.pathCitationsLanguage, this.pathAouInternalCollection, this.pathClassifications, this.pathClassificationsCode, @@ -1171,9 +1065,9 @@ export class DepositFormRuleHelper { return LabelTranslateEnum.subtype; case this.pathSubType: return LabelTranslateEnum.type; - case this.pathIsUnige: - return LabelTranslateEnum.unigeAffiliation; - case this.pathLanguageDocument: + case this.pathLanguages: + return LabelTranslateEnum.languages; + case this.pathLanguagesLanguage: return LabelTranslateEnum.language; case this.pathTitle: return LabelTranslateEnum.title; @@ -1197,16 +1091,14 @@ export class DepositFormRuleHelper { return LabelTranslateEnum.code; case this.pathIdentifier: return LabelTranslateEnum.publicationIdentifiers; - case this.pathIdentifierDois: - return LabelTranslateEnum.dois; - case this.pathIdentifierDoisDoi: + case this.pathIdentifierDoi: return LabelTranslateEnum.doi; case this.pathIdentifierPmid: return LabelTranslateEnum.pmid; + case this.pathIdentifierPmcid: + return LabelTranslateEnum.pmcid; case this.pathIdentifierIsbn: return LabelTranslateEnum.isbn; - case this.pathIdentifierPmcid: - return "UNDEFINED"; //LabelTranslateEnum.pmcid; case this.pathIdentifierArXiv: return LabelTranslateEnum.arxiv; case this.pathIdentifierDblp: @@ -1234,27 +1126,17 @@ export class DepositFormRuleHelper { case this.pathContainer: return LabelTranslateEnum.container; case this.pathContainerTitle: - return "UNDEFINED"; + return LabelTranslateEnum.container; case this.pathContainerTitleText: return LabelTranslateEnum.originalTitle; case this.pathContainerTitleLanguage: return LabelTranslateEnum.language; - case this.pathContainerIdentifier: - return LabelTranslateEnum.identifier; - case this.pathContainerIdentifierDois: - return LabelTranslateEnum.dois; - case this.pathContainerIdentifierDoisDoi: - return LabelTranslateEnum.doi; - case this.pathContainerIdentifierIsbn: - return LabelTranslateEnum.isbn; - case this.pathContainerIdentifierIssn: - return LabelTranslateEnum.issn; case this.pathContainerConferenceTitle: - return LabelTranslateEnum.title; + return LabelTranslateEnum.conferenceTitle; case this.pathContainerConferenceEditor: return LabelTranslateEnum.editor; case this.pathContainerConferencePlace: - return LabelTranslateEnum.place; + return LabelTranslateEnum.conferencePlace; case this.pathContainerConferenceDate: return LabelTranslateEnum.conferenceDate; case this.pathContainerVolume: @@ -1276,7 +1158,7 @@ export class DepositFormRuleHelper { case this.pathPublisher: return LabelTranslateEnum.publisher; case this.pathPublisherPlacePublication: - return LabelTranslateEnum.place; + return LabelTranslateEnum.conferencePlace; case this.pathPublisherPublishingHouse: return LabelTranslateEnum.nameLabel; case this.pathDates: @@ -1299,12 +1181,10 @@ export class DepositFormRuleHelper { return LabelTranslateEnum.language; case this.pathKeywords: return LabelTranslateEnum.keywords; - case this.pathJelCode: - return "UNDEFINED"; //LabelTranslateEnum.undefined; case this.pathNote: return LabelTranslateEnum.note; - case this.pathAwards: - return LabelTranslateEnum.awards; + case this.pathAward: + return LabelTranslateEnum.award; case this.pathFunder: return LabelTranslateEnum.funding; case this.pathFunderFunder: @@ -1315,12 +1195,10 @@ export class DepositFormRuleHelper { return LabelTranslateEnum.code; case this.pathFunderProjectAcronym: return LabelTranslateEnum.acronym; - case this.pathDataset: - return LabelTranslateEnum.dataset; - case this.pathDatasetUrl: + case this.pathDatasets: + return LabelTranslateEnum.datasets; + case this.pathDatasetsUrl: return LabelTranslateEnum.url; - case this.pathDatasetDoi: - return LabelTranslateEnum.doi; case this.pathLinks: return LabelTranslateEnum.links; case this.pathLinksTarget: @@ -1333,12 +1211,6 @@ export class DepositFormRuleHelper { return LabelTranslateEnum.language; case this.pathLinksType: return LabelTranslateEnum.type; - case this.pathCitations: - return LabelTranslateEnum.citations; - case this.pathCitationsText: - return LabelTranslateEnum.citation; - case this.pathCitationsLanguage: - return LabelTranslateEnum.language; case this.pathAouInternalCollection: return LabelTranslateEnum.collectionUnige; case this.pathClassifications: diff --git a/src/app/features/deposit/models/deposit-form-definition.model.ts b/src/app/features/deposit/models/deposit-form-definition.model.ts index e7f51e4a7..dc863c53b 100644 --- a/src/app/features/deposit/models/deposit-form-definition.model.ts +++ b/src/app/features/deposit/models/deposit-form-definition.model.ts @@ -16,7 +16,6 @@ export class FormComponentFormDefinitionFirstStepType extends BaseFormDefinition @PropertyName() type: string; @PropertyName() subtype: string; @PropertyName() subSubtype: string; - @PropertyName() isUnige: string; } export class FormComponentFormDefinitionThirdStepContributors extends BaseFormDefinition { @@ -24,14 +23,13 @@ export class FormComponentFormDefinitionThirdStepContributors extends BaseFormDe @PropertyName() contributorMembersFrontend: string; @PropertyName() collaborationMembersFrontend: string; @PropertyName() isCollaboration: string; - @PropertyName() isUnige: string; @PropertyName() academicStructures: string; @PropertyName() groups: string; @PropertyName() fundings: string; } export class FormComponentFormDefinitionFourthStepDescription extends BaseFormDefinition { - @PropertyName() language: string; + @PropertyName() languages: string; @PropertyName() dates: string; @PropertyName() originalTitle: string; @PropertyName() pages: string; @@ -46,9 +44,8 @@ export class FormComponentFormDefinitionFourthStepDescription extends BaseFormDe @PropertyName() publisher: string; @PropertyName() collections: string; @PropertyName() edition: string; - @PropertyName() awards: string; - @PropertyName() dataset: string; - @PropertyName() citations: string; + @PropertyName() award: string; + @PropertyName() datasets: string; @PropertyName() container: string; @PropertyName() links: string; @PropertyName() aouCollection: string; @@ -82,7 +79,6 @@ export interface DepositFormStepContributors { contributors: DepositFormAbstractContributor[]; contributorMembersFrontend: DepositFormContributor[]; // Only on frontend collaborationMembersFrontend: DepositFormContributor[]; // Only on frontend - isUnige: boolean; isCollaboration: boolean; academicStructures?: DepositFormAcademicStructure[]; groups?: DepositFormGroup[]; @@ -90,7 +86,7 @@ export interface DepositFormStepContributors { } export interface DepositFormStepDescription { - language: string; // "en", "fr" + languages: DepositFormLanguage[]; originalTitle?: DepositFormTextLanguage; dates: DepositFormDate[]; pages: DepositFormPage; @@ -105,9 +101,8 @@ export interface DepositFormStepDescription { publisher?: DepositFormPublisher; collections?: DepositFormCollection[]; edition?: string; - awards?: string; - dataset?: DepositFormDataset; - citations?: DepositFormText[]; + award?: string; + datasets?: DepositFormDataset[]; container?: DepositFormContainer; links?: DepositFormLink[]; aouCollection?: string; @@ -160,6 +155,14 @@ export interface DepositFormText { lang: string; // "en", "fr" } +export class FormComponentFormDefinitionDepositFormLanguage extends BaseFormDefinition { + @PropertyName() language: string; +} + +export interface DepositFormLanguage { + language: string; // "en", "fr" +} + export class FormComponentFormDefinitionDepositFormTextLanguage extends BaseFormDefinition { @PropertyName() text: string; @PropertyName() lang: string; @@ -186,11 +189,13 @@ export interface DepositFormOtherName { } export class FormComponentFormDefinitionDepositFormPublicationIdentifiers extends BaseFormDefinition { - @PropertyName() dois: string; + @PropertyName() doi: string; @PropertyName() pmid: string; + @PropertyName() pmcid: string; @PropertyName() isbn: string; + @PropertyName() issn: string; @PropertyName() arxiv: string; - @PropertyName() rero: string; + @PropertyName() mmsid: string; @PropertyName() repec: string; @PropertyName() dblp: string; @PropertyName() urn: string; @@ -198,40 +203,21 @@ export class FormComponentFormDefinitionDepositFormPublicationIdentifiers extend } export interface DepositFormPublicationIdentifiers { - dois?: DepositFormDoi[]; + doi?: string; pmid?: string; + pmcid?: string; isbn?: string; + issn?: string; arxiv?: string; - rero?: string; + mmsid?: string; repec?: string; dblp?: string; urn?: string; localNumber?: string; } -export class FormComponentFormDefinitionDepositFormContainerIdentifiers extends BaseFormDefinition { - @PropertyName() dois: string; - @PropertyName() isbn: string; - @PropertyName() issn: string; -} - -export interface DepositFormContainerIdentifiers { - dois?: DepositFormDoi[]; - isbn?: string; - issn?: string; -} - -export class FormComponentFormDefinitionDepositFormDoi extends BaseFormDefinition { - @PropertyName() doi: string; -} - -export interface DepositFormDoi { - doi: string; -} - export interface DepositFormEmbargo { accessLevel: Enums.Deposit.AccessLevelEnum; - months?: number; endDate?: Date; } @@ -261,7 +247,8 @@ export class FormComponentFormDefinitionDepositFormContainer extends BaseFormDef @PropertyName() title: string; @PropertyName() identifiers: string; @PropertyName() editor: string; - @PropertyName() place: string; + @PropertyName() conferenceTitle: string; + @PropertyName() conferencePlace: string; @PropertyName() volume: string; @PropertyName() issue: string; @PropertyName() conferenceDate: string; @@ -270,9 +257,9 @@ export class FormComponentFormDefinitionDepositFormContainer extends BaseFormDef export interface DepositFormContainer { title: DepositFormText; - identifiers?: DepositFormContainerIdentifiers; editor?: string; - place?: string; + conferenceTitle?: string; + conferencePlace?: string; volume?: number; issue?: number; conferenceDate?: string; @@ -338,13 +325,11 @@ export interface DepositFormFunding { export class FormComponentFormDefinitionDepositFormAcademicStructure extends BaseFormDefinition { @PropertyName() name: string; @PropertyName() code: string; - @PropertyName() oldCode: string; } export interface DepositFormAcademicStructure { name: string; code: string; - oldCode?: string; } export class FormComponentFormDefinitionDepositFormGroup extends BaseFormDefinition { @@ -359,10 +344,8 @@ export interface DepositFormGroup { export class FormComponentFormDefinitionDepositFormDataset extends BaseFormDefinition { @PropertyName() url: string; - @PropertyName() doi: string; } export interface DepositFormDataset { url: string; - doi: string; } diff --git a/src/app/shared/components/presentationals/shared-structure-tree/shared-structure-tree.presentational.ts b/src/app/shared/components/presentationals/shared-structure-tree/shared-structure-tree.presentational.ts index 5e8c2ff71..a63217949 100644 --- a/src/app/shared/components/presentationals/shared-structure-tree/shared-structure-tree.presentational.ts +++ b/src/app/shared/components/presentationals/shared-structure-tree/shared-structure-tree.presentational.ts @@ -143,7 +143,6 @@ export class SharedStructureTreePresentational extends SharedAbstractPresentatio resId: node.resId, status: node.status, code: node.code, - oldCode: node.oldCode, // tslint:disable-next-line } as StructuredFlatNode); @@ -164,7 +163,6 @@ export class SharedStructureTreePresentational extends SharedAbstractPresentatio name: structure.name, status: structure.status, code: structure.cStruct, - oldCode: structure.cnStructC, children: [], })); @@ -246,7 +244,6 @@ export class SharedStructureTreePresentational extends SharedAbstractPresentatio const value = { code: node.code, name: node.name, - oldCode: node.oldCode, } as DepositFormAcademicStructure; list.push(value as any); } @@ -301,7 +298,6 @@ interface StructuredFlatNode { level: number; status: Enums.Structure.StatusEnum; code: string; - oldCode: string; expandable: boolean; parent: StructuredFlatNode; } @@ -311,7 +307,6 @@ interface StructureNode { name: string; status: Enums.Structure.StatusEnum; code: string; - oldCode: string; children?: StructureNode[]; } diff --git a/src/app/shared/enums/label-translate.enum.ts b/src/app/shared/enums/label-translate.enum.ts index ff06f420f..cad058123 100644 --- a/src/app/shared/enums/label-translate.enum.ts +++ b/src/app/shared/enums/label-translate.enum.ts @@ -382,7 +382,7 @@ export class LabelTranslateEnum { static viewNumber: string = MARK_AS_TRANSLATABLE("general.label.viewNumber"); static downloadNumber: string = MARK_AS_TRANSLATABLE("general.label.downloadNumber"); static rating: string = MARK_AS_TRANSLATABLE("general.label.rating"); - static dataset: string = MARK_AS_TRANSLATABLE("general.label.dataset"); + static datasets: string = MARK_AS_TRANSLATABLE("general.label.datasets"); static policies: string = MARK_AS_TRANSLATABLE("general.label.policies"); static members: string = MARK_AS_TRANSLATABLE("general.label.members"); static guidedTour: string = MARK_AS_TRANSLATABLE("general.label.guidedTour"); @@ -452,13 +452,14 @@ export class LabelTranslateEnum { static discipline: string = MARK_AS_TRANSLATABLE("general.label.discipline"); static mandator: string = MARK_AS_TRANSLATABLE("general.label.mandator"); static edition: string = MARK_AS_TRANSLATABLE("general.label.edition"); - static awards: string = MARK_AS_TRANSLATABLE("general.label.awards"); - static place: string = MARK_AS_TRANSLATABLE("general.label.place"); + static award: string = MARK_AS_TRANSLATABLE("general.label.award"); + static conferencePlace: string = MARK_AS_TRANSLATABLE("general.label.conferencePlace"); static originalTitle: string = MARK_AS_TRANSLATABLE("general.label.originalTitle"); static editor: string = MARK_AS_TRANSLATABLE("general.label.editor"); static volume: string = MARK_AS_TRANSLATABLE("general.label.volume"); static issue: string = MARK_AS_TRANSLATABLE("general.label.issue"); static conferenceDate: string = MARK_AS_TRANSLATABLE("general.label.conferenceDate"); + static conferenceTitle: string = MARK_AS_TRANSLATABLE("general.label.conferenceTitle"); static specialIssue: string = MARK_AS_TRANSLATABLE("general.label.specialIssue"); static isbn: string = MARK_AS_TRANSLATABLE("general.label.isbn"); static issn: string = MARK_AS_TRANSLATABLE("general.label.issn"); @@ -473,7 +474,6 @@ export class LabelTranslateEnum { static funding: string = MARK_AS_TRANSLATABLE("general.label.funding"); static funders: string = MARK_AS_TRANSLATABLE("general.label.funders"); static funder: string = MARK_AS_TRANSLATABLE("general.label.funder"); - static oldCode: string = MARK_AS_TRANSLATABLE("general.label.oldCode"); static academicStructures: string = MARK_AS_TRANSLATABLE("general.label.academicStructures"); static classifications: string = MARK_AS_TRANSLATABLE("general.label.classifications"); static item: string = MARK_AS_TRANSLATABLE("general.label.item"); @@ -484,6 +484,7 @@ export class LabelTranslateEnum { static dates: string = MARK_AS_TRANSLATABLE("general.label.dates"); static dois: string = MARK_AS_TRANSLATABLE("general.label.dois"); static pmid: string = MARK_AS_TRANSLATABLE("general.label.pmid"); + static pmcid: string = MARK_AS_TRANSLATABLE("general.label.pmcid"); static arxiv: string = MARK_AS_TRANSLATABLE("general.label.arxiv"); static mmsId: string = MARK_AS_TRANSLATABLE("general.label.mmsId"); static repec: string = MARK_AS_TRANSLATABLE("general.label.repec"); diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index 81eb8a933..2c929e0fe 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -586,7 +586,7 @@ "associatedPeople": "Assoziierte Personen", "author": "general.label.author", "avatar": "Avatar", - "awards": "general.label.awards", + "award": "general.label.award", "browsing": "Browsing", "cannotPreviewWhileMovingTheFile": "Vorschau während des Verschiebens der Datei nicht möglich", "categories": "Kategorien", @@ -623,6 +623,8 @@ "completed": "Abgeschlossen", "complianceLevel": "Datenkonformitätslevel", "conferenceDate": "general.label.conferenceDate", + "conferencePlace": "general.label.conferencePlace", + "conferenceTitle": "general.label.conferenceTitle", "confirmDeleteAction": "Bestätigung des Löschvorgangs", "container": "Container", "contributor": "Beitragende", @@ -641,7 +643,7 @@ "dataCollectionEndDate": "Enddatum der Datenerhebung", "dataCollectionStartDate": "Startdatum der Datenerhebung", "dataType": "Datentyp", - "dataset": "Datensatz", + "datasets": "general.label.datasets", "date": "Datum", "dateFormatYearOrFullDate": "general.label.dateFormatYearOrFullDate", "dates": "general.label.dates", @@ -819,7 +821,6 @@ "oaiSets": "OAI-Sets", "objectNotFound": "Objekt nicht gefunden", "odConformance": "Od-Konformität", - "oldCode": "general.label.oldCode", "onOrMoreDocumentsAreInAccessControlled": "Ein oder mehrere Dokumente unterliegen einem kontrollierten Zugriff. Ein Download kann ohne vorherige Anfrage nicht durchgeführt werden.", "openLicenseId": "Lizenz-ID öffnen", "opening": "Eröffnung", @@ -845,7 +846,7 @@ "pendingArchivesOrder": "Archivierungsanfrage in Bearbeitung", "people": "Personen", "person": "Person", - "place": "general.label.place", + "pmcid": "general.label.pmcid", "pmid": "general.label.pmid", "policies": "Richtlinien", "preservationPlanning": "Planung der Datenaufbewahrung", @@ -1101,4 +1102,4 @@ "title": "Benutzerhandbuch", "tooltipClose": "Benutzerhandbuch schliessen" } -} \ No newline at end of file +} diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 5cbd1357e..7e2dc479b 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -586,7 +586,7 @@ "associatedPeople": "Associated people", "author": "Author", "avatar": "Avatar", - "awards": "Awards", + "award": "Award", "browsing": "Browsing", "cannotPreviewWhileMovingTheFile": "Cannot preview while moving the file", "categories": "Categories", @@ -623,6 +623,8 @@ "completed": "Completed", "complianceLevel": "Compliance level", "conferenceDate": "Conference date", + "conferencePlace": "Conference place", + "conferenceTitle": "Conference title", "confirmDeleteAction": "Confirm delete action", "container": "Container", "contributor": "Contributor", @@ -641,7 +643,7 @@ "dataCollectionEndDate": "Data collection end date", "dataCollectionStartDate": "Data collection start date", "dataType": "Data type", - "dataset": "Dataset", + "datasets": "Datasets", "date": "Date", "dateFormatYearOrFullDate": "dd.mm.yyyy or yyyy", "dates": "Dates", @@ -819,7 +821,6 @@ "oaiSets": "OAI Sets", "objectNotFound": "Object not found", "odConformance": "Od conformance", - "oldCode": "Code (old)", "onOrMoreDocumentsAreInAccessControlled": "One or more documents are subject to controlled access. The download cannot be carried out without an approved authorization request.", "openLicenseId": "Open license ID", "opening": "Opening", @@ -845,7 +846,7 @@ "pendingArchivesOrder": "Archive request in progress", "people": "People", "person": "Person", - "place": "Place", + "pmcid": "PMCID", "pmid": "PMID", "policies": "Policies", "preservationPlanning": "Preservation planning", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 63ea386f6..202ba911b 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -586,7 +586,7 @@ "associatedPeople": "Personnes associées", "author": "Auteur", "avatar": "Avatar", - "awards": "Prix / Award", + "award": "Prix / Award", "browsing": "En naviguant sur", "cannotPreviewWhileMovingTheFile": "Prévisualisation impossible pendant le déplacement du fichier", "categories": "Catégories", @@ -623,6 +623,8 @@ "completed": "Terminé", "complianceLevel": "Niveau de conformité", "conferenceDate": "Date de la conférence", + "conferencePlace": "Lieu de conférence", + "conferenceTitle": "Titre de la conférence", "confirmDeleteAction": "Confirmer l'action de suppression", "container": "Conteneur", "contributor": "Contributeur", @@ -641,7 +643,7 @@ "dataCollectionEndDate": "Date de fin de la collecte des données", "dataCollectionStartDate": "Date de début de la collecte des données", "dataType": "Type de données", - "dataset": "Ensemble de données", + "datasets": "Ensemble de données", "date": "Date", "dateFormatYearOrFullDate": "jj.mm.aaaa ou aaaa", "dates": "Dates", @@ -819,7 +821,6 @@ "oaiSets": "Sets OAI", "objectNotFound": "Objet non trouvé", "odConformance": "Conformité od", - "oldCode": "Code (ancien)", "onOrMoreDocumentsAreInAccessControlled": "Un ou plusieurs documents font l'objet d'un accès contrôlé, le téléchargement ne pourra être effectué sans une demande préalable.", "openLicenseId": "ID de licence ouverte", "opening": "Ouverture", @@ -845,7 +846,7 @@ "pendingArchivesOrder": "Demande d'archive en cours", "people": "Personnes", "person": "Personne", - "place": "Lieu", + "pmcid": "PMCID", "pmid": "PMID", "policies": "Politiques", "preservationPlanning": "Planification de la préservation", -- GitLab