projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add utils for recognizing resource by uuid
[arvados.git]
/
src
/
store
/
side-panel
/
side-panel-reducer.ts
diff --git
a/src/store/side-panel/side-panel-reducer.ts
b/src/store/side-panel/side-panel-reducer.ts
index 5a45d29590f761c48c6f4515105b66d180777b5b..db1cbe5de51a7133b0a26f00a4f427223872e5d9 100644
(file)
--- a/
src/store/side-panel/side-panel-reducer.ts
+++ b/
src/store/side-panel/side-panel-reducer.ts
@@
-16,19
+16,15
@@
import { columns as favoritePanelColumns } from "../../views/favorite-panel/favo
export type SidePanelState = SidePanelItem[];
export type SidePanelState = SidePanelItem[];
-export const sidePanelReducer = (state: SidePanelState = sidePanel
Data
, action: SidePanelAction) => {
+export const sidePanelReducer = (state: SidePanelState = sidePanel
Items
, action: SidePanelAction) => {
return sidePanelActions.match(action, {
TOGGLE_SIDE_PANEL_ITEM_OPEN: itemId =>
state.map(it => ({...it, open: itemId === it.id && it.open === false})),
return sidePanelActions.match(action, {
TOGGLE_SIDE_PANEL_ITEM_OPEN: itemId =>
state.map(it => ({...it, open: itemId === it.id && it.open === false})),
- TOGGLE_SIDE_PANEL_ITEM_ACTIVE: itemId =>
- state.map(it => ({...it, active: it.id === itemId})),
- RESET_SIDE_PANEL_ACTIVITY: () =>
- state.map(it => ({...it, active: false })),
default: () => state
});
};
default: () => state
});
};
-export enum SidePanelId
entifiers
{
+export enum SidePanelId {
PROJECTS = "Projects",
SHARED_WITH_ME = "SharedWithMe",
WORKFLOWS = "Workflows",
PROJECTS = "Projects",
SHARED_WITH_ME = "SharedWithMe",
WORKFLOWS = "Workflows",
@@
-37,44
+33,58
@@
export enum SidePanelIdentifiers {
TRASH = "Trash"
}
TRASH = "Trash"
}
-export const sidePanel
Data
= [
+export const sidePanel
Items
= [
{
{
- id: SidePanelId
entifiers
.PROJECTS,
+ id: SidePanelId.PROJECTS,
name: "Projects",
name: "Projects",
+ url: "/projects",
icon: ProjectsIcon,
open: false,
active: false,
margin: true,
openAble: true,
activeAction: (dispatch: Dispatch, uuid: string) => {
icon: ProjectsIcon,
open: false,
active: false,
margin: true,
openAble: true,
activeAction: (dispatch: Dispatch, uuid: string) => {
- dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(uuid));
dispatch(push(getProjectUrl(uuid)));
dispatch(push(getProjectUrl(uuid)));
+ dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(uuid));
dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
dispatch(projectPanelActions.RESET_PAGINATION());
dispatch(projectPanelActions.REQUEST_ITEMS());
}
},
{
dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
dispatch(projectPanelActions.RESET_PAGINATION());
dispatch(projectPanelActions.REQUEST_ITEMS());
}
},
{
- id: SidePanelId
entifiers
.SHARED_WITH_ME,
+ id: SidePanelId.SHARED_WITH_ME,
name: "Shared with me",
name: "Shared with me",
+ url: "/shared",
icon: ShareMeIcon,
active: false,
icon: ShareMeIcon,
active: false,
+ activeAction: (dispatch: Dispatch) => {
+ dispatch(push("/shared"));
+ }
},
{
},
{
- id: SidePanelId
entifiers
.WORKFLOWS,
+ id: SidePanelId.WORKFLOWS,
name: "Workflows",
name: "Workflows",
+ url: "/workflows",
icon: WorkflowIcon,
active: false,
icon: WorkflowIcon,
active: false,
+ activeAction: (dispatch: Dispatch) => {
+ dispatch(push("/workflows"));
+ }
},
{
},
{
- id: SidePanelId
entifiers
.RECENT_OPEN,
+ id: SidePanelId.RECENT_OPEN,
name: "Recent open",
name: "Recent open",
+ url: "/recent",
icon: RecentIcon,
active: false,
icon: RecentIcon,
active: false,
+ activeAction: (dispatch: Dispatch) => {
+ dispatch(push("/recent"));
+ }
},
{
},
{
- id: SidePanelId
entifiers
.FAVORITES,
+ id: SidePanelId.FAVORITES,
name: "Favorites",
name: "Favorites",
+ url: "/favorites",
icon: FavoriteIcon,
active: false,
activeAction: (dispatch: Dispatch) => {
icon: FavoriteIcon,
active: false,
activeAction: (dispatch: Dispatch) => {
@@
-85,9
+95,13
@@
export const sidePanelData = [
}
},
{
}
},
{
- id: SidePanelId
entifiers
.TRASH,
+ id: SidePanelId.TRASH,
name: "Trash",
name: "Trash",
+ url: "/trash",
icon: TrashIcon,
active: false,
icon: TrashIcon,
active: false,
+ activeAction: (dispatch: Dispatch) => {
+ dispatch(push("/trash"));
+ }
}
];
}
];