Skip to content

Commit 77eca2a

Browse files
authored
Update copy around adding a new stage/defining a new pipeline to a project without one (#4225)
1 parent 16eaf1a commit 77eca2a

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

webview/src/experiments/components/AddStage.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,30 @@ interface AddStageProps {
1010

1111
export const AddStage: React.FC<AddStageProps> = ({ hasValidDvcYaml }) => (
1212
<div className={styles.addConfigButton}>
13-
<p>Easily and efficiently reproduce your experiments </p>
13+
<p>
14+
Define a{' '}
15+
<a href="https://dvc.org/doc/user-guide/pipelines/defining-pipelines">
16+
pipeline
17+
</a>{' '}
18+
to improve experiment reproducibility.
19+
</p>
1420
<IconButton
1521
icon={Add}
1622
onClick={() => hasValidDvcYaml && addConfiguration()}
17-
text="Add a Pipeline Stage"
23+
text="Add Stage"
1824
disabled={!hasValidDvcYaml}
1925
/>
2026
{!hasValidDvcYaml && (
2127
<p className={styles.errorText}>
22-
Your dvc.yaml file should contain valid yaml before adding any pipeline
23-
stages.
28+
A stage cannot be added to an invalid dvc.yaml file.
2429
</p>
2530
)}
2631
<p>
27-
<a href="https://dvc.org/doc/user-guide/project-structure/dvcyaml-files#stages">
28-
Learn more
29-
</a>
32+
Learn more about{' '}
33+
<a href="https://dvc.org/doc/user-guide/project-structure/dvcyaml-files">
34+
dvc.yaml
35+
</a>{' '}
36+
files.
3037
</p>
3138
</div>
3239
)

webview/src/experiments/components/App.test.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,20 +1740,20 @@ describe('App', () => {
17401740
renderTable()
17411741
setTableData({ ...tableDataFixture, hasConfig: false })
17421742

1743-
expect(screen.getByText('Add a Pipeline Stage')).toBeInTheDocument()
1743+
expect(screen.getByText('Add Stage')).toBeInTheDocument()
17441744
})
17451745

17461746
it('should not show a add config button if the project has pipeline stages', () => {
17471747
renderTable()
17481748

1749-
expect(screen.queryByText('Add a Pipeline Stage')).not.toBeInTheDocument()
1749+
expect(screen.queryByText('Add Stage')).not.toBeInTheDocument()
17501750
})
17511751

17521752
it('should send a message to the extension to add a pipeline stage when clicking on the add config button', () => {
17531753
renderTable()
17541754
setTableData({ ...tableDataFixture, hasConfig: false })
17551755

1756-
fireEvent.click(screen.getByText('Add a Pipeline Stage'))
1756+
fireEvent.click(screen.getByText('Add Stage'))
17571757

17581758
expect(mockPostMessage).toHaveBeenCalledWith({
17591759
type: MessageFromWebviewType.ADD_CONFIGURATION
@@ -1767,7 +1767,7 @@ describe('App', () => {
17671767
hasConfig: false,
17681768
hasValidDvcYaml: false
17691769
})
1770-
const addPipelineButton = await screen.findByText('Add a Pipeline Stage')
1770+
const addPipelineButton = await screen.findByText('Add Stage')
17711771

17721772
fireEvent.click(addPipelineButton)
17731773

@@ -1776,9 +1776,7 @@ describe('App', () => {
17761776
})
17771777

17781778
expect(
1779-
screen.getByText(
1780-
'Your dvc.yaml file should contain valid yaml before adding any pipeline stages.'
1781-
)
1779+
screen.getByText('A stage cannot be added to an invalid dvc.yaml file.')
17821780
).toBeInTheDocument()
17831781
})
17841782
})

0 commit comments

Comments
 (0)