fixed conflicts
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Wed, 21 Nov 2018 15:14:05 +0000 (16:14 +0100)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Wed, 21 Nov 2018 15:14:05 +0000 (16:14 +0100)
Feature #13864

Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>

1  2 
src/components/icon/icon.tsx
src/models/resource.ts
src/routes/route-change-handlers.ts
src/routes/routes.ts
src/services/services.ts
src/store/navigation/navigation-action.ts
src/store/store.ts
src/store/workbench/workbench-actions.ts
src/views-components/main-app-bar/account-menu.tsx
src/views-components/main-content-bar/main-content-bar.tsx
src/views/workbench/workbench.tsx

Simple merge
index f200713e6a6ceb4eea96ccec749c1c9534d79922,520520f76eb1d39c65c04378968b9c4de3093e5e..d2f524fc51d47a4537fd624fd47c9c9952e50b05
@@@ -28,8 -28,8 +28,9 @@@ export enum ResourceKind 
      LOG = "arvados#log",
      PROCESS = "arvados#containerRequest",
      PROJECT = "arvados#group",
+     REPOSITORY = "arvados#repository",
      USER = "arvados#user",
 +    VIRTUAL_MACHINE = "arvados#virtualMachine",
      WORKFLOW = "arvados#workflow",
      NONE = "arvados#none"
  }
@@@ -40,8 -40,8 +41,9 @@@ export enum ResourceObjectType 
      CONTAINER_REQUEST = 'xvhdp',
      GROUP = 'j7d0g',
      LOG = '57u5n',
+     REPOSITORY = 's0uqq',
      USER = 'tpzed',
 +    VIRTUAL_MACHINE = '2x53u',
      WORKFLOW = '7fd4e',
  }
  
@@@ -75,8 -75,8 +77,10 @@@ export const extractUuidKind = (uuid: s
              return ResourceKind.LOG;
          case ResourceObjectType.WORKFLOW:
              return ResourceKind.WORKFLOW;
 +        case ResourceObjectType.VIRTUAL_MACHINE:
 +            return ResourceKind.VIRTUAL_MACHINE;
+         case ResourceObjectType.REPOSITORY:
+             return ResourceKind.REPOSITORY;
          default:
              return undefined;
      }
index ca15a150aa626d8f3d1b3322448b093eb8ba60e2,c7f3555bcf79db6f64448b330cb4132392a913cb..22d0b7c711364d2a466b8b0af5e2b7d465cb73aa
@@@ -4,8 -4,8 +4,8 @@@
  
  import { History, Location } from 'history';
  import { RootStore } from '~/store/store';
- import { matchProcessRoute, matchProcessLogRoute, matchProjectRoute, matchCollectionRoute, matchFavoritesRoute, matchTrashRoute, matchRootRoute, matchSharedWithMeRoute, matchRunProcessRoute, matchWorkflowRoute, matchSearchResultsRoute, matchVirtualMachineRoute } from './routes';
- import { loadProject, loadCollection, loadFavorites, loadTrash, loadProcess, loadProcessLog, loadVirtualMachines } from '~/store/workbench/workbench-actions';
 -import { matchProcessRoute, matchProcessLogRoute, matchProjectRoute, matchCollectionRoute, matchFavoritesRoute, matchTrashRoute, matchRootRoute, matchSharedWithMeRoute, matchRunProcessRoute, matchWorkflowRoute, matchSearchResultsRoute, matchSshKeysRoute, matchRepositoriesRoute } from './routes';
 -import { loadProject, loadCollection, loadFavorites, loadTrash, loadProcess, loadProcessLog, loadSshKeys, loadRepositories } from '~/store/workbench/workbench-actions';
++import { matchProcessRoute, matchProcessLogRoute, matchProjectRoute, matchCollectionRoute, matchFavoritesRoute, matchTrashRoute, matchRootRoute, matchSharedWithMeRoute, matchRunProcessRoute, matchWorkflowRoute, matchSearchResultsRoute, matchSshKeysRoute, matchRepositoriesRoute, matchVirtualMachineRoute } from './routes';
++import { loadProject, loadCollection, loadFavorites, loadTrash, loadProcess, loadProcessLog, loadSshKeys, loadRepositories, loadVirtualMachines } from '~/store/workbench/workbench-actions';
  import { navigateToRootProject } from '~/store/navigation/navigation-action';
  import { loadSharedWithMe, loadRunProcess, loadWorkflow, loadSearchResults } from '~//store/workbench/workbench-actions';
  
@@@ -26,8 -27,8 +27,9 @@@ const handleLocationChange = (store: Ro
      const searchResultsMatch = matchSearchResultsRoute(pathname);
      const sharedWithMeMatch = matchSharedWithMeRoute(pathname);
      const runProcessMatch = matchRunProcessRoute(pathname);
 +    const virtualMachineMatch = matchVirtualMachineRoute(pathname);
      const workflowMatch = matchWorkflowRoute(pathname);
+     const sshKeysMatch = matchSshKeysRoute(pathname);
  
      if (projectMatch) {
          store.dispatch(loadProject(projectMatch.params.id));
          store.dispatch(loadWorkflow);
      } else if (searchResultsMatch) {
          store.dispatch(loadSearchResults);
 +    } else if (virtualMachineMatch) {
 +        store.dispatch(loadVirtualMachines);
+     } else if(repositoryMatch) {
+         store.dispatch(loadRepositories);
+     } else if (sshKeysMatch) {
+         store.dispatch(loadSshKeys);
      }
  };
index 3723847ca8b3ed5cc9632ae547e44f3f3602be91,c9c2ae20e1eff73e55ae7d76b6e52aa3c2658f00..71cdfdacad218da9ea51cf636ffacd2cf95916ad
@@@ -16,11 -16,12 +16,13 @@@ export const Routes = 
      FAVORITES: '/favorites',
      TRASH: '/trash',
      PROCESS_LOGS: `/process-logs/:id(${RESOURCE_UUID_PATTERN})`,
+     REPOSITORIES: '/repositories',
      SHARED_WITH_ME: '/shared-with-me',
      RUN_PROCESS: '/run-process',
 +    VIRTUAL_MACHINES: '/virtual-machines',
      WORKFLOWS: '/workflows',
-     SEARCH_RESULTS: '/search-results'
+     SEARCH_RESULTS: '/search-results',
+     SSH_KEYS: `/ssh-keys`
  };
  
  export const getResourceUrl = (uuid: string) => {
@@@ -78,5 -79,8 +80,11 @@@ export const matchWorkflowRoute = (rout
  export const matchSearchResultsRoute = (route: string) =>
      matchPath<ResourceRouteParams>(route, { path: Routes.SEARCH_RESULTS });
  
 +export const matchVirtualMachineRoute = (route: string) =>
 +    matchPath<ResourceRouteParams>(route, { path: Routes.VIRTUAL_MACHINES });
++    
+ export const matchRepositoriesRoute = (route: string) =>
+     matchPath<ResourceRouteParams>(route, { path: Routes.REPOSITORIES });
+     
+ export const matchSshKeysRoute = (route: string) =>
+     matchPath(route, { path: Routes.SSH_KEYS });
index 9e9fcc59d3d72201b26cb2f5614c7349b244997c,308505c5abdbf1ef625b1ff49e038096dad829d5..f1ef86b88555a7760a43d90178b8a7a36d796285
@@@ -24,7 -24,8 +24,9 @@@ import { ApiActions } from "~/services/
  import { WorkflowService } from "~/services/workflow-service/workflow-service";
  import { SearchService } from '~/services/search-service/search-service';
  import { PermissionService } from "~/services/permission-service/permission-service";
 +import { VirtualMachinesService } from "~/services/virtual-machines-service/virtual-machines-service";
+ import { RepositoriesService } from '~/services/repositories-service/repositories-service';
+ import { AuthorizedKeysService } from '~/services/authorized-keys-service/authorized-keys-service';
  
  export type ServiceRepository = ReturnType<typeof createServices>;
  
@@@ -43,8 -45,8 +46,9 @@@ export const createServices = (config: 
      const logService = new LogService(apiClient, actions);
      const permissionService = new PermissionService(apiClient, actions);
      const projectService = new ProjectService(apiClient, actions);
+     const repositoriesService = new RepositoriesService(apiClient, actions);
      const userService = new UserService(apiClient, actions);
 +    const virtualMachineService = new VirtualMachinesService(apiClient, actions);
      const workflowService = new WorkflowService(apiClient, actions);
  
      const ancestorsService = new AncestorService(groupsService, userService);
index c4cf625271df1820e4742f92b3d92b31c005cce2,fc08f3ac495403949d4aa2fc6f32a82e18db3bba..2bfd8b9944ec75e4911ab2bbd08c19676cab62c5
@@@ -62,4 -62,6 +62,8 @@@ export const navigateToRunProcess = pus
  
  export const navigateToSearchResults = push(Routes.SEARCH_RESULTS);
  
 +export const navigateToVirtualMachines = push(Routes.VIRTUAL_MACHINES);
++
+ export const navigateToRepositories = push(Routes.REPOSITORIES);
+ export const navigateToSshKeys= push(Routes.SSH_KEYS);
index 3f1f4a25b4ed4ce6e57b3ecdeb05117c45fe5915,5e648c99ef9efadd32dffba96a493cd8dde2c397..4ab0918e60fb0ac6a636d03e4f95d0d9d3c6e468
@@@ -43,7 -43,7 +43,8 @@@ import { searchBarReducer } from './sea
  import { SEARCH_RESULTS_PANEL_ID } from '~/store/search-results-panel/search-results-panel-actions';
  import { SearchResultsMiddlewareService } from './search-results-panel/search-results-middleware-service';
  import { resourcesDataReducer } from "~/store/resources-data/resources-data-reducer";
 +import { virtualMachinesReducer } from "~/store/virtual-machines/virtual-machines-reducer";
+ import { repositoriesReducer } from '~/store/repositories/repositories-reducer';
  
  const composeEnhancers =
      (process.env.NODE_ENV === 'development' &&
@@@ -113,5 -113,5 +114,6 @@@ const createRootReducer = (services: Se
      runProcessPanel: runProcessPanelReducer,
      appInfo: appInfoReducer,
      searchBar: searchBarReducer,
-     virtualMachines: virtualMachinesReducer
++    virtualMachines: virtualMachinesReducer,
+     repositories: repositoriesReducer
  });
index 52d6c9e62f409aea7f3b7df1c7b007be7c2c887a,5e33661cfff12f9c0442de7f09011f3381e7a1a0..12dbe7b1a8a2d71ebfcd35eb4c2fb27cd8c6fdec
@@@ -53,7 -54,7 +54,8 @@@ import { collectionPanelActions } from 
  import { CollectionResource } from "~/models/collection";
  import { searchResultsPanelActions, loadSearchResultsPanel } from '~/store/search-results-panel/search-results-panel-actions';
  import { searchResultsPanelColumns } from '~/views/search-results-panel/search-results-panel-view';
 +import { loadVirtualMachinesPanel } from '~/store/virtual-machines/virtual-machines-actions';
+ import { loadRepositoriesPanel } from '~/store/repositories/repositories-actions';
  
  export const WORKBENCH_LOADING_SCREEN = 'workbenchLoadingScreen';
  
@@@ -391,11 -392,16 +393,22 @@@ export const loadSearchResults = handle
          await dispatch(loadSearchResultsPanel());
      });
  
 +export const loadVirtualMachines = handleFirstTimeLoad(
 +    async (dispatch: Dispatch<any>) => {
 +        await dispatch(loadVirtualMachinesPanel());
 +        dispatch(setBreadcrumbs([{ label: 'Virtual Machines' }]));
 +    });
++    
+ export const loadRepositories = handleFirstTimeLoad(
+     async (dispatch: Dispatch<any>) => {
+         await dispatch(loadRepositoriesPanel());
+         dispatch(setBreadcrumbs([{ label: 'Repositories' }]));
+     });
+ export const loadSshKeys = handleFirstTimeLoad(
+     async (dispatch: Dispatch<any>) => {
+         await dispatch(loadSshKeysPanel());
+     });
  
  const finishLoadingProject = (project: GroupContentsResource | string) =>
      async (dispatch: Dispatch<any>) => {
index baf893e2e77e7da55fe5eced464096bd574d8d36,f00c678e15c573abe0572c6e729bafd887edff3d..ca88021ccdb04c6491ec5389f94dade7ccd35424
@@@ -8,10 -8,11 +8,12 @@@ import { User, getUserFullname } from "
  import { DropdownMenu } from "~/components/dropdown-menu/dropdown-menu";
  import { UserPanelIcon } from "~/components/icon/icon";
  import { DispatchProp, connect } from 'react-redux';
- import { logout } from "~/store/auth/auth-action";
+ import { logout } from '~/store/auth/auth-action';
  import { RootState } from "~/store/store";
- import { openCurrentTokenDialog } from '../../store/current-token-dialog/current-token-dialog-actions';
+ import { openCurrentTokenDialog } from '~/store/current-token-dialog/current-token-dialog-actions';
+ import { openRepositoriesPanel } from "~/store/repositories/repositories-actions";
+ import { navigateToSshKeys } from '~/store/navigation/navigation-action';
 +import { openVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions";
  
  interface AccountMenuProps {
      user?: User;
@@@ -31,8 -32,9 +33,10 @@@ export const AccountMenu = connect(mapS
                  <MenuItem>
                      {getUserFullname(user)}
                  </MenuItem>
 +                <MenuItem onClick={() => dispatch(openVirtualMachines())}>Virtual Machines</MenuItem>
+                 <MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
                  <MenuItem onClick={() => dispatch(openCurrentTokenDialog)}>Current token</MenuItem>
+                 <MenuItem onClick={() => dispatch(navigateToSshKeys)}>Ssh Keys</MenuItem>
                  <MenuItem>My account</MenuItem>
                  <MenuItem onClick={() => dispatch(logout())}>Logout</MenuItem>
              </DropdownMenu>
index b38f85b5ff32cd44fe5aee2cd88934fcca93e753,741a7e00f68481b07c24895cbcd5ecf05b8f8290..6b84bde2b6143a6e00abd80e6a17068eb27be66c
@@@ -6,11 -6,10 +6,10 @@@ import * as React from "react"
  import { Toolbar, IconButton, Tooltip, Grid } from "@material-ui/core";
  import { DetailsIcon } from "~/components/icon/icon";
  import { Breadcrumbs } from "~/views-components/breadcrumbs/breadcrumbs";
- import { detailsPanelActions } from "~/store/details-panel/details-panel-action";
  import { connect } from 'react-redux';
  import { RootState } from '~/store/store';
- import { matchWorkflowRoute } from '~/routes/routes';
- import { matchVirtualMachineRoute } from '~/routes/routes';
 -import { matchWorkflowRoute, matchSshKeysRoute, matchRepositoriesRoute } from '~/routes/routes';
++import { matchWorkflowRoute, matchSshKeysRoute, matchRepositoriesRoute, matchVirtualMachineRoute } from '~/routes/routes';
+ import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
  
  interface MainContentBarProps {
      onDetailsPanelToggle: () => void;
@@@ -23,16 -22,22 +22,28 @@@ const isWorkflowPath = ({ router }: Roo
      return !!match;
  };
  
 +const isVirtualMachinePath = ({ router }: RootState) => {
 +    const pathname = router.location ? router.location.pathname : '';
 +    const match = matchVirtualMachineRoute(pathname);
 +    return !!match;
 +};
 +
+ const isRepositoriesPath = ({ router }: RootState) => {
+     const pathname = router.location ? router.location.pathname : '';
+     const match = matchRepositoriesRoute(pathname);
+     return !!match;
+ };
+ const isSshKeysPath = ({ router }: RootState) => {
+     const pathname = router.location ? router.location.pathname : '';
+     const match = matchSshKeysRoute(pathname);
+     return !!match;
+ };
  export const MainContentBar = connect((state: RootState) => ({
-     buttonVisible: !isWorkflowPath(state) && !isVirtualMachinePath(state)
 -    buttonVisible: !isWorkflowPath(state) && !isSshKeysPath(state) && !isRepositoriesPath(state)
++    buttonVisible: !isWorkflowPath(state) && !isSshKeysPath(state) && !isRepositoriesPath(state) && !isVirtualMachinePath(state)
  }), {
-         onDetailsPanelToggle: detailsPanelActions.TOGGLE_DETAILS_PANEL
+         onDetailsPanelToggle: toggleDetailsPanel
      })((props: MainContentBarProps) =>
          <Toolbar>
              <Grid container>
index 4ebc99bd4754c94128643a6fee1336f3daf063dc,ebdf57c3a7a9ac9f2adbb9a944fd3a472db7fc08..5ebf10567f1d87b1d0edc52343659f0cf645bedf
@@@ -47,7 -48,13 +48,14 @@@ import { SshKeyPanel } from '~/views/ss
  import { SharingDialog } from '~/views-components/sharing-dialog/sharing-dialog';
  import { AdvancedTabDialog } from '~/views-components/advanced-tab-dialog/advanced-tab-dialog';
  import { ProcessInputDialog } from '~/views-components/process-input-dialog/process-input-dialog';
 +import { VirtualMachinePanel } from '~/views/virtual-machine-panel/virtual-machine-panel';
+ import { ProjectPropertiesDialog } from '~/views-components/project-properties-dialog/project-properties-dialog';
+ import { RepositoriesPanel } from '~/views/repositories-panel/repositories-panel';
+ import { RepositoriesSampleGitDialog } from '~/views-components/repositories-sample-git-dialog/repositories-sample-git-dialog';
+ import { RepositoryAttributesDialog } from '~/views-components/repository-attributes-dialog/repository-attributes-dialog';
+ import { CreateRepositoryDialog } from '~/views-components/dialog-forms/create-repository-dialog';
+ import { RemoveRepositoryDialog } from '~/views-components/repository-remove-dialog/repository-remove-dialog';
+ import { CreateSshKeyDialog } from '~/views-components/dialog-forms/create-ssh-key-dialog';
  
  type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
  
@@@ -117,7 -124,8 +125,9 @@@ export const WorkbenchPanel 
                                  <Route path={Routes.RUN_PROCESS} component={RunProcessPanel} />
                                  <Route path={Routes.WORKFLOWS} component={WorkflowPanel} />
                                  <Route path={Routes.SEARCH_RESULTS} component={SearchResultsPanel} />
 +                                <Route path={Routes.VIRTUAL_MACHINES} component={VirtualMachinePanel} />
+                                 <Route path={Routes.REPOSITORIES} component={RepositoriesPanel} />
+                                 <Route path={Routes.SSH_KEYS} component={SshKeyPanel} />
                              </Switch>
                          </Grid>
                      </Grid>