fix reference type persist and editor

This commit is contained in:
amentis 2023-11-10 13:03:08 +02:00
parent 3ecb1ed982
commit c2c1d834cc
5 changed files with 15 additions and 15 deletions

View File

@ -190,6 +190,7 @@ public class ReferenceTypeQuery extends QueryBase<ReferenceTypeEntity> {
else if (item.match(ReferenceType._updatedAt)) return ReferenceTypeEntity._updatedAt; else if (item.match(ReferenceType._updatedAt)) return ReferenceTypeEntity._updatedAt;
else if (item.match(ReferenceType._isActive)) return ReferenceTypeEntity._isActive; else if (item.match(ReferenceType._isActive)) return ReferenceTypeEntity._isActive;
else if (item.match(ReferenceType._definition)) return ReferenceTypeEntity._definition; else if (item.match(ReferenceType._definition)) return ReferenceTypeEntity._definition;
else if (item.prefix(ReferenceType._definition)) return ReferenceTypeEntity._definition;
else return null; else return null;
} }

View File

@ -147,7 +147,7 @@ public class ReferenceTypeServiceImpl implements ReferenceTypeService {
data.setRequestType(persist.getRequestType()); data.setRequestType(persist.getRequestType());
data.setRequestBody(persist.getRequestBody()); data.setRequestBody(persist.getRequestBody());
data.setFilterType(persist.getFilterType()); data.setFilterType(persist.getFilterType());
if (data.getAuth() != null) data.setAuth(this.buildAuthConfigEntity(persist.getAuth())); if (persist.getAuth() != null) data.setAuth(this.buildAuthConfigEntity(persist.getAuth()));
if (!this.conventionService.isListNullOrEmpty(persist.getQueries())){ if (!this.conventionService.isListNullOrEmpty(persist.getQueries())){
data.setQueries(new ArrayList<>()); data.setQueries(new ArrayList<>());
for (QueryConfigPersist queryConfigPersist: persist.getQueries()) { for (QueryConfigPersist queryConfigPersist: persist.getQueries()) {

View File

@ -33,7 +33,7 @@ export interface ReferenceTypeExternalApiConfiguration {
requestType?: string; requestType?: string;
requestBody?: string; requestBody?: string;
filterType?: string; filterType?: string;
auth?: AuthenticationConfiguration; auth: AuthenticationConfiguration;
queries?: QueryConfig[]; queries?: QueryConfig[];
} }
@ -96,7 +96,7 @@ export interface ReferenceTypeExternalApiConfigurationPersist {
requestType?: string; requestType?: string;
requestBody?: string; requestBody?: string;
filterType?: string; filterType?: string;
auth?: AuthenticationConfigurationPersist; auth: AuthenticationConfigurationPersist;
queries?: QueryConfigPersist[]; queries?: QueryConfigPersist[];
} }
@ -114,7 +114,7 @@ export interface ResultFieldsMappingConfigurationPersist{
export interface AuthenticationConfigurationPersist{ export interface AuthenticationConfigurationPersist{
authUrl: string; authUrl: string;
authMethod?: string; authMethod: string;
authTokenPath: string; authTokenPath: string;
authRequestBody: string; authRequestBody: string;
type: string; type: string;

View File

@ -26,7 +26,6 @@ import { map, takeUntil } from 'rxjs/operators';
import { ReferenceTypeEditorResolver } from './reference-type-editor.resolver'; import { ReferenceTypeEditorResolver } from './reference-type-editor.resolver';
import { ReferenceTypeEditorService } from './reference-type-editor.service'; import { ReferenceTypeEditorService } from './reference-type-editor.service';
import { QueryConfigEditorModel, ReferenceTypeEditorModel, ReferenceTypeExternalApiConfigurationEditorModel, ReferenceTypeFieldEditorModel, ResultFieldsMappingConfigurationEditorModel } from './reference-type-editor.model'; import { QueryConfigEditorModel, ReferenceTypeEditorModel, ReferenceTypeExternalApiConfigurationEditorModel, ReferenceTypeFieldEditorModel, ResultFieldsMappingConfigurationEditorModel } from './reference-type-editor.model';
import { DmpBlueprintDefinitionSectionEditorModel } from '@app/ui/admin/dmp-blueprint/editor/dmp-blueprint-editor.model';
import { ReferenceFieldDataType } from '@app/core/common/enum/reference-field-data-type'; import { ReferenceFieldDataType } from '@app/core/common/enum/reference-field-data-type';
@ -120,7 +119,7 @@ export class ReferenceTypeEditorComponent extends BaseEditor<ReferenceTypeEditor
buildForm() { buildForm() {
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditReferenceType)); this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditReferenceType));
console.log(this.formGroup.get('definition')); console.log(this.formGroup.get('definition').value);
this.referenceTypeEditorService.setValidationErrorModel(this.editorModel.validationErrorModel); this.referenceTypeEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
} }

View File

@ -43,16 +43,16 @@ export class ReferenceTypeEditorResolver extends BaseEditorResolver {
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.requestBody)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.requestBody)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.filterType)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.filterType)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.results),nameof<AuthenticationConfiguration>(x => x.authUrl)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.auth),nameof<AuthenticationConfiguration>(x => x.authUrl)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.results),nameof<AuthenticationConfiguration>(x => x.authMethod)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.auth),nameof<AuthenticationConfiguration>(x => x.authMethod)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.results),nameof<AuthenticationConfiguration>(x => x.authTokenPath)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.auth),nameof<AuthenticationConfiguration>(x => x.authTokenPath)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.results),nameof<AuthenticationConfiguration>(x => x.authRequestBody)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.auth),nameof<AuthenticationConfiguration>(x => x.authRequestBody)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.results),nameof<AuthenticationConfiguration>(x => x.type)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.auth),nameof<AuthenticationConfiguration>(x => x.type)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.results),nameof<QueryConfig>(x => x.condition)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.queries),nameof<QueryConfig>(x => x.condition)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.results),nameof<QueryConfig>(x => x.separator)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.queries),nameof<QueryConfig>(x => x.separator)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.results),nameof<QueryConfig>(x => x.value)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.queries),nameof<QueryConfig>(x => x.value)].join('.'),
[nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.results),nameof<QueryConfig>(x => x.ordinal)].join('.'), [nameof<ReferenceType>(x => x.definition), nameof<ReferenceTypeDefinition>(x => x.externalApiConfig), nameof<ReferenceTypeExternalApiConfiguration>(x => x.queries),nameof<QueryConfig>(x => x.ordinal)].join('.'),
nameof<ReferenceType>(x => x.createdAt), nameof<ReferenceType>(x => x.createdAt),
nameof<ReferenceType>(x => x.updatedAt), nameof<ReferenceType>(x => x.updatedAt),