Skip to content

Commit

Permalink
fix some spacing; add helper text in export (#332) (#334)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit 29eb275)

Co-authored-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and ohltyler authored Aug 30, 2024
1 parent c5142fe commit 469d235
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
2 changes: 2 additions & 0 deletions common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/';

Expand Down
13 changes: 9 additions & 4 deletions public/pages/workflow_detail/components/export_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,16 @@ export function ExportModal(props: ExportModalProps) {
<EuiFlexGroup direction="column">
<EuiFlexItem grow={false}>
<EuiText>
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.`}{' '}
<EuiLink href={CREATE_WORKFLOW_LINK} target="_blank">
Learn more
</EuiLink>
</EuiText>
<EuiLink href={CREATE_WORKFLOW_LINK} target="_blank">
Learn more
</EuiLink>
<EuiText
size="s"
color="subdued"
>{`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.`}</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiCompressedRadioGroup
Expand Down
2 changes: 1 addition & 1 deletion public/pages/workflow_detail/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export function WorkflowDetailHeader(props: WorkflowDetailHeaderProps) {
>
Close
</EuiSmallButtonEmpty>,
<EuiText style={{ marginTop: '16px' }} color="subdued" size="s">
<EuiText style={{ marginTop: '14px' }} color="subdued" size="s">
{`Last updated: ${workflowLastUpdated}`}
</EuiText>,
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export function MLProcessorInputs(props: MLProcessorInputsProps) {
>
<EuiButtonEmpty
disabled={!isInputPreviewAvailable}
style={{ width: '100px' }}
style={{ width: '100px', paddingTop: '8px' }}
size="s"
onClick={() => {
setIsInputTransformModalOpen(true);
Expand Down Expand Up @@ -251,7 +251,7 @@ export function MLProcessorInputs(props: MLProcessorInputsProps) {
>
<EuiButtonEmpty
disabled={!isOutputPreviewAvailable}
style={{ width: '100px' }}
style={{ width: '100px', paddingTop: '8px' }}
size="s"
onClick={() => {
setIsOutputTransformModalOpen(true);
Expand Down
28 changes: 25 additions & 3 deletions public/pages/workflow_detail/workspace/workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -58,9 +66,9 @@ export function Workspace(props: WorkspaceProps) {
// JSON state
const [provisionTemplate, setProvisionTemplate] = useState<string>('');
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]);
Expand Down Expand Up @@ -141,6 +149,20 @@ export function Workspace(props: WorkspaceProps) {
</EuiFilterButton>
</EuiFilterGroup>
</EuiFlexItem>
<EuiFlexItem grow={false} style={{ paddingTop: '8px' }}>
{visualSelected ? (
<EuiText>
{`A basic visual view representing the configured ingest & search flows.`}
</EuiText>
) : (
<EuiText>
{`The Flow Framework provisioning template describing how to build out the configured resources. `}
<EuiLink href={WORKFLOW_TUTORIAL_LINK} target="_blank">
Learn more
</EuiLink>
</EuiText>
)}
</EuiFlexItem>
</EuiFlexGroup>
</div>
<div className="reactflow-parent-wrapper">
Expand Down

0 comments on commit 469d235

Please sign in to comment.