From 469d23518107b27356eebd511b9854189d7e3369 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 09:46:02 -0700 Subject: [PATCH] fix some spacing; add helper text in export (#332) (#334) Signed-off-by: Tyler Ohlsen (cherry picked from commit 29eb275054ce0ae0d8ade8ac120165ebc1c46dc1) Co-authored-by: Tyler Ohlsen --- common/constants.ts | 2 ++ .../components/export_modal.tsx | 13 ++++++--- .../workflow_detail/components/header.tsx | 2 +- .../processor_inputs/ml_processor_inputs.tsx | 4 +-- .../workflow_detail/workspace/workspace.tsx | 28 +++++++++++++++++-- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/common/constants.ts b/common/constants.ts index 0e08055b..8167231f 100644 --- a/common/constants.ts +++ b/common/constants.ts @@ -130,6 +130,8 @@ export const TEXT_CHUNKING_PROCESSOR_LINK = 'https://opensearch.org/docs/latest/ingest-pipelines/processors/text-chunking/'; export const CREATE_WORKFLOW_LINK = 'https://opensearch.org/docs/latest/automating-configurations/api/create-workflow/'; +export const WORKFLOW_TUTORIAL_LINK = + 'https://opensearch.org/docs/latest/automating-configurations/workflow-tutorial/'; export const NORMALIZATION_PROCESSOR_LINK = 'https://opensearch.org/docs/latest/search-plugins/search-pipelines/normalization-processor/'; diff --git a/public/pages/workflow_detail/components/export_modal.tsx b/public/pages/workflow_detail/components/export_modal.tsx index 55d20a61..fd5bdba3 100644 --- a/public/pages/workflow_detail/components/export_modal.tsx +++ b/public/pages/workflow_detail/components/export_modal.tsx @@ -84,11 +84,16 @@ export function ExportModal(props: ExportModalProps) { - Copy the below workflow templates to use in other clusters. + {`To build out identical resources in other environments, create and provision a workflow using the below template.`}{' '} + + Learn more + - - Learn more - + {`Note: certain resource IDs in the template, such as model IDs, may be cluster-specific and not work out-of-the-box + in other environments. Ensure these values are updated before attempting to provision in other environments.`} Close , - + {`Last updated: ${workflowLastUpdated}`} , ]} diff --git a/public/pages/workflow_detail/workflow_inputs/processor_inputs/ml_processor_inputs.tsx b/public/pages/workflow_detail/workflow_inputs/processor_inputs/ml_processor_inputs.tsx index b1ed05a8..52ce7017 100644 --- a/public/pages/workflow_detail/workflow_inputs/processor_inputs/ml_processor_inputs.tsx +++ b/public/pages/workflow_detail/workflow_inputs/processor_inputs/ml_processor_inputs.tsx @@ -201,7 +201,7 @@ export function MLProcessorInputs(props: MLProcessorInputsProps) { > { setIsInputTransformModalOpen(true); @@ -251,7 +251,7 @@ export function MLProcessorInputs(props: MLProcessorInputsProps) { > { setIsOutputTransformModalOpen(true); diff --git a/public/pages/workflow_detail/workspace/workspace.tsx b/public/pages/workflow_detail/workspace/workspace.tsx index f72a282b..c9186b12 100644 --- a/public/pages/workflow_detail/workspace/workspace.tsx +++ b/public/pages/workflow_detail/workspace/workspace.tsx @@ -20,8 +20,16 @@ import { EuiFilterGroup, EuiFilterButton, EuiCodeEditor, + EuiText, + EuiLink, } from '@elastic/eui'; -import { IComponentData, Workflow, WorkflowConfig } from '../../../../common'; +import { + IComponentData, + WORKFLOW_TUTORIAL_LINK, + Workflow, + WorkflowConfig, + customStringify, +} from '../../../../common'; import { IngestGroupComponent, SearchGroupComponent, @@ -58,9 +66,9 @@ export function Workspace(props: WorkspaceProps) { // JSON state const [provisionTemplate, setProvisionTemplate] = useState(''); useEffect(() => { - if (props.workflow?.workflows.provision) { + if (props.workflow?.workflows?.provision) { const templateAsObj = props.workflow?.workflows.provision as {}; - const templateAsStr = JSON.stringify(templateAsObj, undefined, 2); + const templateAsStr = customStringify(templateAsObj); setProvisionTemplate(templateAsStr); } }, [props.workflow]); @@ -141,6 +149,20 @@ export function Workspace(props: WorkspaceProps) { + + {visualSelected ? ( + + {`A basic visual view representing the configured ingest & search flows.`} + + ) : ( + + {`The Flow Framework provisioning template describing how to build out the configured resources. `} + + Learn more + + + )} +