isMSToolbarVisible: boolean;
checkedList: TCheckedList;
isNotFound: boolean;
+ searchBarValue: string;
}
interface DataExplorerActionProps<T> {
class DataExplorerGeneric<T> extends React.Component<DataExplorerProps<T>> {
multiSelectToolbarInTitle = !this.props.title && !this.props.progressBar;
+ maxItemsAvailable = 0;
componentDidMount() {
if (this.props.onSetColumns) {
}
}
+ componentDidUpdate( prevProps: Readonly<DataExplorerProps<T>>, prevState: Readonly<{}>, snapshot?: any ): void {
+ if (this.props.itemsAvailable !== prevProps.itemsAvailable) {
+ this.maxItemsAvailable = Math.max(this.maxItemsAvailable, this.props.itemsAvailable);
+ }
+ if (this.props.searchBarValue !== prevProps.searchBarValue) {
+ this.maxItemsAvailable = 0;
+ }
+ }
+
render() {
const {
columns,
) : (
<Grid className={classes.loadMoreContainer}>
<Typography className={classes.numResults}>
- Showing {items.length} / {itemsAvailable} results
+ Showing {items.length} / {this.maxItemsAvailable} results
</Typography>
<Button
size="small"
working?: boolean;
}
-const mapStateToProps = ({ progressIndicator, dataExplorer, router, multiselect, detailsPanel, properties}: RootState, { id }: Props) => {
+const mapStateToProps = ({ progressIndicator, dataExplorer, router, multiselect, detailsPanel, properties, searchBar}: RootState, { id }: Props) => {
const working = !!progressIndicator.some(p => p.working);
const dataExplorerState = getDataExplorer(dataExplorer, id);
const currentRoute = router.location ? router.location.pathname : "";
isMSToolbarVisible,
checkedList: multiselect.checkedList,
working,
+ searchBarValue: searchBar.searchValue,
};
};