merge master 14494-add-option-to-run-a-process-from-workflow-view
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Tue, 27 Nov 2018 13:12:40 +0000 (14:12 +0100)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Tue, 27 Nov 2018 13:12:40 +0000 (14:12 +0100)
Feature #14494

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

1  2 
src/views-components/data-explorer/renderers.tsx

index ca79bba46e638f773c1e462727a92dc9bd198bf6,d0266adc539358bf0aeb48ec135dbb37fe4c5b06..a032b3ed5a22945e952d20767afd924fb931d4bd
@@@ -18,7 -18,8 +18,7 @@@ import { ArvadosTheme } from '~/common/
  import { compose, Dispatch } from 'redux';
  import { WorkflowResource } from '~/models/workflow';
  import { ResourceStatus } from '~/views/workflow-panel/workflow-panel-view';
 -import { getUuidPrefix } from '~/store/workflow-panel/workflow-panel-actions';
 -import { CollectionResource } from "~/models/collection";
 +import { getUuidPrefix, openRunProcess } from '~/store/workflow-panel/workflow-panel-actions';
  import { getResourceData } from "~/store/resources-data/resources-data";
  import { openSharingDialog } from '~/store/sharing-dialog/sharing-dialog-actions';
  
@@@ -86,11 -87,12 +86,11 @@@ const getPublicUuid = (uuidPrefix: stri
      return `${uuidPrefix}-tpzed-anonymouspublic`;
  };
  
 -// ToDo: share onClick
  export const resourceShare = (dispatch: Dispatch, uuidPrefix: string, ownerUuid?: string, uuid?: string) => {
      const isPublic = ownerUuid === getPublicUuid(uuidPrefix);
      return (
          <div>
-             {isPublic && uuid &&
 -            { !isPublic && uuid &&
++            {!isPublic && uuid &&
                  <Tooltip title="Share">
                      <IconButton onClick={() => dispatch<any>(openSharingDialog(uuid))}>
                          <ShareIcon />
@@@ -113,28 -115,6 +113,28 @@@ export const ResourceShare = connect
      })((props: { ownerUuid?: string, uuidPrefix: string, uuid?: string } & DispatchProp<any>) =>
          resourceShare(props.dispatch, props.uuidPrefix, props.ownerUuid, props.uuid));
  
 +export const resourceRunProcess = (dispatch: Dispatch, uuid: string) => {
 +    return (
 +        <div>
 +            {uuid &&
 +                <Tooltip title="Run process">
 +                    <IconButton onClick={() => dispatch<any>(openRunProcess(uuid))}>
 +                        <ProcessIcon />
 +                    </IconButton>
 +                </Tooltip>}
 +        </div>
 +    );
 +};
 +
 +export const ResourceRunProcess = connect(
 +    (state: RootState, props: { uuid: string }) => {
 +        const resource = getResource<WorkflowResource>(props.uuid)(state.resources);
 +        return {
 +            uuid: resource ? resource.uuid : ''
 +        };
 +    })((props: { uuid: string } & DispatchProp<any>) =>
 +        resourceRunProcess(props.dispatch, props.uuid));
 +
  export const renderWorkflowStatus = (uuidPrefix: string, ownerUuid?: string) => {
      if (ownerUuid === getPublicUuid(uuidPrefix)) {
          return renderStatus(ResourceStatus.PUBLIC);