From 38eef575d0c4c7f092a2e877b1582e9c6cbc08f9 Mon Sep 17 00:00:00 2001 From: amentis Date: Wed, 21 Feb 2024 13:10:18 +0200 Subject: [PATCH] add dmp user type --- .../src/app/core/common/enum/dmp-user-type.ts | 4 ++++ .../services/utilities/enum-utils.service.ts | 8 +++++++ .../dmp-editor.component.html | 21 ++++++++++++++++--- .../dmp-editor.component.ts | 3 +++ dmp-frontend/src/assets/i18n/en.json | 4 ++++ 5 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 dmp-frontend/src/app/core/common/enum/dmp-user-type.ts diff --git a/dmp-frontend/src/app/core/common/enum/dmp-user-type.ts b/dmp-frontend/src/app/core/common/enum/dmp-user-type.ts new file mode 100644 index 000000000..56e656c0c --- /dev/null +++ b/dmp-frontend/src/app/core/common/enum/dmp-user-type.ts @@ -0,0 +1,4 @@ +export enum DmpUserType { + Internal = 0, + External = 1 +} \ No newline at end of file diff --git a/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts b/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts index 521bbca3f..42277c26f 100644 --- a/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts +++ b/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts @@ -37,6 +37,7 @@ import { DmpStatus } from '../../common/enum/dmp-status'; import { ValidationType } from '../../common/enum/validation-type'; import { DescriptionTemplateExternalSelectAuthType } from '@app/core/common/enum/description-template-external-select-auth-type'; import { DmpBlueprintFieldCategory } from '@app/core/common/enum/dmp-blueprint-field-category'; +import { DmpUserType } from '@app/core/common/enum/dmp-user-type'; @Injectable() export class EnumUtils { @@ -369,6 +370,13 @@ export class EnumUtils { } } + public toDmpUserTypeString(value: DmpUserType): string { + switch (value) { + case DmpUserType.Internal: return this.language.instant('TYPES.DMP-USER-TYPE.INTERNAL'); + case DmpUserType.External: return this.language.instant('TYPES.DMP-USER-TYPE.EXTERNAL'); + } + } + public toDescriptionTemplateExternalSelectHttpMethodTypeString(value: DescriptionTemplateExternalSelectHttpMethodType): string { switch (value) { case DescriptionTemplateExternalSelectHttpMethodType.GET: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-EXTERNAL-SELECT-HTTP-METHOD-TYPE.GET'); diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html index 6520648a8..d63070150 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html @@ -249,16 +249,31 @@ {{userIndex + 1}}
drag_indicator
+
+ +
+ {{enumUtils.toDmpUserTypeString(userType)}} +
+
+
-
+
- {{'DMP-EDITOR.FIELDS1.USER' | translate}} - + {{'DMP-EDITOR.FIELDS1.USER' | translate}}* + {{user.get('user').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
+ + {{'DMP-EDITOR.FIELDS1.EMAIL' | translate}}* + + {{user.get('email').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
{{'DMP-EDITOR.FIELDS1.USER-ROLE' | translate}} diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts index 5a1e979fb..3604a68ad 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts @@ -45,6 +45,7 @@ import { DmpEditorModel } from './dmp-editor.model'; import { DmpEditorResolver } from './dmp-editor.resolver'; import { DmpEditorService } from './dmp-editor.service'; import { DmpUserRole } from '@app/core/common/enum/dmp-user-role'; +import { DmpUserType } from '@app/core/common/enum/dmp-user-type'; @Component({ selector: 'app-dmp-editor', @@ -68,6 +69,8 @@ export class DmpEditorComponent extends BaseEditor implemen dmpAccessTypeEnumValues = this.enumUtils.getEnumValues(DmpAccessType); dmpContactTypeEnum = DmpContactType; dmpContactTypeEnumValues = this.enumUtils.getEnumValues(DmpContactType); + dmpUserTypeEnum = DmpUserType; + dmpUserTypeEnumValues = this.enumUtils.getEnumValues(DmpUserType); dmpUserRoleEnumValues = this.enumUtils.getEnumValues(DmpUserRole); singleAutocompleteBlueprintConfiguration: SingleAutoCompleteConfiguration = { initialItems: (data?: any) => this.dmpBlueprintService.query(this.dmpBlueprintService.buildAutocompleteLookup(null, null, null, [DmpBlueprintStatus.Finalized])).pipe(map(x => x.items)), diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index b43665617..f5cc44c9c 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -2421,6 +2421,10 @@ "INTERNAL": "Internal", "EXTERNAL": "External" }, + "DMP-USER-TYPE": { + "INTERNAL": "Internal", + "EXTERNAL": "External" + }, "DMP-BLUEPRINT-FIELD-CATEGORY": { "SYSTEM": "System", "EXTRA": "Custom",