From 3c3d3d40033879249cd8e8f483f30cfa565d31bd Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Fri, 20 May 2022 18:30:23 -0400 Subject: [PATCH] 19143: Add missing files Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- .../action-sets/workflow-action-set.ts | 15 ++++ .../details-panel/workflow-details.tsx | 88 +++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 src/views-components/context-menu/action-sets/workflow-action-set.ts create mode 100644 src/views-components/details-panel/workflow-details.tsx diff --git a/src/views-components/context-menu/action-sets/workflow-action-set.ts b/src/views-components/context-menu/action-sets/workflow-action-set.ts new file mode 100644 index 00000000..2aa78904 --- /dev/null +++ b/src/views-components/context-menu/action-sets/workflow-action-set.ts @@ -0,0 +1,15 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set"; +import { openRunProcess } from "store/workflow-panel/workflow-panel-actions"; + +export const workflowActionSet: ContextMenuActionSet = [[ + { + name: "Run", + execute: (dispatch, resource) => { + dispatch(openRunProcess(resource.uuid, resource.ownerUuid, resource.name)); + } + }, +]]; diff --git a/src/views-components/details-panel/workflow-details.tsx b/src/views-components/details-panel/workflow-details.tsx new file mode 100644 index 00000000..7076823c --- /dev/null +++ b/src/views-components/details-panel/workflow-details.tsx @@ -0,0 +1,88 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +import React from 'react'; +import { DefaultIcon, WorkflowIcon } from 'components/icon/icon'; +import { WorkflowResource } from 'models/workflow'; +import { DetailsData } from "./details-data"; +import { DefaultView } from 'components/default-view/default-view'; +import { DetailsAttribute } from 'components/details-attribute/details-attribute'; +import { ResourceOwnerWithName } from 'views-components/data-explorer/renderers'; +import { formatDate } from "common/formatters"; +import { Grid } from '@material-ui/core'; +import { withStyles, StyleRulesCallback, WithStyles, Button } from '@material-ui/core'; +import { openRunProcess } from "store/workflow-panel/workflow-panel-actions"; +import { Dispatch } from 'redux'; +import { connect } from 'react-redux'; +import { ArvadosTheme } from 'common/custom-theme'; + +export interface WorkflowDetailsCardDataProps { + workflow?: WorkflowResource; +} + +export interface WorkflowDetailsCardActionProps { + onClick: (wf: WorkflowResource) => () => void; +} + +const mapDispatchToProps = (dispatch: Dispatch) => ({ + onClick: (wf: WorkflowResource) => + () => wf && dispatch(openRunProcess(wf.uuid, wf.ownerUuid, wf.name)), +}); + +type CssRules = 'runButton'; + +const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ + runButton: { + boxShadow: 'none', + padding: '2px 10px 2px 5px', + fontSize: '0.75rem' + }, +}); + +export const WorkflowDetailsAttributes = connect(null, mapDispatchToProps)( + withStyles(styles)( + ({ workflow, onClick, classes }: WorkflowDetailsCardDataProps & WorkflowDetailsCardActionProps & WithStyles) => { + return + + {workflow && workflow.description !== "" && + + } + + + + + } /> + + + + + + + + + } /> + + ; + })); + +export class WorkflowDetails extends DetailsData { + getIcon(className?: string) { + return ; + } + + getDetails() { + return ; + } +} -- 2.30.2