diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/persist/referencetypedefinition/AuthenticationConfigurationPersist.java b/dmp-backend/core/src/main/java/eu/eudat/model/persist/referencetypedefinition/AuthenticationConfigurationPersist.java index dbf6a9394..457355845 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/persist/referencetypedefinition/AuthenticationConfigurationPersist.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/persist/referencetypedefinition/AuthenticationConfigurationPersist.java @@ -113,18 +113,23 @@ public class AuthenticationConfigurationPersist { .must(() -> !this.isNull(item.getEnabled())) .failOn(AuthenticationConfigurationPersist._enabled).failWith(messageSource.getMessage("Validation_Required", new Object[]{AuthenticationConfigurationPersist._enabled}, LocaleContextHolder.getLocale())), this.spec() + .iff(() -> !this.isNull(item.getEnabled())) .must(() -> !this.isEmpty(item.getAuthUrl())) .failOn(AuthenticationConfigurationPersist._authUrl).failWith(messageSource.getMessage("Validation_Required", new Object[]{AuthenticationConfigurationPersist._authUrl}, LocaleContextHolder.getLocale())), this.spec() + .iff(() -> !this.isNull(item.getEnabled())) .must(() -> !this.isNull(item.getAuthMethod())) .failOn(AuthenticationConfigurationPersist._authMethod).failWith(messageSource.getMessage("Validation_Required", new Object[]{AuthenticationConfigurationPersist._authMethod}, LocaleContextHolder.getLocale())), this.spec() + .iff(() -> !this.isNull(item.getEnabled())) .must(() -> !this.isEmpty(item.getAuthTokenPath())) .failOn(AuthenticationConfigurationPersist._authTokenPath).failWith(messageSource.getMessage("Validation_Required", new Object[]{AuthenticationConfigurationPersist._authTokenPath}, LocaleContextHolder.getLocale())), this.spec() + .iff(() -> !this.isNull(item.getEnabled())) .must(() -> !this.isEmpty(item.getAuthRequestBody())) .failOn(AuthenticationConfigurationPersist._authRequestBody).failWith(messageSource.getMessage("Validation_Required", new Object[]{AuthenticationConfigurationPersist._authRequestBody}, LocaleContextHolder.getLocale())), this.spec() + .iff(() -> !this.isNull(item.getEnabled())) .must(() -> !this.isEmpty(item.getType())) .failOn(AuthenticationConfigurationPersist._type).failWith(messageSource.getMessage("Validation_Required", new Object[]{AuthenticationConfigurationPersist._type}, LocaleContextHolder.getLocale())) ); diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/persist/referencetypedefinition/QueryCaseConfigPersist.java b/dmp-backend/core/src/main/java/eu/eudat/model/persist/referencetypedefinition/QueryCaseConfigPersist.java index 8d49280a8..84234dcf2 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/persist/referencetypedefinition/QueryCaseConfigPersist.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/persist/referencetypedefinition/QueryCaseConfigPersist.java @@ -98,7 +98,11 @@ public class QueryCaseConfigPersist { return Arrays.asList( this.spec() .must(() -> !this.isEmpty(item.getValue())) - .failOn(QueryCaseConfigPersist._value).failWith(messageSource.getMessage("Validation_Required", new Object[]{QueryCaseConfigPersist._value}, LocaleContextHolder.getLocale())) + .failOn(QueryCaseConfigPersist._value).failWith(messageSource.getMessage("Validation_Required", new Object[]{QueryCaseConfigPersist._value}, LocaleContextHolder.getLocale())), + this.spec() + .iff(() -> this.isValidGuid(item.getReferenceTypeId())) + .must(() -> !this.isEmpty(item.getReferenceTypeSourceKey())) + .failOn(QueryCaseConfigPersist._referenceTypeSourceKey).failWith(messageSource.getMessage("Validation_Required", new Object[]{QueryCaseConfigPersist._referenceTypeSourceKey}, LocaleContextHolder.getLocale())) ); } } diff --git a/dmp-frontend/src/app/core/model/reference-type/reference-type.ts b/dmp-frontend/src/app/core/model/reference-type/reference-type.ts index fb4804d96..f0ba458b3 100644 --- a/dmp-frontend/src/app/core/model/reference-type/reference-type.ts +++ b/dmp-frontend/src/app/core/model/reference-type/reference-type.ts @@ -2,6 +2,7 @@ import { ReferenceFieldDataType } from "@app/core/common/enum/reference-field-da import { ReferenceTypeExternalApiHTTPMethodType } from "@app/core/common/enum/reference-type-external-api-http-method-type"; import { ReferenceTypeSourceType } from "@app/core/common/enum/reference-type-source-type"; import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model"; +import { Guid } from "@common/types/guid"; export interface ReferenceType extends BaseEntity{ name: string; @@ -26,7 +27,7 @@ export interface ReferenceTypeSourceBaseConfiguration extends ReferenceTypeSourc key: string; label: string; ordinal: number; - dependencies: ReferenceTypeSourceBaseDependency[]; + referenceTypeDependencies?: ReferenceType[]; } export interface ReferenceTypeSourceExternalApiConfiguration{ @@ -34,7 +35,6 @@ export interface ReferenceTypeSourceExternalApiConfiguration{ results: ResultsConfiguration; paginationPath: string; contentType: string; - //funderQuery?: string; firstPage: string; httpMethod: ReferenceTypeExternalApiHTTPMethodType; requestBody?: string; @@ -64,10 +64,17 @@ export interface AuthenticationConfiguration{ } export interface QueryConfig{ - condition: string; + name: string; + defaultValue: string; + cases: QueryCaseConfig[]; +} + +export interface QueryCaseConfig{ + likePattern: string, separator: string; value: string; - ordinal: number; + referenceType?: ReferenceType; + referenceTypeSourceKey: string } export interface ReferenceTypeSourceStaticOptionConfiguration{ @@ -79,20 +86,6 @@ export interface ReferenceTypeStaticOption{ value: string; } -export interface ReferenceTypeSourceBaseDependency{ - referenceTypeCode: string; - key: string; - required: boolean; - properties: DependencyProperty[]; -} - -export interface DependencyProperty{ - code: string; - target: string; - required: boolean; -} - - // Persist export interface ReferenceTypePersist extends BaseEntityPersist{ @@ -118,7 +111,7 @@ export interface ReferenceTypeSourceBaseConfigurationPersist extends ReferenceTy key: string; label: string; ordinal: number; - dependencies?: ReferenceTypeSourceBaseDependencyPersist[]; + referenceTypeDependencyIds?: Guid[]; } export interface ReferenceTypeSourceExternalApiConfigurationPersist{ @@ -126,8 +119,6 @@ export interface ReferenceTypeSourceExternalApiConfigurationPersist{ results: ResultsConfigurationPersist; paginationPath: string; contentType: string; - // toDo move to a general query - //funderQuery?: string; firstPage: string; httpMethod: ReferenceTypeExternalApiHTTPMethodType; requestBody?: string; @@ -158,10 +149,17 @@ export interface AuthenticationConfigurationPersist{ } export interface QueryConfigPersist{ - condition: string; + name: string; + defaultValue: string; + cases: QueryCaseConfigPersist[]; +} + +export interface QueryCaseConfigPersist{ + likePattern: string, separator: string; value: string; - ordinal: number; + referenceTypeId: Guid; + referenceTypeSourceKey: string } export interface ReferenceTypeSourceStaticOptionConfigurationPersist { @@ -172,16 +170,3 @@ export interface ReferenceTypeStaticOptionPersist{ code: string; value: string; } - -export interface ReferenceTypeSourceBaseDependencyPersist{ - referenceTypeCode: string; - key: string; - required: boolean; - properties: DependencyPropertyPersist[]; -} - -export interface DependencyPropertyPersist{ - code: string; - target: string; - required: boolean; -} diff --git a/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.component.html b/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.component.html index b82b8821d..d8cf90708 100644 --- a/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.component.html @@ -173,11 +173,19 @@
{{'REFERENCE-TYPE-EDITOR.FIELDS.ORDINAL' | translate}} - + {{source.get('ordinal').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.DEPENDENCIES' | translate}} + + {{source.get('referenceTypeDependencyIds').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
{{'REFERENCE-TYPE-EDITOR.FIELDS.SOURCE-TYPE' | translate}} @@ -348,7 +356,7 @@

{{'REFERENCE-TYPE-EDITOR.FIELDS.QUERIES' | translate}} - +

@@ -363,45 +371,101 @@ delete
+
+ +
- {{'REFERENCE-TYPE-EDITOR.FIELDS.CONDITION' | translate}} - - {{query.get('condition').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} + {{'REFERENCE-TYPE-EDITOR.FIELDS.NAME' | translate}} + + {{query.get('name').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}}
- {{'REFERENCE-TYPE-EDITOR.FIELDS.SEPARATOR' | translate}} - - {{query.get('separator').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.VALUE' | translate}} - - {{query.get('value').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.ORDINAL' | translate}} - - {{query.get('ordinal').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} + {{'REFERENCE-TYPE-EDITOR.FIELDS.DEFAULT-VALUE' | translate}} + + {{query.get('defaultValue').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+ +
+
+ +
+
+

{{'REFERENCE-TYPE-EDITOR.FIELDS.CASE' | translate}} {{caseIndex + 1}}

+
+
+ +
+
+
+ +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.LIKE-PATTERN' | translate}} + + {{case.get('likePattern').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.SEPARATOR' | translate}} + + {{case.get('separator').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.VALUE' | translate}} + + {{case.get('value').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.REFERENCE-TYPE' | translate}} + + + {{referenceType.code}} + + + {{case.get('referenceTypeId').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.SOURCE-KEY' | translate}} + + + {{sourceKey}} + + + {{case.get('referenceTypeSourceKey').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+
+
+
@@ -441,124 +505,7 @@ - - -

{{'REFERENCE-TYPE-EDITOR.FIELDS.DEPENDENCIES' | translate}} - -

-
-
-
- -
-
-

{{'REFERENCE-TYPE-EDITOR.FIELDS.DEPENDENCY' | translate}} {{dependencyIndex + 1}}

-
-
- -
-
-
- -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.CODE' | translate}} - - - {{referenceType.code}} - - - {{dependency.get('referenceTypeCode').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.KEY' | translate}} - - - {{key}} - - - {{dependency.get('key').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.REQUIRED' | translate}} - - {{dependency.get('required').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- -

{{'REFERENCE-TYPE-EDITOR.FIELDS.PROPERTIES' | translate}} - -

-
-
-
-
-
-

{{'REFERENCE-TYPE-EDITOR.FIELDS.PROPERTY' | translate}} {{propertyIndex + 1}}

-
-
- -
-
-
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.CODE' | translate}} - - - {{code}} - - - {{property.get('code').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.TARGET' | translate}} - - - {{targetCode}} - - - {{property.get('target').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.REQUIRED' | translate}} - - {{property.get('required').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- -
-
- {{'REFERENCE-TYPE-EDITOR.SOURCES-REQUIRED' | translate}} - {{dependency.get('properties').getError('backendError').message}} -
-
-
-
-
- - + @@ -567,6 +514,7 @@ {{formGroup.get('definition').get('sources').getError('backendError').message}} + {{formGroup.value | json}} diff --git a/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.component.ts b/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.component.ts index e1809d133..336f5509a 100644 --- a/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.component.ts @@ -25,7 +25,7 @@ import { FilterService } from '@common/modules/text-filter/filter-service'; import { Guid } from '@common/types/guid'; import { TranslateService } from '@ngx-translate/core'; import { map, takeUntil } from 'rxjs/operators'; -import { DependencyPropertyEditorModel, QueryConfigEditorModel, ReferenceTypeDefinitionEditorModel, ReferenceTypeEditorModel, ReferenceTypeFieldEditorModel, ReferenceTypeSourceBaseConfigurationEditorModel, ReferenceTypeSourceBaseDependencyEditorModel, ReferenceTypeStaticOptionEditorModel, ResultFieldsMappingConfigurationEditorModel } from './reference-type-editor.model'; +import { ReferenceTypeEditorModel} from './reference-type-editor.model'; import { ReferenceTypeEditorResolver } from './reference-type-editor.resolver'; import { ReferenceTypeEditorService } from './reference-type-editor.service'; @@ -48,11 +48,7 @@ export class ReferenceTypeEditorComponent extends BaseEditor(ReferenceFieldDataType); public referenceTypeExternalApiHTTPMethodTypeEnum = this.enumUtils.getEnumValues(ReferenceTypeExternalApiHTTPMethodType); referenceTypes: ReferenceType[] = null; - sourceKeys: string[] = []; - sourceKeysMap: Map = new Map(); - propertyCodes: string[] = []; - targetPropertyCodes: string[] = []; - targetPropertyCodesMap: Map = new Map(); + sourceKeysMap: Map = new Map(); protected get canDelete(): boolean { return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteReferenceType); @@ -86,7 +82,7 @@ export class ReferenceTypeEditorComponent extends BaseEditor source.dependencies.forEach(dependency => { - this.selectedReferenceTypeChanged(dependency.referenceTypeCode); + data.definition.sources?.forEach(source => source.queries?.forEach(query => { + query?.cases?.forEach(queryCase => { + this.selectedReferenceTypeChanged(queryCase.referenceType.id); + }) })); - - this.editorModel.definition.fields.forEach(field => { - if (!this.propertyCodes.includes(field.code)) { - this.propertyCodes.push(field.code); - } - }); } this.isDeleted = data ? data.isActive === IsActive.Inactive : false; @@ -217,15 +208,10 @@ export class ReferenceTypeEditorComponent extends BaseEditor 0) { - if (this.propertyCodes.includes(fieldCode)) { - this.propertyCodes.splice(this.propertyCodes.indexOf(fieldCode), 1); - } - } - - (this.formGroup.get('definition').get('fields') as FormArray).removeAt(fieldIndex); + fieldForm.removeAt(fieldIndex); //Reapply validators ReferenceTypeEditorModel.reApplyDefinitionFieldsValidators( @@ -234,22 +220,24 @@ export class ReferenceTypeEditorComponent extends BaseEditor 0) { @@ -366,13 +350,32 @@ export class ReferenceTypeEditorComponent extends BaseEditor 0) { @@ -400,30 +403,6 @@ export class ReferenceTypeEditorComponent extends BaseEditor { this.referenceTypes = response.items as ReferenceType[]; this.referenceTypes.forEach(referenceType => { - this.sourceKeysMap.set(referenceType.code, []); - this.targetPropertyCodesMap.set(referenceType.code, []); + this.sourceKeysMap.set(referenceType.id, []); }) }); } - selectedReferenceTypeChanged(code: string): void { - this.sourceKeys = []; - this.targetPropertyCodes = []; + selectedReferenceTypeChanged(id: Guid): void { + let sourceKeys: string[] = []; - this.referenceTypeService.getSingleWithCode(code, ReferenceTypeEditorResolver.lookupFields()) + this.referenceTypeService.getSingle(id, ReferenceTypeEditorResolver.lookupFields()) .pipe(takeUntil(this._destroyed)) .subscribe(data => { const referenceType = data as ReferenceType; // source keys referenceType.definition.sources.forEach(source => { - if (!this.sourceKeys.includes(source.key)) this.sourceKeys.push(source.key) + if (!sourceKeys.includes(source.key)) sourceKeys.push(source.key) }); - if (this.sourceKeysMap.has(code) && this.sourceKeysMap.get(code).length == 0) { - this.sourceKeysMap.set(code, this.sourceKeys); + if (this.sourceKeysMap.has(referenceType.id) && this.sourceKeysMap.get(referenceType.id).length == 0) { + this.sourceKeysMap.set(referenceType.id, sourceKeys); } - - // targetPropertyCodes - - let fields = []; - if (referenceType.definition.fields) { - fields = this.referenceTypeService.getSystemFields(referenceType.definition.fields.map(x => x.code)); - } else { - fields = this.referenceTypeService.getSystemFields(fields); - } - - fields.forEach(field => { - if (!this.targetPropertyCodes.includes(field)) this.targetPropertyCodes.push(field) - }) - - if (this.targetPropertyCodesMap.has(code) && this.targetPropertyCodesMap.get(code).length == 0) { - this.targetPropertyCodesMap.set(code, this.targetPropertyCodes); - } - }); - } - // Properties - addProperty(sourceIndex: number, dependencyIndex: number): void { - - if (((this.formGroup.get('definition').get('sources') as FormArray).at(sourceIndex).get('dependencies') as FormArray).at(dependencyIndex).get('referenceTypeCode').value == null) { - return; - } - - const formArray = ((this.formGroup.get('definition').get('sources') as FormArray).at(sourceIndex).get('dependencies') as FormArray).at(dependencyIndex).get("properties") as FormArray - formArray.push(this.editorModel.createProperty(sourceIndex, dependencyIndex, formArray.length)); - } - - removeProperty(sourceIndex: number, dependencyIndex: number, propertyIndex: number): void { - const formArray = (((this.formGroup.get('definition').get('sources') as FormArray).at(sourceIndex).get('dependencies') as FormArray).at(dependencyIndex).get("properties") as FormArray); - formArray.removeAt(propertyIndex); - - ReferenceTypeEditorModel.reApplyDefinitionSourcesValidators( - { - formGroup: this.formGroup, - validationErrorModel: this.editorModel.validationErrorModel - } - ); - ((this.formGroup.get('definition').get('sources') as FormArray).at(sourceIndex).get('dependencies') as FormArray).at(dependencyIndex).get("properties").markAsDirty(); - } } diff --git a/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.model.ts b/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.model.ts index 7d40de96e..be88c79cd 100644 --- a/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.model.ts +++ b/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.model.ts @@ -2,11 +2,12 @@ import { FormArray, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Vali import { ReferenceFieldDataType } from "@app/core/common/enum/reference-field-data-type"; import { ReferenceTypeExternalApiHTTPMethodType } from "@app/core/common/enum/reference-type-external-api-http-method-type"; import { ReferenceTypeSourceType } from "@app/core/common/enum/reference-type-source-type"; -import { AuthenticationConfiguration, AuthenticationConfigurationPersist, DependencyProperty, DependencyPropertyPersist, QueryConfig, QueryConfigPersist, ReferenceType, ReferenceTypeDefinition, ReferenceTypeDefinitionPersist, ReferenceTypeField, ReferenceTypeFieldPersist, ReferenceTypePersist, ReferenceTypeSourceBaseConfiguration, ReferenceTypeSourceBaseConfigurationPersist, ReferenceTypeSourceBaseDependency, ReferenceTypeSourceBaseDependencyPersist, ReferenceTypeStaticOption, ReferenceTypeStaticOptionPersist, ResultFieldsMappingConfiguration, ResultFieldsMappingConfigurationPersist, ResultsConfiguration, ResultsConfigurationPersist } from "@app/core/model/reference-type/reference-type"; +import { AuthenticationConfiguration, AuthenticationConfigurationPersist, QueryCaseConfig, QueryCaseConfigPersist, QueryConfig, QueryConfigPersist, ReferenceType, ReferenceTypeDefinition, ReferenceTypeDefinitionPersist, ReferenceTypeField, ReferenceTypeFieldPersist, ReferenceTypePersist, ReferenceTypeSourceBaseConfiguration, ReferenceTypeSourceBaseConfigurationPersist, ReferenceTypeStaticOption, ReferenceTypeStaticOptionPersist, ResultFieldsMappingConfiguration, ResultFieldsMappingConfigurationPersist, ResultsConfiguration, ResultsConfigurationPersist } from "@app/core/model/reference-type/reference-type"; import { BaseEditorModel } from "@common/base/base-form-editor-model"; import { BackendErrorValidator } from "@common/forms/validation/custom-validator"; import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model"; import { Validation, ValidationContext } from "@common/forms/validation/validation-context"; +import { Guid } from "@common/types/guid"; export class ReferenceTypeEditorModel extends BaseEditorModel implements ReferenceTypePersist { name: string; @@ -84,14 +85,9 @@ export class ReferenceTypeEditorModel extends BaseEditorModel implements Referen return query.buildForm({ rootPath: 'definition.sources[' + sourceIndex + '].queries[' + index + '].'}); } - createDepedency(sourceIndex: number, index: number): UntypedFormGroup { - const dependency: ReferenceTypeSourceBaseDependencyEditorModel = new ReferenceTypeSourceBaseDependencyEditorModel(this.validationErrorModel); - return dependency.buildForm({ rootPath: 'definition.sources[' + sourceIndex + '].dependencies[' + index + '].'}); - } - - createProperty(sourceIndex: number, dependencyIndex: number, index: number): UntypedFormGroup { - const property: DependencyPropertyEditorModel = new DependencyPropertyEditorModel(this.validationErrorModel); - return property.buildForm({ rootPath: 'definition.sources[' + sourceIndex + '].dependencies[' + dependencyIndex + '].properties[' + index + '].'}); + createCase(sourceIndex: number, queryIndex: number, index: number): UntypedFormGroup { + const queryCase: QueryCaseConfigEditorModel = new QueryCaseConfigEditorModel(this.validationErrorModel); + return queryCase.buildForm({ rootPath: 'definition.sources[' + sourceIndex + '].queries[' + queryIndex + '].cases[' + index + '].'}); } static reApplyDefinitionFieldsValidators(params: { @@ -166,9 +162,7 @@ export class ReferenceTypeDefinitionEditorModel implements ReferenceTypeDefiniti ), sources: this.formBuilder.array( (this.sources ?? []).map( - (item, index) => new ReferenceTypeSourceBaseConfigurationEditorModel( - this.validationErrorModel - ).fromModel(item).buildForm({ + (item, index) =>item.buildForm({ rootPath: `${rootPath}sources[${index}].` }) ), context.getValidation('sources').validators @@ -322,7 +316,7 @@ export class ReferenceTypeSourceBaseConfigurationEditorModel implements Referenc options: ReferenceTypeStaticOptionEditorModel[] = []; - dependencies: ReferenceTypeSourceBaseDependencyEditorModel[] = []; + referenceTypeDependencyIds: Guid[] = []; protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); @@ -356,7 +350,7 @@ export class ReferenceTypeSourceBaseConfigurationEditorModel implements Referenc this.options.push(new ReferenceTypeStaticOptionEditorModel().fromModel({ code: 'description', value: undefined })); } - if (item.dependencies) { item.dependencies.map(x => this.dependencies.push(new ReferenceTypeSourceBaseDependencyEditorModel(this.validationErrorModel).fromModel(x))); } + if (item.referenceTypeDependencies) { item.referenceTypeDependencies.forEach(referenceType => this.referenceTypeDependencyIds.push(referenceType.id))} } return this; } @@ -395,9 +389,7 @@ export class ReferenceTypeSourceBaseConfigurationEditorModel implements Referenc }), queries: this.formBuilder.array( (this.queries ?? []).map( - (item, index) => new QueryConfigEditorModel( - this.validationErrorModel - ).fromModel(item).buildForm({ + (item, index) => item.buildForm({ rootPath: `${rootPath}queries[${index}].` }) ), context.getValidation('queries').validators @@ -411,15 +403,7 @@ export class ReferenceTypeSourceBaseConfigurationEditorModel implements Referenc }) ), context.getValidation('options').validators ), - dependencies: this.formBuilder.array( - (this.dependencies ?? []).map( - (item, index) => new ReferenceTypeSourceBaseDependencyEditorModel( - this.validationErrorModel - ).fromModel(item).buildForm({ - rootPath: `${rootPath}dependencies[${index}].` - }) - ), context.getValidation('dependencies').validators - ) + referenceTypeDependencyIds: [{ value: this.referenceTypeDependencyIds, disabled: disabled }, context.getValidation('referenceTypeDependencyIds').validators], }); } @@ -449,7 +433,7 @@ export class ReferenceTypeSourceBaseConfigurationEditorModel implements Referenc baseValidationArray.push({ key: 'options', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}options`)] }); - baseValidationArray.push({ key: 'dependencies', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}dependencies`)] }); + baseValidationArray.push({ key: 'referenceTypeDependencyIds', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}referenceTypeDependencyIds`)] }); baseContext.validation = baseValidationArray; return baseContext; @@ -467,7 +451,7 @@ export class ReferenceTypeSourceBaseConfigurationEditorModel implements Referenc validationErrorModel }); - ['type', 'key', 'label', 'ordinal', 'url', 'paginationPath', 'contentType', 'firstPage', 'httpMethod', 'requestBody','filterType'].forEach(keyField => { + ['type', 'key', 'label', 'ordinal', 'url', 'paginationPath', 'contentType', 'firstPage', 'httpMethod', 'requestBody','filterType', 'referenceTypeDependencyIds'].forEach(keyField => { const control = formGroup?.get(keyField); control?.clearValidators(); control?.addValidators(context.getValidation(keyField).validators); @@ -502,13 +486,6 @@ export class ReferenceTypeSourceBaseConfigurationEditorModel implements Referenc }) ); - (formGroup.get('dependencies') as FormArray).controls?.forEach( - (control, index) => ReferenceTypeSourceBaseDependencyEditorModel.reapplyDepedencyValidators({ - formGroup: control as UntypedFormGroup, - rootPath: `${rootPath}dependencies[${index}].`, - validationErrorModel: validationErrorModel - }) - ); } } @@ -526,9 +503,9 @@ export class ResultsConfigurationEditorModel implements ResultsConfigurationPers this.resultsArrayPath = item.resultsArrayPath; if (item.fieldsMapping) { item.fieldsMapping.map(x => this.fieldsMapping.push(new ResultFieldsMappingConfigurationEditorModel(this.validationErrorModel).fromModel(x))); } else { - this.fieldsMapping.push(new ResultFieldsMappingConfigurationEditorModel().fromModel({ code: 'reference_id', responsePath: undefined })); - this.fieldsMapping.push(new ResultFieldsMappingConfigurationEditorModel().fromModel({ code: 'label', responsePath: undefined })); - this.fieldsMapping.push(new ResultFieldsMappingConfigurationEditorModel().fromModel({ code: 'description', responsePath: undefined })); + this.fieldsMapping.push(new ResultFieldsMappingConfigurationEditorModel(this.validationErrorModel).fromModel({ code: 'reference_id', responsePath: undefined })); + this.fieldsMapping.push(new ResultFieldsMappingConfigurationEditorModel(this.validationErrorModel).fromModel({ code: 'label', responsePath: undefined })); + this.fieldsMapping.push(new ResultFieldsMappingConfigurationEditorModel(this.validationErrorModel).fromModel({ code: 'description', responsePath: undefined })); } return this; } @@ -764,10 +741,9 @@ export class AuthenticationConfigurationEditorModel implements AuthenticationCon } export class QueryConfigEditorModel implements QueryConfigPersist { - public condition: string; - public separator: string; - public value: string; - public ordinal: number; + public name: string; + public defaultValue: string; + public cases: QueryCaseConfigEditorModel[] = []; protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); @@ -776,10 +752,9 @@ export class QueryConfigEditorModel implements QueryConfigPersist { ) { } fromModel(item: QueryConfig): QueryConfigEditorModel { - this.condition = item.condition; - this.separator = item.separator; - this.value = item.value; - this.ordinal = item.ordinal; + this.name = item.name; + this.defaultValue = item.defaultValue; + if (item.cases) { item.cases.map(x => this.cases.push(new QueryCaseConfigEditorModel(this.validationErrorModel).fromModel(x))); } return this; } @@ -798,10 +773,15 @@ export class QueryConfigEditorModel implements QueryConfigPersist { } return this.formBuilder.group({ - condition: [{ value: this.condition, disabled: disabled }, context.getValidation('condition').validators], - separator: [{ value: this.separator, disabled: disabled }, context.getValidation('separator').validators], - value: [{ value: this.value, disabled: disabled }, context.getValidation('value').validators], - ordinal: [{ value: this.ordinal, disabled: disabled }, context.getValidation('ordinal').validators], + name: [{ value: this.name, disabled: disabled }, context.getValidation('name').validators], + defaultValue: [{ value: this.defaultValue, disabled: disabled }, context.getValidation('defaultValue').validators], + cases: this.formBuilder.array( + (this.cases ?? []).map( + (item, index) => item.buildForm({ + rootPath: `${rootPath}cases[${index}].` + }) + ), context.getValidation('cases').validators + ) }); } @@ -813,10 +793,9 @@ export class QueryConfigEditorModel implements QueryConfigPersist { const baseContext: ValidationContext = new ValidationContext(); const baseValidationArray: Validation[] = new Array(); - baseValidationArray.push({ key: 'condition', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}condition`)] }); - baseValidationArray.push({ key: 'separator', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}separator`)] }); - baseValidationArray.push({ key: 'value', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}value`)] }); - baseValidationArray.push({ key: 'ordinal', validators: [Validators.required, Validators.pattern("^[0-9]*$"), BackendErrorValidator(validationErrorModel, `${rootPath}ordinal`)] }); + baseValidationArray.push({ key: 'name', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}name`)] }); + baseValidationArray.push({ key: 'defaultValue', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}defaultValue`)] }); + baseValidationArray.push({ key: 'cases', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}cases`)] }); baseContext.validation = baseValidationArray; return baseContext; @@ -834,7 +813,99 @@ export class QueryConfigEditorModel implements QueryConfigPersist { validationErrorModel }); - ['condition', 'separator', 'value', 'ordinal'].forEach(keyField => { + ['name', 'defaultValue'].forEach(keyField => { + const control = formGroup?.get(keyField); + control?.clearValidators(); + control?.addValidators(context.getValidation(keyField).validators); + }); + + (formGroup.get('cases') as FormArray).controls?.forEach( + (control, index) => QueryCaseConfigEditorModel.reapplyValidators({ + formGroup: control as UntypedFormGroup, + rootPath: `${rootPath}cases[${index}].`, + validationErrorModel: validationErrorModel + } + ) + ); + } +} + +export class QueryCaseConfigEditorModel implements QueryCaseConfigPersist { + public likePattern: string; + public separator: string; + public value: string; + public referenceTypeId: Guid; + public referenceTypeSourceKey: string; + + protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); + + constructor( + public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() + ) { } + + fromModel(item: QueryCaseConfig): QueryCaseConfigEditorModel { + this.likePattern = item.likePattern; + this.separator = item.separator; + this.value = item.value; + if(item?.referenceType?.id) this.referenceTypeId = item.referenceType.id; + this.referenceTypeSourceKey = item.referenceTypeSourceKey; + + return this; + } + + buildForm(params?: { + context?: ValidationContext, + disabled?: boolean, + rootPath?: string + }): UntypedFormGroup { + let { context = null, disabled = false, rootPath } = params ?? {} + if (context == null) { + context = QueryCaseConfigEditorModel.createValidationContext({ + validationErrorModel: this.validationErrorModel, + rootPath + }); + } + + return this.formBuilder.group({ + likePattern: [{ value: this.likePattern, disabled: disabled }, context.getValidation('likePattern').validators], + separator: [{ value: this.separator, disabled: disabled }, context.getValidation('separator').validators], + value: [{ value: this.value, disabled: disabled }, context.getValidation('value').validators], + referenceTypeId: [{ value: this.referenceTypeId, disabled: disabled }, context.getValidation('referenceTypeId').validators], + referenceTypeSourceKey: [{ value: this.referenceTypeSourceKey, disabled: disabled }, context.getValidation('referenceTypeSourceKey').validators], + }); + } + + static createValidationContext(params: { + rootPath?: string, + validationErrorModel: ValidationErrorModel + }): ValidationContext { + const { rootPath = '', validationErrorModel } = params; + + const baseContext: ValidationContext = new ValidationContext(); + const baseValidationArray: Validation[] = new Array(); + baseValidationArray.push({ key: 'likePattern', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}likePattern`)] }); + baseValidationArray.push({ key: 'separator', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}separator`)] }); + baseValidationArray.push({ key: 'value', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}value`)] }); + baseValidationArray.push({ key: 'referenceTypeId', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}referenceTypeId`)] }); + baseValidationArray.push({ key: 'referenceTypeSourceKey', validators: [BackendErrorValidator(validationErrorModel, `${rootPath}referenceTypeSourceKey`)] }); + + baseContext.validation = baseValidationArray; + return baseContext; + } + + static reapplyValidators(params: { + formGroup: UntypedFormGroup, + validationErrorModel: ValidationErrorModel, + rootPath: string + }): void { + + const { formGroup, rootPath, validationErrorModel } = params; + const context = QueryCaseConfigEditorModel.createValidationContext({ + rootPath, + validationErrorModel + }); + + ['likePattern', 'separator', 'value', 'referenceTypeId', 'referenceTypeSourceKey'].forEach(keyField => { const control = formGroup?.get(keyField); control?.clearValidators(); control?.addValidators(context.getValidation(keyField).validators); @@ -915,174 +986,3 @@ export class ReferenceTypeStaticOptionEditorModel implements ReferenceTypeStatic } } -export class ReferenceTypeSourceBaseDependencyEditorModel implements ReferenceTypeSourceBaseDependencyPersist { - public referenceTypeCode: string; - public key: string; - public required = true; - public properties: DependencyPropertyEditorModel[] = []; - - - protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); - - constructor( - public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() - ) { } - - fromModel(item: ReferenceTypeSourceBaseDependency): ReferenceTypeSourceBaseDependencyEditorModel { - this.referenceTypeCode = item.referenceTypeCode; - this.key = item.key; - this.required = item.required; - if (item.properties) { item.properties.map(x => this.properties.push(new DependencyPropertyEditorModel(this.validationErrorModel).fromModel(x))); } - - return this; - } - - buildForm(params?: { - context?: ValidationContext, - disabled?: boolean, - rootPath?: string - }): UntypedFormGroup { - let { context = null, disabled = false, rootPath } = params ?? {} - if (context == null) { - context = ReferenceTypeSourceBaseDependencyEditorModel.createValidationContext({ - validationErrorModel: this.validationErrorModel, - rootPath - }); - } - - return this.formBuilder.group({ - referenceTypeCode: [{ value: this.referenceTypeCode, disabled: disabled }, context.getValidation('referenceTypeCode').validators], - key: [{ value: this.key, disabled: disabled }, context.getValidation('key').validators], - required: [{ value: this.required, disabled: true }, context.getValidation('required').validators], - properties: this.formBuilder.array( - (this.properties ?? []).map( - (item, index) => new DependencyPropertyEditorModel( - this.validationErrorModel - ).fromModel(item).buildForm({ - rootPath: `${rootPath}properties[${index}].` - }) - ), context.getValidation('properties').validators - ), - }); - } - - static createValidationContext(params: { - rootPath?: string, - validationErrorModel: ValidationErrorModel - }): ValidationContext { - const { rootPath = '', validationErrorModel } = params; - - const baseContext: ValidationContext = new ValidationContext(); - const baseValidationArray: Validation[] = new Array(); - baseValidationArray.push({ key: 'referenceTypeCode', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}referenceTypeCode`)] }); - baseValidationArray.push({ key: 'key', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}key`)] }); - baseValidationArray.push({ key: 'required', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}required`)] }); - baseValidationArray.push({ key: 'properties', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}properties`)] }); - - baseContext.validation = baseValidationArray; - return baseContext; - } - - static reapplyDepedencyValidators(params: { - formGroup: UntypedFormGroup, - validationErrorModel: ValidationErrorModel, - rootPath: string - }): void { - - const { formGroup, rootPath, validationErrorModel } = params; - const context = ReferenceTypeSourceBaseDependencyEditorModel.createValidationContext({ - rootPath, - validationErrorModel - }); - - ['referenceTypeCode', 'key', 'required'].forEach(keyField => { - const control = formGroup?.get(keyField); - control?.clearValidators(); - control?.addValidators(context.getValidation(keyField).validators); - }); - - (formGroup.get('properties') as FormArray).controls?.forEach( - (control, index) => DependencyPropertyEditorModel.reapplyPropertyValidators({ - formGroup: control as UntypedFormGroup, - rootPath: `${rootPath}properties[${index}].`, - validationErrorModel: validationErrorModel - }) - ); - } -} - -export class DependencyPropertyEditorModel implements DependencyPropertyPersist { - public code: string; - public target: string; - public required = true; - - - protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); - - constructor( - public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() - ) { } - - fromModel(item: DependencyProperty): DependencyPropertyEditorModel { - this.code = item.code; - this.target = item.target; - this.required = item.required; - - return this; - } - - buildForm(params?: { - context?: ValidationContext, - disabled?: boolean, - rootPath?: string - }): UntypedFormGroup { - let { context = null, disabled = false, rootPath } = params ?? {} - if (context == null) { - context = DependencyPropertyEditorModel.createValidationContext({ - validationErrorModel: this.validationErrorModel, - rootPath - }); - } - - return this.formBuilder.group({ - code: [{ value: this.code, disabled: disabled }, context.getValidation('code').validators], - target: [{ value: this.target, disabled: disabled }, context.getValidation('target').validators], - required: [{ value: this.required, disabled: true }, context.getValidation('required').validators], - }); - } - - static createValidationContext(params: { - rootPath?: string, - validationErrorModel: ValidationErrorModel - }): ValidationContext { - const { rootPath = '', validationErrorModel } = params; - - const baseContext: ValidationContext = new ValidationContext(); - const baseValidationArray: Validation[] = new Array(); - baseValidationArray.push({ key: 'code', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}code`)] }); - baseValidationArray.push({ key: 'target', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}target`)] }); - baseValidationArray.push({ key: 'required', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}required`)] }); - - baseContext.validation = baseValidationArray; - return baseContext; - } - - static reapplyPropertyValidators(params: { - formGroup: UntypedFormGroup, - validationErrorModel: ValidationErrorModel, - rootPath: string - }): void { - - const { formGroup, rootPath, validationErrorModel } = params; - const context = DependencyPropertyEditorModel.createValidationContext({ - rootPath, - validationErrorModel - }); - - ['code', 'target', 'required'].forEach(keyField => { - const control = formGroup?.get(keyField); - control?.clearValidators(); - control?.addValidators(context.getValidation(keyField).validators); - }) - } -} \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.resolver.ts b/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.resolver.ts index ca622335d..fac38d952 100644 --- a/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.resolver.ts +++ b/dmp-frontend/src/app/ui/admin/reference-type/editor/reference-type-editor.resolver.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; -import { AuthenticationConfiguration, QueryConfig, ReferenceType, ReferenceTypeDefinition, ReferenceTypeField, ReferenceTypeSourceBaseConfiguration, ResultsConfiguration, ResultFieldsMappingConfiguration, ReferenceTypeStaticOption, ReferenceTypeSourceBaseDependency, DependencyProperty } from '@app/core/model/reference-type/reference-type'; +import { AuthenticationConfiguration, QueryConfig, ReferenceType, ReferenceTypeDefinition, ReferenceTypeField, ReferenceTypeSourceBaseConfiguration, ResultsConfiguration, ResultFieldsMappingConfiguration, ReferenceTypeStaticOption, QueryCaseConfig } from '@app/core/model/reference-type/reference-type'; import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service'; import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service'; import { BaseEditorResolver } from '@common/base/base-editor.resolver'; @@ -31,6 +31,8 @@ export class ReferenceTypeEditorResolver extends BaseEditorResolver { [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.key)].join('.'), [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.label)].join('.'), [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.ordinal)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.referenceTypeDependencies),nameof(x => x.id)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.referenceTypeDependencies),nameof(x => x.name)].join('.'), [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.url)].join('.'), [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.results), nameof(x => x.resultsArrayPath)].join('.'), @@ -52,22 +54,19 @@ export class ReferenceTypeEditorResolver extends BaseEditorResolver { [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.auth),nameof(x => x.authRequestBody)].join('.'), [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.auth),nameof(x => x.type)].join('.'), - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.condition)].join('.'), - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.separator)].join('.'), - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.value)].join('.'), - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.ordinal)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.name)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.defaultValue)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.cases),nameof(x => x.likePattern)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.cases),nameof(x => x.separator)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.cases),nameof(x => x.value)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.cases),nameof(x => x.referenceType)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.cases),nameof(x => x.referenceType),nameof(x => x.id)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.cases),nameof(x => x.referenceType),nameof(x => x.name)].join('.'), + [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.queries),nameof(x => x.cases),nameof(x => x.referenceTypeSourceKey)].join('.'), [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.options),nameof(x => x.code)].join('.'), [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.options),nameof(x => x.value)].join('.'), - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.dependencies),nameof(x => x.referenceTypeCode)].join('.'), - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.dependencies),nameof(x => x.key)].join('.'), - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.dependencies),nameof(x => x.required)].join('.'), - - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.dependencies),nameof(x => x.properties), nameof(x => x.code)].join('.'), - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.dependencies),nameof(x => x.properties), nameof(x => x.target)].join('.'), - [nameof(x => x.definition), nameof(x => x.sources), nameof(x => x.dependencies),nameof(x => x.properties), nameof(x => x.required)].join('.'), - nameof(x => x.createdAt), nameof(x => x.updatedAt), nameof(x => x.isActive) diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 1d1298266..2d81beefb 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1496,14 +1496,13 @@ "RESULTS-PATH": "Results Path", "TOKEN-PATH": "Token Path", "TYPE": "Type", - "CONDITION": "Condition", "SEPARATOR": "Separator", "DEPENDENCIES": "Dependencies", - "DEPENDENCY": "Dependency", "REQUIRED": "Required", - "PROPERTIES": "Properties", - "PROPERTY": "Property", - "TARGET": "Target" + "DEFAULT-VALUE": "Default Value", + "CASE": "Case", + "LIKE-PATTERN": "Condition", + "SOURCE-KEY": "Source Key" }, "ACTIONS": { "SAVE": "Save", @@ -1515,10 +1514,8 @@ "REMOVE-SOURCE": "Remove Source", "ADD-QUERY": "Add Query", "REMOVE-QUERY": "Remove Query", - "ADD-DEPENDENCY": "Add Dependency", - "REMOVE-DEPENDENCY": "Remove Dependency", - "ADD-PROPERTY": "Add property", - "REMOVE-PROPERTY": "Remove property" + "ADD-CASE": "Add Case", + "REMOVE-CASE": "Remove Case" }, "CONFIRM-DELETE-DIALOG": { "MESSAGE": "Would you like to delete this Reference type?",