Skip to content

Commit

Permalink
apply default filters to related tab to hide disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-deboer committed Nov 3, 2017
1 parent e9a9456 commit 33ba6b4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/ui/src/containers/WorkloadInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const AsyncEditorPage = Loadable({
loading: LoadingComponentStub
})

const defaultRelatedFilters = ['status:!disabled']

const mapStateToProps = function(store) {
return {
resource: store.resources.resource,
Expand Down Expand Up @@ -50,7 +52,6 @@ const mapDispatchToProps = function(dispatch, ownProps) {
},
editResource: function(namespace, kind, name) {
dispatch(editResource(namespace, kind, name))
// ownProps.selectView('edit')
let { params } = ownProps.match
dispatch(editResource(params.namespace, params.kind, params.name))
},
Expand Down Expand Up @@ -95,8 +96,14 @@ const mapDispatchToProps = function(dispatch, ownProps) {
}

let { location } = ownProps
let newSearch = `?view=${tab}`
console.log(`selectView: pushed new location...`)
let query = queryString.parse(location.search)
if (query.view !== tab && tab === 'related') {
query.filters = defaultRelatedFilters
}
query.view = tab

let newSearch = queryString.stringify(query)

dispatch(routerActions.push({
pathname: location.pathname,
search: newSearch,
Expand Down

0 comments on commit 33ba6b4

Please sign in to comment.