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

@ -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;
}
}