1- import { formatDates , initCopyHandler } from '../table.js' ;
1+ import { formatDates , initCopyHandler , trimForDisplay } from '../table.js' ;
22import toasts from '../toasts.js' ;
33import PubSub from '../../pub-sub.js' ;
44
@@ -97,11 +97,13 @@ function initFilter(tableFilter) {
9797 { value : 'status: running' , dbValue : 'running' , field : 'status' } ,
9898 { value : 'status: failed' , dbValue : 'failed' , field : 'status' } ,
9999 { value : 'status: queued' , dbValue : 'queued' , field : 'status' } ,
100+ { value : 'status: warning' , dbValue : 'warning' , field : 'status' } ,
100101 ] ;
101102 const allowedValues = allowedList . map ( ( t ) => t . value ) ;
102103 // eslint-disable-next-line no-new
103104 const tagInput = new Tagify ( filterInput , {
104105 whitelist : allowedList ,
106+ delimiters : null ,
105107 validate ( tag ) {
106108 if ( allowedValues . includes ( tag . value ) ) {
107109 return true ;
@@ -115,6 +117,21 @@ function initFilter(tableFilter) {
115117 enabled : 0 ,
116118 closeOnSelect : true ,
117119 } ,
120+ templates : {
121+ tag ( tagData ) {
122+ return `<tag title="${ tagData . dbValue } "
123+ contenteditable='false'
124+ spellcheck='false'
125+ tabIndex="${ this . settings . a11y . focusableTags ? 0 : - 1 } "
126+ class="${ this . settings . classNames . tag } "
127+ ${ this . getAttributes ( tagData ) } >
128+ <x title='' class="${ this . settings . classNames . tagX } " role='button' aria-label='remove tag'></x>
129+ <div>
130+ <span class="${ this . settings . classNames . tagText } ">${ trimForDisplay ( tagData . value . split ( ': ' ) [ 1 ] , 20 ) } </span>
131+ </div>
132+ </tag>` ;
133+ } ,
134+ } ,
118135 } ) ;
119136 const initialTags = JSON . parse ( tableFilter ) ;
120137 tagInput . addTags ( initialTags ) ;
0 commit comments