Connect-Admin release 19th June 2023 #2
|
@ -49,7 +49,6 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.reset();
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.subscriptions.push(this.vocabulariesService.getVocabularyByType('fos', null, properties).subscribe((fos: any[]) => {
|
this.subscriptions.push(this.vocabulariesService.getVocabularyByType('fos', null, properties).subscribe((fos: any[]) => {
|
||||||
this.fos = fos.map(element => element.id);
|
this.fos = fos.map(element => element.id);
|
||||||
|
@ -60,6 +59,9 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
|
if(changes.selectionCriteria){
|
||||||
|
this.reset();
|
||||||
|
}
|
||||||
this.calculateMaxHeight();
|
this.calculateMaxHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,10 +88,11 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||||
}
|
}
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
|
this.selectionCriteriaForm = this.fb.group({
|
||||||
|
criteria: this.fb.array([])
|
||||||
|
});
|
||||||
if (this.selectionCriteria?.criteria) {
|
if (this.selectionCriteria?.criteria) {
|
||||||
this.selectionCriteriaForm = this.fb.group({
|
|
||||||
criteria: this.fb.array([])
|
|
||||||
});
|
|
||||||
this.selectionCriteria.criteria.forEach(criterion => {
|
this.selectionCriteria.criteria.forEach(criterion => {
|
||||||
let constraintArray: UntypedFormArray = this.fb.array([]);
|
let constraintArray: UntypedFormArray = this.fb.array([]);
|
||||||
criterion.constraint.forEach(constraint => {
|
criterion.constraint.forEach(constraint => {
|
||||||
|
|
Loading…
Reference in New Issue