Commit 0dc02c2f authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

refactor: regroup enums

parent 158c8821
import {ApplicationRoleEnum} from "@src/app/shared/enums/application-role.enum";
import {Enums} from "@src/app/enums";
import {DataTestEnum} from "@src/app/shared/enums/data-test.enum";
import {ModuleLoadedEnum} from "@src/app/shared/enums/module-loaded.enum";
import {OrgunitHelper} from "./orgunit-helper";
......@@ -6,7 +6,7 @@ import {TestHelper} from "./test-helper";
describe("Admin Page", () => {
beforeEach(() => {
TestHelper.login(ApplicationRoleEnum.root);
TestHelper.login(Enums.UserApplicationRole.UserApplicationRoleEnum.root);
cy.get(".avatar-wrapper").first().click();
cy.wait(1000); // MANDATORY FOR NOT RANDOM ERROR...
TestHelper.getTestData(DataTestEnum.linkMenuAdmin).click();
......
import {ApplicationRoleEnum} from "@src/app/shared/enums/application-role.enum";
import {Enums} from "@src/app/enums";
import {DataTestEnum} from "@src/app/shared/enums/data-test.enum";
import {HttpVerbEnum} from "@src/app/shared/enums/http-verb.enum";
import {ModuleLoadedEnum} from "@src/app/shared/enums/module-loaded.enum";
......@@ -7,7 +7,7 @@ import {TestHelper} from "./test-helper";
describe("Deposit Page", () => {
beforeEach(() => {
TestHelper.login(ApplicationRoleEnum.root);
TestHelper.login(Enums.UserApplicationRole.UserApplicationRoleEnum.root);
TestHelper.waitXhr("preingest/deposits?*", () => {
cy.wait(2000); // MANDATORY FOR NOT RANDOM ERROR...
TestHelper.getTestData(DataTestEnum.linkMenuDeposit).click();
......
import {ApplicationRoleEnum} from "@src/app/shared/enums/application-role.enum";
import {Enums} from "@src/app/enums";
import {DataTestEnum} from "@src/app/shared/enums/data-test.enum";
import {HttpVerbEnum} from "@src/app/shared/enums/http-verb.enum";
import {HttpStatus} from "solidify-frontend";
......@@ -6,7 +6,7 @@ import {TestHelper} from "./test-helper";
describe("Home Page", () => {
beforeEach(() => {
TestHelper.login(ApplicationRoleEnum.guest);
TestHelper.login(Enums.UserApplicationRole.UserApplicationRoleEnum.guest);
});
it("check the title", () => {
......
import {ApplicationRoleEnum} from "@src/app/shared/enums/application-role.enum";
import {Enums} from "@src/app/enums";
import {DataTestEnum} from "@src/app/shared/enums/data-test.enum";
import {HttpVerbEnum} from "@src/app/shared/enums/http-verb.enum";
import {ModuleLoadedEnum} from "@src/app/shared/enums/module-loaded.enum";
......@@ -31,7 +31,7 @@ export class OrgunitHelper {
static createIfNotExistOrgUnitForPrerequisiteTest(role: RoleEnum | undefined): string {
const orgUnitName = this._generateOrgUnitName(role, true);
TestHelper.login(ApplicationRoleEnum.root);
TestHelper.login(Enums.UserApplicationRole.UserApplicationRoleEnum.root);
// Go to admin page
cy.get(".avatar-wrapper").first().click();
......@@ -59,7 +59,7 @@ export class OrgunitHelper {
static createOrgUnit(role: RoleEnum | undefined, forPrerequisiteTest: boolean = false): string {
const orgUnitName = this._generateOrgUnitName(role, forPrerequisiteTest);
TestHelper.login(ApplicationRoleEnum.root);
TestHelper.login(Enums.UserApplicationRole.UserApplicationRoleEnum.root);
// Go to admin page
cy.get(".avatar-wrapper").first().click();
......
import {ApplicationRoleEnum} from "@src/app/shared/enums/application-role.enum";
import {Enums} from "@src/app/enums";
import {TestHelper} from "./test-helper";
describe("Admin Page", () => {
before(() => {
TestHelper.login(ApplicationRoleEnum.root);
TestHelper.login(Enums.UserApplicationRole.UserApplicationRoleEnum.root);
});
});
import {ApplicationRoleEnum} from "@shared/enums/application-role.enum";
import {DataTestEnum} from "@shared/enums/data-test.enum";
import {ModuleLoadedEnum} from "@shared/enums/module-loaded.enum";
import {TestHelper} from "../test-helper";
export class PreservationSpaceCommonHelper {
static goToPreservationSpaceMenu(): void {
TestHelper.login(ApplicationRoleEnum.user);
TestHelper.login(Enums.UserApplicationRole.UserApplicationRoleEnum.user);
TestHelper.waitXhr("organizational-units?*", () => {
cy.wait(1000); // MANDATORY FOR NOT RANDOM ERROR...
TestHelper.getTestData(DataTestEnum.linkMenuPreservationSpace).click();
......
import {Enums} from "@src/app/enums";
import {ApiResourceNameEnum} from "@src/app/shared/enums/api-resource-name.enum";
import {ApplicationRoleEnum} from "@src/app/shared/enums/application-role.enum";
import {DataTestEnum} from "@src/app/shared/enums/data-test.enum";
import {HttpVerbEnum} from "@src/app/shared/enums/http-verb.enum";
import {ModuleLoadedEnum} from "@src/app/shared/enums/module-loaded.enum";
......@@ -23,20 +23,20 @@ export class TestHelper {
cy.wait(250); // In some case app is not still init after the request to ApiResourceNameEnum.SYSTEM_PROPERTY
}
static login(applicationRole: ApplicationRoleEnum): void {
static login(applicationRole: Enums.UserApplicationRole.UserApplicationRoleEnum): void {
let token: string | undefined = undefined;
if (!cypressEnvironment.localAuth) {
switch (applicationRole) {
case ApplicationRoleEnum.root:
case Enums.UserApplicationRole.UserApplicationRoleEnum.root:
token = cypressEnvironment.tokenRoot;
break;
case ApplicationRoleEnum.admin:
case Enums.UserApplicationRole.UserApplicationRoleEnum.admin:
token = cypressEnvironment.tokenAdmin;
break;
case ApplicationRoleEnum.user:
case Enums.UserApplicationRole.UserApplicationRoleEnum.user:
token = cypressEnvironment.tokenUser;
break;
case ApplicationRoleEnum.guest:
case Enums.UserApplicationRole.UserApplicationRoleEnum.guest:
default:
this.logout();
return;
......
......@@ -53,6 +53,9 @@
],
"@models": [
"app/models/index"
],
"@enums": [
"app/enums/index"
]
}
}
......
......@@ -18,6 +18,7 @@ module.exports = {
'@preservation-space': path.resolve(__dirname, '../src/app/features/preservation-space'),
'@order': path.resolve(__dirname, '../src/app/features/order'),
'@models': path.resolve(__dirname, '../src/app/models/index'),
'@enums': path.resolve(__dirname, '../src/app/enums/index'),
'solidify-frontend': path.resolve(__dirname, '../node_modules/solidify-frontend')
}
},
......
......@@ -14,8 +14,6 @@ import {CartDialog} from "@app/components/dialogs/cart/cart.dialog";
import {UpdateVersionDialog} from "@app/components/dialogs/update-version/update-version.dialog";
import {UserDialog} from "@app/components/dialogs/user/user.dialog";
import {SharedAbstractPresentational} from "@app/shared/components/presentationals/shared-abstract/shared-abstract.presentational";
import {ApplicationRoleEnum} from "@app/shared/enums/application-role.enum";
import {LanguagesEnum} from "@app/shared/enums/languages.enum";
import {
RoutesEnum,
urlSeparator,
......@@ -26,6 +24,7 @@ import {AppAction} from "@app/stores/app.action";
import {AppState} from "@app/stores/app.state";
import {AppCartArchiveState} from "@app/stores/cart/archive/app-cart-archive.state";
import {AppUserState} from "@app/stores/user/app-user.state";
import {Enums} from "@enums";
import {environment} from "@environments/environment";
import {HomeHelper} from "@home/helpers/home.helper";
import {User} from "@models";
......@@ -81,11 +80,11 @@ export class AppComponent extends SharedAbstractPresentational {
logo: string;
@Select((state: LocalStateModel) => state.router.state) urlStateObs: Observable<RouterStateSnapshot>;
appLanguageObs: Observable<LanguagesEnum> = MemoizedUtil.select(this._store, AppState, state => state.appLanguage);
appLanguageObs: Observable<Enums.Language.LanguageEnum> = MemoizedUtil.select(this._store, AppState, state => state.appLanguage);
isLoggedObs: Observable<boolean> = MemoizedUtil.select(this._store, AppState, state => state.isLoggedIn);
isApplicationInitializedObs: Observable<boolean> = MemoizedUtil.select(this._store, AppState, state => state.isApplicationInitialized);
themeObs: Observable<ThemeEnum> = MemoizedUtil.select(this._store, AppState, state => state.theme);
userRolesObs: Observable<ApplicationRoleEnum[]> = MemoizedUtil.select(this._store, AppState, state => state.userRoles);
userRolesObs: Observable<Enums.UserApplicationRole.UserApplicationRoleEnum[]> = MemoizedUtil.select(this._store, AppState, state => state.userRoles);
currentUserObs: Observable<User> = MemoizedUtil.current(this._store, AppUserState);
numberArchiveInCartObs: Observable<number> = MemoizedUtil.total(this._store, AppCartArchiveState);
......@@ -193,7 +192,7 @@ export class AppComponent extends SharedAbstractPresentational {
}
}
useLanguage(language: LanguagesEnum): void {
useLanguage(language: Enums.Language.LanguageEnum): void {
this._store.dispatch(new AppAction.ChangeAppLanguage(language));
}
......@@ -302,9 +301,9 @@ export class AppComponent extends SharedAbstractPresentational {
);
}
private listenLanguageChange(): Observable<LanguagesEnum> {
private listenLanguageChange(): Observable<Enums.Language.LanguageEnum> {
return this.appLanguageObs.pipe(
tap((language: LanguagesEnum) => {
tap((language: Enums.Language.LanguageEnum) => {
this._setTitle();
}),
);
......@@ -333,7 +332,7 @@ export class AppComponent extends SharedAbstractPresentational {
this._renderer.appendChild(header, link);
}
computeDisplayCart(isLogged: boolean, userRoles: ApplicationRoleEnum[]): boolean {
computeDisplayCart(isLogged: boolean, userRoles: Enums.UserApplicationRole.UserApplicationRoleEnum[]): boolean {
this.displayCart = PermissionUtil.isUserHavePermission(isLogged, ApplicationRolePermissionEnum.userPermission, userRoles);
return this.displayCart;
}
......
......@@ -13,7 +13,7 @@
[value]="lang"
>
<img class="option-language-img"
[matTooltip]="languagesEnumHelper.getLabel(lang) | translate"
[matTooltip]="enums.EnumHelper.getLabel(languageEnumTranslate, lang) | translate"
[matTooltipPosition]="'after'"
[src]="getPathToImage(lang)"
style="max-height: 18px; max-width: 18px; padding-left: 13px;"
......
......@@ -6,10 +6,7 @@ import {
ViewEncapsulation,
} from "@angular/core";
import {SharedAbstractPresentational} from "@app/shared/components/presentationals/shared-abstract/shared-abstract.presentational";
import {
LanguagesEnum,
LanguagesEnumHelper,
} from "@app/shared/enums/languages.enum";
import {Enums} from "@enums";
import {
BehaviorSubject,
Observable,
......@@ -27,43 +24,43 @@ import {
encapsulation: ViewEncapsulation.None,
})
export class LanguageSelectorPresentational extends SharedAbstractPresentational {
private _languageList: LanguagesEnum[] = [LanguagesEnum.en, LanguagesEnum.fr, LanguagesEnum.de];
private _languageList: Enums.Language.LanguageEnum[] = [Enums.Language.LanguageEnum.en, Enums.Language.LanguageEnum.fr, Enums.Language.LanguageEnum.de];
private readonly _languageBS: BehaviorSubject<LanguagesEnum | undefined> = new BehaviorSubject<LanguagesEnum | undefined>(undefined);
private readonly _languageBS: BehaviorSubject<Enums.Language.LanguageEnum | undefined> = new BehaviorSubject<Enums.Language.LanguageEnum | undefined>(undefined);
@Input()
currentLanguage: LanguagesEnum;
currentLanguage: Enums.Language.LanguageEnum;
@Output("languageChange")
readonly languageObs: Observable<LanguagesEnum | undefined> = ObservableUtil.asObservable(this._languageBS);
readonly languageObs: Observable<Enums.Language.LanguageEnum | undefined> = ObservableUtil.asObservable(this._languageBS);
get language(): LanguagesEnum | undefined {
get language(): Enums.Language.LanguageEnum | undefined {
return this._languageBS.getValue();
}
@Input()
set language(value: LanguagesEnum | undefined) {
set language(value: Enums.Language.LanguageEnum | undefined) {
if (this._languageBS.value !== value) {
this._languageBS.next(value);
}
}
get languagesEnumHelper(): typeof LanguagesEnumHelper {
return LanguagesEnumHelper;
get languageEnumTranslate(): typeof Enums.Language.LanguageEnumTranslate {
return Enums.Language.LanguageEnumTranslate;
}
useLanguage(language: LanguagesEnum): void {
useLanguage(language: Enums.Language.LanguageEnum): void {
this._languageBS.next(language);
}
getPathToImage(language: LanguagesEnum): string | undefined {
getPathToImage(language: Enums.Language.LanguageEnum): string | undefined {
if (isNullOrUndefined(language)) {
return undefined;
}
return "assets/language-icons/" + language + ".svg";
}
get languageList(): LanguagesEnum[] {
get languageList(): Enums.Language.LanguageEnum[] {
return this._languageList.filter(l => this.language !== l && this.currentLanguage !== l);
}
}
......@@ -6,8 +6,6 @@ import {
import {AppHelper} from "@app/app.helper";
import {SharedAbstractPresentational} from "@app/shared/components/presentationals/shared-abstract/shared-abstract.presentational";
import {ApplicationRolePermissionEnum} from "@app/shared/enums/application-role-permission.enum";
import {ApplicationRoleEnum} from "@app/shared/enums/application-role.enum";
import {LanguagesEnum} from "@app/shared/enums/languages.enum";
import {
AppRoutesEnum,
OrderRoutesEnum,
......@@ -15,6 +13,7 @@ import {
} from "@app/shared/enums/routes.enum";
import {ThemeEnum} from "@app/shared/enums/theme.enum";
import {PermissionUtil} from "@app/shared/utils/permission.util";
import {Enums} from "@enums";
import {environment} from "@environments/environment";
import {User} from "@models";
import {DataTestEnum} from "@shared/enums/data-test.enum";
......@@ -38,7 +37,7 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr
currentPath: string;
@Input()
currentLanguage: LanguagesEnum;
currentLanguage: Enums.Language.LanguageEnum;
@Input()
user: User;
......@@ -55,7 +54,7 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr
numberPendingRequestNotificationInbox: number = 0;
@Input()
private userRoles: ApplicationRoleEnum[];
private userRoles: Enums.UserApplicationRole.UserApplicationRoleEnum[];
// Theme
private readonly _themeBS: BehaviorSubject<ThemeEnum | undefined> = new BehaviorSubject<ThemeEnum | undefined>(undefined);
......@@ -90,9 +89,9 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr
readonly navigateObs: Observable<string | undefined> = ObservableUtil.asObservable(this._navigateBS);
// Language
private readonly _languageBS: BehaviorSubject<LanguagesEnum | undefined> = new BehaviorSubject<LanguagesEnum | undefined>(undefined);
private readonly _languageBS: BehaviorSubject<Enums.Language.LanguageEnum | undefined> = new BehaviorSubject<Enums.Language.LanguageEnum | undefined>(undefined);
@Output("languageChange")
readonly languageObs: Observable<LanguagesEnum | undefined> = ObservableUtil.asObservable(this._languageBS);
readonly languageObs: Observable<Enums.Language.LanguageEnum | undefined> = ObservableUtil.asObservable(this._languageBS);
// Logout
private readonly _logoutBS: BehaviorSubject<void | undefined> = new BehaviorSubject<void | undefined>(undefined);
......@@ -194,7 +193,7 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr
this._navigateBS.next(path);
}
useLanguage(language: LanguagesEnum): void {
useLanguage(language: Enums.Language.LanguageEnum): void {
this._languageBS.next(language);
}
......@@ -207,7 +206,7 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr
}
openOrder(): void {
if (this.userRoles.includes(ApplicationRoleEnum.admin) || this.userRoles.includes(ApplicationRoleEnum.root)) {
if (this.userRoles.includes(Enums.UserApplicationRole.UserApplicationRoleEnum.admin) || this.userRoles.includes(Enums.UserApplicationRole.UserApplicationRoleEnum.root)) {
this._navigateBS.next(AppRoutesEnum.order);
} else {
this._navigateBS.next(AppRoutesEnum.order + urlSeparator + OrderRoutesEnum.myOrder);
......
......@@ -4,10 +4,9 @@ import {
Input,
Output,
} from "@angular/core";
import {Enums} from "@enums";
import {User} from "@models";
import {SharedAbstractPresentational} from "@shared/components/presentationals/shared-abstract/shared-abstract.presentational";
import {ApplicationRoleEnum} from "@shared/enums/application-role.enum";
import {LanguagesEnum} from "@shared/enums/languages.enum";
import {ThemeEnum} from "@shared/enums/theme.enum";
import {
BehaviorSubject,
......@@ -29,10 +28,10 @@ export class MainToolbarPresentational extends SharedAbstractPresentational {
currentPath: string;
@Input()
currentLanguage: LanguagesEnum;
currentLanguage: Enums.Language.LanguageEnum;
@Input()
userRoles: ApplicationRoleEnum[];
userRoles: Enums.UserApplicationRole.UserApplicationRoleEnum[];
@Input()
user: User;
......@@ -68,9 +67,9 @@ export class MainToolbarPresentational extends SharedAbstractPresentational {
readonly navigateObs: Observable<string | undefined> = ObservableUtil.asObservable(this._navigateBS);
// Language
private readonly _languageBS: BehaviorSubject<LanguagesEnum | undefined> = new BehaviorSubject<LanguagesEnum | undefined>(undefined);
private readonly _languageBS: BehaviorSubject<Enums.Language.LanguageEnum | undefined> = new BehaviorSubject<Enums.Language.LanguageEnum | undefined>(undefined);
@Output("languageChange")
readonly languageObs: Observable<LanguagesEnum | undefined> = ObservableUtil.asObservable(this._languageBS);
readonly languageObs: Observable<Enums.Language.LanguageEnum | undefined> = ObservableUtil.asObservable(this._languageBS);
// Logout
private readonly _logoutBS: BehaviorSubject<void | undefined> = new BehaviorSubject<void | undefined>(undefined);
......@@ -98,7 +97,7 @@ export class MainToolbarPresentational extends SharedAbstractPresentational {
}
}
changeLanguage(language: LanguagesEnum): void {
changeLanguage(language: Enums.Language.LanguageEnum): void {
if (this._languageBS.value !== language) {
this._languageBS.next(language);
}
......
......@@ -11,8 +11,8 @@ import {
Validators,
} from "@angular/forms";
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";
import {Enums} from "@enums";
import {
AccessOrganizationalUnit,
User,
......@@ -33,7 +33,7 @@ import {
})
export class UserForm extends SharedAbstractFormPresentational<User> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
applicationRolesNames: string[] = EnumUtil.convertToArray(UserApplicationRoleEnum, [UserApplicationRoleEnum.trusted_client]);
applicationRolesNames: string[] = EnumUtil.convertToArray(Enums.UserApplicationRole.UserApplicationRoleEnum, [Enums.UserApplicationRole.UserApplicationRoleEnum.trusted_client]);
@Input()
listOrganizationalUnit: AccessOrganizationalUnit[];
......
This diff is collapsed.
......@@ -8,6 +8,7 @@ import {
FormBuilder,
Validators,
} from "@angular/forms";
import {Enums} from "@enums";
import {DisseminationPolicy} from "@models";
import {SharedAbstractFormPresentational} from "@shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {BaseFormDefinition} from "@shared/models/base-form-definition.model";
......@@ -26,7 +27,7 @@ import {
export class AdminDisseminationPolicyFormPresentational extends SharedAbstractFormPresentational<DisseminationPolicy> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
disseminationPolicyTypeEnum: DisseminationPolicy.TypeEnum[] = EnumUtil.convertToArray(DisseminationPolicy.TypeEnum);
disseminationPolicyTypeEnum: Enums.DisseminationPolicy.TypeEnum[] = EnumUtil.convertToArray(Enums.DisseminationPolicy.TypeEnum);
constructor(protected readonly _changeDetectorRef: ChangeDetectorRef,
protected readonly _elementRef: ElementRef,
......
......@@ -7,6 +7,7 @@ import {
} from "@angular/core";
import {MatDialog} from "@angular/material/dialog";
import {ActivatedRoute} from "@angular/router";
import {Enums} from "@enums";
import {DisseminationPolicy} from "@models";
import {
Actions,
......@@ -17,8 +18,8 @@ import {FieldTypeEnum} from "@shared/enums/field-type.enum";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {RouterExtService} from "@shared/services/router-ext.service";
import {
OrderEnum,
MARK_AS_TRANSLATABLE,
OrderEnum,
} from "solidify-frontend";
@Component({
......@@ -56,16 +57,7 @@ export class AdminDisseminationPolicyListRoutable extends SharedAbstractListRout
field: "type",
header: MARK_AS_TRANSLATABLE("admin.disseminationPolicy.table.header.type"),
type: FieldTypeEnum.singleSelect,
filterEnum: [
{
key: DisseminationPolicy.TypeEnum.WEB,
value: "WEB",
},
{
key: DisseminationPolicy.TypeEnum.IIIF,
value: "IIIF",
},
],
filterEnum: Enums.DisseminationPolicy.TypeEnumTranslate,
order: OrderEnum.none,
isFilterable: true,
isSortable: true,
......
......@@ -8,11 +8,9 @@ import {
FormBuilder,
Validators,
} from "@angular/forms";
import {Enums} from "@enums";
import {License} from "@models";
import {SharedAbstractFormPresentational} from "@shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {LicenseOdConformanceEnumHelper} from "@shared/enums/business/license-od-conformance-enum.helper";
import {LicenseOsdConformanceEnumHelper} from "@shared/enums/business/license-osd-conformance-enum.helper";
import {LicenseStatusEnumHelper} from "@shared/enums/business/license-status-enum.helper";
import {BaseFormDefinition} from "@shared/models/base-form-definition.model";
import {RegexpUtil} from "@shared/utils/regexp.util";
import {
......@@ -30,9 +28,9 @@ import {
export class AdminLicenseFormPresentational extends SharedAbstractFormPresentational<License> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
licensesStatusEnum: KeyValue[] = LicenseStatusEnumHelper.getListKeyValue();
licenseOdConformanceEnum: KeyValue[] = LicenseOdConformanceEnumHelper.getListKeyValue();
licenseOsdConformanceEnum: KeyValue[] = LicenseOsdConformanceEnumHelper.getListKeyValue();
licensesStatusEnum: KeyValue[] = Enums.License.StatusEnumTranslate;
licenseOdConformanceEnum: KeyValue[] = Enums.License.OdConformanceEnumTranslate;
licenseOsdConformanceEnum: KeyValue[] = Enums.License.OsdConformanceEnumTranslate;
constructor(protected readonly _changeDetectorRef: ChangeDetectorRef,
protected readonly _elementRef: ElementRef,
......@@ -48,7 +46,7 @@ export class AdminLicenseFormPresentational extends SharedAbstractFormPresentati
[this.formDefinition.maintainer]: ["", [SolidifyValidator]],
[this.formDefinition.odConformance]: ["", [SolidifyValidator]],
[this.formDefinition.osdConformance]: ["", [SolidifyValidator]],
[this.formDefinition.status]: [License.StatusEnum.Retired, [SolidifyValidator]],
[this.formDefinition.status]: [Enums.License.StatusEnum.Retired, [SolidifyValidator]],
[this.formDefinition.isGeneric]: [false, [SolidifyValidator]],
[this.formDefinition.family]: ["", [SolidifyValidator]],
[this.formDefinition.domainContent]: [false, [SolidifyValidator]],
......
import {MetadataTypeFormatEnumHelper} from "@admin/metadata-type/helpers/metadata-type-format-enum.helper";
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
......@@ -10,6 +9,7 @@ import {
FormBuilder,
Validators,
} from "@angular/forms";
import {Enums} from "@enums";
import {MetadataType} from "@models";
import {SharedAbstractFormPresentational} from "@shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {BaseFormDefinition} from "@shared/models/base-form-definition.model";
......@@ -39,7 +39,7 @@ export class AdminMetadataTypeFormPresentational extends SharedAbstractFormPrese
readonly maxSizeFile: number = 25000000;
uploadedOrChangedFile: boolean = false;
metadataFormatEnum: KeyValue[] = MetadataTypeFormatEnumHelper.getListKeyValue();
metadataFormatEnum: KeyValue[] = Enums.MetadataType.MetadataFormatEnumTranslate;
private readonly _fileUploadBS: BehaviorSubject<File | undefined> = new BehaviorSubject<File | undefined>(undefined);
@Output("fileUploadChange")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment