Skip to content

Commit 4362a1a

Browse files
UX fit-n-finish updates X (#586) (#588)
(cherry picked from commit fb7b64d) Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 345ad8b commit 4362a1a

13 files changed

+150
-25
lines changed

common/constants.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -590,14 +590,14 @@ export const INPUT_TRANSFORM_OPTIONS = [
590590
id: TRANSFORM_TYPE.FIELD,
591591
description: 'Map an existing field from your data.',
592592
},
593-
{
594-
id: TRANSFORM_TYPE.TEMPLATE,
595-
description: 'Configure a prompt and map to the input field.',
596-
},
597593
{
598594
id: TRANSFORM_TYPE.EXPRESSION,
599595
description: 'Extract data before mapping to the input field.',
600596
},
597+
{
598+
id: TRANSFORM_TYPE.TEMPLATE,
599+
description: 'Configure a prompt and map to the input field.',
600+
},
601601
{
602602
id: TRANSFORM_TYPE.STRING,
603603
description: 'Declare a string to the input field.',
@@ -679,21 +679,21 @@ export enum SOURCE_OPTIONS {
679679
EXISTING_INDEX = 'existing_index',
680680
}
681681
export enum INSPECTOR_TAB_ID {
682+
TEST = 'test',
682683
INGEST = 'ingest',
683-
QUERY = 'query',
684684
ERRORS = 'errors',
685685
RESOURCES = 'resources',
686686
}
687687

688688
export const INSPECTOR_TABS = [
689689
{
690-
id: INSPECTOR_TAB_ID.INGEST,
691-
name: 'Ingest response',
690+
id: INSPECTOR_TAB_ID.TEST,
691+
name: 'Test flow',
692692
disabled: false,
693693
},
694694
{
695-
id: INSPECTOR_TAB_ID.QUERY,
696-
name: 'Search tool',
695+
id: INSPECTOR_TAB_ID.INGEST,
696+
name: 'Ingest response',
697697
disabled: false,
698698
},
699699
{

public/pages/workflow_detail/components/edit_workflow_metadata_modal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,15 @@ export function EditWorkflowMetadataModal(
205205
<EuiFlexItem>
206206
<TextField
207207
label="Name"
208-
fullWidth={false}
208+
fullWidth={true}
209209
fieldPath={`name`}
210210
showError={true}
211211
/>
212212
</EuiFlexItem>
213213
<EuiFlexItem>
214214
<TextField
215215
label="Description - optional"
216-
fullWidth={false}
216+
fullWidth={true}
217217
fieldPath={`description`}
218218
showError={true}
219219
placeholder="Provide a description for identifying this workflow."

public/pages/workflow_detail/resizable_workspace.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
8686
const [ingestResponse, setIngestResponse] = useState<string>('');
8787
const [selectedInspectorTabId, setSelectedInspectorTabId] = useState<
8888
INSPECTOR_TAB_ID
89-
>(INSPECTOR_TAB_ID.INGEST);
89+
>(INSPECTOR_TAB_ID.TEST);
9090

9191
// is valid workflow state, + associated hook to set it as such
9292
const [isValidWorkflow, setIsValidWorkflow] = useState<boolean>(true);
@@ -141,7 +141,7 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
141141
if (!isToolsPanelOpen) {
142142
onToggleToolsChange();
143143
}
144-
setSelectedInspectorTabId(INSPECTOR_TAB_ID.QUERY);
144+
setSelectedInspectorTabId(INSPECTOR_TAB_ID.TEST);
145145
}}
146146
setCachedFormikState={props.setCachedFormikState}
147147
/>

public/pages/workflow_detail/tools/tools.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function Tools(props: ToolsProps) {
124124
{props.selectedTabId === INSPECTOR_TAB_ID.INGEST && (
125125
<Ingest ingestResponse={props.ingestResponse} />
126126
)}
127-
{props.selectedTabId === INSPECTOR_TAB_ID.QUERY && (
127+
{props.selectedTabId === INSPECTOR_TAB_ID.TEST && (
128128
<Query
129129
hasSearchPipeline={hasProvisionedSearchResources(
130130
props.workflow

public/pages/workflow_detail/workflow_detail.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ describe('WorkflowDetail Page with create ingestion option', () => {
9595
expect(getByText('Export')).toBeInTheDocument();
9696
expect(getByText('Visual')).toBeInTheDocument();
9797
expect(getByText('JSON')).toBeInTheDocument();
98+
expect(getByRole('tab', { name: 'Test flow' })).toBeInTheDocument();
9899
expect(getByRole('tab', { name: 'Ingest response' })).toBeInTheDocument();
99-
expect(getByRole('tab', { name: 'Search tool' })).toBeInTheDocument();
100100
expect(getByRole('tab', { name: 'Errors' })).toBeInTheDocument();
101101
expect(getByRole('tab', { name: 'Resources' })).toBeInTheDocument();
102102

public/pages/workflow_detail/workflow_inputs/ingest_inputs/source_data_modal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export function SourceDataModal(props: SourceDataProps) {
282282
<EuiText
283283
size="xs"
284284
color="subdued"
285-
>{`Only the top ${MAX_DOCS_TO_IMPORT} documents will be imported.`}</EuiText>
285+
>{`Only the first ${MAX_DOCS_TO_IMPORT} documents will be imported.`}</EuiText>
286286
<EuiSpacer size="xs" />
287287
</>
288288
)}

public/pages/workflow_detail/workflow_inputs/workflow_inputs.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,7 @@ export function WorkflowInputs(props: WorkflowInputsProps) {
550550
text: (
551551
<EuiFlexGroup direction="column">
552552
<EuiFlexItem grow={false}>
553-
<EuiText size="s">
554-
Validate your ingest flow with the search tool
555-
</EuiText>
553+
<EuiText size="s">Validate your ingest flow</EuiText>
556554
</EuiFlexItem>
557555
<EuiFlexItem>
558556
<EuiFlexGroup direction="row" justifyContent="flexEnd">
@@ -561,7 +559,7 @@ export function WorkflowInputs(props: WorkflowInputsProps) {
561559
fill={false}
562560
onClick={() => props.displaySearchPanel()}
563561
>
564-
Open Search tool
562+
Test flow
565563
</EuiSmallButton>
566564
</EuiFlexItem>
567565
</EuiFlexGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
import React from 'react';
7+
import {
8+
EuiFlexGroup,
9+
EuiFlexItem,
10+
EuiSpacer,
11+
EuiText,
12+
EuiCard,
13+
EuiLink,
14+
EuiTitle,
15+
EuiAccordion,
16+
} from '@elastic/eui';
17+
import { CREATE_WORKFLOW_LINK, ML_REMOTE_MODEL_LINK } from '../../../common';
18+
19+
interface GetStartedAccordionProps {}
20+
21+
export function GetStartedAccordion(props: GetStartedAccordionProps) {
22+
return (
23+
<EuiAccordion
24+
style={{ marginBottom: '-16px' }}
25+
initialIsOpen={false}
26+
id={`accordionGetStarted`}
27+
buttonContent={
28+
<EuiFlexGroup direction="row">
29+
<EuiFlexItem grow={false}>
30+
<EuiText>Get started</EuiText>
31+
</EuiFlexItem>
32+
</EuiFlexGroup>
33+
}
34+
>
35+
<EuiSpacer size="s" />
36+
<EuiFlexItem>
37+
<EuiFlexGroup direction="row">
38+
<EuiFlexItem>
39+
<EuiCard
40+
layout="horizontal"
41+
title={
42+
<EuiTitle size="s">
43+
<h3>1. Set up models</h3>
44+
</EuiTitle>
45+
}
46+
>
47+
<EuiText>
48+
Connect to an externally hosted model and make it available in
49+
your OpenSearch cluster.{' '}
50+
<EuiLink href={ML_REMOTE_MODEL_LINK} target="_blank">
51+
Learn more
52+
</EuiLink>
53+
</EuiText>
54+
</EuiCard>
55+
</EuiFlexItem>
56+
<EuiFlexItem>
57+
<EuiCard
58+
layout="horizontal"
59+
title={
60+
<EuiTitle size="s">
61+
<h3>2. Ingest data</h3>
62+
</EuiTitle>
63+
}
64+
>
65+
<EuiText>
66+
Import sample data to get started; add processors to customize
67+
your ingest pipeline.
68+
</EuiText>
69+
</EuiCard>
70+
</EuiFlexItem>
71+
<EuiFlexItem>
72+
<EuiCard
73+
layout="horizontal"
74+
title={
75+
<EuiTitle size="s">
76+
<h3>3. Build a search pipeline</h3>
77+
</EuiTitle>
78+
}
79+
>
80+
<EuiText>
81+
Set up a query and configure your search pipeline.
82+
</EuiText>
83+
</EuiCard>
84+
</EuiFlexItem>
85+
<EuiFlexItem>
86+
<EuiCard
87+
layout="horizontal"
88+
title={
89+
<EuiTitle size="s">
90+
<h3>4. Export the workflow</h3>
91+
</EuiTitle>
92+
}
93+
>
94+
<EuiText>
95+
Export your workflow template to create and deploy the workflow
96+
on other OpenSearch clusters.{' '}
97+
<EuiLink href={CREATE_WORKFLOW_LINK} target="_blank">
98+
Learn more
99+
</EuiLink>
100+
</EuiText>
101+
</EuiCard>
102+
</EuiFlexItem>
103+
</EuiFlexGroup>
104+
</EuiFlexItem>
105+
</EuiAccordion>
106+
);
107+
}

public/pages/workflows/new_workflow/quick_configure_inputs.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
DEFAULT_LLM_RESPONSE_FIELD,
2424
DEFAULT_TEXT_FIELD,
2525
DEFAULT_VECTOR_FIELD,
26+
ML_CHOOSE_MODEL_LINK,
2627
ML_REMOTE_MODEL_LINK,
2728
MODEL_STATE,
2829
Model,
@@ -194,6 +195,14 @@ export function QuickConfigureInputs(props: QuickConfigureInputsProps) {
194195
? 'Large language model'
195196
: 'Embedding model'
196197
}
198+
labelAppend={
199+
// TODO: update to be a popover with more content.
200+
<EuiText size="xs">
201+
<EuiLink href={ML_CHOOSE_MODEL_LINK} target="_blank">
202+
Learn more
203+
</EuiLink>
204+
</EuiText>
205+
}
197206
isInvalid={false}
198207
helpText={
199208
isEmpty(deployedModels)

public/pages/workflows/new_workflow/quick_configure_modal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export function QuickConfigureModal(props: QuickConfigureModalProps) {
164164
>
165165
<EuiCompressedTextArea
166166
fullWidth={true}
167-
placeholder="Enter a description for your workflow"
167+
placeholder="Enter a description for this workflow"
168168
value={workflowDescription}
169169
onChange={(e) => {
170170
setWorkflowDescription(e.target.value);

public/pages/workflows/workflow_list/columns.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const columns = (actions: any[]) => {
2424
{
2525
field: 'name',
2626
name: 'Name',
27-
width: '35%',
27+
width: '25%',
2828
sortable: true,
2929
render: (name: string, workflow: Workflow) => (
3030
<EuiLink
@@ -40,13 +40,19 @@ export const columns = (actions: any[]) => {
4040
{
4141
field: 'ui_metadata.type',
4242
name: 'Type',
43-
width: '20%',
43+
width: '25%',
4444
sortable: true,
4545
},
46+
{
47+
field: 'description',
48+
name: 'Description',
49+
width: '35%',
50+
sortable: false,
51+
},
4652
{
4753
field: 'lastUpdated',
4854
name: 'Last saved',
49-
width: '35%',
55+
width: '15%',
5056
sortable: true,
5157
render: (lastUpdated: number) =>
5258
lastUpdated !== undefined

public/pages/workflows/workflow_list/workflow_list.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
} from '@elastic/eui';
2323
import { AppState } from '../../../store';
2424
import {
25+
EMPTY_FIELD_STRING,
2526
MAX_WORKFLOW_NAME_TO_DISPLAY,
2627
UIState,
2728
WORKFLOW_TYPE,
@@ -222,10 +223,11 @@ function fetchFilteredWorkflows(
222223
const allWorkflowsExceptRegisterAgent = allWorkflows.filter(
223224
(workflow) => workflow.use_case !== 'REGISTER_AGENT'
224225
);
225-
// If missing/invalid ui metadata, add defaults
226+
// If missing/invalid fields for each workflow, add defaults
226227
const allWorkflowsWithDefaults = allWorkflowsExceptRegisterAgent.map(
227228
(workflow) => ({
228229
...workflow,
230+
description: workflow.description || EMPTY_FIELD_STRING,
229231
ui_metadata: {
230232
...workflow.ui_metadata,
231233
type: workflow.ui_metadata?.type || WORKFLOW_TYPE.UNKNOWN,

public/pages/workflows/workflows.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
} from '../../services';
4343
import { prettifyErrorMessage } from '../../../common/utils';
4444
import { DataSourceOption } from '../../../../../src/plugins/data_source_management/public/components/data_source_menu/types';
45+
import { GetStartedAccordion } from './get_started_accordion';
4546

4647
export interface WorkflowsRouterProps {}
4748

@@ -238,6 +239,8 @@ export function Workflows(props: WorkflowsProps) {
238239
</EuiFlexItem>
239240
</EuiFlexGroup>
240241
<EuiText color="subdued">{DESCRIPTION}</EuiText>
242+
<EuiSpacer size="l" />
243+
<GetStartedAccordion />
241244
</EuiFlexGroup>
242245
);
243246

0 commit comments

Comments
 (0)