Skip to content

Commit e2bcbc5

Browse files
committed
[BA-124] Move edit suite button inside the suite page.
1 parent 1692645 commit e2bcbc5

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

src/components/TestSuites/TestSuiteRow.js

-25
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@ import format from 'date-fns/format'
55

66
import StatusBadge from 'components/StatusBadge'
77
import routes from 'constants/routesPaths'
8-
import Anchor from 'components/Anchor'
98
import TestSuiteRowWrapper from './TestSuiteRowWrapper'
109

1110
const TestSuiteRow = ({
1211
id,
1312
name,
14-
url,
15-
description,
1613
production,
1714
tests,
1815
lastSuiteExecution,
1916
match
2017
}) => {
21-
const { repositoryName, repositoryOwner, repositoryRef } = match.params
2218
const testsCount = tests.length
2319

2420
return (
@@ -41,25 +37,6 @@ const TestSuiteRow = ({
4137
</p>
4238
)}
4339
{production && <p>Only for production</p>}
44-
<Link
45-
to={{
46-
pathname: routes.editTestSuite({
47-
repositoryName,
48-
repositoryOwner,
49-
repositoryRef,
50-
id
51-
}),
52-
state: {
53-
name,
54-
url,
55-
description,
56-
production,
57-
tests
58-
}
59-
}}
60-
>
61-
<Anchor className="mc-mt-2">EDIT</Anchor>
62-
</Link>
6340
</div>
6441
</TestSuiteRowWrapper>
6542
)
@@ -68,9 +45,7 @@ const TestSuiteRow = ({
6845
TestSuiteRow.propTypes = {
6946
id: PropTypes.string.isRequired,
7047
name: PropTypes.string.isRequired,
71-
url: PropTypes.string.isRequired,
7248
production: PropTypes.bool,
73-
description: PropTypes.string.isRequired,
7449
tests: PropTypes.array.isRequired,
7550
lastSuiteExecution: PropTypes.object,
7651
match: PropTypes.object

src/containers/SuitePage/SuitePage.js

+30-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import React, { useState, useEffect, Fragment } from 'react'
22
import PropTypes from 'prop-types'
33
import { Separator, Button } from 'mc-components'
4+
import { Link } from 'react-router-dom'
45

56
import api from 'api'
7+
import routes from 'constants/routesPaths'
68
import Header from 'components/Header'
9+
import Anchor from 'components/Anchor'
10+
import Flex from 'components/Flex'
711
import Environment from 'components/Environment'
812
import StatusBadge from 'components/StatusBadge'
913
import Spinner from 'components/Spinner'
@@ -76,12 +80,33 @@ const SuitePage = ({
7680
{suite && suite.tests && (
7781
<Fragment>
7882
<div>
79-
<div>
83+
<Flex alignItems="center">
8084
<h5 className="d-inline mc-text-h5 mc-mr-2">{suite.name}</h5>
81-
{suite.lastSuiteExecution && (
82-
<StatusBadge status={suite.lastSuiteExecution.status} />
83-
)}
84-
</div>
85+
<div className="mc-mr-2">
86+
{suite.lastSuiteExecution && (
87+
<StatusBadge status={suite.lastSuiteExecution.status} />
88+
)}
89+
</div>
90+
<Link
91+
to={{
92+
pathname: routes.editTestSuite({
93+
repositoryName,
94+
repositoryOwner,
95+
repositoryRef,
96+
id: suite.id
97+
}),
98+
state: {
99+
name: suite.name,
100+
url: suite.url,
101+
description: suite.description,
102+
production: suite.production,
103+
tests: suite.tests
104+
}
105+
}}
106+
>
107+
<Anchor>Edit</Anchor>
108+
</Link>
109+
</Flex>
85110
<p>{suite.description}</p>
86111
<p className="mc-text--hinted">
87112
Default URL:{' '}

0 commit comments

Comments
 (0)