Merge branch 'master' of git.curoverse.com:arvados-workbench2 into 14500_admin_api_tokens 14500_admin_api_tokens
authorJanicki Artur <artur.janicki@contractors.roche.com>
Fri, 7 Dec 2018 09:48:35 +0000 (10:48 +0100)
committerJanicki Artur <artur.janicki@contractors.roche.com>
Fri, 7 Dec 2018 09:48:35 +0000 (10:48 +0100)
refs #2
14500

Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki@contractors.roche.com>

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

index 1a88ff20f956e81efe66e8a6f7926f47247075f8,68de3107f1a82bb219fb49e883c27682c486902f..a733e42f7e902a7aa912ff9482de9e000627b0b3
@@@ -31,7 -31,7 +31,8 @@@ const handleLocationChange = (store: Ro
      const sshKeysMatch = Routes.matchSshKeysRoute(pathname);
      const keepServicesMatch = Routes.matchKeepServicesRoute(pathname);
      const computeNodesMatch = Routes.matchComputeNodesRoute(pathname);
 +    const apiClientAuthorizationsMatch = Routes.matchApiClientAuthorizationsRoute(pathname);
+     const myAccountMatch = Routes.matchMyAccountRoute(pathname);
  
      if (projectMatch) {
          store.dispatch(WorkbenchActions.loadProject(projectMatch.params.id));
@@@ -65,7 -65,7 +66,9 @@@
          store.dispatch(WorkbenchActions.loadKeepServices);
      } else if (computeNodesMatch) {
          store.dispatch(WorkbenchActions.loadComputeNodes);
 +    } else if (apiClientAuthorizationsMatch) {
 +        store.dispatch(WorkbenchActions.loadApiClientAuthorizations);
+     } else if (myAccountMatch) {
+         store.dispatch(WorkbenchActions.loadMyAccount);
      }
  };
index 1fda25d0afca45853b6a8eadd3fd24a27fc04cfe,71d920ab3e4d984dcf126a5aaf6b439431dde9d7..7f15a8de74bb52c47e67a5f1e608a1e3ab0df9cf
@@@ -23,9 -23,9 +23,10 @@@ export const Routes = 
      WORKFLOWS: '/workflows',
      SEARCH_RESULTS: '/search-results',
      SSH_KEYS: `/ssh-keys`,
+     MY_ACCOUNT: '/my-account',
      KEEP_SERVICES: `/keep-services`,
 -    COMPUTE_NODES: `/nodes`
 +    COMPUTE_NODES: `/nodes`,
 +    API_CLIENT_AUTHORIZATIONS: `/api_client_authorizations`
  };
  
  export const getResourceUrl = (uuid: string) => {
index e1e8cef557e1af4a6879ae60f2180ce4dd784877,a3652726f1d2dfda5b51d8c1f5200ebf1bbd6b71..067a9ac487f0869e038c00b67cd75c8f1f9d2985
@@@ -68,8 -68,8 +68,10 @@@ export const navigateToRepositories = p
  
  export const navigateToSshKeys= push(Routes.SSH_KEYS);
  
+ export const navigateToMyAccount = push(Routes.MY_ACCOUNT);
  export const navigateToKeepServices = push(Routes.KEEP_SERVICES);
  
 -export const navigateToComputeNodes = push(Routes.COMPUTE_NODES);
 +export const navigateToComputeNodes = push(Routes.COMPUTE_NODES);
 +
 +export const navigateToApiClientAuthorizations = push(Routes.API_CLIENT_AUTHORIZATIONS);
index f385b9f600143d6748f5a5b20d13bea4a435fa22,ee726f3d75ec5a603acbf80c0708be9085b59316..415cba37c97b543da6ee41d4cb7dccce6f91a6c6
@@@ -12,10 -12,7 +12,10 @@@ 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, navigateToMyAccount } from '~/store/navigation/navigation-action';
 +import { 
 +    navigateToSshKeys, navigateToKeepServices, navigateToComputeNodes,
-     navigateToApiClientAuthorizations
++    navigateToApiClientAuthorizations, navigateToMyAccount
 +} from '~/store/navigation/navigation-action';
  import { openVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions";
  
  interface AccountMenuProps {
@@@ -40,10 -37,9 +40,10 @@@ export const AccountMenu = connect(mapS
                  <MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
                  <MenuItem onClick={() => dispatch(openCurrentTokenDialog)}>Current token</MenuItem>
                  <MenuItem onClick={() => dispatch(navigateToSshKeys)}>Ssh Keys</MenuItem>
 +                { user.isAdmin && <MenuItem onClick={() => dispatch(navigateToApiClientAuthorizations)}>Api Tokens</MenuItem> }
                  { user.isAdmin && <MenuItem onClick={() => dispatch(navigateToKeepServices)}>Keep Services</MenuItem> }
                  { user.isAdmin && <MenuItem onClick={() => dispatch(navigateToComputeNodes)}>Compute Nodes</MenuItem> }
-                 <MenuItem>My account</MenuItem>
+                 <MenuItem onClick={() => dispatch(navigateToMyAccount)}>My account</MenuItem>
                  <MenuItem onClick={() => dispatch(logout())}>Logout</MenuItem>
              </DropdownMenu>
              : null);
index 1f5a5035ec8de68b43a41ba14f986fe532b1e9ab,5efffa19ac26b705233cd24c3fb4e08578a6c32f..3cd040f78c6aeec4819c92dd5db500a1495ab9e0
@@@ -145,7 -142,7 +146,8 @@@ export const WorkbenchPanel 
                                  <Route path={Routes.SSH_KEYS} component={SshKeyPanel} />
                                  <Route path={Routes.KEEP_SERVICES} component={KeepServicePanel} />
                                  <Route path={Routes.COMPUTE_NODES} component={ComputeNodePanel} />
 +                                <Route path={Routes.API_CLIENT_AUTHORIZATIONS} component={ApiClientAuthorizationPanel} />
+                                 <Route path={Routes.MY_ACCOUNT} component={MyAccountPanel} />
                              </Switch>
                          </Grid>
                      </Grid>