From 357887417c4bd4640668ecdc206d73533f2233a2 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 26 Jul 2019 09:52:20 -0400 Subject: [PATCH] working commit --- .../src/components/FilterTags/FilterTags.jsx | 14 +++++++------- .../src/components/ListHeader/ListHeader.jsx | 2 +- .../PaginatedDataList/PaginatedDataList.jsx | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/awx/ui_next/src/components/FilterTags/FilterTags.jsx b/awx/ui_next/src/components/FilterTags/FilterTags.jsx index cf0ca41575..15be557527 100644 --- a/awx/ui_next/src/components/FilterTags/FilterTags.jsx +++ b/awx/ui_next/src/components/FilterTags/FilterTags.jsx @@ -25,7 +25,7 @@ const FilterLabel = styled.span` `; // remove non-default query params so they don't show up as filter tags -const filterOutDefaultParams = (paramsArr, config) => { +const filterDefaultParams = (paramsArr, config) => { const defaultParamsKeys = Object.keys(config.defaultParams); return paramsArr.filter(key => defaultParamsKeys.indexOf(key) === -1); }; @@ -34,7 +34,7 @@ const FilterTags = ({ i18n, itemCount, qsConfig, location, onRemove, onRemoveAll const queryParams = parseQueryString(qsConfig, location.search); const queryParamsArr = []; const displayAll = true; - const nonDefaultParams = filterOutDefaultParams(Object.keys(queryParams), qsConfig); + const nonDefaultParams = filterDefaultParams(Object.keys(queryParams), qsConfig); nonDefaultParams .forEach(key => { if (Array.isArray(queryParams[key])) { @@ -50,16 +50,16 @@ const FilterTags = ({ i18n, itemCount, qsConfig, location, onRemove, onRemoveAll {`${itemCount} results`} - Active Filters: + {i18n._(t`Active Filters:`)} - {queryParamsArr.map(param => ( + {queryParamsArr.map(({ key, value }) => ( onRemove(param)} + onClick={() => onRemove(key, value)} > - {param.value} + {value} ))}
diff --git a/awx/ui_next/src/components/ListHeader/ListHeader.jsx b/awx/ui_next/src/components/ListHeader/ListHeader.jsx index 1009de50f2..aca82ad7f1 100644 --- a/awx/ui_next/src/components/ListHeader/ListHeader.jsx +++ b/awx/ui_next/src/components/ListHeader/ListHeader.jsx @@ -50,7 +50,7 @@ class ListHeader extends React.Component { this.pushHistoryState(addParams(qsConfig, search, { [key]: value })); } - handleRemove ({ key, value }) { + handleRemove (key, value) { const { history, qsConfig } = this.props; const { search } = history.location; this.pushHistoryState(removeParams(qsConfig, search, { [key]: value })); diff --git a/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.jsx b/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.jsx index 6508e0d6aa..d369598b79 100644 --- a/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.jsx +++ b/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.jsx @@ -51,7 +51,7 @@ class PaginatedDataList extends React.Component { render () { const { - hasContentError, + contentError, hasContentLoading, emptyStateControls, items, @@ -79,8 +79,8 @@ class PaginatedDataList extends React.Component { let Content; if (hasContentLoading && items.length <= 0) { Content = (); - } else if (hasContentError) { - Content = (); + } else if (contentError) { + Content = (); } else if (items.length <= 0) { Content = (); } else { @@ -150,12 +150,12 @@ PaginatedDataList.propTypes = { showPageSizeOptions: PropTypes.bool, renderToolbar: PropTypes.func, hasContentLoading: PropTypes.bool, - hasContentError: PropTypes.bool, + contentError: PropTypes.shape(), }; PaginatedDataList.defaultProps = { hasContentLoading: false, - hasContentError: false, + contentError: null, toolbarColumns: [], itemName: 'item', itemNamePlural: '',