SidePanel renamings
authorDaniel Kos <daniel.kos@contractors.roche.com>
Sat, 18 Aug 2018 20:30:46 +0000 (22:30 +0200)
committerDaniel Kos <daniel.kos@contractors.roche.com>
Sat, 18 Aug 2018 20:30:46 +0000 (22:30 +0200)
Feature #13986

Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos@contractors.roche.com>

src/store/navigation/navigation-action.ts
src/store/side-panel/side-panel-action.ts
src/store/side-panel/side-panel-reducer.ts
src/views/workbench/workbench.tsx

index 593ff5d33389e5de877e8c2893621d5c3a1b0351..50ec93d25e8091e2186e0eccf7a6f403d0ca90ae 100644 (file)
@@ -15,7 +15,7 @@ import { getProjectUrl, ProjectResource } from "~/models/project";
 import { ProjectService } from "~/services/project-service/project-service";
 import { ServiceRepository } from "~/services/services";
 import { sidePanelActions } from "../side-panel/side-panel-action";
-import { SidePanelIdentifiers } from "../side-panel/side-panel-reducer";
+import { SidePanelId } from "../side-panel/side-panel-reducer";
 import { getUuidObjectType, ObjectTypes } from "~/models/object-types";
 
 export const getResourceUrl = (resourceKind: ResourceKind, resourceUuid: string): string => {
@@ -75,7 +75,7 @@ export const restoreBranch = (itemId: string) =>
         const ancestors = await loadProjectAncestors(itemId, services.projectService);
         const uuids = ancestors.map(ancestor => ancestor.uuid);
         await loadBranch(uuids, dispatch);
-        dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelIdentifiers.PROJECTS));
+        dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelId.PROJECTS));
         uuids.forEach(uuid => {
             dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN(uuid));
         });
index 4aa5809c28afd80987b7258d1810d7284ba37fa7..ecea3535e35040fdbb8095830ea60e21bacff95e 100644 (file)
@@ -3,9 +3,10 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { default as unionize, ofType, UnionOf } from "unionize";
+import { SidePanelId } from "~/store/side-panel/side-panel-reducer";
 
 export const sidePanelActions = unionize({
-    TOGGLE_SIDE_PANEL_ITEM_OPEN: ofType<string>()
+    TOGGLE_SIDE_PANEL_ITEM_OPEN: ofType<SidePanelId>()
 }, {
     tag: 'type',
     value: 'payload'
index 66c228967284c60a1a50abc41a0a09b2cee1e3f4..db1cbe5de51a7133b0a26f00a4f427223872e5d9 100644 (file)
@@ -16,7 +16,7 @@ import { columns as favoritePanelColumns } from "../../views/favorite-panel/favo
 
 export type SidePanelState = SidePanelItem[];
 
-export const sidePanelReducer = (state: SidePanelState = sidePanelData, action: SidePanelAction) => {
+export const sidePanelReducer = (state: SidePanelState = sidePanelItems, action: SidePanelAction) => {
     return sidePanelActions.match(action, {
         TOGGLE_SIDE_PANEL_ITEM_OPEN: itemId =>
             state.map(it => ({...it, open: itemId === it.id && it.open === false})),
@@ -24,7 +24,7 @@ export const sidePanelReducer = (state: SidePanelState = sidePanelData, action:
     });
 };
 
-export enum SidePanelIdentifiers {
+export enum SidePanelId {
     PROJECTS = "Projects",
     SHARED_WITH_ME = "SharedWithMe",
     WORKFLOWS = "Workflows",
@@ -33,9 +33,9 @@ export enum SidePanelIdentifiers {
     TRASH = "Trash"
 }
 
-export const sidePanelData = [
+export const sidePanelItems = [
     {
-        id: SidePanelIdentifiers.PROJECTS,
+        id: SidePanelId.PROJECTS,
         name: "Projects",
         url: "/projects",
         icon: ProjectsIcon,
@@ -52,7 +52,7 @@ export const sidePanelData = [
         }
     },
     {
-        id: SidePanelIdentifiers.SHARED_WITH_ME,
+        id: SidePanelId.SHARED_WITH_ME,
         name: "Shared with me",
         url: "/shared",
         icon: ShareMeIcon,
@@ -62,7 +62,7 @@ export const sidePanelData = [
         }
     },
     {
-        id: SidePanelIdentifiers.WORKFLOWS,
+        id: SidePanelId.WORKFLOWS,
         name: "Workflows",
         url: "/workflows",
         icon: WorkflowIcon,
@@ -72,7 +72,7 @@ export const sidePanelData = [
         }
     },
     {
-        id: SidePanelIdentifiers.RECENT_OPEN,
+        id: SidePanelId.RECENT_OPEN,
         name: "Recent open",
         url: "/recent",
         icon: RecentIcon,
@@ -82,7 +82,7 @@ export const sidePanelData = [
         }
     },
     {
-        id: SidePanelIdentifiers.FAVORITES,
+        id: SidePanelId.FAVORITES,
         name: "Favorites",
         url: "/favorites",
         icon: FavoriteIcon,
@@ -95,7 +95,7 @@ export const sidePanelData = [
         }
     },
     {
-        id: SidePanelIdentifiers.TRASH,
+        id: SidePanelId.TRASH,
         name: "Trash",
         url: "/trash",
         icon: TrashIcon,
index 4e00349f2497510ae5669ac4e19da1c04aa783cf..ac8d61ebb0977eadbe578ef2736f1fd159f79dc7 100644 (file)
@@ -29,7 +29,6 @@ import { CreateProjectDialog } from "~/views-components/create-project-dialog/cr
 
 import { detailsPanelActions, loadDetails } from "~/store/details-panel/details-panel-action";
 import { contextMenuActions } from "~/store/context-menu/context-menu-actions";
-import { SidePanelIdentifiers } from '~/store/side-panel/side-panel-reducer';
 import { ProjectResource } from '~/models/project';
 import { ResourceKind } from '~/models/resource';
 import { ContextMenu, ContextMenuKind } from "~/views-components/context-menu/context-menu";