21386: search results good Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii...
[arvados.git] / services / workbench2 / src / views / search-results-panel / search-results-panel.tsx
index 0b69ff246add938a4be74251c7893fd2441701cf..df243d67cfd95df9f6e43d629844bccd94d0672d 100644 (file)
@@ -14,6 +14,7 @@ import { User } from "models/user";
 import { Config } from 'common/config';
 import { Session } from "models/session";
 import { toggleOne, deselectAllOthers } from "store/multiselect/multiselect-actions";
+import { SEARCH_RESULTS_PANEL_ID } from 'store/search-results-panel/search-results-panel-actions';
 
 export interface SearchResultsPanelDataProps {
     data: SearchBarAdvancedFormData;
@@ -21,6 +22,8 @@ export interface SearchResultsPanelDataProps {
     sessions: Session[];
     remoteHostsConfig: { [key: string]: Config };
     localCluster: string;
+    numberOfItems: number;
+    is404: boolean;
 }
 
 export interface SearchResultsPanelActionProps {
@@ -33,11 +36,16 @@ export interface SearchResultsPanelActionProps {
 export type SearchResultsPanelProps = SearchResultsPanelDataProps & SearchResultsPanelActionProps;
 
 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,
     };
 };