Commit 40053599 authored by Florent Poittevin's avatar Florent Poittevin
Browse files

Add open api json file and remove generated model

parent b1dc6033
......@@ -6,9 +6,9 @@
},
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"start:nodocker": "ng serve --proxy-config proxy.conf.no-docker.json",
"start:dlcmtest": "ng serve --proxy-config proxy.conf.dlcmtest.json -c=dlcmtest",
"start": "npm run generate-dlcm-api && ng serve --proxy-config proxy.conf.json",
"start:nodocker": "npm run generate-dlcm-api && ng serve --proxy-config proxy.conf.no-docker.json",
"start:dlcmtest": "npm run generate-dlcm-api && ng serve --proxy-config proxy.conf.dlcmtest.json -c=dlcmtest",
"build": "ng build --aot=true --prod=true --source-map=false",
"test": "ng test --no-progress --code-coverage",
"clean": "rm -rf node_modules",
......@@ -16,7 +16,7 @@
"lint:fix": "ng lint --fix",
"e2e": "ng e2e",
"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 --marker TRANSLATE",
"generate-dlcm-api": "rm -fR src/app/generated-api && openapi-generator generate -Dmodels -DsupportingFiles -i ../DLCM-Backend/DLCM-Solution/target/classes/static/openapi/openapi-3.0.json -g typescript-angular -o src/app/generated-api --additional-properties=\"ngVersion=7.2.0,providedInRoot=true,modelSuffix=Model,modelFileSuffix=.model,fileNaming=kebab-case,prependFormOrBodyParameters=true,modelPropertyNaming=original\" --skip-validate-spec && clean-after-api-generation.sh",
"generate-dlcm-api": "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 && clean-after-api-generation.sh",
"install-solidify-schematics": "npm i --no-save ../Solidify-Frontend/solidify-schematics/schematics-solidify-1.0.0.tgz",
"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 {depositActionNameSpace} from "@app/features/deposit/stores/deposit.action";
import {DepositStateModel} from "@app/features/deposit/stores/deposit.state";
import {DepositsModel} from "@app/generated-api";
import {Deposits} from "@app/generated-api";
import {SharedAbstractDeleteDialog} from "@app/shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog";
import {LocalStateEnum} from "../../../../../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 DepositDeleteDialog extends SharedAbstractDeleteDialog<DepositsModel, DepositStateModel> {
export class DepositDeleteDialog extends SharedAbstractDeleteDialog<Deposits, DepositStateModel> {
public readonly KEY_TITLE: string = TRANSLATE("deposit.dialog.delete.title");
public readonly KEY_MESSAGE: string = TRANSLATE("deposit.dialog.delete.message");
public readonly KEY_CONFIRM_BUTTON: string = TRANSLATE("deposit.dialog.delete.confirm");
......
import {ChangeDetectionStrategy, Component, Input} from "@angular/core";
import {FormBuilder, Validators} from "@angular/forms";
import {
DepositsModel,
LanguagesModel,
LicensesModel,
OrganizationalUnitsModel,
PreservationPoliciesModel,
SubmissionPoliciesModel,
Deposits,
Languages,
Licenses,
OrganizationalUnits,
PreservationPolicies,
SubmissionPolicies,
} 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 AccessModelEnum = DepositsModel.AccessModelEnum;
import AccessEnum = Deposits.AccessEnum;
import {DateUtil, PropertyName} from "solidify-frontend";
@Component({
......@@ -19,27 +19,27 @@ import {DateUtil, PropertyName} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DepositFormPresentational extends SharedAbstractFormPresentational<DepositsModel> {
export class DepositFormPresentational extends SharedAbstractFormPresentational<Deposits> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
get accessModelEnum(): typeof AccessModelEnum {
return AccessModelEnum;
get accessModelEnum(): typeof AccessEnum {
return AccessEnum;
}
@Input()
languages: LanguagesModel[];
languages: Languages[];
@Input()
licenses: LicensesModel[];
licenses: Licenses[];
@Input()
submissionPolicies: SubmissionPoliciesModel[];
submissionPolicies: SubmissionPolicies[];
@Input()
preservationPolicies: PreservationPoliciesModel[];
preservationPolicies: PreservationPolicies[];
@Input()
organizationalUnits: OrganizationalUnitsModel[];
organizationalUnits: OrganizationalUnits[];
constructor(protected fb: FormBuilder) {
super();
......@@ -55,7 +55,7 @@ export class DepositFormPresentational extends SharedAbstractFormPresentational<
[this.formDefinition.collectionBegin]: [""],
[this.formDefinition.collectionEnd]: [""],
[this.formDefinition.author]: [""],
[this.formDefinition.accessLevel]: [AccessModelEnum.PUBLIC],
[this.formDefinition.accessLevel]: [AccessEnum.PUBLIC],
[this.formDefinition.hasEmbargo]: [false],
[this.formDefinition.licenseId]: [""],
[this.formDefinition.submissionPolicyId]: [""],
......@@ -63,7 +63,7 @@ export class DepositFormPresentational extends SharedAbstractFormPresentational<
});
}
protected bindFormTo(deposit: DepositsModel): void {
protected bindFormTo(deposit: Deposits): void {
this.form = this.fb.group({
[this.formDefinition.organizationalUnitId]: [deposit.organizationalUnitId, Validators.required],
[this.formDefinition.title]: [deposit.title, Validators.required],
......@@ -81,7 +81,7 @@ export class DepositFormPresentational extends SharedAbstractFormPresentational<
});
}
protected treatmentBeforeSubmit(deposit: DepositsModel): DepositsModel {
protected treatmentBeforeSubmit(deposit: Deposits): Deposits {
deposit.publicationDate = DateUtil.convertToLocalDateDateSimple(deposit.publicationDate);
deposit.collectionBegin = DateUtil.convertToOffsetDateTimeIso8601(deposit.collectionBegin);
deposit.collectionEnd = DateUtil.convertToOffsetDateTimeIso8601(deposit.collectionEnd);
......
import {ChangeDetectionStrategy, Component, OnInit} from "@angular/core";
import {depositActionNameSpace} from "@app/features/deposit/stores/deposit.action";
import {DepositStateModel} from "@app/features/deposit/stores/deposit.state";
import {DepositsModel, LanguagesModel, LicensesModel, PreservationPoliciesModel, SubmissionPoliciesModel} from "@app/generated-api";
import {Deposits, Languages, Licenses, PreservationPolicies, SubmissionPolicies} from "@app/generated-api";
import {OrganizationalUnitModule} from "@app/features/organizational-unit/organizational-unit.module";
import {LocalStateEnum} from "../../../../../shared/enums/local-state.enum";
import {LocalStateModel} from "@app/shared/models/localStateModel";
......@@ -16,11 +16,11 @@ import {Observable} from "rxjs";
styleUrls: ["../../../../../shared/components/routables/shared-abstract-create/shared-abstract-create.routable.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DepositCreateRoutable extends SharedAbstractCreateRoutable<DepositsModel, DepositStateModel> implements OnInit {
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.language].list) languagesObs: Observable<LanguagesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.license].list) licensesObs: Observable<LicensesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) submissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) preservationPoliciesObs: Observable<PreservationPoliciesModel[]>;
export class DepositCreateRoutable extends SharedAbstractCreateRoutable<Deposits, DepositStateModel> implements OnInit {
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.language].list) languagesObs: Observable<Languages[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.license].list) licensesObs: Observable<Licenses[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) submissionPoliciesObs: Observable<SubmissionPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) preservationPoliciesObs: Observable<PreservationPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.organizationalUnit].list) organizationalUnitsObs: Observable<OrganizationalUnitModule[]>;
constructor(protected store: Store) {
......
......@@ -5,7 +5,7 @@ import {DepositDataFile} from "@app/features/deposit/models/deposit-data-file.mo
import {DepositDataFileAction} from "@app/features/deposit/stores/data-file/deposit-data-file.action";
import {depositActionNameSpace} from "@app/features/deposit/stores/deposit.action";
import {DepositStateModel} from "@app/features/deposit/stores/deposit.state";
import {DepositsModel, LanguagesModel, LicensesModel, PreservationPoliciesModel, SubmissionPoliciesModel} from "@app/generated-api";
import {Deposits, Languages, Licenses, PreservationPolicies, SubmissionPolicies} from "@app/generated-api";
import {OrganizationalUnitModule} from "@app/features/organizational-unit/organizational-unit.module";
import {LocalStateEnum} from "../../../../../shared/enums/local-state.enum";
import {LocalStateModel} from "@app/shared/models/localStateModel";
......@@ -21,11 +21,11 @@ import {TRANSLATE} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/routables/shared-abstract-detail/shared-abstract-detail.routable.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DepositDetailRoutable extends SharedAbstractDetailRoutable<DepositsModel, DepositStateModel> implements OnInit {
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.language].list) languagesObs: Observable<LanguagesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.license].list) licensesObs: Observable<LicensesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) submissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) preservationPoliciesObs: Observable<PreservationPoliciesModel[]>;
export class DepositDetailRoutable extends SharedAbstractDetailRoutable<Deposits, DepositStateModel> implements OnInit {
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.language].list) languagesObs: Observable<Languages[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.license].list) licensesObs: Observable<Licenses[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) submissionPoliciesObs: Observable<SubmissionPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) preservationPoliciesObs: Observable<PreservationPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.organizationalUnit].list) organizationalUnitsObs: Observable<OrganizationalUnitModule[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.deposit].listDataFile) listDataFileObs: Observable<DepositDataFile[]>;
......
......@@ -3,7 +3,7 @@ import {ActivatedRoute} from "@angular/router";
import {DepositDataFileAction} from "@app/features/deposit/stores/data-file/deposit-data-file.action";
import {depositActionNameSpace} from "@app/features/deposit/stores/deposit.action";
import {DepositStateModel} from "@app/features/deposit/stores/deposit.state";
import {DepositsModel, LanguagesModel, LicensesModel, PreservationPoliciesModel, SubmissionPoliciesModel} from "@app/generated-api";
import {Deposits, Languages, Licenses, PreservationPolicies, SubmissionPolicies} from "@app/generated-api";
import {OrganizationalUnitModule} from "@app/features/organizational-unit/organizational-unit.module";
import {LocalStateEnum} from "../../../../../shared/enums/local-state.enum";
import {LocalStateModel} from "@app/shared/models/localStateModel";
......@@ -18,11 +18,11 @@ import {Observable} from "rxjs";
styleUrls: ["../../../../../shared/components/routables/shared-abstract-edit/shared-abstract-edit.routable.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DepositEditRoutable extends SharedAbstractEditRoutable<DepositsModel, DepositStateModel> implements OnInit {
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.language].list) languagesObs: Observable<LanguagesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.license].list) licensesObs: Observable<LicensesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) submissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) preservationPoliciesObs: Observable<PreservationPoliciesModel[]>;
export class DepositEditRoutable extends SharedAbstractEditRoutable<Deposits, DepositStateModel> implements OnInit {
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.language].list) languagesObs: Observable<Languages[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.license].list) licensesObs: Observable<Licenses[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) submissionPoliciesObs: Observable<SubmissionPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) preservationPoliciesObs: Observable<PreservationPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.organizationalUnit].list) organizationalUnitsObs: Observable<OrganizationalUnitModule[]>;
constructor(protected store: Store,
......
import {ChangeDetectionStrategy, Component} from "@angular/core";
import {depositActionNameSpace} from "@app/features/deposit/stores/deposit.action";
import {DepositStateModel} from "@app/features/deposit/stores/deposit.state";
import {DepositsModel} from "@app/generated-api";
import {Deposits} from "@app/generated-api";
import {SharedAbstractListRoutable} from "@app/shared/components/routables/shared-abstract-list/shared-abstract-list.routable";
import {FieldTypeEnum} from "@app/shared/enums/field-type.enum";
import {LocalStateEnum} from "../../../../../shared/enums/local-state.enum";
......@@ -15,7 +15,7 @@ import {TRANSLATE} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/routables/shared-abstract-list/shared-abstract-list.routable.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DepositListRoutable extends SharedAbstractListRoutable<DepositsModel, DepositStateModel> {
export class DepositListRoutable extends SharedAbstractListRoutable<Deposits, DepositStateModel> {
readonly KEY_CREATE_BUTTON: string = TRANSLATE("deposit.new");
readonly KEY_REFRESH_BUTTON: string = TRANSLATE("deposit.refresh");
......
import {Checksum} from "@app/features/deposit/models/checksum.model";
import {FileFormat} from "@app/features/deposit/models/file-format.model";
import {ChangeInfoModel, DepositsModel} from "@app/generated-api";
import StatusModelEnum = DepositsModel.StatusModelEnum;
import {ChangeInfo, Deposits} from "@app/generated-api";
import StatusEnum = Deposits.StatusEnum;
export interface DepositDataFile {
resId?: string;
creation?: ChangeInfoModel;
lastUpdate?: ChangeInfoModel;
creation?: ChangeInfo;
lastUpdate?: ChangeInfo;
packageId?: string;
sourceData?: string;
relativeLocation?: string;
finalData?: string;
fileSize?: number;
status?: StatusModelEnum;
status?: StatusEnum;
statusMessage?: string;
dataCategory?: string; // Enum get with ApiActionEnum.LIST_DATA_CATEGORY
dataType?: string; // Enum get with ApiActionEnum.LIST_DATA_TYPE
......
import {DepositsModel} from "@app/generated-api";
import {Deposits} from "@app/generated-api";
import {LocalStateEnum} from "../../../shared/enums/local-state.enum";
import {TypeDefaultAction, ResourceAction, ResourceNameSpace} from "solidify-frontend";
......@@ -26,11 +26,11 @@ export namespace DepositAction {
}
@TypeDefaultAction(state)
export class GetAllSuccess extends ResourceAction.GetAllSuccess<DepositsModel> {
export class GetAllSuccess extends ResourceAction.GetAllSuccess<Deposits> {
}
@TypeDefaultAction(state)
export class GetAllFail extends ResourceAction.GetAllFail<DepositsModel> {
export class GetAllFail extends ResourceAction.GetAllFail<Deposits> {
}
@TypeDefaultAction(state)
......@@ -38,35 +38,35 @@ export namespace DepositAction {
}
@TypeDefaultAction(state)
export class GetByIdSuccess extends ResourceAction.GetByIdSuccess<DepositsModel> {
export class GetByIdSuccess extends ResourceAction.GetByIdSuccess<Deposits> {
}
@TypeDefaultAction(state)
export class GetByIdFail extends ResourceAction.GetByIdFail<DepositsModel> {
export class GetByIdFail extends ResourceAction.GetByIdFail<Deposits> {
}
@TypeDefaultAction(state)
export class Create extends ResourceAction.Create<DepositsModel> {
export class Create extends ResourceAction.Create<Deposits> {
}
@TypeDefaultAction(state)
export class CreateSuccess extends ResourceAction.CreateSuccess<DepositsModel> {
export class CreateSuccess extends ResourceAction.CreateSuccess<Deposits> {
}
@TypeDefaultAction(state)
export class CreateFail extends ResourceAction.CreateFail<DepositsModel> {
export class CreateFail extends ResourceAction.CreateFail<Deposits> {
}
@TypeDefaultAction(state)
export class Update extends ResourceAction.Update<DepositsModel> {
export class Update extends ResourceAction.Update<Deposits> {
}
@TypeDefaultAction(state)
export class UpdateSuccess extends ResourceAction.UpdateSuccess<DepositsModel> {
export class UpdateSuccess extends ResourceAction.UpdateSuccess<Deposits> {
}
@TypeDefaultAction(state)
export class UpdateFail extends ResourceAction.UpdateFail<DepositsModel> {
export class UpdateFail extends ResourceAction.UpdateFail<Deposits> {
}
@TypeDefaultAction(state)
......
......@@ -5,7 +5,7 @@ import {UploadFileStatus} from "@app/features/deposit/models/upload-file-status.
import {depositDataFileActionNameSpace} from "@app/features/deposit/stores/data-file/deposit-data-file.action";
import {DepositDataFileState, DepositDataFileStateModel} from "@app/features/deposit/stores/data-file/deposit-data-file.state";
import {DepositAction, depositActionNameSpace} from "@app/features/deposit/stores/deposit.action";
import {DepositsModel} from "@app/generated-api";
import {Deposits} from "@app/generated-api";
import {ApiActionEnum} from "@app/shared/enums/api-action.enum";
import {PreIngestResourceApiEnum} from "@app/shared/enums/api.enum";
import {LanguageAction} from "@app/shared/stores/language/language.action";
......@@ -27,7 +27,7 @@ import {
} from "solidify-frontend";
import {LocalStateEnum} from "../../../shared/enums/local-state.enum";
export interface DepositStateModel extends ResourceStateModel<DepositsModel> {
export interface DepositStateModel extends ResourceStateModel<Deposits> {
[LocalStateEnum.deposit_dataFile]: DepositDataFileStateModel;
listDataFile: DepositDataFile[];
isLoadingDataFile: boolean;
......@@ -47,7 +47,7 @@ export interface DepositStateModel extends ResourceStateModel<DepositsModel> {
DepositDataFileState,
],
})
export class DepositState extends ResourceState<DepositsModel> {
export class DepositState extends ResourceState<Deposits> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -2,7 +2,8 @@ import {ChangeDetectionStrategy, Component, OnInit} from "@angular/core";
import {SearchScopeEnum} from "@app/features/home/enums/search-scope.enum";
import {Archive} from "@app/features/home/models/archive.model";
import {AccessChangeQueryParameters, AccessSearch, ChangeSearchScope} from "@app/features/home/stores/home.action";
import {DepositsModel, OrganizationalUnitsModel} from "@app/generated-api";
import {OrganizationalUnits} from "@app/generated-api";
import {Deposits} from "@app/generated-api/model/deposits.model";
import {SharedAbstractPresentational} from "@app/shared/components/presentationals/shared-abstract/shared-abstract.presentational";
import {FieldTypeEnum} from "@app/shared/enums/field-type.enum";
import {LocalStateEnum} from "../../../../../shared/enums/local-state.enum";
......@@ -32,7 +33,7 @@ export class HomeSearchRoutable extends SharedAbstractPresentational implements
@Select((state: LocalStateModel) => state[LocalStateEnum.access].list) listObs: Observable<ArchiveMetadata[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.access].searchScope) searchScopeObs: Observable<SearchScopeEnum>;
@Select((state: LocalStateModel) => state[LocalStateEnum.access].queryParameters) queryParametersObs: Observable<ArchiveMetadata[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.organizationalUnit].list) listOrganizationalUnitObs: Observable<OrganizationalUnitsModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.organizationalUnit].list) listOrganizationalUnitObs: Observable<OrganizationalUnits[]>;
@Select((state: LocalStateModel) => StoreUtil.isLoadingState(state[LocalStateEnum.organizationalUnit])) isLoadingOrgUnitObs: Observable<boolean>;
columns: DataTableColumns[];
......@@ -99,7 +100,7 @@ export class HomeSearchRoutable extends SharedAbstractPresentational implements
),
title: MetadataUtil.getTitle(archive.metadata),
yearPublicationDate: MetadataUtil.getPublicationYear(archive.metadata),
accessLevel: MetadataUtil.getAccessLevel(archive.metadata) as DepositsModel.AccessModelEnum,
accessLevel: MetadataUtil.getAccessLevel(archive.metadata) as Deposits.AccessEnum,
});
});
this.listAdaptedBS.next(newList);
......@@ -108,7 +109,7 @@ export class HomeSearchRoutable extends SharedAbstractPresentational implements
);
}
getOrganizationalUnitNameFromId(resId: string, listOrgUnits: OrganizationalUnitsModel[]): string {
getOrganizationalUnitNameFromId(resId: string, listOrgUnits: OrganizationalUnits[]): string {
const orgUnits = listOrgUnits.find(o => o.resId === resId);
if (orgUnits) {
return orgUnits.name;
......
import {DepositsModel} from "@app/generated-api";
import {Deposits} from "@app/generated-api";
export interface Archive {
organizationalUnit: string;
title: string;
yearPublicationDate: number;
accessLevel: DepositsModel.AccessModelEnum;
accessLevel: Deposits.AccessEnum;
}
import {ChangeDetectionStrategy, Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
import {OrganizationalUnitsModel} from "@app/generated-api";
import {OrganizationalUnits} from "@app/generated-api";
import {SharedAbstractDeleteDialog} from "@app/shared/components/dialogs/shared-abstract-delete/shared-abstract-delete.dialog";
import {LocalStateEnum} from "../../../../../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 OrgunitDeleteDialog extends SharedAbstractDeleteDialog<OrganizationalUnitsModel, OrganizationalUnitStateModel> {
export class OrgunitDeleteDialog extends SharedAbstractDeleteDialog<OrganizationalUnits, OrganizationalUnitStateModel> {
public readonly KEY_TITLE: string = TRANSLATE("organizationalUnit.dialog.delete.title");
public readonly KEY_MESSAGE: string = TRANSLATE("organizationalUnit.dialog.delete.message");
public readonly KEY_CONFIRM_BUTTON: string = TRANSLATE("organizationalUnit.dialog.delete.confirm");
......
import {ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges} from "@angular/core";
import {FormBuilder, Validators} from "@angular/forms";
import {OrganizationalUnitsModel, PreservationPoliciesModel, SubmissionPoliciesModel} from "@app/generated-api";
import {OrganizationalUnits, PreservationPolicies, SubmissionPolicies} 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";
......@@ -13,17 +13,17 @@ import {PropertyName, DateUtil} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrgunitFormPresentational extends SharedAbstractFormPresentational<OrganizationalUnitsModel> implements OnChanges {
export class OrgunitFormPresentational extends SharedAbstractFormPresentational<OrganizationalUnits> implements OnChanges {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
@Input()
selectedSubmissionPolicies: SubmissionPoliciesModel[];
selectedSubmissionPolicies: SubmissionPolicies[];
@Input()
listSubmissionPolicies: SubmissionPoliciesModel[];
listSubmissionPolicies: SubmissionPolicies[];
@Input()
listPreservationPolicies: PreservationPoliciesModel[];
listPreservationPolicies: PreservationPolicies[];
constructor(private fb: FormBuilder) {
super();
......@@ -54,7 +54,7 @@ export class OrgunitFormPresentational extends SharedAbstractFormPresentational<
});
}
protected bindFormTo(organizationalUnit: OrganizationalUnitsModel): void {
protected bindFormTo(organizationalUnit: OrganizationalUnits): void {
this.form = this.fb.group({
[this.formDefinition.name]: [organizationalUnit.name, Validators.required],
[this.formDefinition.description]: [organizationalUnit.description, Validators.required],
......@@ -66,7 +66,7 @@ export class OrgunitFormPresentational extends SharedAbstractFormPresentational<
});
}
protected treatmentBeforeSubmit(organizationalUnit: OrganizationalUnitsModel): OrganizationalUnitsModel {
protected treatmentBeforeSubmit(organizationalUnit: OrganizationalUnits): OrganizationalUnits {
organizationalUnit.openingDate = DateUtil.convertToLocalDateDateSimple(organizationalUnit.openingDate);
organizationalUnit.closingDate = DateUtil.convertToLocalDateDateSimple(organizationalUnit.closingDate);
return organizationalUnit;
......
import {ChangeDetectionStrategy, Component, OnInit} from "@angular/core";
import {OrganizationalUnitsModel, PreservationPoliciesModel, SubmissionPoliciesModel} from "@app/generated-api";
import {OrganizationalUnits, PreservationPolicies, SubmissionPolicies} from "@app/generated-api";
import {LocalStateEnum} from "../../../../../shared/enums/local-state.enum";
import {LocalStateModel} from "@app/shared/models/localStateModel";
import {orgUnitActionNameSpace} from "@app/shared/stores/organizational-unit/organizational-unit.action";
......@@ -14,9 +14,9 @@ import {Observable} from "rxjs";
styleUrls: ["../../../../../shared/components/routables/shared-abstract-create/shared-abstract-create.routable.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrgunitCreatePresentational extends SharedAbstractCreateRoutable<OrganizationalUnitsModel, OrganizationalUnitStateModel> implements OnInit {
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) listSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) listPreservationPoliciesObs: Observable<PreservationPoliciesModel[]>;
export class OrgunitCreatePresentational extends SharedAbstractCreateRoutable<OrganizationalUnits, OrganizationalUnitStateModel> implements OnInit {
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) listSubmissionPoliciesObs: Observable<SubmissionPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) listPreservationPoliciesObs: Observable<PreservationPolicies[]>;
constructor(protected store: Store) {
super(store, LocalStateEnum.organizationalUnit, orgUnitActionNameSpace);
......
import {ChangeDetectionStrategy, Component} from "@angular/core";
import {MatDialog} from "@angular/material";
import {ActivatedRoute} from "@angular/router";
import {OrganizationalUnitsModel, PreservationPoliciesModel, SubmissionPoliciesModel} from "@app/generated-api";
import {OrganizationalUnits, PreservationPolicies, SubmissionPolicies} from "@app/generated-api";
import {LocalStateEnum} from "../../../../../shared/enums/local-state.enum";
import {LocalStateModel} from "@app/shared/models/localStateModel";
import {OrgUnitSubmissionPolicyAction} from "@app/shared/stores/organizational-unit/submission-policy/organizational-unit-submission-policy.action";
......@@ -18,11 +18,11 @@ import {TRANSLATE, StoreUtil} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/routables/shared-abstract-detail/shared-abstract-detail.routable.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrgunitDetailPresentational extends SharedAbstractDetailRoutable<OrganizationalUnitsModel, OrganizationalUnitStateModel> {
export class OrgunitDetailPresentational extends SharedAbstractDetailRoutable<OrganizationalUnits, OrganizationalUnitStateModel> {
@Select((state: LocalStateModel) => StoreUtil.isLoadingState(state[LocalStateEnum.organizationalUnit][LocalStateEnum.organizationalUnit_submissionPolicy])) isLoadingSubmissionPoliciesObs: Observable<boolean>;
@Select((state: LocalStateModel) => state[LocalStateEnum.organizationalUnit][LocalStateEnum.organizationalUnit_submissionPolicy].selected) selectedSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) listSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) listPreservationPoliciesObs: Observable<PreservationPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.organizationalUnit][LocalStateEnum.organizationalUnit_submissionPolicy].selected) selectedSubmissionPoliciesObs: Observable<SubmissionPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) listSubmissionPoliciesObs: Observable<SubmissionPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) listPreservationPoliciesObs: Observable<PreservationPolicies[]>;
readonly KEY_PARAM_NAME: string = "name";
readonly KEY_DELETE_BUTTON: string = TRANSLATE("organizationalUnit.delete");
......
import {ChangeDetectionStrategy, Component, OnInit} from "@angular/core";
import {ActivatedRoute} from "@angular/router";
import {OrganizationalUnitsModel, PreservationPoliciesModel, SubmissionPoliciesModel} from "@app/generated-api";
import {OrganizationalUnits, PreservationPolicies, SubmissionPolicies} from "@app/generated-api";
import {SharedAbstractEditRoutable} from "@app/shared/components/routables/shared-abstract-edit/shared-abstract-edit.routable";
import {LocalStateEnum} from "../../../../../shared/enums/local-state.enum";
import {LocalStateModel} from "@app/shared/models/localStateModel";
......@@ -17,11 +17,11 @@ import {StoreUtil} from "solidify-frontend";
styleUrls: ["../../../../../shared/components/routables/shared-abstract-edit/shared-abstract-edit.routable.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrgunitEditPresentational extends SharedAbstractEditRoutable<OrganizationalUnitsModel, OrganizationalUnitStateModel> implements OnInit {
export class OrgunitEditPresentational extends SharedAbstractEditRoutable<OrganizationalUnits, OrganizationalUnitStateModel> implements OnInit {
@Select((state: LocalStateModel) => StoreUtil.isLoadingState(state[LocalStateEnum.organizationalUnit][LocalStateEnum.organizationalUnit_submissionPolicy])) isLoadingSubmissionPoliciesObs: Observable<boolean>;
@Select((state: LocalStateModel) => state[LocalStateEnum.organizationalUnit][LocalStateEnum.organizationalUnit_submissionPolicy].selected) selectedSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) listSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) listPreservationPoliciesObs: Observable<PreservationPoliciesModel[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.organizationalUnit][LocalStateEnum.organizationalUnit_submissionPolicy].selected) selectedSubmissionPoliciesObs: Observable<SubmissionPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.submissionPolicy].list) listSubmissionPoliciesObs: Observable<SubmissionPolicies[]>;
@Select((state: LocalStateModel) => state[LocalStateEnum.shared][LocalStateEnum.preservationPolicy].list) listPreservationPoliciesObs: Observable<PreservationPolicies[]>;
constructor(protected store: Store,
protected route: ActivatedRoute) {
......
import {ChangeDetectionStrategy, Component} from "@angular/core";
import {OrganizationalUnitsModel} from "@app/generated-api";
import {OrganizationalUnits} from "@app/generated-api";
import {SharedAbstractListRoutable} from "@app/shared/components/routables/shared-abstract-list/shared-abstract-list.routable";
import {FieldTypeEnum} from "@app/shared/enums/field-type.enum";
import {orgUnitActionNameSpace} from "@app/shared/stores/organizational-unit/organizational-unit.action";
......@@ -14,7 +14,7 @@ import {LocalStateEnum} from "../../../../../shared/enums/local-state.enum";
styleUrls: ["../../../../../shared/components/routables/shared-abstract-list/shared-abstract-list.routable.scss"],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrgunitListPresentational extends SharedAbstractListRoutable<OrganizationalUnitsModel, OrganizationalUnitStateModel> {