projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cancel-running-workflow
[arvados-workbench2.git]
/
src
/
store
/
collection-panel
/
collection-panel-reducer.ts
diff --git
a/src/store/collection-panel/collection-panel-reducer.ts
b/src/store/collection-panel/collection-panel-reducer.ts
index 61f4127fae55b6cde9e640077f7a042fb4d5d294..55829cb5d094b8e4b9dbddd313dffa256f78eb6f 100644
(file)
--- a/
src/store/collection-panel/collection-panel-reducer.ts
+++ b/
src/store/collection-panel/collection-panel-reducer.ts
@@
-3,23
+3,19
@@
// SPDX-License-Identifier: AGPL-3.0
import { collectionPanelActions, CollectionPanelAction } from "./collection-panel-action";
// SPDX-License-Identifier: AGPL-3.0
import { collectionPanelActions, CollectionPanelAction } from "./collection-panel-action";
-import { CollectionResource } from "../../models/collection";
-import { LinkResource } from "../../models/link";
+import { CollectionResource } from "~/models/collection";
export interface CollectionPanelState {
item: CollectionResource | null;
export interface CollectionPanelState {
item: CollectionResource | null;
- tags: LinkResource[];
}
const initialState = {
}
const initialState = {
- item: null,
- tags: []
+ item: null
};
export const collectionPanelReducer = (state: CollectionPanelState = initialState, action: CollectionPanelAction) =>
collectionPanelActions.match(action, {
default: () => state,
};
export const collectionPanelReducer = (state: CollectionPanelState = initialState, action: CollectionPanelAction) =>
collectionPanelActions.match(action, {
default: () => state,
+ SET_COLLECTION: (item) => ({ ...state, item }),
LOAD_COLLECTION_SUCCESS: ({ item }) => ({ ...state, item }),
LOAD_COLLECTION_SUCCESS: ({ item }) => ({ ...state, item }),
- LOAD_COLLECTION_TAGS_SUCCESS: ({ tags }) => ({...state, tags}),
- CREATE_COLLECTION_TAG_SUCCESS: ({ tag }) => ({...state, tags: [...state.tags, tag] })
});
});