Skip to content

Commit

Permalink
fixing cluster and scope filtration
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Bukhanets committed Apr 18, 2018
1 parent d4fea94 commit 7fd3ba9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions client/lib/application/src/cluster-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ClusterList extends React.Component {
super();
this.state = {
term: '',
filtered: props.clusters,
filtered: props.clusters || [],
selected: props.selected || []
};
}
Expand Down Expand Up @@ -42,7 +42,7 @@ class ClusterList extends React.Component {
this.setState({
term: term,
filtered: term.length ?
this.props.clusters.filter(c => c.alias.indexOf(term) >= 0 || this.state.selected.some(s => s === c.id)) :
this.props.clusters.filter(c => c.alias.indexOf(term) >= 0 || (this.state.selected && this.state.selected.some(s => s === c.id))) :
this.props.clusters
});
}
Expand Down
12 changes: 5 additions & 7 deletions client/lib/application/src/folded-scope-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ class OwnerScopeList extends ScopeList {
}

componentWillReceiveProps(nextProps) {
if (!this.state.term.length) {
this.setState({
filtered: nextProps.scopes,
selected: nextProps.selected,
allResources: nextProps.allResources
});
}
this.setState({
filtered: nextProps.scopes,
selected: nextProps.selected,
allResources: nextProps.allResources
});
}

toggleFolding(resourceType) {
Expand Down

0 comments on commit 7fd3ba9

Please sign in to comment.