fix reference type persist and editor
This commit is contained in:
parent
3ecb1ed982
commit
c2c1d834cc
|
@ -190,6 +190,7 @@ public class ReferenceTypeQuery extends QueryBase<ReferenceTypeEntity> {
|
|||
else if (item.match(ReferenceType._updatedAt)) return ReferenceTypeEntity._updatedAt;
|
||||
else if (item.match(ReferenceType._isActive)) return ReferenceTypeEntity._isActive;
|
||||
else if (item.match(ReferenceType._definition)) return ReferenceTypeEntity._definition;
|
||||
else if (item.prefix(ReferenceType._definition)) return ReferenceTypeEntity._definition;
|
||||
else return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ public class ReferenceTypeServiceImpl implements ReferenceTypeService {
|
|||
data.setRequestType(persist.getRequestType());
|
||||
data.setRequestBody(persist.getRequestBody());
|
||||
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())){
|
||||
data.setQueries(new ArrayList<>());
|
||||
for (QueryConfigPersist queryConfigPersist: persist.getQueries()) {
|
||||
|
|
|
@ -33,7 +33,7 @@ export interface ReferenceTypeExternalApiConfiguration {
|
|||
requestType?: string;
|
||||
requestBody?: string;
|
||||
filterType?: string;
|
||||
auth?: AuthenticationConfiguration;
|
||||
auth: AuthenticationConfiguration;
|
||||
queries?: QueryConfig[];
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ export interface ReferenceTypeExternalApiConfigurationPersist {
|
|||
requestType?: string;
|
||||
requestBody?: string;
|
||||
filterType?: string;
|
||||
auth?: AuthenticationConfigurationPersist;
|
||||
auth: AuthenticationConfigurationPersist;
|
||||
queries?: QueryConfigPersist[];
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ export interface ResultFieldsMappingConfigurationPersist{
|
|||
|
||||
export interface AuthenticationConfigurationPersist{
|
||||
authUrl: string;
|
||||
authMethod?: string;
|
||||
authMethod: string;
|
||||
authTokenPath: string;
|
||||
authRequestBody: string;
|
||||
type: string;
|
||||
|
|
|
@ -26,7 +26,6 @@ import { map, takeUntil } from 'rxjs/operators';
|
|||
import { ReferenceTypeEditorResolver } from './reference-type-editor.resolver';
|
||||
import { ReferenceTypeEditorService } from './reference-type-editor.service';
|
||||
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';
|
||||
|
||||
|
||||
|
@ -120,7 +119,7 @@ export class ReferenceTypeEditorComponent extends BaseEditor<ReferenceTypeEditor
|
|||
|
||||
buildForm() {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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.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.results),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.results),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.authUrl)].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.auth),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.authRequestBody)].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.results),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.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.condition)].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.queries),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.ordinal)].join('.'),
|
||||
|
||||
nameof<ReferenceType>(x => x.createdAt),
|
||||
nameof<ReferenceType>(x => x.updatedAt),
|
||||
|
|
Loading…
Reference in New Issue