From: Lenz Grimmer Date: Wed, 13 Mar 2019 14:37:28 +0000 (+0100) Subject: Merge pull request #26765 from p-na/wip-pna-rbd-conf-table-search X-Git-Tag: v14.2.0~36 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d239b3c0e7b9c4082ccfceafaf9bbe6ef894ffbe;p=ceph-ci.git Merge pull request #26765 from p-na/wip-pna-rbd-conf-table-search mgr/dashboard: Fix search in `Source` column of RBD configuration list Reviewed-by: Stephan Müller Reviewed-by: Volker Theile --- d239b3c0e7b9c4082ccfceafaf9bbe6ef894ffbe diff --cc src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts index 5052a93cf31,dbf8d1b426f..784c86f1bcb --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts @@@ -509,20 -510,22 +510,22 @@@ export class TableComponent implements return this.subSearch(data, currentSearch, columnsClone); } - basicDataSearch(searchTerm: string, data: any[], columns: CdTableColumn[]) { + basicDataSearch(searchTerm: string, rows: any[], columns: CdTableColumn[]) { if (searchTerm.length === 0) { - return data; + return rows; } - return data.filter((d) => { + return rows.filter((row) => { return ( - columns.filter((c) => { - let cellValue: any = _.get(d, c.prop); - if (!_.isUndefined(c.pipe)) { - cellValue = c.pipe.transform(cellValue); + columns.filter((col) => { + let cellValue: any = _.get(row, col.prop); + + if (!_.isUndefined(col.pipe)) { + cellValue = col.pipe.transform(cellValue); } - if (_.isUndefined(cellValue)) { - return; + if (_.isUndefined(cellValue) || _.isNull(cellValue)) { + return false; } + if (_.isArray(cellValue)) { cellValue = cellValue.join(' '); } else if (_.isNumber(cellValue) || _.isBoolean(cellValue)) {