[arvados-workbench2] created: 2.6.0-5-gbe33bc8c
git repository hosting
git at public.arvados.org
Tue May 9 19:47:59 UTC 2023
at be33bc8c17b2e12b96d176d16e60f8ebe3fe1c06 (commit)
commit be33bc8c17b2e12b96d176d16e60f8ebe3fe1c06
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Tue May 9 15:39:16 2023 -0400
20487: loadProject doesn't call openProjectPanel
The bug was was that loading the registered workflow panel would call
loadProject() which would call openProjectPanel() which would dispatch
REQUEST_ITEMS for the project (which is 100% wasteful, because we're
not displaying the project contents).
However, the results from REQUEST_ITEMS (which excludes some fields in
the standard query) would replace the result that previously got the
complete workflow object. As a result the "definition" field went
away, which cause the inputs/outputs panels to go blank.
This switches the navigation action to call "openProjectPanel", and
have that begin by calling "loadProject". As a result, other places
that call loadProject no longer call openProjectPanel.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/package.json b/package.json
index c17fc917..0a10da78 100644
--- a/package.json
+++ b/package.json
@@ -68,6 +68,7 @@
"react-virtualized-auto-sizer": "1.0.2",
"react-window": "1.8.5",
"redux": "4.0.3",
+ "redux-devtools-extension": "^2.13.9",
"redux-form": "7.4.2",
"redux-thunk": "2.3.0",
"reselect": "4.0.0",
diff --git a/src/routes/route-change-handlers.ts b/src/routes/route-change-handlers.ts
index cded6d65..eef52058 100644
--- a/src/routes/route-change-handlers.ts
+++ b/src/routes/route-change-handlers.ts
@@ -11,6 +11,7 @@ import { dialogActions } from 'store/dialog/dialog-actions';
import { contextMenuActions } from 'store/context-menu/context-menu-actions';
import { searchBarActions } from 'store/search-bar/search-bar-actions';
import { pluginConfig } from 'plugins';
+import { openProjectPanel } from 'store/project-panel/project-panel-action';
export const addRouteChangeHandlers = (history: History, store: RootStore) => {
const handler = handleLocationChange(store);
@@ -60,7 +61,7 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
}
if (projectMatch) {
- store.dispatch(WorkbenchActions.loadProject(projectMatch.params.id));
+ store.dispatch(openProjectPanel(projectMatch.params.id));
} else if (collectionMatch) {
store.dispatch(WorkbenchActions.loadCollection(collectionMatch.params.id));
} else if (favoriteMatch) {
diff --git a/src/store/project-panel/project-panel-action.ts b/src/store/project-panel/project-panel-action.ts
index 3b30f4aa..6b99e300 100644
--- a/src/store/project-panel/project-panel-action.ts
+++ b/src/store/project-panel/project-panel-action.ts
@@ -7,6 +7,7 @@ import { bindDataExplorerActions } from "store/data-explorer/data-explorer-actio
import { propertiesActions } from "store/properties/properties-actions";
import { RootState } from 'store/store';
import { getProperty } from "store/properties/properties";
+import { loadProject } from "store/workbench/workbench-actions";
export const PROJECT_PANEL_ID = "projectPanel";
export const PROJECT_PANEL_CURRENT_UUID = "projectPanelCurrentUuid";
@@ -14,7 +15,8 @@ export const IS_PROJECT_PANEL_TRASHED = 'isProjectPanelTrashed';
export const projectPanelActions = bindDataExplorerActions(PROJECT_PANEL_ID);
export const openProjectPanel = (projectUuid: string) =>
- (dispatch: Dispatch) => {
+ async (dispatch: Dispatch) => {
+ await loadProject(projectUuid);
dispatch(propertiesActions.SET_PROPERTY({ key: PROJECT_PANEL_CURRENT_UUID, value: projectUuid }));
dispatch(projectPanelActions.RESET_EXPLORER_SEARCH_VALUE());
dispatch(projectPanelActions.REQUEST_ITEMS());
diff --git a/src/store/store.ts b/src/store/store.ts
index 1501fd4f..ec673d62 100644
--- a/src/store/store.ts
+++ b/src/store/store.ts
@@ -77,17 +77,7 @@ import { MiddlewareListReducer } from 'common/plugintypes';
import { tooltipsMiddleware } from './tooltips/tooltips-middleware';
import { sidePanelReducer } from './side-panel/side-panel-reducer'
import { bannerReducer } from './banner/banner-reducer';
-
-declare global {
- interface Window {
- __REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: typeof compose;
- }
-}
-
-const composeEnhancers =
- (process.env.NODE_ENV === 'development' &&
- window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) ||
- compose;
+import { composeWithDevTools } from 'redux-devtools-extension';
export type RootState = ReturnType<ReturnType<typeof createRootReducer>>;
@@ -187,7 +177,7 @@ export function configureStore(history: History, services: ServiceRepository, co
middlewares = pluginConfig.middlewares.reduce(reduceMiddlewaresFn, middlewares);
- const enhancer = composeEnhancers(applyMiddleware(redirectToMiddleware, ...middlewares));
+ const enhancer = composeWithDevTools({/* options */ })(applyMiddleware(redirectToMiddleware, ...middlewares));
return createStore(rootReducer, enhancer);
}
diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts
index 52433779..a3c3a096 100644
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@ -13,7 +13,6 @@ import {
} from 'store/favorite-panel/favorite-panel-action';
import {
getProjectPanelCurrentUuid,
- openProjectPanel,
projectPanelActions,
setIsProjectPanelTrashed,
} from 'store/project-panel/project-panel-action';
@@ -866,7 +865,6 @@ const finishLoadingProject =
(project: GroupContentsResource | string) =>
async (dispatch: Dispatch<any>) => {
const uuid = typeof project === 'string' ? project : project.uuid;
- dispatch(openProjectPanel(uuid));
dispatch(loadDetailsPanel(uuid));
if (typeof project !== 'string') {
dispatch(updateResources([project]));
diff --git a/yarn.lock b/yarn.lock
index 580aa8ed..e96e7751 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3811,6 +3811,7 @@ __metadata:
react-window: 1.8.5
redux: 4.0.3
redux-devtools: 3.4.1
+ redux-devtools-extension: ^2.13.9
redux-form: 7.4.2
redux-mock-store: 1.5.4
redux-thunk: 2.3.0
@@ -15448,6 +15449,15 @@ __metadata:
languageName: node
linkType: hard
+"redux-devtools-extension at npm:^2.13.9":
+ version: 2.13.9
+ resolution: "redux-devtools-extension at npm:2.13.9"
+ peerDependencies:
+ redux: ^3.1.0 || ^4.0.0
+ checksum: 603d48fd6acf3922ef373b251ab3fdbb990035e90284191047b29d25b06ea18122bc4ef01e0704ccae495acb27ab5e47b560937e98213605dd88299470025db9
+ languageName: node
+ linkType: hard
+
"redux-devtools-instrument at npm:^1.0.1":
version: 1.10.0
resolution: "redux-devtools-instrument at npm:1.10.0"
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list