diff --git a/ui/src/app/workflows/components/submit-workflow-panel.tsx b/ui/src/app/workflows/components/submit-workflow-panel.tsx index 87ad365f99d5..490470f3b926 100644 --- a/ui/src/app/workflows/components/submit-workflow-panel.tsx +++ b/ui/src/app/workflows/components/submit-workflow-panel.tsx @@ -1,4 +1,5 @@ import {Select} from 'argo-ui/src/components/select/select'; +import {TextInput} from '../../shared/components/text-input'; import React, {useContext, useMemo, useState} from 'react'; import {Parameter, Template} from '../../../models'; @@ -10,8 +11,10 @@ import {TagsInput} from '../../shared/components/tags-input/tags-input'; import {services} from '../../shared/services'; import {Utils} from '../../shared/utils'; +type WorkflowTemplateType = 'ClusterWorkflowTemplate' | 'WorkflowTemplate'; + interface Props { - kind: string; + kind: WorkflowTemplateType; namespace: string; name: string; entrypoint: string; @@ -31,6 +34,7 @@ export function SubmitWorkflowPanel(props: Props) { const {navigation} = useContext(Context); const [entrypoint, setEntrypoint] = useState(workflowEntrypoint); const [parameters, setParameters] = useState([]); + const [namespace, setNamespace] = useState(props.namespace); const [workflowParameters, setWorkflowParameters] = useState(JSON.parse(JSON.stringify(props.workflowParameters))); const [labels, setLabels] = useState(['submit-from-ui=true']); const [error, setError] = useState(); @@ -50,7 +54,7 @@ export function SubmitWorkflowPanel(props: Props) { async function submit() { setIsSubmitting(true); try { - const submitted = await services.workflows.submit(props.kind, props.name, props.namespace, { + const submitted = await services.workflows.submit(props.kind, props.name, namespace, { entryPoint: entrypoint === workflowEntrypoint ? null : entrypoint, parameters: [ ...workflowParameters.filter(p => Utils.getValueFromParameter(p) !== undefined).map(p => p.name + '=' + Utils.getValueFromParameter(p)), @@ -69,7 +73,7 @@ export function SubmitWorkflowPanel(props: Props) { <>

Submit Workflow

- {props.namespace}/{props.name} + {namespace}/{props.name}
{error && }
@@ -85,6 +89,12 @@ export function SubmitWorkflowPanel(props: Props) { }} />
+ {props.kind === 'ClusterWorkflowTemplate' && ( +
+ + +
+ )}
{workflowParameters.length > 0 && }