File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
apps/back-office/src/app/dashboard/pages/dashboard Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,8 @@ <h1 class="!m-0 overflow-hidden text-ellipsis">
140140 < ui-graphql-select
141141 [query] ="recordsQuery "
142142 [formControl] ="contextId "
143+ [filterable] ="true "
144+ (searchChange) ="onSearchChange($event) "
143145 path ="records "
144146 valueField ="id "
145147 textField ="data.{{ dashboard.page.context.displayField }} "
Original file line number Diff line number Diff line change @@ -846,4 +846,32 @@ export class DashboardComponent
846846 subscription ?. unsubscribe ( ) ;
847847 } ) ;
848848 }
849+
850+ /**
851+ * Update query based on text search.
852+ *
853+ * @param search Search text from the graphql select
854+ */
855+ public onSearchChange ( search : string ) : void {
856+ const context = this . dashboard ?. page ?. context ;
857+ if ( ! context ) return ;
858+ if ( 'resource' in context ) {
859+ this . recordsQuery . refetch ( {
860+ variables : {
861+ first : ITEMS_PER_PAGE ,
862+ id : context . resource ,
863+ } ,
864+ filter : {
865+ logic : 'and' ,
866+ filters : [
867+ {
868+ field : context . displayField ,
869+ operator : 'contains' ,
870+ value : search ,
871+ } ,
872+ ] ,
873+ } ,
874+ } ) ;
875+ }
876+ }
849877}
You can’t perform that action at this time.
0 commit comments