From b226cffc5a83d0f202020ea64628a5f6614e24fa Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 21 Feb 2020 15:09:03 +0100 Subject: [PATCH] ui: convert all spaces to commas for filter We replace all spaces by commas when filtering the status page, however, due to the fact we don't use the `g` flag, it only splits the first value and stops after the first one. This patch adds the `g` flag to the regex so that all of the spaces are replaced by commas when filtering. Change-Id: I9b9cd33a7067fd00415e2ae1634e340a6df46749 --- web/src/containers/jobs/Jobs.jsx | 2 +- web/src/containers/status/Pipeline.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/containers/jobs/Jobs.jsx b/web/src/containers/jobs/Jobs.jsx index b4835cd145..9bd54ca68c 100644 --- a/web/src/containers/jobs/Jobs.jsx +++ b/web/src/containers/jobs/Jobs.jsx @@ -114,7 +114,7 @@ class JobsList extends React.Component { let filtered = false if (filter) { filtered = true - let filters = filter.replace(/ +/, ',').split(',') + let filters = filter.replace(/ +/g, ',').split(',') for (let job of jobs) { filters.forEach(jobFilter => { if (jobFilter && ( diff --git a/web/src/containers/status/Pipeline.jsx b/web/src/containers/status/Pipeline.jsx index b6ce6487a7..865e961a9b 100644 --- a/web/src/containers/status/Pipeline.jsx +++ b/web/src/containers/status/Pipeline.jsx @@ -90,7 +90,7 @@ class Pipeline extends React.Component { filterQueue(queue, filter) { let found = false - let filters = filter.replace(/ +/, ',').split(',') + let filters = filter.replace(/ +/g, ',').split(',') queue.heads.forEach(changes => { changes.forEach(change => { filters.forEach(changeFilter => {