diff --git a/ui/src/flux/components/DatabaseListItem.tsx b/ui/src/flux/components/DatabaseListItem.tsx index a9eba5be52..3b0795ea57 100644 --- a/ui/src/flux/components/DatabaseListItem.tsx +++ b/ui/src/flux/components/DatabaseListItem.tsx @@ -85,25 +85,23 @@ class DatabaseListItem extends PureComponent { const {db, service} = this.props const {isOpen, searchTerm} = this.state - if (isOpen) { - return ( -
-
- -
- + return ( +
+
+
- ) - } + +
+ ) } private handleClickCopy = e => { diff --git a/ui/src/flux/components/TagList.tsx b/ui/src/flux/components/TagList.tsx index 86295ad873..aea90cbb19 100644 --- a/ui/src/flux/components/TagList.tsx +++ b/ui/src/flux/components/TagList.tsx @@ -12,17 +12,7 @@ interface Props { filter: SchemaFilter[] } -interface State { - isOpen: boolean -} - -export default class TagList extends PureComponent { - constructor(props) { - super(props) - - this.state = {isOpen: false} - } - +export default class TagList extends PureComponent { public render() { const {db, service, tags, filter} = this.props diff --git a/ui/src/flux/components/TagListItem.tsx b/ui/src/flux/components/TagListItem.tsx index 1093f6da07..ec4f17314b 100644 --- a/ui/src/flux/components/TagListItem.tsx +++ b/ui/src/flux/components/TagListItem.tsx @@ -66,7 +66,14 @@ export default class TagListItem extends PureComponent { public render() { const {tagKey, db, service, filter} = this.props - const {tagValues, searchTerm, loadingMore, count, limit} = this.state + const { + tagValues, + searchTerm, + loadingMore, + count, + limit, + isOpen, + } = this.state return (
@@ -83,44 +90,37 @@ export default class TagListItem extends PureComponent {
- {this.state.isOpen && ( -
-
-
- - {this.isSearching && ( - - )} -
- {this.count} -
- {this.isLoading && } - {!this.isLoading && ( - +
+
+ - )} + {this.isSearching && } +
+ {this.count}
- )} + {this.isLoading && } + {!this.isLoading && ( + + )} +
) } @@ -313,7 +313,7 @@ export default class TagListItem extends PureComponent { return ( !isOpen && (loadingAll === RemoteDataState.NotStarted || - loadingAll !== RemoteDataState.Error) + loadingAll === RemoteDataState.Error) ) } diff --git a/ui/src/flux/components/TagValueListItem.tsx b/ui/src/flux/components/TagValueListItem.tsx index ffc88b61ac..19b992658d 100644 --- a/ui/src/flux/components/TagValueListItem.tsx +++ b/ui/src/flux/components/TagValueListItem.tsx @@ -48,7 +48,7 @@ class TagValueListItem extends PureComponent { public render() { const {db, service, value} = this.props - const {searchTerm} = this.state + const {searchTerm, isOpen} = this.state return (
@@ -65,35 +65,33 @@ class TagValueListItem extends PureComponent {
- {this.state.isOpen && ( -
- {this.isLoading && } - {!this.isLoading && ( - <> - {!!this.tags.length && ( -
- -
- )} - - - )} -
- )} +
+ {this.isLoading && } + {!this.isLoading && ( + <> + {!!this.tags.length && ( +
+ +
+ )} + + + )} +
) } @@ -177,7 +175,7 @@ class TagValueListItem extends PureComponent { return ( !isOpen && (loading === RemoteDataState.NotStarted || - loading !== RemoteDataState.Error) + loading === RemoteDataState.Error) ) } } diff --git a/ui/src/style/components/time-machine/flux-explorer.scss b/ui/src/style/components/time-machine/flux-explorer.scss index 635ff1dcce..36a9831102 100644 --- a/ui/src/style/components/time-machine/flux-explorer.scss +++ b/ui/src/style/components/time-machine/flux-explorer.scss @@ -27,6 +27,10 @@ $flux-tree-gutter: 11px; } } +.flux-schema--children.hidden { + display: none; +} + .flux-schema-tree__empty { height: $flux-tree-indent; display: flex;