From: Pawel Kowalczyk Date: Wed, 21 Nov 2018 15:14:05 +0000 (+0100) Subject: fixed conflicts X-Git-Tag: 1.3.0~11^2~5 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/e4b54c3b5d99c99553e319ead28c3aa8dcd6eecc fixed conflicts Feature #13864 Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk --- e4b54c3b5d99c99553e319ead28c3aa8dcd6eecc diff --cc src/models/resource.ts index f200713e,520520f7..d2f524fc --- a/src/models/resource.ts +++ b/src/models/resource.ts @@@ -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; } diff --cc src/routes/route-change-handlers.ts index ca15a150,c7f3555b..22d0b7c7 --- a/src/routes/route-change-handlers.ts +++ b/src/routes/route-change-handlers.ts @@@ -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)); @@@ -51,7 -52,9 +53,11 @@@ 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); } }; diff --cc src/routes/routes.ts index 3723847c,c9c2ae20..71cdfdac --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@@ -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(route, { path: Routes.SEARCH_RESULTS }); +export const matchVirtualMachineRoute = (route: string) => + matchPath(route, { path: Routes.VIRTUAL_MACHINES }); ++ + export const matchRepositoriesRoute = (route: string) => + matchPath(route, { path: Routes.REPOSITORIES }); + + export const matchSshKeysRoute = (route: string) => + matchPath(route, { path: Routes.SSH_KEYS }); diff --cc src/services/services.ts index 9e9fcc59,308505c5..f1ef86b8 --- a/src/services/services.ts +++ b/src/services/services.ts @@@ -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; @@@ -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); diff --cc src/store/navigation/navigation-action.ts index c4cf6252,fc08f3ac..2bfd8b99 --- a/src/store/navigation/navigation-action.ts +++ b/src/store/navigation/navigation-action.ts @@@ -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); diff --cc src/store/store.ts index 3f1f4a25,5e648c99..4ab0918e --- a/src/store/store.ts +++ b/src/store/store.ts @@@ -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 }); diff --cc src/store/workbench/workbench-actions.ts index 52d6c9e6,5e33661c..12dbe7b1 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@@ -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) => { + await dispatch(loadVirtualMachinesPanel()); + dispatch(setBreadcrumbs([{ label: 'Virtual Machines' }])); + }); ++ + export const loadRepositories = handleFirstTimeLoad( + async (dispatch: Dispatch) => { + await dispatch(loadRepositoriesPanel()); + dispatch(setBreadcrumbs([{ label: 'Repositories' }])); + }); + + export const loadSshKeys = handleFirstTimeLoad( + async (dispatch: Dispatch) => { + await dispatch(loadSshKeysPanel()); + }); const finishLoadingProject = (project: GroupContentsResource | string) => async (dispatch: Dispatch) => { diff --cc src/views-components/main-app-bar/account-menu.tsx index baf893e2,f00c678e..ca88021c --- a/src/views-components/main-app-bar/account-menu.tsx +++ b/src/views-components/main-app-bar/account-menu.tsx @@@ -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 {getUserFullname(user)} + dispatch(openVirtualMachines())}>Virtual Machines + dispatch(openRepositoriesPanel())}>Repositories dispatch(openCurrentTokenDialog)}>Current token + dispatch(navigateToSshKeys)}>Ssh Keys My account dispatch(logout())}>Logout diff --cc src/views-components/main-content-bar/main-content-bar.tsx index b38f85b5,741a7e00..6b84bde2 --- a/src/views-components/main-content-bar/main-content-bar.tsx +++ b/src/views-components/main-content-bar/main-content-bar.tsx @@@ -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) => diff --cc src/views/workbench/workbench.tsx index 4ebc99bd,ebdf57c3..5ebf1056 --- a/src/views/workbench/workbench.tsx +++ b/src/views/workbench/workbench.tsx @@@ -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 + + +