[arvados-workbench2] created: 2.4.0-382-g861e5ee6
git repository hosting
git at public.arvados.org
Thu Dec 15 12:45:41 UTC 2022
at 861e5ee64f7001ae6dd5b900cf0ad16f01ee349d (commit)
commit 861e5ee64f7001ae6dd5b900cf0ad16f01ee349d
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Thu Dec 15 13:45:13 2022 +0100
19865: Fixes DataExplorer/SearchInput communication.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index 549c4765..6f4ed790 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -109,7 +109,6 @@ export const DataExplorer = withStyles(styles)(
showLoading: false,
prevRefresh: '',
prevRoute: '',
- searchValue: '',
};
componentDidUpdate(prevProps: DataExplorerProps<T>) {
@@ -147,19 +146,17 @@ export const DataExplorer = withStyles(styles)(
this.props.onSetColumns(this.props.columns);
}
// Component just mounted, so we need to show the loading indicator.
- this.props.onSearch('');
this.setState({
showLoading: this.props.working,
prevRefresh: this.props.currentRefresh || '',
prevRoute: this.props.currentRoute || '',
- searchValue: '',
});
}
render() {
const {
columns, onContextMenu, onFiltersChange, onSortToggle, extractKey,
- rowsPerPage, rowsPerPageOptions, onColumnToggle, searchLabel, onSearch,
+ rowsPerPage, rowsPerPageOptions, onColumnToggle, searchLabel, searchValue, onSearch,
items, itemsAvailable, onRowClick, onRowDoubleClick, classes,
defaultViewIcon, defaultViewMessages, hideColumnSelector, actions, paperProps, hideSearchInput,
paperKey, fetchMode, currentItemUuid, title,
@@ -177,7 +174,7 @@ export const DataExplorer = withStyles(styles)(
{!hideSearchInput && <div className={classes.searchBox}>
{!hideSearchInput && <SearchInput
label={searchLabel}
- value={this.state.searchValue}
+ value={searchValue}
selfClearProp={''}
onSearch={onSearch} />}
</div>}
commit 3f3ea67a093f3521fe613f0f82247b622c48b9b0
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Thu Dec 15 10:41:35 2022 +0100
19865: Improved search box reset on route change.
Instead of querying the location bar, rely on already existing mechanisms
from DataExplorer to detect route changes.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index 052a5ae9..549c4765 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -82,7 +82,6 @@ interface DataExplorerDataProps<T> {
title?: React.ReactNode;
paperKey?: string;
currentItemUuid: string;
- currentPath: string;
elementPath?: string;
}
@@ -110,6 +109,7 @@ export const DataExplorer = withStyles(styles)(
showLoading: false,
prevRefresh: '',
prevRoute: '',
+ searchValue: '',
};
componentDidUpdate(prevProps: DataExplorerProps<T>) {
@@ -119,9 +119,11 @@ export const DataExplorer = withStyles(styles)(
if (currentRoute !== this.state.prevRoute) {
// Component already mounted, but the user comes from a route change,
// like browsing through a project hierarchy.
+ this.props.onSearch('');
this.setState({
showLoading: this.props.working,
prevRoute: currentRoute,
+ searchValue: '', // reset search on navigation
});
}
@@ -145,20 +147,22 @@ export const DataExplorer = withStyles(styles)(
this.props.onSetColumns(this.props.columns);
}
// Component just mounted, so we need to show the loading indicator.
+ this.props.onSearch('');
this.setState({
showLoading: this.props.working,
prevRefresh: this.props.currentRefresh || '',
prevRoute: this.props.currentRoute || '',
+ searchValue: '',
});
}
render() {
const {
columns, onContextMenu, onFiltersChange, onSortToggle, extractKey,
- rowsPerPage, rowsPerPageOptions, onColumnToggle, searchLabel, searchValue, onSearch,
+ rowsPerPage, rowsPerPageOptions, onColumnToggle, searchLabel, onSearch,
items, itemsAvailable, onRowClick, onRowDoubleClick, classes,
defaultViewIcon, defaultViewMessages, hideColumnSelector, actions, paperProps, hideSearchInput,
- paperKey, fetchMode, currentItemUuid, currentPath, title,
+ paperKey, fetchMode, currentItemUuid, title,
doHidePanel, doMaximizePanel, doUnMaximizePanel, panelName, panelMaximized, elementPath
} = this.props;
@@ -173,8 +177,8 @@ export const DataExplorer = withStyles(styles)(
{!hideSearchInput && <div className={classes.searchBox}>
{!hideSearchInput && <SearchInput
label={searchLabel}
- value={searchValue}
- selfClearProp={currentPath}
+ value={this.state.searchValue}
+ selfClearProp={''}
onSearch={onSearch} />}
</div>}
{actions}
diff --git a/src/views-components/data-explorer/data-explorer.tsx b/src/views-components/data-explorer/data-explorer.tsx
index 2f8eca11..2a0d1f47 100644
--- a/src/views-components/data-explorer/data-explorer.tsx
+++ b/src/views-components/data-explorer/data-explorer.tsx
@@ -27,7 +27,6 @@ const mapStateToProps = (state: RootState, { id }: Props) => {
const currentRoute = state.router.location ? state.router.location.pathname : '';
const currentRefresh = localStorage.getItem(LAST_REFRESH_TIMESTAMP) || '';
const currentItemUuid = currentRoute === '/workflows' ? state.properties.workflowPanelDetailsUuid : state.detailsPanel.resourceUuid;
- const currentPath = state.router.location?.pathname;
return {
...dataExplorerState,
@@ -36,7 +35,6 @@ const mapStateToProps = (state: RootState, { id }: Props) => {
currentRoute: currentRoute,
paperKey: currentRoute,
currentItemUuid,
- currentPath,
};
};
commit 6ed29d15f871865afa2a2321075cbd9fdf2d46ba
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Wed Dec 14 21:52:10 2022 +0100
19865: Fixes selfClearProp passing to SearchInput in DataTable.
Instead of passing the UUID of the selected object, pass the current location
path, so navigation actions that change said path will trigger an input
field reset, but selecting different items in the table won't.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index c7a296a6..052a5ae9 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -82,6 +82,7 @@ interface DataExplorerDataProps<T> {
title?: React.ReactNode;
paperKey?: string;
currentItemUuid: string;
+ currentPath: string;
elementPath?: string;
}
@@ -157,7 +158,7 @@ export const DataExplorer = withStyles(styles)(
rowsPerPage, rowsPerPageOptions, onColumnToggle, searchLabel, searchValue, onSearch,
items, itemsAvailable, onRowClick, onRowDoubleClick, classes,
defaultViewIcon, defaultViewMessages, hideColumnSelector, actions, paperProps, hideSearchInput,
- paperKey, fetchMode, currentItemUuid, title,
+ paperKey, fetchMode, currentItemUuid, currentPath, title,
doHidePanel, doMaximizePanel, doUnMaximizePanel, panelName, panelMaximized, elementPath
} = this.props;
@@ -173,7 +174,7 @@ export const DataExplorer = withStyles(styles)(
{!hideSearchInput && <SearchInput
label={searchLabel}
value={searchValue}
- selfClearProp={currentItemUuid}
+ selfClearProp={currentPath}
onSearch={onSearch} />}
</div>}
{actions}
diff --git a/src/components/search-input/search-input.tsx b/src/components/search-input/search-input.tsx
index 6d85ed22..fbb4f599 100644
--- a/src/components/search-input/search-input.tsx
+++ b/src/components/search-input/search-input.tsx
@@ -71,7 +71,7 @@ export const SearchInput = (props: SearchInputProps) => {
() => {
props.onSearch(eventValue);
},
- props.debounce || DEFAULT_SEARCH_DEBOUNCE
+ props.debounce || DEFAULT_SEARCH_DEBOUNCE
));
};
diff --git a/src/views-components/data-explorer/data-explorer.tsx b/src/views-components/data-explorer/data-explorer.tsx
index 06d97038..2f8eca11 100644
--- a/src/views-components/data-explorer/data-explorer.tsx
+++ b/src/views-components/data-explorer/data-explorer.tsx
@@ -27,6 +27,7 @@ const mapStateToProps = (state: RootState, { id }: Props) => {
const currentRoute = state.router.location ? state.router.location.pathname : '';
const currentRefresh = localStorage.getItem(LAST_REFRESH_TIMESTAMP) || '';
const currentItemUuid = currentRoute === '/workflows' ? state.properties.workflowPanelDetailsUuid : state.detailsPanel.resourceUuid;
+ const currentPath = state.router.location?.pathname;
return {
...dataExplorerState,
@@ -34,7 +35,8 @@ const mapStateToProps = (state: RootState, { id }: Props) => {
currentRefresh: currentRefresh,
currentRoute: currentRoute,
paperKey: currentRoute,
- currentItemUuid
+ currentItemUuid,
+ currentPath,
};
};
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list