[arvados] updated: 2.7.0-6046-gaf40119a34
git repository hosting
git at public.arvados.org
Fri Mar 15 14:18:48 UTC 2024
Summary of changes:
.../selected-resource/selected-resource-actions.ts | 17 +++++++++++++++++
.../selected-resource/selected-resource-reducer.ts | 14 ++++++++++++++
services/workbench2/src/store/store.ts | 2 ++
3 files changed, 33 insertions(+)
create mode 100644 services/workbench2/src/store/selected-resource/selected-resource-actions.ts
create mode 100644 services/workbench2/src/store/selected-resource/selected-resource-reducer.ts
via af40119a34d8437cdf51c1b69982a022a220e90d (commit)
from 986d5166d62e0f6d84a8b36634b34bf1f594b1bc (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 af40119a34d8437cdf51c1b69982a022a220e90d
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Fri Mar 15 10:18:41 2024 -0400
21224: created global selected resource state Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/services/workbench2/src/store/selected-resource/selected-resource-actions.ts b/services/workbench2/src/store/selected-resource/selected-resource-actions.ts
new file mode 100644
index 0000000000..0b119598c1
--- /dev/null
+++ b/services/workbench2/src/store/selected-resource/selected-resource-actions.ts
@@ -0,0 +1,17 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+export const selectedResourceActions = {
+ SET_SELECTED_RESOURCE: 'SET_SELECTED_RESOURCE',
+}
+
+type SelectedResourceAction = {
+ type: string;
+ payload: string;
+};
+
+export const setSelectedResource = (resourceUuid: string): SelectedResourceAction => ({
+ type: selectedResourceActions.SET_SELECTED_RESOURCE,
+ payload: resourceUuid
+});
diff --git a/services/workbench2/src/store/selected-resource/selected-resource-reducer.ts b/services/workbench2/src/store/selected-resource/selected-resource-reducer.ts
new file mode 100644
index 0000000000..502fa264c1
--- /dev/null
+++ b/services/workbench2/src/store/selected-resource/selected-resource-reducer.ts
@@ -0,0 +1,14 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { selectedResourceActions } from "./selected-resource-actions";
+
+type SelectedResourceState = string | null;
+
+export const selectedResourceReducer = (state: SelectedResourceState = null, action: any) => {
+ if (action.type === selectedResourceActions.SET_SELECTED_RESOURCE) {
+ return action.payload;
+ }
+ return state;
+};
\ No newline at end of file
diff --git a/services/workbench2/src/store/store.ts b/services/workbench2/src/store/store.ts
index daa9812e72..05f402485d 100644
--- a/services/workbench2/src/store/store.ts
+++ b/services/workbench2/src/store/store.ts
@@ -79,6 +79,7 @@ import { sidePanelReducer } from "./side-panel/side-panel-reducer";
import { bannerReducer } from "./banner/banner-reducer";
import { multiselectReducer } from "./multiselect/multiselect-reducer";
import { composeWithDevTools } from "redux-devtools-extension";
+import { selectedResourceReducer } from "./selected-resource/selected-resource-reducer";
declare global {
interface Window {
@@ -182,6 +183,7 @@ const createRootReducer = (services: ServiceRepository) =>
properties: propertiesReducer,
resources: resourcesReducer,
router: routerReducer,
+ selectedResource: selectedResourceReducer,
snackbar: snackbarReducer,
treePicker: treePickerReducer,
treePickerSearch: treePickerSearchReducer,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list