[arvados] updated: 2.7.0-6008-gcd0d451424
git repository hosting
git at public.arvados.org
Tue Feb 20 19:50:42 UTC 2024
Summary of changes:
.../workbench2/src/components/data-table/data-table.tsx | 4 ++--
.../search-results-middleware-service.ts | 7 ++++++-
.../search-results-panel/search-results-panel-view.tsx | 6 +-----
.../views/search-results-panel/search-results-panel.tsx | 14 ++++----------
4 files changed, 13 insertions(+), 18 deletions(-)
via cd0d451424fd6dbdb4dfb8ce98e479a60b94e0fd (commit)
from 2ace2e7ca42a3949de3e6c0327cd2648f344dee9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit cd0d451424fd6dbdb4dfb8ce98e479a60b94e0fd
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Tue Feb 20 14:50:38 2024 -0500
21386: search results good Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/services/workbench2/src/components/data-table/data-table.tsx b/services/workbench2/src/components/data-table/data-table.tsx
index fb5886681c..3e7c86459b 100644
--- a/services/workbench2/src/components/data-table/data-table.tsx
+++ b/services/workbench2/src/components/data-table/data-table.tsx
@@ -312,7 +312,7 @@ export const DataTable = withStyles(styles)(
renderNoItemsPlaceholder = (columns: DataColumns<T, any>) => {
const dirty = columns.some(column => getTreeDirty("")(column.filters));
- if (this.state.isLoaded === false) {
+ if (this.state.isLoaded === false || this.props.working === true) {
return (
<DataTableDefaultView
icon={this.props.defaultViewIcon}
@@ -327,7 +327,7 @@ export const DataTable = withStyles(styles)(
/>
);
} else {
- //if (isLoaded && !is404)
+ //if (isLoaded && !working && !is404)
return (
<DataTableDefaultView
icon={this.props.defaultViewIcon}
diff --git a/services/workbench2/src/store/search-results-panel/search-results-middleware-service.ts b/services/workbench2/src/store/search-results-panel/search-results-middleware-service.ts
index e70cb29ae6..86d94d9ccb 100644
--- a/services/workbench2/src/store/search-results-panel/search-results-middleware-service.ts
+++ b/services/workbench2/src/store/search-results-panel/search-results-middleware-service.ts
@@ -27,6 +27,7 @@ import { ProjectPanelColumnNames } from 'views/project-panel/project-panel';
import { ResourceKind } from 'models/resource';
import { ContainerRequestResource } from 'models/container-request';
import { progressIndicatorActions } from 'store/progress-indicator/progress-indicator-actions';
+import { dataExplorerActions } from 'store/data-explorer/data-explorer-action';
export class SearchResultsMiddlewareService extends DataExplorerMiddlewareService {
constructor(private services: ServiceRepository, id: string) {
@@ -58,7 +59,9 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic
const numberOfSessions = sessions.length;
let numberOfResolvedResponses = 0;
+ let totalNumItemsAvailable = 0;
api.dispatch(progressIndicatorActions.START_WORKING(this.id))
+ api.dispatch(dataExplorerActions.SET_IS_RESPONSE_404({ id: this.id, isResponse404: false }));
sessions.forEach(session => {
const params = getParams(dataExplorer, searchValue, session.apiRevision);
@@ -67,8 +70,10 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic
api.dispatch(updateResources(response.items));
api.dispatch(appendItems(response));
numberOfResolvedResponses++;
+ totalNumItemsAvailable += response.itemsAvailable;
if (numberOfResolvedResponses === numberOfSessions) {
api.dispatch(progressIndicatorActions.STOP_WORKING(this.id))
+ if(totalNumItemsAvailable === 0) api.dispatch(dataExplorerActions.SET_IS_RESPONSE_404({ id: this.id, isResponse404: true }))
}
// Request all containers for process status to be available
const containerRequests = response.items.filter((item) => item.kind === ResourceKind.CONTAINER_REQUEST) as ContainerRequestResource[];
@@ -84,7 +89,7 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic
});
}).catch(() => {
api.dispatch(couldNotFetchSearchResults(session.clusterId));
- api.dispatch(progressIndicatorActions.PERSIST_STOP_WORKING(this.id))
+ api.dispatch(progressIndicatorActions.STOP_WORKING(this.id))
});
}
);
diff --git a/services/workbench2/src/views/search-results-panel/search-results-panel-view.tsx b/services/workbench2/src/views/search-results-panel/search-results-panel-view.tsx
index 10ff2b7565..45fbd0ac76 100644
--- a/services/workbench2/src/views/search-results-panel/search-results-panel-view.tsx
+++ b/services/workbench2/src/views/search-results-panel/search-results-panel-view.tsx
@@ -30,7 +30,6 @@ import { ArvadosTheme } from 'common/custom-theme';
import { getSearchSessions } from 'store/search-bar/search-bar-actions';
import { camelCase } from 'lodash';
import { GroupContentsResource } from 'services/groups-service/groups-service';
-import { PendingIcon } from 'components/icon/icon';
export enum SearchResultsPanelColumnNames {
CLUSTER = "Cluster",
@@ -154,8 +153,6 @@ export const SearchResultsPanelView = withStyles(styles, { withTheme: true })(
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedItem]);
- const [isLoaded, setIsLoaded] = React.useState<boolean>(false);
-
const onItemClick = useCallback((uuid) => {
setSelectedItem(uuid);
props.onItemClick(uuid);
@@ -171,8 +168,7 @@ export const SearchResultsPanelView = withStyles(styles, { withTheme: true })(
contextMenuColumn={false}
elementPath={`/ ${itemPath.reverse().join(' / ')}`}
hideSearchInput
- defaultViewIcon={isLoaded && props.numberOfItems === 0 ? undefined : PendingIcon}
- defaultViewMessages={isLoaded && props.numberOfItems === 0 ? ['No items found'] : ['Loading data, please wait']}
+ is404={props.is404}
title={
<div>
{loggedIn.length === 1 ?
diff --git a/services/workbench2/src/views/search-results-panel/search-results-panel.tsx b/services/workbench2/src/views/search-results-panel/search-results-panel.tsx
index 639008216c..df243d67cf 100644
--- a/services/workbench2/src/views/search-results-panel/search-results-panel.tsx
+++ b/services/workbench2/src/views/search-results-panel/search-results-panel.tsx
@@ -14,7 +14,6 @@ import { User } from "models/user";
import { Config } from 'common/config';
import { Session } from "models/session";
import { toggleOne, deselectAllOthers } from "store/multiselect/multiselect-actions";
-import { progressIndicatorActions } from 'store/progress-indicator/progress-indicator-actions';
import { SEARCH_RESULTS_PANEL_ID } from 'store/search-results-panel/search-results-panel-actions';
export interface SearchResultsPanelDataProps {
@@ -24,6 +23,7 @@ export interface SearchResultsPanelDataProps {
remoteHostsConfig: { [key: string]: Config };
localCluster: string;
numberOfItems: number;
+ is404: boolean;
}
export interface SearchResultsPanelActionProps {
@@ -31,8 +31,6 @@ export interface SearchResultsPanelActionProps {
onContextMenu: (event: React.MouseEvent<HTMLElement>, item: string) => void;
onDialogOpen: (ownerUuid: string) => void;
onItemDoubleClick: (item: string) => void;
- startSpinner: () => void;
- stopSpinner: () => void;
}
export type SearchResultsPanelProps = SearchResultsPanelDataProps & SearchResultsPanelActionProps;
@@ -40,12 +38,14 @@ export type SearchResultsPanelProps = SearchResultsPanelDataProps & SearchResult
const mapStateToProps = (rootState: RootState) => {
const { dataExplorer } = rootState;
const numberOfItems = dataExplorer[SEARCH_RESULTS_PANEL_ID].items.length;
+ const is404 = dataExplorer[SEARCH_RESULTS_PANEL_ID].isResponse404;
return {
user: rootState.auth.user,
sessions: rootState.auth.sessions,
remoteHostsConfig: rootState.auth.remoteHostsConfig,
localCluster: rootState.auth.localCluster,
numberOfItems,
+ is404,
};
};
@@ -61,13 +61,7 @@ const mapDispatchToProps = (dispatch: Dispatch): SearchResultsPanelActionProps =
},
onItemDoubleClick: uuid => {
dispatch<any>(navigateTo(uuid));
- },
- startSpinner: () => {
- dispatch<any>(progressIndicatorActions.START_WORKING(SEARCH_RESULTS_PANEL_ID));
- },
- stopSpinner: () => {
- dispatch<any>(progressIndicatorActions.STOP_WORKING(SEARCH_RESULTS_PANEL_ID));
- },
+ }
});
export const SearchResultsPanel = connect(mapStateToProps, mapDispatchToProps)(SearchResultsPanelView);
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list