[ARVADOS-WORKBENCH2] updated: 1.3.0-12-gcc72c29

Git user git at public.curoverse.com
Mon Dec 3 07:33:06 EST 2018


Summary of changes:
 README.md                                          |  4 +
 public/vocabulary-example.json                     | 32 ++++++++
 src/common/config.ts                               |  3 +-
 src/index.tsx                                      |  2 +
 src/models/{keep.ts => keep-services.ts}           | 25 ++++---
 src/models/resource.ts                             |  6 +-
 src/routes/route-change-handlers.ts                | 19 ++++-
 src/routes/routes.ts                               |  6 +-
 src/services/auth-service/auth-service.ts          |  2 +-
 src/services/keep-service/keep-service.ts          |  6 +-
 src/store/advanced-tab/advanced-tab.ts             | 52 ++++++++++++-
 src/store/auth/auth-actions.test.ts                |  4 +-
 src/store/auth/auth-reducer.test.ts                |  6 +-
 src/store/context-menu/context-menu-actions.ts     | 17 ++++-
 src/store/keep-services/keep-services-actions.ts   | 71 ++++++++++++++++++
 src/store/keep-services/keep-services-reducer.ts   | 17 +++++
 src/store/navigation/navigation-action.ts          |  2 +
 src/store/store.ts                                 |  4 +-
 src/store/workbench/workbench-actions.ts           |  6 ++
 ...ey-action-set.ts => keep-service-action-set.ts} | 10 +--
 src/views-components/context-menu/context-menu.tsx |  3 +-
 .../keep-services-dialog/attributes-dialog.tsx     | 73 ++++++++++++++++++
 .../remove-dialog.tsx                              |  8 +-
 src/views-components/main-app-bar/account-menu.tsx |  3 +-
 .../main-content-bar/main-content-bar.tsx          | 28 ++-----
 .../keep-service-panel/keep-service-panel-root.tsx | 87 ++++++++++++++++++++++
 .../keep-service-panel/keep-service-panel.tsx      | 29 ++++++++
 .../run-process-panel/inputs/boolean-input.tsx     | 17 +++--
 .../run-process-panel/inputs/directory-input.tsx   | 42 ++++++-----
 src/views/run-process-panel/inputs/enum-input.tsx  | 20 ++++-
 src/views/run-process-panel/inputs/file-input.tsx  | 31 +++++---
 src/views/run-process-panel/inputs/float-input.tsx | 17 +++--
 src/views/run-process-panel/inputs/int-input.tsx   | 22 ++++--
 .../run-process-panel/inputs/string-input.tsx      | 14 ++--
 src/views/workbench/workbench.tsx                  |  6 ++
 35 files changed, 570 insertions(+), 124 deletions(-)
 create mode 100644 public/vocabulary-example.json
 rename src/models/{keep.ts => keep-services.ts} (61%)
 create mode 100644 src/store/keep-services/keep-services-actions.ts
 create mode 100644 src/store/keep-services/keep-services-reducer.ts
 copy src/views-components/context-menu/action-sets/{ssh-key-action-set.ts => keep-service-action-set.ts} (69%)
 create mode 100644 src/views-components/keep-services-dialog/attributes-dialog.tsx
 copy src/views-components/{ssh-keys-dialog => keep-services-dialog}/remove-dialog.tsx (65%)
 create mode 100644 src/views/keep-service-panel/keep-service-panel-root.tsx
 create mode 100644 src/views/keep-service-panel/keep-service-panel.tsx

       via  cc72c29b709759a4498ad232e3f0374e857c7a62 (commit)
       via  8695e9d621330e691fbcc4bbc1d600d91bae2ac6 (commit)
       via  785a62a8934dc439cbd201d9011775ccbcbb2c24 (commit)
       via  f320a6e774ee53dbefb8dafdc40a4f42ab7454ed (commit)
       via  33916938dc164fa0cca9e8abb693b3048fc931ab (commit)
       via  17d467bf2fecc68a6d66beea293cf23a38f95a53 (commit)
       via  756f931c1faeb27a00625093697ff95358e0afc4 (commit)
       via  bb4f491da85b1e953941209e4bc422c707504ee3 (commit)
       via  9ee2f1c761b0d5867dfcab90fc8d11de211a3030 (commit)
       via  ee3ea64385ba6c409f74c8a2f2a367f007a44bd6 (commit)
       via  dbca22d752af6473a39e4f67c5fc0be355c80eaf (commit)
       via  e4143ec29fb0adb4f38d4066fccc88af036bbe01 (commit)
       via  0ded4d49712a782919828e3d6a2d258e71d3f8f3 (commit)
       via  3e2e65e95cf4070e4742ee96ea16cb6c5e841b7a (commit)
       via  598e2bcda179324f0457f6e15cdd2f2a8785374d (commit)
       via  fa9e1f065eefa7265879869e4b45eb76be64b4ce (commit)
       via  2759843b203ee1b3db4da0d2326319e072c3bf33 (commit)
       via  a8187ba6c1780cef4de40729cbd3875a9d3dafc4 (commit)
       via  793701b5251bea3670137b4a14a35bb537f40a82 (commit)
       via  36e62deaa887cea4bd475e222c37c941af70534c (commit)
       via  89f5e163802e04dc6ebb84a390bbc5907486a718 (commit)
       via  fc3f2ce8575095a33a3e62571c85cba6db7a6200 (commit)
       via  1e5b9cce5a4bb83fe958f1a0a1a47c6748b8ea86 (commit)
       via  c09ad994a225b752e81acc4d956981f2239d5297 (commit)
       via  7108a1b63584de629f0632f8179304216a5ec9bb (commit)
       via  717210dfd80d0831c83c08086a3c27cace13ed18 (commit)
       via  135ec797465fc6052cb51ef00243d86f6d794659 (commit)
       via  292980a1d4fb85d873effed62729dc014162c8c6 (commit)
       via  2b86e5928fb3ebe3d32a7dceef56b3803958f1cb (commit)
       via  c26c98ff85da6a9ed2b946eae1d3484a3056bd10 (commit)
       via  e80358167d498a3601c10b03a497622dcdf25167 (commit)
       via  e3232103918da984d2d8198a08abe389af15aeb1 (commit)
       via  ce23dccaf88e67b279c17ab2ce744f54536972f9 (commit)
       via  b223ff6adeb599c59346042a096fac309429db1f (commit)
      from  60e8ad5f90108900b4c189f88fbe483e7010432e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit cc72c29b709759a4498ad232e3f0374e857c7a62
Merge: 60e8ad5 8695e9d
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Mon Dec 3 13:32:53 2018 +0100

    conflicts
    
    Feature #14498
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --cc src/index.tsx
index 3ff8088,79525a8..d838596
--- a/src/index.tsx
+++ b/src/index.tsx
@@@ -50,8 -50,8 +50,9 @@@ import HTML5Backend from 'react-dnd-htm
  import { initAdvanceFormProjectsTree } from '~/store/search-bar/search-bar-actions';
  import { repositoryActionSet } from '~/views-components/context-menu/action-sets/repository-action-set';
  import { sshKeyActionSet } from '~/views-components/context-menu/action-sets/ssh-key-action-set';
+ import { keepServiceActionSet } from '~/views-components/context-menu/action-sets/keep-service-action-set';
  import { loadVocabulary } from '~/store/vocabulary/vocabulary-actions';
 +import { virtualMachineActionSet } from '~/views-components/context-menu/action-sets/virtual-machine-action-set';
  
  console.log(`Starting arvados [${getBuildInfo()}]`);
  
@@@ -70,7 -70,7 +71,8 @@@ addMenuActionSet(ContextMenuKind.PROCES
  addMenuActionSet(ContextMenuKind.TRASH, trashActionSet);
  addMenuActionSet(ContextMenuKind.REPOSITORY, repositoryActionSet);
  addMenuActionSet(ContextMenuKind.SSH_KEY, sshKeyActionSet);
 +addMenuActionSet(ContextMenuKind.VIRTUAL_MACHINE, virtualMachineActionSet);
+ addMenuActionSet(ContextMenuKind.KEEP_SERVICE, keepServiceActionSet);
  
  fetchConfig()
      .then(({ config, apiHost }) => {
diff --cc src/store/advanced-tab/advanced-tab.ts
index fd68eb4,c48011d..d9dabe5
--- a/src/store/advanced-tab/advanced-tab.ts
+++ b/src/store/advanced-tab/advanced-tab.ts
@@@ -16,10 -16,7 +16,11 @@@ import { ServiceRepository } from '~/se
  import { FilterBuilder } from '~/services/api/filter-builder';
  import { RepositoryResource } from '~/models/repositories';
  import { SshKeyResource } from '~/models/ssh-key';
 +import { VirtualMachinesResource } from '~/models/virtual-machines';
 +import { UserResource } from '~/models/user';
 +import { ListResults } from '~/services/common-service/common-resource-service';
 +import { LinkResource } from '~/models/link';
+ import { KeepServiceResource } from '~/models/keep-services';
  
  export const ADVANCED_TAB_DIALOG = 'advancedTabDialog';
  
@@@ -62,21 -59,15 +63,27 @@@ enum SshKeyData 
      CREATED_AT = 'created_at'
  }
  
 +enum VirtualMachineData {
 +    VIRTUAL_MACHINE = 'virtual_machine',
 +    CREATED_AT = 'created_at'
 +}
 +
 +enum ResourcePrefix {
 +    REPOSITORIES = 'repositories',
 +    AUTORIZED_KEYS = 'authorized_keys',
-     VIRTUAL_MACHINES = 'virtual_machines'
++    VIRTUAL_MACHINES = 'virtual_machines',
++    KEEP_SERVICES = 'keep_services'
 +}
 +
- type AdvanceResourceKind = CollectionData | ProcessData | ProjectData | RepositoryData | SshKeyData | VirtualMachineData;
+ enum KeepServiceData {
+     KEEP_SERVICE = 'keep_services',
+     CREATED_AT = 'created_at'
+ }
+ 
 -type AdvanceResourceKind = CollectionData | ProcessData | ProjectData | RepositoryData | SshKeyData | KeepServiceData;
 -type AdvanceResourcePrefix = GroupContentsResourcePrefix | 'repositories' | 'authorized_keys' | 'keep_services';
++type AdvanceResourceKind = CollectionData | ProcessData | ProjectData | RepositoryData | SshKeyData | VirtualMachineData | KeepServiceData;
 +type AdvanceResourcePrefix = GroupContentsResourcePrefix | ResourcePrefix;
  
 -export const openAdvancedTabDialog = (uuid: string, index?: number) =>
 +export const openAdvancedTabDialog = (uuid: string) =>
      async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
          const kind = extractUuidKind(uuid);
          switch (kind) {
@@@ -141,35 -92,15 +148,50 @@@
                  dispatch<any>(initAdvancedTabDialog(advanceDataRepository));
                  break;
              case ResourceKind.SSH_KEY:
 -                const dataSshKey = getState().auth.sshKeys[index!];
 -                const advanceDataSshKey: AdvancedTabDialogData = advancedTabData(uuid, '', '', sshKeyApiResponse, dataSshKey, SshKeyData.SSH_KEY, 'authorized_keys', SshKeyData.CREATED_AT, dataSshKey.createdAt);
 +                const dataSshKey = getState().auth.sshKeys.find(it => it.uuid === uuid);
 +                const advanceDataSshKey: AdvancedTabDialogData = advancedTabData({
 +                    uuid,
 +                    metadata: '',
 +                    user: '',
 +                    apiResponseKind: sshKeyApiResponse,
 +                    data: dataSshKey,
 +                    resourceKind: SshKeyData.SSH_KEY,
 +                    resourcePrefix: ResourcePrefix.AUTORIZED_KEYS,
 +                    resourceKindProperty: SshKeyData.CREATED_AT,
 +                    property: dataSshKey!.createdAt
 +                });
                  dispatch<any>(initAdvancedTabDialog(advanceDataSshKey));
                  break;
 +            case ResourceKind.VIRTUAL_MACHINE:
 +                const dataVirtualMachine = getState().virtualMachines.virtualMachines.items.find(it => it.uuid === uuid);
 +                const advanceDataVirtualMachine: AdvancedTabDialogData = advancedTabData({
 +                    uuid,
 +                    metadata: '',
 +                    user: '',
 +                    apiResponseKind: virtualMachineApiResponse,
 +                    data: dataVirtualMachine,
 +                    resourceKind: VirtualMachineData.VIRTUAL_MACHINE,
 +                    resourcePrefix: ResourcePrefix.VIRTUAL_MACHINES,
 +                    resourceKindProperty: VirtualMachineData.CREATED_AT,
 +                    property: dataVirtualMachine.createdAt
 +                });
 +                dispatch<any>(initAdvancedTabDialog(advanceDataVirtualMachine));
 +                break;
+             case ResourceKind.KEEP_SERVICE:
 -                const dataKeepService = getState().keepServices[index!];
 -                const advanceDataKeepService: AdvancedTabDialogData = advancedTabData(uuid, '', '', keepServiceApiResponse, dataKeepService, KeepServiceData.KEEP_SERVICE, 'keep_services', KeepServiceData.CREATED_AT, dataKeepService.createdAt);
++                const dataKeepService = getState().keepServices.find(it => it.uuid === uuid);
++                const advanceDataKeepService: AdvancedTabDialogData = advancedTabData({
++                    uuid,
++                    metadata: '',
++                    user: '',
++                    apiResponseKind: keepServiceApiResponse,
++                    data: dataKeepService,
++                    resourceKind: KeepServiceData.KEEP_SERVICE,
++                    resourcePrefix: ResourcePrefix.KEEP_SERVICES,
++                    resourceKindProperty: KeepServiceData.CREATED_AT,
++                    property: dataKeepService!.createdAt
++                });
+                 dispatch<any>(initAdvancedTabDialog(advanceDataKeepService));
+                 break;
              default:
                  dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Could not open advanced tab for this resource.", hideDuration: 2000, kind: SnackbarKind.ERROR }));
          }
@@@ -377,14 -306,22 +399,36 @@@ const sshKeyApiResponse = (apiResponse
      return response;
  };
  
 +const virtualMachineApiResponse = (apiResponse: VirtualMachinesResource) => {
 +    const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, hostname } = apiResponse;
-     const response = `"uuid": "${uuid}",
++    const response = `"hostname": ${stringify(hostname)},
++"uuid": "${uuid}",
 +"owner_uuid": "${ownerUuid}",
 +"modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
 +"modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
 +"modified_at": ${stringify(modifiedAt)},
- "hostname": ${stringify(hostname)},
++"modified_at": ${stringify(modifiedAt)},
 +"created_at": "${createdAt}"`;
++
++    return response;
++};
++
+ const keepServiceApiResponse = (apiResponse: KeepServiceResource) => {
+     const {
+         uuid, readOnly, serviceHost, servicePort, serviceSslFlag, serviceType,
+         ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid
+     } = apiResponse;
+     const response = `"uuid": "${uuid}",
+ "owner_uuid": "${ownerUuid}",
+ "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
+ "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
+ "modified_at": ${stringify(modifiedAt)},
+ "service_host": "${serviceHost}",
+ "service_port": "${servicePort}",
+ "service_ssl_flag": "${stringify(serviceSslFlag)}",
+ "service_type": "${serviceType}",
+ "created_at": "${createdAt}",
+ "read_only": "${stringify(readOnly)}"`;
+ 
      return response;
  };
diff --cc src/store/context-menu/context-menu-actions.ts
index 1412d95,2c533d6..d56a3fb
--- a/src/store/context-menu/context-menu-actions.ts
+++ b/src/store/context-menu/context-menu-actions.ts
@@@ -15,7 -15,7 +15,8 @@@ import { extractUuidKind, ResourceKind 
  import { Process } from '~/store/processes/process';
  import { RepositoryResource } from '~/models/repositories';
  import { SshKeyResource } from '~/models/ssh-key';
 +import { VirtualMachinesResource } from '~/models/virtual-machines';
+ import { KeepServiceResource } from '~/models/keep-services';
  
  export const contextMenuActions = unionize({
      OPEN_CONTEXT_MENU: ofType<{ position: ContextMenuPosition, resource: ContextMenuResource }>(),
@@@ -96,6 -88,18 +98,17 @@@ export const openSshKeyContextMenu = (e
          }));
      };
  
 -export const openKeepServiceContextMenu = (event: React.MouseEvent<HTMLElement>, index: number, keepService: KeepServiceResource) =>
++export const openKeepServiceContextMenu = (event: React.MouseEvent<HTMLElement>, keepService: KeepServiceResource) =>
+     (dispatch: Dispatch) => {
+         dispatch<any>(openContextMenu(event, {
+             name: '',
+             uuid: keepService.uuid,
+             ownerUuid: keepService.ownerUuid,
+             kind: ResourceKind.KEEP_SERVICE,
 -            menuKind: ContextMenuKind.KEEP_SERVICE,
 -            index
++            menuKind: ContextMenuKind.KEEP_SERVICE
+         }));
+     };
+ 
  export const openRootProjectContextMenu = (event: React.MouseEvent<HTMLElement>, projectUuid: string) =>
      (dispatch: Dispatch, getState: () => RootState) => {
          const res = getResource<UserResource>(projectUuid)(getState().resources);
diff --cc src/store/keep-services/keep-services-actions.ts
index 0000000,1de6802..54a7c3f
mode 000000,100644..100644
--- a/src/store/keep-services/keep-services-actions.ts
+++ b/src/store/keep-services/keep-services-actions.ts
@@@ -1,0 -1,71 +1,71 @@@
+ // Copyright (C) The Arvados Authors. All rights reserved.
+ //
+ // SPDX-License-Identifier: AGPL-3.0
+ 
+ import { Dispatch } from "redux";
+ import { unionize, ofType, UnionOf } from "~/common/unionize";
+ import { RootState } from '~/store/store';
+ import { setBreadcrumbs } from '~/store/breadcrumbs/breadcrumbs-actions';
+ import { ServiceRepository } from "~/services/services";
+ import { KeepServiceResource } from '~/models/keep-services';
+ import { dialogActions } from '~/store/dialog/dialog-actions';
+ import { snackbarActions } from '~/store/snackbar/snackbar-actions';
+ import { navigateToRootProject } from '~/store/navigation/navigation-action';
+ 
+ export const keepServicesActions = unionize({
+     SET_KEEP_SERVICES: ofType<KeepServiceResource[]>(),
+     REMOVE_KEEP_SERVICE: ofType<string>()
+ });
+ 
+ export type KeepServicesActions = UnionOf<typeof keepServicesActions>;
+ 
+ export const KEEP_SERVICE_REMOVE_DIALOG = 'keepServiceRemoveDialog';
+ export const KEEP_SERVICE_ATTRIBUTES_DIALOG = 'keepServiceAttributesDialog';
+ 
+ export const loadKeepServicesPanel = () =>
+     async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+         const user = getState().auth.user;
+         if(user && user.isAdmin) {
+             try {
+                 dispatch(setBreadcrumbs([{ label: 'Keep Services' }]));
+                 const response = await services.keepService.list();
+                 dispatch(keepServicesActions.SET_KEEP_SERVICES(response.items));
+             } catch (e) {
+                 return;
+             }
+         } else {
+             dispatch(navigateToRootProject);
+             dispatch(snackbarActions.OPEN_SNACKBAR({ message: "You don't have permissions to view this page", hideDuration: 2000 }));
+         }
+     };
+ 
 -export const openKeepServiceAttributesDialog = (index: number) =>
++export const openKeepServiceAttributesDialog = (uuid: string) =>
+     (dispatch: Dispatch, getState: () => RootState) => {
 -        const keepService = getState().keepServices[index];
++        const keepService = getState().keepServices.find(it => it.uuid === uuid);
+         dispatch(dialogActions.OPEN_DIALOG({ id: KEEP_SERVICE_ATTRIBUTES_DIALOG, data: { keepService } }));
+     };
+ 
+ export const openKeepServiceRemoveDialog = (uuid: string) =>
+     (dispatch: Dispatch, getState: () => RootState) => {
+         dispatch(dialogActions.OPEN_DIALOG({
+             id: KEEP_SERVICE_REMOVE_DIALOG,
+             data: {
+                 title: 'Remove keep service',
+                 text: 'Are you sure you want to remove this keep service?',
+                 confirmButtonLabel: 'Remove',
+                 uuid
+             }
+         }));
+     };
+ 
+ export const removeKeepService = (uuid: string) =>
+     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+         dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...' }));
+         try {
+             await services.keepService.delete(uuid);
+             dispatch(keepServicesActions.REMOVE_KEEP_SERVICE(uuid));
+             dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Keep service has been successfully removed.', hideDuration: 2000 }));
+         } catch (e) {
+             return;
+         }
+     };
diff --cc src/views-components/context-menu/action-sets/keep-service-action-set.ts
index 0000000,5d27e4e..807a3ab
mode 000000,100644..100644
--- a/src/views-components/context-menu/action-sets/keep-service-action-set.ts
+++ b/src/views-components/context-menu/action-sets/keep-service-action-set.ts
@@@ -1,0 -1,28 +1,28 @@@
+ // Copyright (C) The Arvados Authors. All rights reserved.
+ //
+ // SPDX-License-Identifier: AGPL-3.0
+ 
+ import { openKeepServiceAttributesDialog, openKeepServiceRemoveDialog } from '~/store/keep-services/keep-services-actions';
+ import { openAdvancedTabDialog } from '~/store/advanced-tab/advanced-tab';
+ import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
+ import { AdvancedIcon, RemoveIcon, AttributesIcon } from "~/components/icon/icon";
+ 
+ export const keepServiceActionSet: ContextMenuActionSet = [[{
+     name: "Attributes",
+     icon: AttributesIcon,
 -    execute: (dispatch, { index }) => {
 -        dispatch<any>(openKeepServiceAttributesDialog(index!));
++    execute: (dispatch, { uuid }) => {
++        dispatch<any>(openKeepServiceAttributesDialog(uuid));
+     }
+ }, {
+     name: "Advanced",
+     icon: AdvancedIcon,
 -    execute: (dispatch, { uuid, index }) => {
 -        dispatch<any>(openAdvancedTabDialog(uuid, index));
++    execute: (dispatch, { uuid }) => {
++        dispatch<any>(openAdvancedTabDialog(uuid));
+     }
+ }, {
+     name: "Remove",
+     icon: RemoveIcon,
+     execute: (dispatch, { uuid }) => {
+         dispatch<any>(openKeepServiceRemoveDialog(uuid));
+     }
+ }]];
diff --cc src/views-components/context-menu/context-menu.tsx
index d08798f,211881c..5f321bf
--- a/src/views-components/context-menu/context-menu.tsx
+++ b/src/views-components/context-menu/context-menu.tsx
@@@ -71,5 -71,5 +71,6 @@@ export enum ContextMenuKind 
      PROCESS_LOGS = "ProcessLogs",
      REPOSITORY = "Repository",
      SSH_KEY = "SshKey",
-     VIRTUAL_MACHINE = "VirtualMachine"
++    VIRTUAL_MACHINE = "VirtualMachine",
+     KEEP_SERVICE = "KeepService"
  }
diff --cc src/views/keep-service-panel/keep-service-panel-root.tsx
index 0000000,57193d3..8c266b6
mode 000000,100644..100644
--- a/src/views/keep-service-panel/keep-service-panel-root.tsx
+++ b/src/views/keep-service-panel/keep-service-panel-root.tsx
@@@ -1,0 -1,87 +1,87 @@@
+ // Copyright (C) The Arvados Authors. All rights reserved.
+ //
+ // SPDX-License-Identifier: AGPL-3.0
+ 
+ import * as React from 'react';
+ import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Button, Typography, Grid, Table, TableHead, TableRow, TableCell, TableBody, Tooltip, IconButton, Checkbox } from '@material-ui/core';
+ import { ArvadosTheme } from '~/common/custom-theme';
+ import { MoreOptionsIcon } from '~/components/icon/icon';
+ import { KeepServiceResource } from '~/models/keep-services';
+ 
+ type CssRules = 'root' | 'tableRow';
+ 
+ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+     root: {
+         width: '100%',
+         overflow: 'auto'
+     },
+     tableRow: {
+         '& td, th': {
+             whiteSpace: 'nowrap'
+         }
+     }
+ });
+ 
+ export interface KeepServicePanelRootActionProps {
 -    openRowOptions: (event: React.MouseEvent<HTMLElement>, index: number, keepService: KeepServiceResource) => void;
++    openRowOptions: (event: React.MouseEvent<HTMLElement>, keepService: KeepServiceResource) => void;
+ }
+ 
+ export interface KeepServicePanelRootDataProps {
+     keepServices: KeepServiceResource[];
+     hasKeepSerices: boolean;
+ }
+ 
+ type KeepServicePanelRootProps = KeepServicePanelRootActionProps & KeepServicePanelRootDataProps & WithStyles<CssRules>;
+ 
+ export const KeepServicePanelRoot = withStyles(styles)(
+     ({ classes, hasKeepSerices, keepServices, openRowOptions }: KeepServicePanelRootProps) => 
+         <Card className={classes.root}>
+             <CardContent>
+                 {hasKeepSerices && <Grid container direction="row">
+                     <Grid item xs={12}>
+                         <Table>
+                             <TableHead>
+                                 <TableRow className={classes.tableRow}>
+                                     <TableCell>UUID</TableCell>
+                                     <TableCell>Read only</TableCell>
+                                     <TableCell>Service host</TableCell>
+                                     <TableCell>Service port</TableCell>
+                                     <TableCell>Service SSL flag</TableCell>
+                                     <TableCell>Service type</TableCell>
+                                     <TableCell />
+                                 </TableRow>
+                             </TableHead>
+                             <TableBody>
+                                 {keepServices.map((keepService, index) =>
+                                     <TableRow key={index} className={classes.tableRow}>
+                                         <TableCell>{keepService.uuid}</TableCell>
+                                         <TableCell>
+                                             <Checkbox
+                                                 disableRipple
+                                                 color="primary"
+                                                 checked={keepService.readOnly} />
+                                         </TableCell>
+                                         <TableCell>{keepService.serviceHost}</TableCell>
+                                         <TableCell>{keepService.servicePort}</TableCell>
+                                         <TableCell>
+                                             <Checkbox
+                                                 disableRipple
+                                                 color="primary"
+                                                 checked={keepService.serviceSslFlag} />
+                                         </TableCell>
+                                         <TableCell>{keepService.serviceType}</TableCell>
+                                         <TableCell>
+                                             <Tooltip title="More options" disableFocusListener>
 -                                                <IconButton onClick={event => openRowOptions(event, index, keepService)}>
++                                                <IconButton onClick={event => openRowOptions(event, keepService)}>
+                                                     <MoreOptionsIcon />
+                                                 </IconButton>
+                                             </Tooltip>
+                                         </TableCell>
+                                     </TableRow>)}
+                             </TableBody>
+                         </Table>
+                     </Grid>
+                 </Grid>}
+             </CardContent>
+         </Card>
+ );
diff --cc src/views/keep-service-panel/keep-service-panel.tsx
index 0000000,2c6323b..a11cee0
mode 000000,100644..100644
--- a/src/views/keep-service-panel/keep-service-panel.tsx
+++ b/src/views/keep-service-panel/keep-service-panel.tsx
@@@ -1,0 -1,29 +1,29 @@@
+ // Copyright (C) The Arvados Authors. All rights reserved.
+ //
+ // SPDX-License-Identifier: AGPL-3.0
+ 
+ import { RootState } from '~/store/store';
+ import { Dispatch } from 'redux';
+ import { connect } from 'react-redux';
+ import { } from '~/store/keep-services/keep-services-actions';
+ import { 
+     KeepServicePanelRoot, 
+     KeepServicePanelRootDataProps, 
+     KeepServicePanelRootActionProps 
+ } from '~/views/keep-service-panel/keep-service-panel-root';
+ import { openKeepServiceContextMenu } from '~/store/context-menu/context-menu-actions';
+ 
+ const mapStateToProps = (state: RootState): KeepServicePanelRootDataProps => {
+     return {
+         keepServices: state.keepServices,
+         hasKeepSerices: state.keepServices.length > 0
+     };
+ };
+ 
+ const mapDispatchToProps = (dispatch: Dispatch): KeepServicePanelRootActionProps => ({
 -    openRowOptions: (event, index, keepService) => {
 -        dispatch<any>(openKeepServiceContextMenu(event, index, keepService));
++    openRowOptions: (event, keepService) => {
++        dispatch<any>(openKeepServiceContextMenu(event, keepService));
+     }
+ });
+ 
+ export const KeepServicePanel = connect(mapStateToProps, mapDispatchToProps)(KeepServicePanelRoot);
diff --cc src/views/workbench/workbench.tsx
index 3fc514a,dd4f802..2d17fad
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@@ -57,10 -58,10 +58,12 @@@ import { CreateRepositoryDialog } from 
  import { RemoveRepositoryDialog } from '~/views-components/repository-remove-dialog/repository-remove-dialog';
  import { CreateSshKeyDialog } from '~/views-components/dialog-forms/create-ssh-key-dialog';
  import { PublicKeyDialog } from '~/views-components/ssh-keys-dialog/public-key-dialog';
+ import { RemoveKeepServiceDialog } from '~/views-components/keep-services-dialog/remove-dialog';
  import { RemoveSshKeyDialog } from '~/views-components/ssh-keys-dialog/remove-dialog';
+ import { AttributesKeepServiceDialog } from '~/views-components/keep-services-dialog/attributes-dialog';
  import { AttributesSshKeyDialog } from '~/views-components/ssh-keys-dialog/attributes-dialog';
 +import { VirtualMachineAttributesDialog } from '~/views-components/virtual-machines-dialog/attributes-dialog';
 +import { RemoveVirtualMachineDialog } from '~/views-components/virtual-machines-dialog/remove-dialog';
  
  type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
  

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list