minor fixes

This commit is contained in:
Diamantis Tziotzios 2024-04-16 18:20:43 +03:00
parent b7774759f6
commit 04da845f49
6 changed files with 34 additions and 22 deletions

View File

@ -216,7 +216,6 @@ public class ReferenceQuery extends QueryBase<ReferenceEntity> {
List<Predicate> predicates = new ArrayList<>();
if (userId != null || usePublic) {
predicates.add(queryContext.CriteriaBuilder.or(
queryContext.CriteriaBuilder.isNull(queryContext.Root.get(ReferenceEntity._createdById)),
userId != null ? queryContext.CriteriaBuilder.equal(queryContext.Root.get(ReferenceEntity._createdById), userId) : queryContext.CriteriaBuilder.or(), //Creates a false query
queryContext.CriteriaBuilder.in(queryContext.Root.get(ReferenceEntity._id)).value(queryUtilsService.buildSubQuery(new BuildSubQueryInput<>(new BuildSubQueryInput.Builder<>(DmpReferenceEntity.class, UUID.class)
.query(queryContext.Query)

View File

@ -216,7 +216,7 @@ public class ExternalFetcherServiceImpl implements ExternalFetcherService {
else if (!this.conventionService.isNullOrEmpty(apiSource.getFirstPage())) completedPath = completedPath.replace("{page}", apiSource.getFirstPage());
else completedPath = completedPath.replace("{page}", "1");
completedPath = completedPath.replace("{pageSize}", !this.conventionService.isNullOrEmpty(externalReferenceCriteria.getPageSize()) ? externalReferenceCriteria.getPageSize() : "60");
completedPath = completedPath.replace("{pageSize}", !this.conventionService.isNullOrEmpty(externalReferenceCriteria.getPageSize()) ? externalReferenceCriteria.getPageSize() : "50");
completedPath = completedPath.replace("{host}", !this.conventionService.isNullOrEmpty(externalReferenceCriteria.getHost()) ? externalReferenceCriteria.getHost() : "");
completedPath = completedPath.replace("{path}", !this.conventionService.isNullOrEmpty(externalReferenceCriteria.getPath()) ? externalReferenceCriteria.getPath() : "");

View File

@ -3,7 +3,7 @@ import { ReferenceType } from "../reference-type/reference-type";
import { ExternalFetcherSourceType } from "@app/core/common/enum/external-fetcher-source-type";
import { Guid } from "@common/types/guid";
export interface ExternalFetcherBaseSourceConfiguration extends ExternalFetcherApiSourceConfiguration, ExternalFetcherStaticOptionSourceConfiguration{
export interface ExternalFetcherBaseSourceConfiguration extends ExternalFetcherApiSourceConfiguration, ExternalFetcherStaticOptionSourceConfiguration {
type: ExternalFetcherSourceType;
key: string;
label: string;
@ -11,7 +11,7 @@ export interface ExternalFetcherBaseSourceConfiguration extends ExternalFetcherA
referenceTypeDependencies?: ReferenceType[];
}
export interface ExternalFetcherApiSourceConfiguration{
export interface ExternalFetcherApiSourceConfiguration {
url: string;
results: ResultsConfiguration;
paginationPath: string;
@ -24,18 +24,18 @@ export interface ExternalFetcherApiSourceConfiguration{
queries?: QueryConfig[];
}
export interface ResultsConfiguration{
export interface ResultsConfiguration {
resultsArrayPath: string;
fieldsMapping: ResultFieldsMappingConfiguration[];
}
export interface ResultFieldsMappingConfiguration{
export interface ResultFieldsMappingConfiguration {
code: string;
responsePath: string;
}
export interface AuthenticationConfiguration{
export interface AuthenticationConfiguration {
enabled: boolean;
authUrl: string;
authMethod: ExternalFetcherApiHTTPMethodType;
@ -44,13 +44,13 @@ export interface AuthenticationConfiguration{
type: string;
}
export interface QueryConfig{
export interface QueryConfig {
name: string;
defaultValue: string;
cases: QueryCaseConfig[];
}
export interface QueryCaseConfig{
export interface QueryCaseConfig {
likePattern: string,
separator: string;
value: string;
@ -58,15 +58,15 @@ export interface QueryCaseConfig{
referenceTypeSourceKey: string
}
export interface ExternalFetcherStaticOptionSourceConfiguration{
export interface ExternalFetcherStaticOptionSourceConfiguration {
items: Static[];
}
export interface Static{
export interface Static {
options: StaticOption[];
}
export interface StaticOption{
export interface StaticOption {
code: string;
value: string;
}
@ -75,7 +75,7 @@ export interface StaticOption{
// Persist
//
export interface ExternalFetcherBaseSourceConfigurationPersist extends ExternalFetcherApiSourceConfigurationPersist, ExternalFetcherStaticOptionSourceConfigurationPersist{
export interface ExternalFetcherBaseSourceConfigurationPersist extends ExternalFetcherApiSourceConfigurationPersist, ExternalFetcherStaticOptionSourceConfigurationPersist {
type: ExternalFetcherSourceType;
key: string;
label: string;
@ -83,7 +83,7 @@ export interface ExternalFetcherBaseSourceConfigurationPersist extends ExternalF
referenceTypeDependencyIds?: Guid[];
}
export interface ExternalFetcherApiSourceConfigurationPersist{
export interface ExternalFetcherApiSourceConfigurationPersist {
url: string;
results: ResultsConfigurationPersist;
paginationPath: string;
@ -96,18 +96,18 @@ export interface ExternalFetcherApiSourceConfigurationPersist{
queries?: QueryConfigPersist[];
}
export interface ResultsConfigurationPersist{
export interface ResultsConfigurationPersist {
resultsArrayPath: string;
fieldsMapping: ResultFieldsMappingConfigurationPersist[];
}
export interface ResultFieldsMappingConfigurationPersist{
export interface ResultFieldsMappingConfigurationPersist {
code: string;
responsePath: string;
}
export interface AuthenticationConfigurationPersist{
export interface AuthenticationConfigurationPersist {
enabled: boolean;
authUrl: string;
authMethod: ExternalFetcherApiHTTPMethodType;
@ -116,13 +116,13 @@ export interface AuthenticationConfigurationPersist{
type: string;
}
export interface QueryConfigPersist{
export interface QueryConfigPersist {
name: string;
defaultValue: string;
cases: QueryCaseConfigPersist[];
}
export interface QueryCaseConfigPersist{
export interface QueryCaseConfigPersist {
likePattern: string,
separator: string;
value: string;
@ -134,11 +134,11 @@ export interface ExternalFetcherStaticOptionSourceConfigurationPersist {
items: StaticPersist[];
}
export interface StaticPersist{
export interface StaticPersist {
options: StaticOptionPersist[];
}
export interface StaticOptionPersist{
export interface StaticOptionPersist {
code: string;
value: string;
}

View File

@ -1,10 +1,12 @@
import { Lookup } from "@common/model/lookup";
import { Guid } from "@common/types/guid";
import { Reference } from "../model/reference/reference";
export class ReferenceSearchLookup extends Lookup {
like: string;
typeId: Guid;
key: string;
dependencyReferences: Reference[];
constructor() {
super();
@ -16,6 +18,7 @@ export class ReferenceSearchDefinitionLookup extends Lookup {
like: string;
typeId: Guid;
key: string;
dependencyReferences: Reference[];
constructor() {
super();

View File

@ -584,7 +584,6 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
},
error => this.onCallbackError(error)
);
}
calculateMultiplicityRejectedDmpDescriptionTemplates(section: DmpBlueprintDefinitionSection, descriptions: Description[]) : DmpDescriptionTemplate[]{

View File

@ -28,6 +28,8 @@ export class ReferenceFieldComponent extends BaseComponent implements OnInit {
@Input() multiple: boolean = true;
@Input() hint: string;
@Input() placeholder: string;
@Input() dependencies: UntypedFormGroup = null;
multipleAutoCompleteSearchConfiguration: MultipleAutoCompleteConfiguration;
singleAutoCompleteSearchConfiguration: SingleAutoCompleteConfiguration;
@ -84,6 +86,15 @@ export class ReferenceFieldComponent extends BaseComponent implements OnInit {
};
lookup.typeId = typeId;
lookup.order = { items: [nameof<Reference>(x => x.label)] };
// const sourcesWithDependencies = this.referenceType.definition.sources.filter(x => x.referenceTypeDependencies);
// if (sourcesWithDependencies.length > 0) {
// Object.keys(this.dependencies.controls).forEach(controlName => {
// (this.dependencies.get(controlName).get('references').value as Reference[]).filter(x=> sourcesWithDependencies.some(y => y.referenceTypeDependencies) x.type.id == this.referenceType.id &&)
// });
// lookup.dependencyReferences = [];
// }
return lookup;
}
}