diff options
author | James E. Blair <jim@acmegating.com> | 2022-11-01 14:40:17 -0700 |
---|---|---|
committer | James E. Blair <jim@acmegating.com> | 2022-11-01 14:43:36 -0700 |
commit | f9b0cca24d5d9dc194987ad5106402af85a9d7c7 (patch) | |
tree | b025fa4442ee608f2ea66bc0037b76f2e3c04c18 | |
parent | 3c8d460bf8699a11c2f9d04a355d551b29a9b4a9 (diff) | |
download | zuul-f9b0cca24d5d9dc194987ad5106402af85a9d7c7.tar.gz |
Fix skipped builds filter in web ui
The change to automatically filter out skipped builds inadvertently
affected the buildsets tab as well since they share the query builder.
This caused the buildsets tab to automatically append a filter which
is invalid for buildsets and therefore return a 404.
This change adds an argument to the query builder to indicate whether
it should include the automatic filter.
Additionally, the query builder had an error which caused it to
append the query in all cases (which affects the otherwise working
builds tab). This change corrects that as well.
Change-Id: Id03eee51b3551c4b32ae3c6b784b0993c4a3779c
-rw-r--r-- | releasenotes/notes/fix-buildsets-tab-5576b72cf7a2251f.yaml | 5 | ||||
-rw-r--r-- | web/src/containers/FilterToolbar.jsx | 6 | ||||
-rw-r--r-- | web/src/pages/Builds.jsx | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/releasenotes/notes/fix-buildsets-tab-5576b72cf7a2251f.yaml b/releasenotes/notes/fix-buildsets-tab-5576b72cf7a2251f.yaml new file mode 100644 index 000000000..59fec39fc --- /dev/null +++ b/releasenotes/notes/fix-buildsets-tab-5576b72cf7a2251f.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + An error which prevented results from appearing in the web UI on + the "Buildsets" tab has been corrected. diff --git a/web/src/containers/FilterToolbar.jsx b/web/src/containers/FilterToolbar.jsx index 4cc1e3f25..328d60d85 100644 --- a/web/src/containers/FilterToolbar.jsx +++ b/web/src/containers/FilterToolbar.jsx @@ -317,13 +317,13 @@ function writeFiltersToUrl(filters, location, history) { }) } -function buildQueryString(filters) { +function buildQueryString(filters, excludeResults) { let queryString = '&complete=true' let resultFilter = false if (filters) { Object.keys(filters).map((key) => { filters[key].forEach((value) => { - if (value === 'result') { + if (key === 'result') { resultFilter = true } queryString += '&' + key + '=' + value @@ -331,7 +331,7 @@ function buildQueryString(filters) { return queryString }) } - if (!resultFilter) { + if (excludeResults && !resultFilter) { queryString += '&exclude_result=SKIPPED' } return queryString diff --git a/web/src/pages/Builds.jsx b/web/src/pages/Builds.jsx index 7165e143b..b89bcd678 100644 --- a/web/src/pages/Builds.jsx +++ b/web/src/pages/Builds.jsx @@ -158,7 +158,7 @@ class BuildsPage extends React.Component { limit: filters.limit.length > 0 ? filters.limit : [50,] } let _filters = { ...filters, ...paginationOptions } - const queryString = buildQueryString(_filters) + const queryString = buildQueryString(_filters, true) this.setState({ fetching: true }) // TODO (felix): What happens in case of a broken network connection? Is the // fetching shows infinitely or can we catch this and show an erro state in |