Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1.0-maintenance
  • 1.1-maintenance
  • 2.0-maintenance
  • 2.1-maintenance
  • adf-1032-keytitle-at-issn-service
  • adf-1212-add-forgotten-publications-to-validate-into-profile
  • adf-1259-abstract-not-mandatory-for-thesis
  • adf-1393-manage-old-thesis
  • adf-1542-disable-button-to-update-publication-in-access
  • adf-1603-remove-guide-link-from-menu
  • adf-237-structures-user-icons-in-profile
  • adf-956-new-document-types
  • adf-956-new-file-type-imprimatur-and-mode-de-diffusion-for-thesis
  • aou-1542_add_button_access_bibliography_generator
  • aou-1617_create_warning_when_contributor_are_identical
  • aou-1638_change_radio_to_checkbox
  • fpo/1040_do_not_show_multiple_action_buttons_when_only_one_deposit_is_selected
  • fpo/263_flatten_the_json_format_used_by_the_frontend
  • fpo/avoid_infinite_login_loop
  • fpo/components_in_solidify
  • fpo/dark_mode_refactor
  • fpo/migration-angular-20
  • hbo-test
  • hbo_fix_dont_run_twice_http_request_autocomplete
  • jbc-new-icons
  • master
  • rodn-1767-access-level-images
  • rodn-1829-scheduled-task-to-export-to-orcid
  • rodn-admin-user-business-roles
  • rodn-labels-refactoring
  • rodn-rename-form-data
  • aou-0.0.1
  • aou-0.0.2
  • aou-0.0.3
  • aou-0.0.4
  • aou-0.0.5
  • aou-1.0.0
  • aou-1.0.1
  • aou-1.0.2
  • aou-1.0.3
  • aou-1.0.4
  • aou-1.0.5
  • aou-1.0.6
  • aou-1.1.0
  • aou-1.1.1
  • aou-1.1.2
  • aou-1.2.0-RC1
  • aou-1.2.0-RC2
  • aou-1.2.0-RC3
  • aou-1.2.0-alpha1
  • aou-2.0.0
  • aou-2.0.1
  • aou-2.0.2
  • aou-2.0.3
  • aou-2.0.4
  • aou-2.0.5
  • aou-2.0.6
  • aou-2.0.7
  • aou-2.1.0
  • aou-2.1.1
  • aou-2.1.2
  • aou-2.1.3
  • aou-2.1.4
  • aou-2.1.5
  • aou-2.1.6
  • aou-2.1.7
66 results

Target

Select target project
  • aou/aou-portal
1 result
Select Git revision
  • 1.0-maintenance
  • 1.1-maintenance
  • 2.0-maintenance
  • 2.1-maintenance
  • adf-1032-keytitle-at-issn-service
  • adf-1212-add-forgotten-publications-to-validate-into-profile
  • adf-1259-abstract-not-mandatory-for-thesis
  • adf-1393-manage-old-thesis
  • adf-1542-disable-button-to-update-publication-in-access
  • adf-1603-remove-guide-link-from-menu
  • adf-237-structures-user-icons-in-profile
  • adf-956-new-document-types
  • adf-956-new-file-type-imprimatur-and-mode-de-diffusion-for-thesis
  • aou-1542_add_button_access_bibliography_generator
  • aou-1617_create_warning_when_contributor_are_identical
  • aou-1638_change_radio_to_checkbox
  • fpo/1040_do_not_show_multiple_action_buttons_when_only_one_deposit_is_selected
  • fpo/263_flatten_the_json_format_used_by_the_frontend
  • fpo/avoid_infinite_login_loop
  • fpo/components_in_solidify
  • fpo/dark_mode_refactor
  • fpo/migration-angular-20
  • hbo-test
  • hbo_fix_dont_run_twice_http_request_autocomplete
  • jbc-new-icons
  • master
  • rodn-1767-access-level-images
  • rodn-1829-scheduled-task-to-export-to-orcid
  • rodn-admin-user-business-roles
  • rodn-labels-refactoring
  • rodn-rename-form-data
  • aou-0.0.1
  • aou-0.0.2
  • aou-0.0.3
  • aou-0.0.4
  • aou-0.0.5
  • aou-1.0.0
  • aou-1.0.1
  • aou-1.0.2
  • aou-1.0.3
  • aou-1.0.4
  • aou-1.0.5
  • aou-1.0.6
  • aou-1.1.0
  • aou-1.1.1
  • aou-1.1.2
  • aou-1.2.0-RC1
  • aou-1.2.0-RC2
  • aou-1.2.0-RC3
  • aou-1.2.0-alpha1
  • aou-2.0.0
  • aou-2.0.1
  • aou-2.0.2
  • aou-2.0.3
  • aou-2.0.4
  • aou-2.0.5
  • aou-2.0.6
  • aou-2.0.7
  • aou-2.1.0
  • aou-2.1.1
  • aou-2.1.2
  • aou-2.1.3
  • aou-2.1.4
  • aou-2.1.5
  • aou-2.1.6
  • aou-2.1.7
66 results
Show changes
Commits on Source (5)
Showing
with 89 additions and 28 deletions
......@@ -317,6 +317,12 @@ export class DepositTableContributorContainer extends SharedAbstractContainer im
createContributor(): FormGroup {
const form = DepositTableContributorContainer.getFormGroupContributor(this._fb, this.formDefinition);
this._addSubscriptionOnContributor(form);
if (this.mode === DepositTableContributorModeEnum.collaborationMembers) {
form.get(this.formDefinition.role).setValue(Enums.Deposit.RoleContributorEnum.collaborator);
return form;
}
const listRole = MemoizedUtil.listSnapshot(this._store, SharedContributorRoleState);
if (isNonEmptyArray(listRole)) {
const defaultRole = listRole[0].value;
......
......@@ -87,6 +87,10 @@ export class DepositFormDescriptionDatePresentational extends SharedAbstractPres
return this.formArray.controls as FormGroup[];
}
externalDetectChanges(): void {
this._changeDetector.detectChanges();
}
isRequired(formControl: AbstractControl, key: string): boolean {
const errors = formControl.get(key).errors;
return isNullOrUndefined(errors) ? false : errors.required;
......
......@@ -123,6 +123,7 @@
[required]="formValidationHelper.hasRequiredField(getFormControl(formDefinition.subSubtype))"
[solidifyValidation]="errors"
>
<mat-option [value]="undefined"></mat-option>
<mat-option *ngFor="let depositSubSubtype of listDepositSubSubtype"
[value]="depositSubSubtype.resId"
>
......
......@@ -47,7 +47,6 @@ import {
isNotNullNorUndefined,
isNullOrUndefined,
isTrue,
MappingObject,
MappingObjectUtil,
ObservableUtil,
SolidifyValidator,
......@@ -113,17 +112,7 @@ export class DepositFormFirstStepTypePresentational extends AbstractFormPresenta
if (isNotNullNorUndefined(this._groupSubTypeByType) && this._groupBasedOnDepositSubtypeList === this.listDepositSubtype) {
return this._groupSubTypeByType;
}
listResult = AouObjectUtil.groupBy(this.listDepositSubtype, key => this.listDepositSubtype.find(s => s.publicationType?.resId === key), "publicationType", "resId");
// const key = "publicationType";
// const subKey = "resId";
// const reducedList = this.listDepositSubtype.reduce((rv, x) => {
// (rv[x[key][subKey]] = rv[x[key][subKey]] || []).push(x);
// return rv;
// }, {});
// MappingObjectUtil.forEach(reducedList as MappingObject, (item: DepositSubtype[], typeResId: string) => {
// const type = ;
// listResult.push({type: type, subType: item});
// });
listResult = AouObjectUtil.groupBy(this.listDepositSubtype, key => this.listDepositSubtype.find(s => s.publicationType?.resId === key)?.publicationType, "publicationType", "resId");
this._groupSubTypeByType = listResult;
this._groupBasedOnDepositSubtypeList = this.listDepositSubtype;
return listResult;
......@@ -284,6 +273,10 @@ export class DepositFormFirstStepTypePresentational extends AbstractFormPresenta
);
}
externalDetectChanges(): void {
this._changeDetectorRef.detectChanges();
}
protected initNewForm(): void {
}
......
......@@ -14,6 +14,7 @@
>
<mat-label>{{labelTranslateEnum.language | translate}}</mat-label>
<mat-select [formControl]="fd"
[solidifyValidation]="errors"
[required]="formValidationHelper.hasRequiredField(fd)"
[solidifyValidation]="errors"
>
......@@ -38,6 +39,7 @@
></aou-deposit-form-description-publisher>
<aou-deposit-form-description-date *ngIf="getFormControl(formDefinition.dates) as fd"
#depositDescriptionDatePresentational
[formArray]="fd"
>
</aou-deposit-form-description-date>
......
......@@ -5,6 +5,7 @@ import {
ElementRef,
Injector,
Input,
ViewChild,
} from "@angular/core";
import {
FormArray,
......@@ -12,6 +13,7 @@ import {
FormGroup,
} from "@angular/forms";
import {FloatLabelType} from "@angular/material/form-field";
import {DepositFormDescriptionDatePresentational} from "@app/features/deposit/components/presentationals/deposit-form-description-date/deposit-form-description-date.presentational";
import {
DepositDefaultData,
FormComponentFormDefinitionFirstStepType,
......@@ -81,6 +83,9 @@ export class DepositFormFourthStepDescriptionPresentational extends AbstractForm
return IconNameEnum;
}
@ViewChild("depositDescriptionDatePresentational")
readonly depositDescriptionDatePresentational: DepositFormDescriptionDatePresentational;
constructor(protected readonly _changeDetectorRef: ChangeDetectorRef,
protected readonly _elementRef: ElementRef,
protected readonly _injector: Injector,
......@@ -89,6 +94,11 @@ export class DepositFormFourthStepDescriptionPresentational extends AbstractForm
super(_changeDetectorRef, _elementRef, _injector);
}
externalDetectChanges(): void {
this._changeDetectorRef.detectChanges();
this.depositDescriptionDatePresentational?.externalDetectChanges();
}
protected initNewForm(): void {
}
......
......@@ -62,6 +62,10 @@ export class DepositFormSecondStepFilesPresentational extends AbstractPresentati
super();
}
externalDetectChanges(): void {
this._changeDetectorRef.detectChanges();
}
protected initNewForm(): void {
}
......
......@@ -102,6 +102,10 @@ export class DepositFormThirdStepContributorsPresentational extends AbstractForm
super(_changeDetectorRef, _elementRef, _injector);
}
externalDetectChanges(): void {
this._changeDetectorRef.detectChanges();
}
protected initNewForm(): void {
}
......
......@@ -7,6 +7,7 @@
></aou-shared-stepper>
<aou-deposit-form-first-step-type *ngIf="(model | isNullOrUndefined) || step === depositStepEnum.TYPE"
#depositTypePresentational
[isCreation]="model | isNullOrUndefined"
[isImported]="isImported"
[mainFormGroup]="form"
......@@ -18,12 +19,14 @@
></aou-deposit-form-first-step-type>
<aou-deposit-form-second-step-files *ngIf="step === depositStepEnum.FILES"
#depositFilesPresentational
[mainFormGroup]="form"
[depositId]="model?.resId"
></aou-deposit-form-second-step-files>
<ng-template [ngIf]="step === depositStepEnum.CONTRIBUTORS">
<aou-deposit-form-third-step-contributors *ngIf="model | isNotNullNorUndefined"
#depositContributorsPresentational
[mainFormGroup]="form"
[subModel]="depositFormModel?.contributors"
[listStructure]="listStructure"
......
......@@ -31,8 +31,13 @@ import {DepositFormDescriptionGroupPresentational} from "@app/features/deposit/c
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";
import {GetMetadataFromServiceInfo} from "@app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational";
import {
DepositFormFirstStepTypePresentational,
GetMetadataFromServiceInfo,
} from "@app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational";
import {DepositFormFourthStepDescriptionPresentational} from "@app/features/deposit/components/presentationals/deposit-form-fourth-step-description/deposit-form-fourth-step-description.presentational";
import {DepositFormSecondStepFilesPresentational} from "@app/features/deposit/components/presentationals/deposit-form-second-step-files/deposit-form-second-step-files.presentational";
import {DepositFormThirdStepContributorsPresentational} from "@app/features/deposit/components/presentationals/deposit-form-third-step-contributors/deposit-form-third-step-contributors.presentational";
import {DepositHelper} from "@app/features/deposit/helpers/deposit.helper";
import {
DepositDefaultData,
......@@ -63,6 +68,7 @@ import {
FormComponentFormDefinitionMain,
FormComponentFormDefinitionThirdStepContributors,
} from "@app/features/deposit/models/deposit-form-definition.model";
import {ModelFormControlEventDeposit} from "@app/features/deposit/models/model-form-control-event-deposit.model";
import {Enums} from "@enums";
import {
Deposit,
......@@ -103,7 +109,6 @@ import {
isNumber,
isTrue,
MARK_AS_TRANSLATABLE,
ModelFormControlEvent,
ObservableUtil,
ScrollService,
SOLIDIFY_CONSTANTS,
......@@ -209,6 +214,15 @@ export class DepositFormPresentational extends AbstractPresentational implements
@Output("navigateToStepChange")
readonly navigateToStepObs: Observable<Enums.Deposit.StepEnum> = ObservableUtil.asObservable(this._navigateToStepBS);
@ViewChild("depositTypePresentational")
readonly depositTypePresentational: DepositFormFirstStepTypePresentational;
@ViewChild("depositFilesPresentational")
readonly depositFilesPresentational: DepositFormSecondStepFilesPresentational;
@ViewChild("depositContributorsPresentational")
readonly depositContributorsPresentational: DepositFormThirdStepContributorsPresentational;
@ViewChild("depositDescriptionPresentational")
readonly depositDescriptionPresentational: DepositFormFourthStepDescriptionPresentational;
......@@ -231,17 +245,17 @@ export class DepositFormPresentational extends AbstractPresentational implements
return Enums.Deposit.TargetRoutingAfterSaveEnum;
}
protected readonly _createBS: BehaviorSubject<ModelFormControlEvent<Deposit> | undefined> = new BehaviorSubject<ModelFormControlEvent<Deposit> | undefined>(undefined);
protected readonly _createBS: BehaviorSubject<ModelFormControlEventDeposit | undefined> = new BehaviorSubject<ModelFormControlEventDeposit | undefined>(undefined);
@Output("createChange")
readonly createObs: Observable<ModelFormControlEvent<Deposit> | undefined> = ObservableUtil.asObservable(this._createBS);
readonly createObs: Observable<ModelFormControlEventDeposit | undefined> = ObservableUtil.asObservable(this._createBS);
protected readonly _updateBS: BehaviorSubject<ModelFormControlEvent<Deposit> | undefined> = new BehaviorSubject<ModelFormControlEvent<Deposit> | undefined>(undefined);
protected readonly _updateBS: BehaviorSubject<ModelFormControlEventDeposit | undefined> = new BehaviorSubject<ModelFormControlEventDeposit | undefined>(undefined);
@Output("updateChange")
readonly updateObs: Observable<ModelFormControlEvent<Deposit> | undefined> = ObservableUtil.asObservable(this._updateBS);
readonly updateObs: Observable<ModelFormControlEventDeposit | undefined> = ObservableUtil.asObservable(this._updateBS);
protected readonly _submitBS: BehaviorSubject<ModelFormControlEvent<Deposit> | undefined> = new BehaviorSubject<ModelFormControlEvent<Deposit> | undefined>(undefined);
protected readonly _submitBS: BehaviorSubject<ModelFormControlEventDeposit | undefined> = new BehaviorSubject<ModelFormControlEventDeposit | undefined>(undefined);
@Output("submitChange")
readonly submitObs: Observable<ModelFormControlEvent<Deposit> | undefined> = ObservableUtil.asObservable(this._submitBS);
readonly submitObs: Observable<ModelFormControlEventDeposit | undefined> = ObservableUtil.asObservable(this._submitBS);
protected readonly _exitBS: BehaviorSubject<void> = new BehaviorSubject<void>(undefined);
@Output("exitChange")
......@@ -274,6 +288,10 @@ export class DepositFormPresentational extends AbstractPresentational implements
}
}
externalDetectChanges(): void {
this._changeDetectorRef.detectChanges();
}
private _defineStep(): void {
this.steps = [
{
......@@ -777,7 +795,7 @@ export class DepositFormPresentational extends AbstractPresentational implements
this._exitBS.next();
}
private _generateModelFormControlEvent(formStep: Enums.Deposit.StepEnum, targetRoutingAfterSave: Enums.Deposit.TargetRoutingAfterSaveEnum): ModelFormControlEvent<Deposit> {
private _generateModelFormControlEvent(formStep: Enums.Deposit.StepEnum, targetRoutingAfterSave: Enums.Deposit.TargetRoutingAfterSaveEnum): ModelFormControlEventDeposit {
const model = this.convertFormToDeposit();
model.formStep = formStep;
model.resId = this.model?.resId;
......@@ -787,7 +805,13 @@ export class DepositFormPresentational extends AbstractPresentational implements
formControl: this.form,
changeDetectorRef: this._changeDetectorRef,
listFieldNameToDisplayErrorInToast: [],
} as ModelFormControlEvent<Deposit>;
subFormPartDetectChanges: () => {
this.depositTypePresentational?.externalDetectChanges();
this.depositFilesPresentational?.externalDetectChanges();
this.depositContributorsPresentational?.externalDetectChanges();
this.depositDescriptionPresentational?.externalDetectChanges();
},
} as ModelFormControlEventDeposit;
}
navigateToStep(step: Enums.Deposit.StepEnum): void {
......
......@@ -14,6 +14,7 @@ import {
import {GetMetadataFromServiceInfo} from "@app/features/deposit/components/presentationals/deposit-form-first-step-type/deposit-form-first-step-type.presentational";
import {DepositFormPresentational} from "@app/features/deposit/components/presentationals/deposit-form/deposit-form.presentational";
import {DepositDefaultData} from "@app/features/deposit/models/deposit-form-definition.model";
import {ModelFormControlEventDeposit} from "@app/features/deposit/models/model-form-control-event-deposit.model";
import {DepositAction} from "@app/features/deposit/stores/deposit.action";
import {DepositState} from "@app/features/deposit/stores/deposit.state";
import {DepositDocumentFileAction} from "@app/features/deposit/stores/document-file/deposit-document-file.action";
......@@ -171,15 +172,15 @@ export class DepositCreateEditRoutable extends AbstractRoutable implements OnIni
this._store.dispatch(new Navigate([RoutesEnum.deposit]));
}
create($event: ModelFormControlEvent<Deposit>): void {
create($event: ModelFormControlEventDeposit): void {
this._store.dispatch(new DepositAction.Create($event));
}
update($event: ModelFormControlEvent<Deposit>): void {
update($event: ModelFormControlEventDeposit): void {
this._store.dispatch(new DepositAction.Update($event));
}
submit($event: ModelFormControlEvent<Deposit>): void {
submit($event: ModelFormControlEventDeposit): void {
const validationStructureId = $event.model.validationStructureId;
delete $event.model.validationStructureId;
this._store.dispatch(new DepositAction.SubmitForValidation($event.model.resId, validationStructureId));
......
import {Deposit} from "@models";
import {ModelFormControlEvent} from "solidify-frontend";
export interface ModelFormControlEventDeposit extends ModelFormControlEvent<Deposit> {
subFormPartDetectChanges: () => void;
}
import {Injectable} from "@angular/core";
import {DepositListTabEnum} from "@app/features/deposit/components/routables/deposit-list/deposit-list.routable";
import {DepositDefaultData} from "@app/features/deposit/models/deposit-form-definition.model";
import {ModelFormControlEventDeposit} from "@app/features/deposit/models/model-form-control-event-deposit.model";
import {DepositCommentAction} from "@app/features/deposit/stores/comment/deposit-comment.action";
import {
defaultDepositCommentStateModel,
......@@ -368,7 +369,7 @@ export class DepositState extends ResourceState<DepositStateModel, Deposit> {
@Action(DepositAction.Create)
create(ctx: StateContext<DepositStateModel>, action: DepositAction.Create): Observable<Deposit> {
return super.create(ctx, action).pipe(
this._catchValidationErrorsForMarkStepAsInError(ctx, action.modelFormControlEvent),
this._catchValidationErrorsForMarkStepAsInError(ctx, action.modelFormControlEvent as ModelFormControlEventDeposit),
);
}
......@@ -376,7 +377,7 @@ export class DepositState extends ResourceState<DepositStateModel, Deposit> {
@Action(DepositAction.Update)
update(ctx: StateContext<DepositStateModel>, action: DepositAction.Update): Observable<Deposit> {
return super.update(ctx, action).pipe(
this._catchValidationErrorsForMarkStepAsInError(ctx, action.modelFormControlEvent),
this._catchValidationErrorsForMarkStepAsInError(ctx, action.modelFormControlEvent as ModelFormControlEventDeposit),
);
}
......@@ -428,7 +429,7 @@ export class DepositState extends ResourceState<DepositStateModel, Deposit> {
ctx.dispatch(new Navigate([RoutesEnum.depositDetail, resId, DepositRoutesEnum.edit, nextStepName]));
}
private _catchValidationErrorsForMarkStepAsInError<T>(ctx: StateContext<DepositStateModel>, modelFormControlEvent: ModelFormControlEvent<Deposit>): MonoTypeOperatorFunction<Deposit> {
private _catchValidationErrorsForMarkStepAsInError<T>(ctx: StateContext<DepositStateModel>, modelFormControlEvent: ModelFormControlEventDeposit): MonoTypeOperatorFunction<Deposit> {
return catchError(error => {
let errorToTreat = error;
if (error instanceof SolidifyError) {
......@@ -455,6 +456,8 @@ export class DepositState extends ResourceState<DepositStateModel, Deposit> {
}
});
}
modelFormControlEvent.changeDetectorRef.detectChanges();
modelFormControlEvent.subFormPartDetectChanges();
throw error;
});
}
......