Skip to content

Commit b938467

Browse files
authored
Merge pull request #301 from atlassian/feature/design-4
Feature/design 4 merge to main
2 parents 57af85a + ba6badf commit b938467

File tree

9 files changed

+270
-124
lines changed

9 files changed

+270
-124
lines changed

app/jenkins-for-jira-ui/src/GlobalStyles.styles.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const orderedListItem = css`
1616
padding-left: ${token('space.200')};
1717
1818
counter-increment: item;
19-
margin-bottom: ${token('space.075')};
2019
2120
::before {
2221
background: #F7F8F9;

app/jenkins-for-jira-ui/src/components/ConnectionWizard/ConnectionWizard.styles.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { css } from '@emotion/css';
22
import { token } from '@atlaskit/tokens';
33

44
export const connectionWizardContentContainer = css`
5-
margin-left: ${token('space.negative.400')};
65
width: 100%;
6+
text-align: center;
7+
margin-bottom: ${token('space.400')};
78
89
#connection-wizard-instruction {
910
margin-top: ${token('space.400')};
@@ -33,3 +34,23 @@ export const connectionWizardButton = css`
3334
display: flex;
3435
}
3536
`;
37+
38+
export const connectionInfoContainer = css`
39+
background-color: #F7F8F9;
40+
border: 3px;
41+
display: inline;
42+
width: 330px;
43+
padding: ${token('space.250')};
44+
45+
[role=img] {
46+
margin-right: ${token('space.200')};
47+
}
48+
49+
p {
50+
margin-top: ${token('space.0')};
51+
}
52+
`;
53+
54+
export const iconContainer = css`
55+
margin-right: ${token('space.100')};
56+
`;

app/jenkins-for-jira-ui/src/components/ConnectionWizard/ConnectionWizard.tsx

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
import React, { useEffect } from 'react';
22
import { cx } from '@emotion/css';
33
import Button from '@atlaskit/button';
4+
import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
45
import ArrowRightIcon from '@atlaskit/icon/glyph/arrow-right';
6+
import UserAvatarCircleIcon from '@atlaskit/icon/glyph/user-avatar-circle';
57
import { useHistory, useParams } from 'react-router';
68
import {
7-
connectionWizardNestedOrderedListItem,
8-
connectionWizardOrderedListItem,
99
connectionWizardContentContainer,
10-
connectionWizardButton
10+
connectionWizardButton,
11+
connectionInfoContainer,
12+
iconContainer
1113
} from './ConnectionWizard.styles';
1214
import {
13-
connectionFlowContainer,
14-
orderedList,
15-
orderedListItem
15+
connectionFlowContainer
1616
} from '../../GlobalStyles.styles';
17-
import { InProductHelpActionType } from '../InProductHelpDrawer/InProductHelpAction';
17+
import { InProductHelpAction, InProductHelpActionType } from '../InProductHelpDrawer/InProductHelpAction';
1818
import { ConnectionFlowHeader } from './ConnectionFlowHeader';
19-
import { InfoPanel } from '../InfoPanel/InfoPanel';
2019
import { AnalyticsEventTypes, AnalyticsScreenEventsEnum } from '../../common/analytics/analytics-events';
2120
import { AnalyticsClient } from '../../common/analytics/analytics-client';
2221
import { CONNECTION_WIZARD_SCREEN_NAME } from '../../common/constants';
@@ -47,40 +46,33 @@ const ConnectionWizard = (): JSX.Element => {
4746

4847
<div className={cx(connectionWizardContentContainer)}>
4948
<p id="connection-wizard-instruction">To complete this connection you'll need:</p>
50-
51-
<ol className={cx(orderedList)}>
52-
<li className={cx(orderedListItem, connectionWizardOrderedListItem)}>An active Jenkins server</li>
53-
<li className={cx(orderedListItem, connectionWizardOrderedListItem)}>Team knowledge</li>
54-
<p className={cx(connectionWizardNestedOrderedListItem)}>
55-
How your teams use Jenkins
56-
</p>
57-
<li
58-
className={cx(orderedListItem, connectionWizardOrderedListItem)}
59-
>
60-
The help of your Jenkins admin
61-
</li>
62-
<p className={cx(connectionWizardNestedOrderedListItem)}>
63-
Unless you're an admin yourself
49+
</div>
50+
<div className={cx(connectionInfoContainer)}>
51+
<div style={{ display: 'flex', marginBottom: '5px' }}>
52+
<div className={cx(iconContainer)}>
53+
<CheckCircleIcon label='' size='small' primaryColor='grey'/>
54+
</div>
55+
<p>An active Jenkins server</p>
56+
</div>
57+
<div style={{ display: 'flex' }}>
58+
<div className={cx(iconContainer)}><UserAvatarCircleIcon label='' size='small' primaryColor='grey'/></div>
59+
<p>The help of your Jenkins admin, unless you're an admin yourself<br/>
60+
<InProductHelpAction
61+
label="What you'll be doing and how your team can help"
62+
type={InProductHelpActionType.HelpLink}
63+
searchQuery={InProductHelpIds.CONNECTION_WIZARD_DISCUSS_WITH_TEAM}
64+
screenName={CONNECTION_WIZARD_SCREEN_NAME}
65+
/>
6466
</p>
65-
</ol>
67+
</div>
6668
</div>
67-
68-
<InfoPanel
69-
content="If this is your first time connecting a Jenkins server, take a few minutes to talk to your team."
70-
iphContainerWidth="340px"
71-
iphLabel="What to discuss with your team before connecting Jenkins"
72-
iphType={InProductHelpActionType.HelpLink}
73-
screenName={CONNECTION_WIZARD_SCREEN_NAME}
74-
searchQuery={InProductHelpIds.CONNECTION_WIZARD_DISCUSS_WITH_TEAM}
75-
/>
76-
7769
<Button
7870
appearance="primary"
7971
className={cx(connectionWizardButton)}
8072
onClick={(e) => handleNavigateToServerNameScreen(e)}
81-
testId="team-gathered"
73+
testId="continue"
8274
>
83-
I've gathered my team
75+
Continue
8476
<ArrowRightIcon label="Continue to next screen" />
8577
</Button>
8678
</div>

app/jenkins-for-jira-ui/src/components/JenkinsSetup/JenkinsSetup.styles.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const jenkinsSetupHeader = css`
2525

2626
export const jenkinsSetupContent = css`
2727
font-size: 14px;
28+
color: #626F86;
2829
margin: ${token('space.300')} auto !important;
2930
`;
3031

app/jenkins-for-jira-ui/src/components/JenkinsSetup/JenkinsSetup.test.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,12 @@ describe('JenkinsSetup Component', () => {
6161
jest.spyOn(fetchGlobalPageUrlModule, 'fetchGlobalPageUrl').mockResolvedValueOnce('https://somesite.atlassian.net/blah');
6262
jest.spyOn(getAllJenkinsServersModule, 'getAllJenkinsServers').mockResolvedValueOnce([]);
6363

64-
const { getByText, queryByText } = render(<JenkinsSetup />);
64+
const { getByText } = render(<JenkinsSetup />);
6565
expect(screen.getByTestId('loading-spinner')).toBeInTheDocument();
6666
expect(getByText('Connect Jenkins to Jira')).toBeInTheDocument();
67-
expect(queryByText('Server name:')).toBeNull();
6867
});
6968

70-
it('should display the server name', async () => {
69+
it('should have the server name in the Setup Content', async () => {
7170
(fetchGlobalPageUrlModule.fetchSiteName as jest.Mock).mockResolvedValueOnce('https://mocked-site-name.com');
7271

7372
(getJenkinsServerWithSecretModule.getJenkinsServerWithSecret as jest.Mock).mockResolvedValueOnce({
@@ -89,11 +88,11 @@ describe('JenkinsSetup Component', () => {
8988
render(<JenkinsSetup />);
9089
});
9190

92-
expect(screen.getByText(/Server name:/i)).toBeInTheDocument();
93-
expect(screen.getByText(/Server name:/i)).toHaveTextContent('Mocked Server');
91+
expect(screen.getByText(/To complete the connection for /i)).toBeInTheDocument();
92+
expect(screen.getByText(/To complete the connection for /i)).toHaveTextContent('Mocked Server');
9493
});
9594

96-
it('toggles between "A Jenkins admin is helping me" and "I am the Jenkins admin" views', async () => {
95+
it('toggles between "A Jenkins admin on my team" and "I am a Jenkins admin" views', async () => {
9796
(fetchGlobalPageUrlModule.fetchSiteName as jest.Mock).mockResolvedValueOnce('https://mocked-site-name.com');
9897

9998
(getJenkinsServerWithSecretModule.getJenkinsServerWithSecret as jest.Mock).mockResolvedValueOnce({
@@ -118,13 +117,13 @@ describe('JenkinsSetup Component', () => {
118117
const { getByText, queryByText } = screen;
119118

120119
await waitFor(() => {
121-
fireEvent.click(getByText('A Jenkins admin is helping me'));
120+
fireEvent.click(getByText('A Jenkins admin on my team'));
122121
expect(getByText('Copy the items below and give them to your Jenkins admin')).toBeInTheDocument();
123122
expect(queryByText('Log in to Jenkins in another window and use the items below to set up your server.')).not.toBeInTheDocument();
124123
});
125124

126125
await waitFor(() => {
127-
fireEvent.click(getByText('I\'m logging into Jenkins myself'));
126+
fireEvent.click(getByText('I am a Jenkins admin'));
128127
expect(queryByText('Copy the items below and give them to your Jenkins admin')).not.toBeInTheDocument();
129128
expect(getByText('Log in to Jenkins in another window and use the items below to set up your server.')).toBeInTheDocument();
130129
});
@@ -155,7 +154,7 @@ describe('JenkinsSetup Component', () => {
155154
const { getByText, getByTestId } = screen;
156155

157156
await waitFor(() => {
158-
fireEvent.click(getByText('A Jenkins admin is helping me'));
157+
fireEvent.click(getByText('A Jenkins admin on my team'));
159158
});
160159

161160
await act(async () => {
@@ -173,6 +172,12 @@ describe('JenkinsSetup Component', () => {
173172
fireEvent.click(getByTestId('i-am-the-jenkins-admin'));
174173
});
175174

175+
await act(async () => {
176+
fireEvent.click(getByTestId('site-name-copy-button'));
177+
});
178+
179+
expect(document.execCommand).toHaveBeenCalledWith('copy');
180+
176181
await act(async () => {
177182
fireEvent.click(getByTestId('copy-webhook-url'));
178183
});
@@ -186,7 +191,7 @@ describe('JenkinsSetup Component', () => {
186191
expect(document.execCommand).toHaveBeenCalledWith('copy');
187192
});
188193

189-
it('displays "Next" button when either "A Jenkins admin is helping me" or "I\'m logging into Jenkins myself" is selected', async () => {
194+
it('displays "Finish" button when either "A Jenkins admin on my team" or "I am a Jenkins admin" is selected', async () => {
190195
(fetchGlobalPageUrlModule.fetchSiteName as jest.Mock).mockResolvedValueOnce('https://mocked-site-name.com');
191196

192197
(getJenkinsServerWithSecretModule.getJenkinsServerWithSecret as jest.Mock).mockResolvedValueOnce({
@@ -211,13 +216,13 @@ describe('JenkinsSetup Component', () => {
211216
const { getByText } = screen;
212217

213218
await waitFor(() => {
214-
fireEvent.click(getByText('A Jenkins admin is helping me'));
215-
expect(getByText('Next')).toBeInTheDocument();
219+
fireEvent.click(getByText('A Jenkins admin on my team'));
220+
expect(getByText('Finish')).toBeInTheDocument();
216221
});
217222

218223
await waitFor(() => {
219-
fireEvent.click(getByText('I\'m logging into Jenkins myself'));
220-
expect(getByText('Next')).toBeInTheDocument();
224+
fireEvent.click(getByText('I am a Jenkins admin'));
225+
expect(getByText('Finish')).toBeInTheDocument();
221226
});
222227
});
223228
});

0 commit comments

Comments
 (0)