Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Commit

Permalink
bugfix (Issue #111): remove attributefilter in the structured query, …
Browse files Browse the repository at this point in the history
…where no concepts are selected

removed unnecessary console.logs
  • Loading branch information
thkoehler11 committed Feb 21, 2022
1 parent b477d73 commit 14005e8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class DisplayEntitiesComponent implements OnInit {
child.valueFilters[0].selectedConcepts = child.valueDefinitions[0].selectableConcepts
})
})
console.log(this.critGroup)
}

getInnerLabelKey(): 'AND' | 'OR' {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div *ngIf="filter" class="container">
<div *ngIf="filter.type === OperatorOptions.CONCEPT">
<div *ngIf="filter">
<div
*ngIf="filter.type === OperatorOptions.CONCEPT && filter.selectedConcepts.length > 0"
class="container"
>
<span *ngIf="filter.display">{{ filter.display }}{{ ': ' }}</span>
<span *ngIf="filter.attributeDefinition?.attributeCode?.display"
>{{ filter.attributeDefinition?.attributeCode?.display }}{{ ': ' }}</span
Expand All @@ -14,7 +17,7 @@
</span>
</div>

<div *ngIf="filter.type === OperatorOptions.QUANTITY_COMPARATOR">
<div *ngIf="filter.type === OperatorOptions.QUANTITY_COMPARATOR" class="container">
<span *ngIf="filter.display">{{ filter.display }}{{ ': ' }}</span>
<span *ngIf="filter.attributeDefinition?.attributeCode?.display"
>{{ filter.attributeDefinition?.attributeCode?.display }}{{ ': ' }}</span
Expand All @@ -31,7 +34,7 @@
}}
</div>

<div *ngIf="filter.type === OperatorOptions.QUANTITY_RANGE">
<div *ngIf="filter.type === OperatorOptions.QUANTITY_RANGE" class="container">
<span *ngIf="filter.display">{{ filter.display }}{{ ': ' }}</span>
<span *ngIf="filter.attributeDefinition?.attributeCode?.display"
>{{ filter.attributeDefinition?.attributeCode?.display }}{{ ': ' }}</span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class EditValueFilterComponent implements OnInit {
constructor() {}

ngOnInit(): void {
console.log(this.filter)
this.filter?.selectedConcepts.forEach((concept) =>
this.selectedConceptsAsJson.add(JSON.stringify(concept))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export class EnterCriterionListComponent implements OnInit {
isAddible: undefined,
})
})
console.log(this.criterionList)
}

doSave(event: { groupId: number }, criterion: Criterion): void {
Expand Down
10 changes: 8 additions & 2 deletions src/app/modules/querybuilder/controller/ApiTranslator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,14 @@ export class ApiTranslator {
criterionV2.valueFilter.valueDefinition = undefined
}
if (criterion.attributeFilters?.length > 0) {
criterionV2.attributeFilters = criterion.attributeFilters
criterionV2.attributeFilters.forEach((attribute) => {
criterion.attributeFilters.forEach((attribute) => {
if (attribute.type === OperatorOptions.CONCEPT) {
if (attribute.selectedConcepts.length > 0) {
criterionV2.attributeFilters.push(attribute)
}
} else {
criterionV2.attributeFilters.push(attribute)
}
attribute.attributeCode = attribute.attributeDefinition.attributeCode
})
}
Expand Down

0 comments on commit 14005e8

Please sign in to comment.