Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Add and improve some helper text; fix minor spacing #334

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading