Commit 5b681e5e authored by Florent Poittevin's avatar Florent Poittevin
Browse files

refactor: regenerate new data model with open api

parent 25f426a7
......@@ -21,7 +21,7 @@
"sonar": "sonar-scanner",
"extract-translations": "ngx-translate-extract --input ./src --output ./src/assets/i18n/fr.json ./src/assets/i18n/en.json ./src/assets/i18n/de.json --clean --sort --format namespaced-json --key-as-default-value=true --format-indentation \" \" --marker TRANSLATE",
"generate-version": "ts-node --project tsconfig-ts-node.json git.version.ts",
"generate-models": "openapi-generator generate -Dmodels -DsupportingFiles -i src/assets/openapi/DLCM-APIs.json -g typescript-angular -o src/app/generated-api --additional-properties=\"ngVersion=7.2.0,providedInRoot=true,modelSuffix=,modelFileSuffix=.model,fileNaming=kebab-case,prependFormOrBodyParameters=true,modelPropertyNaming=original\" --skip-validate-spec && npm run clean-after-models-generation",
"generate-models": "rm src/app/generated-api -fr && openapi-generator generate -Dmodels -DsupportingFiles -i src/assets/openapi/DLCM-APIs.json -g typescript-angular -o src/app/generated-api --additional-properties=\"ngVersion=7.2.0,providedInRoot=true,modelSuffix=,modelFileSuffix=.model,fileNaming=kebab-case,prependFormOrBodyParameters=true,modelPropertyNaming=original\" --skip-validate-spec && npm run clean-after-models-generation",
"clean-after-models-generation": "cd src/app/generated-api && rm -fr .openapi-generator .gitignore .openapi-generator-ignore git_push.sh api api.module.ts configuration.ts encoder.ts index.ts variables.ts README.md && cp ../../assets/openapi/index-ts-to-copy.txt index.ts && cp ../../assets/openapi/README-txt-to-copy.txt README.txt",
"build:sourcemaps": "ng build --prod --sourceMap --base-href /",
"serve:prod": "http-server dist/DLCM-Frontend -o -a localhost -p 8000",
......
......@@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
import {adminInstitutionActionNameSpace} from "@app/features/admin/stores/institution/admin-institution.action";
import {AdminInstitutionStateModel} from "@app/features/admin/stores/institution/admin-institution.state";
import {Institutions} from "@app/generated-api";
import {Institution} from "@app/generated-api";
import {SharedAbstractDeleteDialog} from "@app/shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {DeleteDialog} from "@app/shared/models/delete-dialog.model";
......@@ -15,7 +15,7 @@ import {TRANSLATE} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminInstitutionDeleteDialog extends SharedAbstractDeleteDialog<Institutions, AdminInstitutionStateModel> {
export class AdminInstitutionDeleteDialog extends SharedAbstractDeleteDialog<Institution, AdminInstitutionStateModel> {
public readonly KEY_TITLE: string = TRANSLATE("admin.institution.dialog.delete.title");
public readonly KEY_MESSAGE: string = TRANSLATE("admin.institution.dialog.delete.message");
public readonly KEY_CONFIRM_BUTTON: string = TRANSLATE("admin.institution.dialog.delete.confirm");
......
......@@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
import {adminLicenseActionNameSpace} from "@app/features/admin/stores/license/admin-license.action";
import {AdminLicenseStateModel} from "@app/features/admin/stores/license/admin-license.state";
import {Licenses} from "@app/generated-api";
import {License} from "@app/generated-api";
import {SharedAbstractDeleteDialog} from "@app/shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {DeleteDialog} from "@app/shared/models/delete-dialog.model";
......@@ -15,7 +15,7 @@ import {TRANSLATE} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminLicenseDeleteDialog extends SharedAbstractDeleteDialog<Licenses, AdminLicenseStateModel> {
export class AdminLicenseDeleteDialog extends SharedAbstractDeleteDialog<License, AdminLicenseStateModel> {
public readonly KEY_TITLE: string = TRANSLATE("admin.license.dialog.delete.title");
public readonly KEY_MESSAGE: string = TRANSLATE("admin.license.dialog.delete.message");
public readonly KEY_CONFIRM_BUTTON: string = TRANSLATE("admin.license.dialog.delete.confirm");
......
import {ChangeDetectionStrategy, Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
import {Oauth2Clients} from "@app/generated-api";
import {adminOAuth2ClientActionNameSpace} from "@app/features/admin/stores/oauth2-client/admin-oauth2-client.action";
import {AdminOAuth2ClientStateModel} from "@app/features/admin/stores/oauth2-client/admin-oauth2-client.state";
import {Oauth2Client} from "@app/generated-api";
import {SharedAbstractDeleteDialog} from "@app/shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {DeleteDialog} from "@app/shared/models/delete-dialog.model";
import {Store} from "@ngxs/store";
import {TRANSLATE} from "solidify-frontend";
import {AdminOAuth2ClientStateModel} from "@app/features/admin/stores/oauth2-client/admin-oauth2-client.state";
import {adminOAuth2ClientActionNameSpace} from "@app/features/admin/stores/oauth2-client/admin-oauth2-client.action";
@Component({
selector: "dlcm-admin-orgunit-delete-dialog",
......@@ -15,7 +15,7 @@ import {adminOAuth2ClientActionNameSpace} from "@app/features/admin/stores/oauth
styleUrls: ["../../../../../shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminOauth2ClientDeleteDialog extends SharedAbstractDeleteDialog<Oauth2Clients, AdminOAuth2ClientStateModel> {
export class AdminOauth2ClientDeleteDialog extends SharedAbstractDeleteDialog<Oauth2Client, AdminOAuth2ClientStateModel> {
public readonly KEY_TITLE: string = TRANSLATE("admin.oauth2.dialog.delete.title");
public readonly KEY_MESSAGE: string = TRANSLATE("admin.oauth2.dialog.delete.message");
public readonly KEY_CONFIRM_BUTTON: string = TRANSLATE("admin.oauth2.dialog.delete.confirm");
......
......@@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
import {adminOrgUnitActionNameSpace} from "@app/features/admin/stores/organizational-unit/admin-organizational-unit.action";
import {AdminOrganizationalUnitStateModel} from "@app/features/admin/stores/organizational-unit/admin-organizational-unit.state";
import {OrganizationalUnits} from "@app/generated-api";
import {OrganizationalUnitExtended} from "@app/features/deposit/models/organizational-unit-extended.model";
import {SharedAbstractDeleteDialog} from "@app/shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {DeleteDialog} from "@app/shared/models/delete-dialog.model";
......@@ -15,7 +15,7 @@ import {TRANSLATE} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminOrgunitDeleteDialog extends SharedAbstractDeleteDialog<OrganizationalUnits, AdminOrganizationalUnitStateModel> {
export class AdminOrgunitDeleteDialog extends SharedAbstractDeleteDialog<OrganizationalUnitExtended, AdminOrganizationalUnitStateModel> {
public readonly KEY_TITLE: string = TRANSLATE("admin.organizationalUnit.dialog.delete.title");
public readonly KEY_MESSAGE: string = TRANSLATE("admin.organizationalUnit.dialog.delete.message");
public readonly KEY_CONFIRM_BUTTON: string = TRANSLATE("admin.organizationalUnit.dialog.delete.confirm");
......
......@@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
import {adminPreservationPolicyActionNameSpace} from "@app/features/admin/stores/preservation-policy/admin-preservation-policy.action";
import {AdminPreservationPolicyStateModel} from "@app/features/admin/stores/preservation-policy/admin-preservation-policy.state";
import {PreservationPolicies} from "@app/generated-api";
import {PreservationPolicy} from "@app/generated-api";
import {SharedAbstractDeleteDialog} from "@app/shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {DeleteDialog} from "@app/shared/models/delete-dialog.model";
......@@ -15,7 +15,7 @@ import {TRANSLATE} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminPreservationPolicyDeleteDialog extends SharedAbstractDeleteDialog<PreservationPolicies, AdminPreservationPolicyStateModel> {
export class AdminPreservationPolicyDeleteDialog extends SharedAbstractDeleteDialog<PreservationPolicy, AdminPreservationPolicyStateModel> {
public readonly KEY_TITLE: string = TRANSLATE("admin.preservationPolicy.dialog.delete.title");
public readonly KEY_MESSAGE: string = TRANSLATE("admin.preservationPolicy.dialog.delete.message");
public readonly KEY_CONFIRM_BUTTON: string = TRANSLATE("admin.preservationPolicy.dialog.delete.confirm");
......
......@@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
import {adminSubmissionPolicyActionNameSpace} from "@app/features/admin/stores/submission-policy/admin-submission-policy.action";
import {AdminSubmissionPolicyStateModel} from "@app/features/admin/stores/submission-policy/admin-submission-policy.state";
import {SubmissionPolicies} from "@app/generated-api";
import {SubmissionPolicy} from "@app/generated-api";
import {SharedAbstractDeleteDialog} from "@app/shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {DeleteDialog} from "@app/shared/models/delete-dialog.model";
......@@ -15,7 +15,7 @@ import {TRANSLATE} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminSubmissionPolicyDeleteDialog extends SharedAbstractDeleteDialog<SubmissionPolicies, AdminSubmissionPolicyStateModel> {
export class AdminSubmissionPolicyDeleteDialog extends SharedAbstractDeleteDialog<SubmissionPolicy, AdminSubmissionPolicyStateModel> {
public readonly KEY_TITLE: string = TRANSLATE("admin.submissionPolicy.dialog.delete.title");
public readonly KEY_MESSAGE: string = TRANSLATE("admin.submissionPolicy.dialog.delete.message");
public readonly KEY_CONFIRM_BUTTON: string = TRANSLATE("admin.submissionPolicy.dialog.delete.confirm");
......
import {ChangeDetectionStrategy, Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
import {UserExtended} from "@app/features/admin/models/user-extended.model";
import {adminUserActionNameSpace} from "@app/features/admin/stores/user/admin-user.action";
import {AdminUserStateModel} from "@app/features/admin/stores/user/admin-user.state";
import {SharedAbstractDeleteDialog} from "@app/shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {DeleteDialog} from "@app/shared/models/delete-dialog.model";
import {Store} from "@ngxs/store";
import {TRANSLATE} from "solidify-frontend";
import {AdminUserStateModel} from "@app/features/admin/stores/user/admin-user.state";
import {adminUserActionNameSpace} from "@app/features/admin/stores/user/admin-user.action";
import {UsersExtended} from "@app/features/admin/models/user-extended.model";
@Component({
selector: "dlcm-user-delete-dialog",
......@@ -15,7 +15,7 @@ import {UsersExtended} from "@app/features/admin/models/user-extended.model";
styleUrls: ["../../../../../shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminUserDeleteDialog extends SharedAbstractDeleteDialog<UsersExtended, AdminUserStateModel> {
export class AdminUserDeleteDialog extends SharedAbstractDeleteDialog<UserExtended, AdminUserStateModel> {
public readonly KEY_TITLE: string = TRANSLATE("admin.user.dialog.delete.title");
public readonly KEY_MESSAGE: string = TRANSLATE("admin.user.dialog.delete.message");
public readonly KEY_CONFIRM_BUTTON: string = TRANSLATE("admin.user.dialog.delete.confirm");
......
import {ChangeDetectionStrategy, ChangeDetectorRef, Component} from "@angular/core";
import {FormBuilder, Validators} from "@angular/forms";
import {Institutions} from "@app/generated-api";
import {Institution} from "@app/generated-api";
import {SharedAbstractFormPresentational} from "@app/shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {BaseFormDefinition} from "@app/shared/models/base-form-definition.model";
import {PropertyName, SolidifyValidator} from "solidify-frontend";
......@@ -11,7 +11,7 @@ import {PropertyName, SolidifyValidator} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminInstitutionFormPresentational extends SharedAbstractFormPresentational<Institutions> {
export class AdminInstitutionFormPresentational extends SharedAbstractFormPresentational<Institution> {
public formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
constructor(protected readonly _changeDetectorRef: ChangeDetectorRef,
......@@ -27,7 +27,7 @@ export class AdminInstitutionFormPresentational extends SharedAbstractFormPresen
});
}
protected bindFormTo(institutions: Institutions): void {
protected bindFormTo(institutions: Institution): void {
this.form = this._fb.group({
[this.formDefinition.name]: [institutions.name, [Validators.required, SolidifyValidator]],
[this.formDefinition.url]: [institutions.url, [SolidifyValidator]],
......@@ -35,7 +35,7 @@ export class AdminInstitutionFormPresentational extends SharedAbstractFormPresen
});
}
protected treatmentBeforeSubmit(institutions: Institutions): Institutions {
protected treatmentBeforeSubmit(institutions: Institution): Institution {
return institutions;
}
}
......
import {ChangeDetectionStrategy, ChangeDetectorRef, Component} from "@angular/core";
import {FormBuilder, Validators} from "@angular/forms";
import {Licenses} from "@app/generated-api";
import {License} from "@app/generated-api";
import {SharedAbstractFormPresentational} from "@app/shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {odConformanceEnum, osdConformanceEnum} from "@app/shared/enums/license.enums";
import {BaseFormDefinition} from "@app/shared/models/base-form-definition.model";
......@@ -12,13 +12,13 @@ import {PropertyName, SolidifyValidator} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminLicenseFormPresentational extends SharedAbstractFormPresentational<Licenses> {
export class AdminLicenseFormPresentational extends SharedAbstractFormPresentational<License> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
get licensesStatusEnum(): Licenses.StatusEnum[] {
return [Licenses.StatusEnum.Active,
Licenses.StatusEnum.Retired,
Licenses.StatusEnum.Superseded];
get licensesStatusEnum(): License.StatusEnum[] {
return [License.StatusEnum.Active,
License.StatusEnum.Retired,
License.StatusEnum.Superseded];
}
get licenseOdConformanceEnum(): odConformanceEnum[] {
......@@ -48,7 +48,7 @@ export class AdminLicenseFormPresentational extends SharedAbstractFormPresentati
[this.formDefinition.maintainer]: ["", [SolidifyValidator]],
[this.formDefinition.odConformance]: ["", [SolidifyValidator]],
[this.formDefinition.osdConformance]: ["", [SolidifyValidator]],
[this.formDefinition.status]: [Licenses.StatusEnum.Retired, [SolidifyValidator]],
[this.formDefinition.status]: [License.StatusEnum.Retired, [SolidifyValidator]],
[this.formDefinition.isGeneric]: [false, [SolidifyValidator]],
[this.formDefinition.family]: ["", [SolidifyValidator]],
[this.formDefinition.domainContent]: [false, [SolidifyValidator]],
......@@ -57,7 +57,7 @@ export class AdminLicenseFormPresentational extends SharedAbstractFormPresentati
});
}
protected bindFormTo(licenses: Licenses): void {
protected bindFormTo(licenses: License): void {
this.form = this._fb.group({
[this.formDefinition.title]: [licenses.title, [Validators.required, SolidifyValidator]],
[this.formDefinition.openLicenseId]: [licenses.openLicenseId, [Validators.required, SolidifyValidator]],
......@@ -74,7 +74,7 @@ export class AdminLicenseFormPresentational extends SharedAbstractFormPresentati
});
}
protected treatmentBeforeSubmit(licenses: Licenses): Licenses {
protected treatmentBeforeSubmit(licenses: License): License {
return licenses;
}
......
import {SharedAbstractFormPresentational} from "@app/shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {Oauth2Clients} from "@app/generated-api";
import {ChangeDetectionStrategy, ChangeDetectorRef, Component} from "@angular/core";
import {FormArray, FormBuilder, Validators} from "@angular/forms";
import {Oauth2Client} from "@app/generated-api";
import {SharedAbstractFormPresentational} from "@app/shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {BaseFormDefinition} from "@app/shared/models/base-form-definition.model";
import {PropertyName, SolidifyValidator} from "solidify-frontend";
import {FormArray, FormBuilder, Validators} from "@angular/forms";
@Component({
selector: "dlcm-admin-oauth-form",
......@@ -11,7 +11,7 @@ import {FormArray, FormBuilder, Validators} from "@angular/forms";
styleUrls: ["../../../../../shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminOAtuh2ClientFormPresentational extends SharedAbstractFormPresentational<Oauth2Clients> {
export class AdminOAtuh2ClientFormPresentational extends SharedAbstractFormPresentational<Oauth2Client> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
public availableGrantTypes: any[] = [...Object.values(GrantTypesEnum)];
hide: boolean = true;
......@@ -21,7 +21,7 @@ export class AdminOAtuh2ClientFormPresentational extends SharedAbstractFormPrese
super(_changeDetectorRef);
}
protected bindFormTo(oauth2Client: Oauth2Clients): void {
protected bindFormTo(oauth2Client: Oauth2Client): void {
this.form = this._fb.group({
[this.formDefinition.name]: [oauth2Client.name, [Validators.required, SolidifyValidator]],
[this.formDefinition.clientId]: [oauth2Client.clientId, [Validators.required, SolidifyValidator]],
......@@ -30,7 +30,7 @@ export class AdminOAtuh2ClientFormPresentational extends SharedAbstractFormPrese
[this.formDefinition.scope]: [oauth2Client.scope, [Validators.required, SolidifyValidator]],
[this.formDefinition.grantTypes]: [this.prefillGrantSelection(this.availableGrantTypes, oauth2Client.grantTypes)],
[this.formDefinition.accessTokenValiditySeconds]: [oauth2Client.accessTokenValiditySeconds, [Validators.required, SolidifyValidator]],
[this.formDefinition.refreshTokenValiditySeconds]: [oauth2Client.refreshTokenValiditySeconds, [Validators.required, SolidifyValidator]]
[this.formDefinition.refreshTokenValiditySeconds]: [oauth2Client.refreshTokenValiditySeconds, [Validators.required, SolidifyValidator]],
});
}
......@@ -43,7 +43,7 @@ export class AdminOAtuh2ClientFormPresentational extends SharedAbstractFormPrese
[this.formDefinition.scope]: ["", [Validators.required, SolidifyValidator]],
[this.formDefinition.grantTypes]: [this.mapToCheckboxArrayGroup(this.availableGrantTypes)],
[this.formDefinition.accessTokenValiditySeconds]: [84600, [Validators.required, SolidifyValidator]],
[this.formDefinition.refreshTokenValiditySeconds]: [84600, [Validators.required, SolidifyValidator]]
[this.formDefinition.refreshTokenValiditySeconds]: [84600, [Validators.required, SolidifyValidator]],
});
}
......@@ -51,7 +51,7 @@ export class AdminOAtuh2ClientFormPresentational extends SharedAbstractFormPrese
return this.form.controls.grantTypes.value as FormArray;
}
protected treatmentBeforeSubmit(oauth2Client: Oauth2Clients): Oauth2Clients {
protected treatmentBeforeSubmit(oauth2Client: Oauth2Client): Oauth2Client {
const grantTypes = this.form.controls.grantTypes.value.controls as FormArray [];
const selectedArray: string [] = [];
grantTypes.map((formCtrl) => {
......@@ -73,7 +73,7 @@ export class AdminOAtuh2ClientFormPresentational extends SharedAbstractFormPrese
return this._fb.array(data.map((i) =>
this._fb.group({
name: i,
selected: false
selected: false,
})));
}
......@@ -81,7 +81,7 @@ export class AdminOAtuh2ClientFormPresentational extends SharedAbstractFormPrese
return this._fb.array(data.map((i) =>
this._fb.group({
name: i,
selected: selectedGrantTypes.includes(i)
selected: selectedGrantTypes.includes(i),
})));
}
......
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input} from "@angular/core";
import {FormBuilder, Validators} from "@angular/forms";
import {OrganizationalUnitsExtended} from "@app/features/deposit/models/organizational-unit-extended.model";
import {OrganizationalUnits, PreservationPolicies, SubmissionPolicies} from "@app/generated-api";
import {OrganizationalUnitExtended} from "@app/features/deposit/models/organizational-unit-extended.model";
import {PreservationPolicy, SubmissionPolicy} from "@app/generated-api";
import {SharedAbstractFormPresentational} from "@app/shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {LocalModelAttributeEnum} from "@app/shared/enums/model-attribute.enum";
import {BaseFormDefinition} from "@app/shared/models/base-form-definition.model";
......@@ -14,20 +14,20 @@ import {DateUtil, PropertyName, SolidifyValidator} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminOrgunitFormPresentational extends SharedAbstractFormPresentational<OrganizationalUnits> {
export class AdminOrgunitFormPresentational extends SharedAbstractFormPresentational<OrganizationalUnitExtended> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
@Input()
selectedSubmissionPolicies: SubmissionPolicies[];
selectedSubmissionPolicies: SubmissionPolicy[];
@Input()
selectedPreservationPolicies: PreservationPolicies[];
selectedPreservationPolicies: PreservationPolicy[];
@Input()
listSubmissionPolicies: SubmissionPolicies[];
listSubmissionPolicies: SubmissionPolicy[];
@Input()
listPreservationPolicies: PreservationPolicies[];
listPreservationPolicies: PreservationPolicy[];
constructor(protected readonly _changeDetectorRef: ChangeDetectorRef,
private readonly _fb: FormBuilder) {
......@@ -49,7 +49,7 @@ export class AdminOrgunitFormPresentational extends SharedAbstractFormPresentati
});
}
protected bindFormTo(organizationalUnit: OrganizationalUnitsExtended): void {
protected bindFormTo(organizationalUnit: OrganizationalUnitExtended): void {
this.form = this._fb.group({
[this.formDefinition.name]: [organizationalUnit.name, [Validators.required, SolidifyValidator]],
[this.formDefinition.description]: [organizationalUnit.description, [SolidifyValidator]],
......@@ -64,7 +64,7 @@ export class AdminOrgunitFormPresentational extends SharedAbstractFormPresentati
});
}
protected treatmentBeforeSubmit(organizationalUnit: OrganizationalUnitsExtended | any): OrganizationalUnitsExtended {
protected treatmentBeforeSubmit(organizationalUnit: OrganizationalUnitExtended | any): OrganizationalUnitExtended {
organizationalUnit.openingDate = DateUtil.convertToLocalDateDateSimple(organizationalUnit.openingDate);
organizationalUnit.closingDate = DateUtil.convertToLocalDateDateSimple(organizationalUnit.closingDate);
organizationalUnit.defaultSubmissionPolicy = {resId: organizationalUnit[this.formDefinition.defaultSubmissionPolicy]};
......
import {ChangeDetectionStrategy, ChangeDetectorRef, Component} from "@angular/core";
import {FormBuilder, Validators} from "@angular/forms";
import {PreservationPolicies} from "@app/generated-api";
import {PreservationPolicy} from "@app/generated-api";
import {SharedAbstractFormPresentational} from "@app/shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {BaseFormDefinition} from "@app/shared/models/base-form-definition.model";
import {PropertyName, SolidifyValidator} from "solidify-frontend";
......@@ -11,7 +11,7 @@ import {PropertyName, SolidifyValidator} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminPreservationPolicyFormPresentational extends SharedAbstractFormPresentational<PreservationPolicies> {
export class AdminPreservationPolicyFormPresentational extends SharedAbstractFormPresentational<PreservationPolicy> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
constructor(protected readonly _changeDetectorRef: ChangeDetectorRef,
......@@ -19,7 +19,7 @@ export class AdminPreservationPolicyFormPresentational extends SharedAbstractFor
super(_changeDetectorRef);
}
protected bindFormTo(preservationPolicies: PreservationPolicies): void {
protected bindFormTo(preservationPolicies: PreservationPolicy): void {
this.form = this._fb.group({
[this.formDefinition.name]: [preservationPolicies.name, [Validators.required, SolidifyValidator]],
[this.formDefinition.dispositionApproval]: [preservationPolicies.dispositionApproval, [SolidifyValidator]],
......@@ -35,7 +35,7 @@ export class AdminPreservationPolicyFormPresentational extends SharedAbstractFor
});
}
protected treatmentBeforeSubmit(preservationPolicies: PreservationPolicies): PreservationPolicies {
protected treatmentBeforeSubmit(preservationPolicies: PreservationPolicy): PreservationPolicy {
return preservationPolicies;
}
......
import {ChangeDetectionStrategy, ChangeDetectorRef, Component} from "@angular/core";
import {FormBuilder, Validators} from "@angular/forms";
import {SubmissionPolicies} from "@app/generated-api";
import {SubmissionPolicy} from "@app/generated-api";
import {SharedAbstractFormPresentational} from "@app/shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {BaseFormDefinition} from "@app/shared/models/base-form-definition.model";
import {PropertyName, SolidifyValidator} from "solidify-frontend";
......@@ -11,7 +11,7 @@ import {PropertyName, SolidifyValidator} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminSubmissionPolicyFormPresentational extends SharedAbstractFormPresentational<SubmissionPolicies> {
export class AdminSubmissionPolicyFormPresentational extends SharedAbstractFormPresentational<SubmissionPolicy> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
constructor(protected readonly _changeDetectorRef: ChangeDetectorRef,
......@@ -27,7 +27,7 @@ export class AdminSubmissionPolicyFormPresentational extends SharedAbstractFormP
});
}
protected bindFormTo(submissionPolicies: SubmissionPolicies): void {
protected bindFormTo(submissionPolicies: SubmissionPolicy): void {
this.form = this._fb.group({
[this.formDefinition.name]: [submissionPolicies.name, [Validators.required, SolidifyValidator]],
[this.formDefinition.submissionApproval]: [submissionPolicies.submissionApproval, [SolidifyValidator]],
......@@ -35,7 +35,7 @@ export class AdminSubmissionPolicyFormPresentational extends SharedAbstractFormP
});
}
protected treatmentBeforeSubmit(submissionPolicies: SubmissionPolicies): SubmissionPolicies {
protected treatmentBeforeSubmit(submissionPolicies: SubmissionPolicy): SubmissionPolicy {
return submissionPolicies;
}
}
......
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input} from "@angular/core";
import {FormArray, FormBuilder, Validators} from "@angular/forms";
import {UsersExtended} from "@app/features/admin/models/user-extended.model";
import {OrganizationalUnitsExtended} from "@app/features/deposit/models/organizational-unit-extended.model";
import {ApplicationRoles, People} from "@app/generated-api";
import {UserExtended} from "@app/features/admin/models/user-extended.model";
import {AccessOrganizationalUnit, ApplicationRole, Person} from "@app/generated-api";
import {SharedAbstractFormPresentational} from "@app/shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {UserApplicationRoleEnum} from "@app/shared/enums/user-application-role.enum";
import {BaseFormDefinition} from "@app/shared/models/base-form-definition.model";
......@@ -14,23 +13,23 @@ import {isNullOrUndefined, PropertyName, SolidifyValidator} from "solidify-front
styleUrls: ["../../../../../shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminUserForm extends SharedAbstractFormPresentational<UsersExtended> {
export class AdminUserForm extends SharedAbstractFormPresentational<UserExtended> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
applicationRolesNames: string[] = [...Object.values(UserApplicationRoleEnum)];
@Input()
listPersons: People[];
listPersons: Person[];
@Input()
listOrganizationalUnit: OrganizationalUnitsExtended[];
listOrganizationalUnit: AccessOrganizationalUnit[];
constructor(protected readonly _changeDetectorRef: ChangeDetectorRef,
private readonly _fb: FormBuilder) {
super(_changeDetectorRef);
}
protected bindFormTo(user: UsersExtended): void {
protected bindFormTo(user: UserExtended): void {
this.form = this._fb.group({
[this.formDefinition.externalUid]: [user.externalUid, [Validators.required, SolidifyValidator]],
[this.formDefinition.targetedUid]: [user.targetedUid],
......@@ -60,7 +59,7 @@ export class AdminUserForm extends SharedAbstractFormPresentational<UsersExtende
});
}
protected treatmentBeforeSubmit(user: UsersExtended): UsersExtended {
protected treatmentBeforeSubmit(user: UserExtended): UserExtended {
const userRoles = this.form.controls.applicationRoles.value.controls as FormArray[];
const selectedArray: string [] = [];
userRoles.map((formCtrl) => {
......@@ -100,7 +99,7 @@ export class AdminUserForm extends SharedAbstractFormPresentational<UsersExtende
})));
}
private fillApplicationRolesSelection(data: any[], selectedRoles: ApplicationRoles[]): FormArray {
private fillApplicationRolesSelection(data: any[], selectedRoles: ApplicationRole[]): FormArray {
return this._fb.array(data.map((i) =>
this._fb.group({
name: i,
......
import {ChangeDetectionStrategy, Component, OnInit, ViewChild} from "@angular/core";
import {adminInstitutionActionNameSpace} from "@app/features/admin/stores/institution/admin-institution.action";
import {AdminInstitutionStateModel} from "@app/features/admin/stores/institution/admin-institution.state";
import {Institutions} from "@app/generated-api";
import {Institution} from "@app/generated-api";
import {SharedAbstractFormPresentational} from "@app/shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {SharedAbstractCreateRoutable} from "@app/shared/components/routables/shared-abstract-create/shared-abstract-create.routable";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
......@@ -13,9 +13,9 @@ import {Store} from "@ngxs/store";
styleUrls: ["../../../../../shared/components/routables/shared-abstract-create/shared-abstract-create.routable.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminInstitutionCreateRoutable extends SharedAbstractCreateRoutable<Institutions, AdminInstitutionStateModel> implements OnInit {
export class AdminInstitutionCreateRoutable extends SharedAbstractCreateRoutable<Institution, AdminInstitutionStateModel> implements OnInit {
@ViewChild("formPresentational", {static: false})
readonly formPresentational: SharedAbstractFormPresentational<Institutions>;
readonly formPresentational: SharedAbstractFormPresentational<Institution>;
constructor(protected store: Store) {
super(store, LocalStateEnum.admin_institution, adminInstitutionActionNameSpace, LocalStateEnum.admin);
......
import {ChangeDetectionStrategy, Component} from "@angular/core";
import {MatDialog} from "@angular/material";
import {ActivatedRoute} from "@angular/router";
import {Institutions} from "@app/generated-api";
import {adminInstitutionActionNameSpace} from "@app/features/admin/stores/institution/admin-institution.action";
import {AdminInstitutionStateModel} from "@app/features/admin/stores/institution/admin-institution.state";
import {Institution} from "@app/generated-api";
import {SharedAbstractDetailRoutable} from "@app/shared/components/routables/shared-abstract-detail/shared-abstract-detail.routable";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {Store} from "@ngxs/store";
import {TRANSLATE} from "solidify-frontend";
import {AdminInstitutionStateModel} from "@app/features/admin/stores/institution/admin-institution.state";
import {adminInstitutionActionNameSpace} from "@app/features/admin/stores/institution/admin-institution.action";
@Component({
selector: "dlcm-admin-institution-detail-routable",
......@@ -15,7 +15,7 @@ import {adminInstitutionActionNameSpace} from "@app/features/admin/stores/instit