From: Michal Klobukowski Date: Sun, 16 Dec 2018 21:44:03 +0000 (+0100) Subject: Merge branch 'master' X-Git-Tag: 1.4.0~71^2~18^2~6 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/59329caeae17903b97b90b167df5a8122a0c9d95 Merge branch 'master' Feature #14505 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- 59329caeae17903b97b90b167df5a8122a0c9d95 diff --cc src/index.tsx index f64e076a,e73f08c4..508fa7c3 --- a/src/index.tsx +++ b/src/index.tsx @@@ -56,8 -56,7 +56,9 @@@ import { virtualMachineActionSet } fro import { userActionSet } from '~/views-components/context-menu/action-sets/user-action-set'; import { computeNodeActionSet } from '~/views-components/context-menu/action-sets/compute-node-action-set'; import { apiClientAuthorizationActionSet } from '~/views-components/context-menu/action-sets/api-client-authorization-action-set'; +import { groupActionSet } from '~/views-components/context-menu/action-sets/group-action-set'; +import { groupMemberActionSet } from '~/views-components/context-menu/action-sets/group-member-action-set'; + import { linkActionSet } from '~/views-components/context-menu/action-sets/link-action-set'; console.log(`Starting arvados [${getBuildInfo()}]`); @@@ -79,10 -78,9 +80,11 @@@ addMenuActionSet(ContextMenuKind.SSH_KE addMenuActionSet(ContextMenuKind.VIRTUAL_MACHINE, virtualMachineActionSet); addMenuActionSet(ContextMenuKind.KEEP_SERVICE, keepServiceActionSet); addMenuActionSet(ContextMenuKind.USER, userActionSet); + addMenuActionSet(ContextMenuKind.LINK, linkActionSet); addMenuActionSet(ContextMenuKind.NODE, computeNodeActionSet); addMenuActionSet(ContextMenuKind.API_CLIENT_AUTHORIZATION, apiClientAuthorizationActionSet); +addMenuActionSet(ContextMenuKind.GROUPS, groupActionSet); +addMenuActionSet(ContextMenuKind.GROUP_MEMBER, groupMemberActionSet); fetchConfig() .then(({ config, apiHost }) => { diff --cc src/models/link.ts index 1798e447,d931f7f2..785d531c --- a/src/models/link.ts +++ b/src/models/link.ts @@@ -2,8 -2,9 +2,8 @@@ // // SPDX-License-Identifier: AGPL-3.0 - import { Resource, ResourceKind } from "./resource"; -import { Resource } from "./resource"; import { TagProperty } from "~/models/tag"; -import { ResourceKind } from '~/models/resource'; ++import { Resource, ResourceKind } from '~/models/resource'; export interface LinkResource extends Resource { headUuid: string; diff --cc src/routes/route-change-handlers.ts index cbfbfd38,655c806f..7b37509f --- a/src/routes/route-change-handlers.ts +++ b/src/routes/route-change-handlers.ts @@@ -34,8 -37,9 +37,11 @@@ const handleLocationChange = (store: Ro const apiClientAuthorizationsMatch = Routes.matchApiClientAuthorizationsRoute(pathname); const myAccountMatch = Routes.matchMyAccountRoute(pathname); const userMatch = Routes.matchUsersRoute(pathname); + const groupsMatch = Routes.matchGroupsRoute(pathname); + const groupDetailsMatch = Routes.matchGroupDetailsRoute(pathname); + const linksMatch = Routes.matchLinksRoute(pathname); + + store.dispatch(dialogActions.CLOSE_ALL_DIALOGS()); if (projectMatch) { store.dispatch(WorkbenchActions.loadProject(projectMatch.params.id)); @@@ -73,11 -81,9 +83,13 @@@ store.dispatch(WorkbenchActions.loadApiClientAuthorizations); } else if (myAccountMatch) { store.dispatch(WorkbenchActions.loadMyAccount); - }else if (userMatch) { + } else if (userMatch) { store.dispatch(WorkbenchActions.loadUsers); + } else if (groupsMatch) { + store.dispatch(WorkbenchActions.loadGroupsPanel); + } else if (groupDetailsMatch) { + store.dispatch(WorkbenchActions.loadGroupDetailsPanel(groupDetailsMatch.params.id)); + } else if (linksMatch) { + store.dispatch(WorkbenchActions.loadLinks); } }; diff --cc src/routes/routes.ts index 6d44725c,05f6663f..661a065e --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@@ -28,8 -30,7 +30,9 @@@ export const Routes = COMPUTE_NODES: `/nodes`, USERS: '/users', API_CLIENT_AUTHORIZATIONS: `/api_client_authorizations`, + GROUPS: '/groups', + GROUP_DETAILS: `/group/:id(${RESOURCE_UUID_PATTERN})`, + LINKS: '/links' }; export const getResourceUrl = (uuid: string) => { @@@ -113,8 -118,5 +122,11 @@@ export const matchComputeNodesRoute = ( export const matchApiClientAuthorizationsRoute = (route: string) => matchPath(route, { path: Routes.API_CLIENT_AUTHORIZATIONS }); +export const matchGroupsRoute = (route: string) => + matchPath(route, { path: Routes.GROUPS }); + +export const matchGroupDetailsRoute = (route: string) => + matchPath(route, { path: Routes.GROUP_DETAILS }); ++ + export const matchLinksRoute = (route: string) => - matchPath(route, { path: Routes.LINKS }); ++ matchPath(route, { path: Routes.LINKS }); diff --cc src/store/navigation/navigation-action.ts index 9aa4a32c,92443c02..c53c55e8 --- a/src/store/navigation/navigation-action.ts +++ b/src/store/navigation/navigation-action.ts @@@ -81,6 -84,4 +87,8 @@@ export const navigateToUsers = push(Rou export const navigateToApiClientAuthorizations = push(Routes.API_CLIENT_AUTHORIZATIONS); -export const navigateToLinks = push(Routes.LINKS); +export const navigateToGroups = push(Routes.GROUPS); + +export const navigateToGroupDetails = compose(push, getGroupUrl); ++ ++export const navigateToLinks = push(Routes.LINKS); diff --cc src/store/store.ts index ad70868e,792224d2..3aef8f50 --- a/src/store/store.ts +++ b/src/store/store.ts @@@ -50,10 -50,8 +50,12 @@@ import { UserMiddlewareService } from ' import { USERS_PANEL_ID } from '~/store/users/users-actions'; import { computeNodesReducer } from '~/store/compute-nodes/compute-nodes-reducer'; import { apiClientAuthorizationsReducer } from '~/store/api-client-authorizations/api-client-authorizations-reducer'; +import { GroupsPanelMiddlewareService } from '~/store/groups-panel/groups-panel-middleware-service'; +import { GROUPS_PANEL_ID } from '~/store/groups-panel/groups-panel-actions'; +import { GroupDetailsPanelMiddlewareService } from '~/store/group-details-panel/group-details-panel-middleware-service'; +import { GROUP_DETAILS_PANEL_ID } from '~/store/group-details-panel/group-details-panel-actions'; + import { LINK_PANEL_ID } from '~/store/link-panel/link-panel-actions'; + import { LinkMiddlewareService } from '~/store/link-panel/link-panel-middleware-service'; const composeEnhancers = (process.env.NODE_ENV === 'development' && @@@ -88,13 -86,9 +90,16 @@@ export function configureStore(history const userPanelMiddleware = dataExplorerMiddleware( new UserMiddlewareService(services, USERS_PANEL_ID) ); + const groupsPanelMiddleware = dataExplorerMiddleware( + new GroupsPanelMiddlewareService(services, GROUPS_PANEL_ID) + ); + const groupDetailsPanelMiddleware = dataExplorerMiddleware( + new GroupDetailsPanelMiddlewareService(services, GROUP_DETAILS_PANEL_ID) + ); + + const linkPanelMiddleware = dataExplorerMiddleware( + new LinkMiddlewareService(services, LINK_PANEL_ID) + ); const middlewares: Middleware[] = [ routerMiddleware(history), thunkMiddleware.withExtraArgument(services), @@@ -105,8 -99,7 +110,9 @@@ sharedWithMePanelMiddleware, workflowPanelMiddleware, userPanelMiddleware, + groupsPanelMiddleware, + groupDetailsPanelMiddleware, + linkPanelMiddleware ]; const enhancer = composeEnhancers(applyMiddleware(...middlewares)); return createStore(rootReducer, enhancer); diff --cc src/store/workbench/workbench-actions.ts index e185e8cf,85540f0b..af2afab2 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@@ -100,8 -98,7 +102,9 @@@ export const loadWorkbench = () = dispatch(workflowPanelActions.SET_COLUMNS({ columns: workflowPanelColumns })); dispatch(searchResultsPanelActions.SET_COLUMNS({ columns: searchResultsPanelColumns })); dispatch(userBindedActions.SET_COLUMNS({ columns: userPanelColumns })); + dispatch(groupPanelActions.GroupsPanelActions.SET_COLUMNS({ columns: groupsPanelColumns })); + dispatch(groupDetailsPanelActions.GroupDetailsPanelActions.SET_COLUMNS({columns: groupDetailsPanelColumns})); + dispatch(linkPanelActions.SET_COLUMNS({ columns: linkPanelColumns })); dispatch(initSidePanelTree()); if (router.location) { const match = matchRootRoute(router.location.pathname); diff --cc src/views-components/context-menu/context-menu.tsx index e148a78a,a9200ebb..4ce2f521 --- a/src/views-components/context-menu/context-menu.tsx +++ b/src/views-components/context-menu/context-menu.tsx @@@ -75,7 -75,6 +75,8 @@@ export enum ContextMenuKind VIRTUAL_MACHINE = "VirtualMachine", KEEP_SERVICE = "KeepService", USER = "User", + NODE = "Node", + GROUPS = "Group", - GROUP_MEMBER = "GroupMember" ++ GROUP_MEMBER = "GroupMember", + LINK = "Link", - NODE = "Node" } diff --cc src/views-components/main-app-bar/account-menu.tsx index cb8fd566,1609aafa..a1116540 --- a/src/views-components/main-app-bar/account-menu.tsx +++ b/src/views-components/main-app-bar/account-menu.tsx @@@ -12,12 -12,8 +12,13 @@@ import { logout } from '~/store/auth/au import { RootState } from "~/store/store"; import { openCurrentTokenDialog } from '~/store/current-token-dialog/current-token-dialog-actions'; import { openRepositoriesPanel } from "~/store/repositories/repositories-actions"; - import { - navigateToSshKeys, navigateToKeepServices, navigateToComputeNodes, - navigateToApiClientAuthorizations, navigateToMyAccount, navigateToGroups ++import { ++ navigateToKeepServices, navigateToComputeNodes, ++ navigateToApiClientAuthorizations, navigateToGroups +} from '~/store/navigation/navigation-action'; - import { openVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions"; +import { navigateToUsers } from '~/store/navigation/navigation-action'; + import { navigateToSshKeysUser, navigateToMyAccount } from '~/store/navigation/navigation-action'; + import { openUserVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions"; interface AccountMenuProps { user?: User; @@@ -37,15 -33,10 +38,15 @@@ export const AccountMenu = connect(mapS {getUserFullname(user)} - dispatch(openVirtualMachines())}>Virtual Machines - dispatch(openRepositoriesPanel())}>Repositories + dispatch(openUserVirtualMachines())}>Virtual Machines + {!user.isAdmin && dispatch(openRepositoriesPanel())}>Repositories} dispatch(openCurrentTokenDialog)}>Current token - dispatch(navigateToSshKeys)}>Ssh Keys + dispatch(navigateToUsers)}>Users - { user.isAdmin && dispatch(navigateToGroups)}>Groups } - { user.isAdmin && dispatch(navigateToApiClientAuthorizations)}>Api Tokens } - { user.isAdmin && dispatch(navigateToKeepServices)}>Keep Services } - { user.isAdmin && dispatch(navigateToComputeNodes)}>Compute Nodes } ++ {user.isAdmin && dispatch(navigateToGroups)}>Groups} ++ {user.isAdmin && dispatch(navigateToApiClientAuthorizations)}>Api Tokens} ++ {user.isAdmin && dispatch(navigateToKeepServices)}>Keep Services} ++ {user.isAdmin && dispatch(navigateToComputeNodes)}>Compute Nodes} + dispatch(navigateToSshKeysUser)}>Ssh Keys dispatch(navigateToMyAccount)}>My account dispatch(logout())}>Logout diff --cc src/views/workbench/workbench.tsx index 695834a6,025540e2..bff328e8 --- a/src/views/workbench/workbench.tsx +++ b/src/views/workbench/workbench.tsx @@@ -160,8 -158,7 +166,9 @@@ export const WorkbenchPanel + + + @@@ -203,9 -197,8 +211,10 @@@ + + +