Skip to content
Snippets Groups Projects
Verified Commit 9bf838cc authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #13271 TIME 0:30 save searchTerm in searchTemplate

parent 9973e2c4
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@
(keydown)="$event.stopPropagation()">
</mat-form-field>
</div>
<button mat-menu-item (click)="saveSearchTemplate()" style="display: flex;align-items: center;" [disabled]="functions.empty(currentCriteria)">
<button mat-menu-item (click)="saveSearchTemplate()" style="display: flex;align-items: center;" [disabled]="functions.empty(currentCriteria) && functions.empty(searchTermControl.value)">
<div style="flex:1;">
{{'lang.createSearchTemplate' | translate}}
</div>
......
......@@ -394,6 +394,8 @@ export class CriteriaToolComponent implements OnInit {
query.push({'identifier': field.identifier, 'values': field.control.value});
});
query.push({'identifier': 'searchTerm', 'values': this.searchTermControl.value});
const dialogRef = this.dialog.open(
AddSearchTemplateModalComponent,
{
......@@ -456,5 +458,10 @@ export class CriteriaToolComponent implements OnInit {
this.addCriteria(element);
}
});
let index = searchTemplate.query.map((field: any) => field.identifier).indexOf('searchTerm');
if (index > -1) {
this.searchTermControl.setValue(searchTemplate.query[index].values);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment