-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from atlassian/ARC-2599-part-2-connection-pan…
…el-main-pending-and-duplicate Arc-2599 part 2 connection panel main pending and duplicate
- Loading branch information
Showing
9 changed files
with
206 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 45 additions & 4 deletions
49
app/jenkins-for-jira-ui/src/components/ConnectionPanel/ConnectionPanelMain.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/jenkins-for-jira-ui/src/components/ConnectionPanel/NotConnectedState.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
import { NotConnectedState } from './NotConnectedState'; | ||
import { ConnectedState } from '../StatusLabel/StatusLabel'; | ||
|
||
describe('NotConnectedState', () => { | ||
test('renders with connected state DUPLICATE', () => { | ||
render(<NotConnectedState connectedState={ConnectedState.DUPLICATE} />); | ||
expect(screen.getByText('Duplicate server')).toBeInTheDocument(); | ||
expect(screen.getByText('Delete')).toBeInTheDocument(); | ||
}); | ||
|
||
test('renders with connected state PENDING', () => { | ||
render(<NotConnectedState connectedState={ConnectedState.PENDING} />); | ||
expect(screen.getByText('Connection pending')).toBeInTheDocument(); | ||
expect(screen.getByText('Connection settings')).toBeInTheDocument(); | ||
}); | ||
}); |
52 changes: 52 additions & 0 deletions
52
app/jenkins-for-jira-ui/src/components/ConnectionPanel/NotConnectedState.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from 'react'; | ||
import { cx } from '@emotion/css'; | ||
import Button from '@atlaskit/button'; | ||
import { ConnectedState } from '../StatusLabel/StatusLabel'; | ||
import { | ||
notConnectedStateContainer, | ||
notConnectedStateHeader, | ||
notConnectedStateParagraph, | ||
notConnectedTempImgPlaceholder | ||
} from './ConnectionPanel.styles'; | ||
|
||
type NotConnectedStateProps = { | ||
connectedState: ConnectedState | ||
}; | ||
|
||
const NotConnectedState = ({ connectedState }: NotConnectedStateProps): JSX.Element => { | ||
const notConnectedHeader = | ||
connectedState === ConnectedState.PENDING ? 'Connection pending' : 'Duplicate server'; | ||
const notConnectedContent = | ||
connectedState === ConnectedState.PENDING | ||
? ( | ||
<> | ||
This connection is pending completion by a Jenkins admin. | ||
Its set up guide will be available when the connection is complete. | ||
<div /> | ||
Open connection settings if your Jenkins admin needs to revisit the items they need. | ||
</> | ||
) | ||
: ( | ||
<> | ||
This connection is a duplicate of SERVER NAME. | ||
<div /> | ||
Use SERVER NAME to manage this server. | ||
</> | ||
); | ||
|
||
return ( | ||
<div className={cx(notConnectedStateContainer)}> | ||
<div className={cx(notConnectedTempImgPlaceholder)}></div> | ||
<h3 className={cx(notConnectedStateHeader)}>{notConnectedHeader}</h3> | ||
<p className={cx(notConnectedStateParagraph)}>{notConnectedContent}</p> | ||
{/* TODO - add onClick handler */} | ||
{ | ||
connectedState === ConnectedState.PENDING | ||
? <Button>Connection settings</Button> | ||
: <Button appearance="danger">Delete</Button> | ||
} | ||
</div> | ||
); | ||
}; | ||
|
||
export { NotConnectedState }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,6 +168,16 @@ | |
"@emotion/react" "^11.7.1" | ||
tiny-invariant "^1.2.0" | ||
|
||
"@atlaskit/ds-explorations@^3.0.0": | ||
version "3.0.5" | ||
resolved "https://packages.atlassian.com/api/npm/npm-remote/@atlaskit/ds-explorations/-/ds-explorations-3.0.5.tgz#e1e18da56198ee06878c89dfdbf42f7ca5be5240" | ||
integrity sha512-7iGD7lWeDrGG6skZTCeBXGi3lWZE9RO1Ckozg569Iao0r9mjBNDDTG+1xa3Ve5Os+TIYqfNQ763AEBCkMI3ByQ== | ||
dependencies: | ||
"@atlaskit/tokens" "^1.28.0" | ||
"@babel/runtime" "^7.0.0" | ||
"@emotion/react" "^11.7.1" | ||
tiny-invariant "^1.2.0" | ||
|
||
"@atlaskit/ds-lib@^2.1.0", "@atlaskit/ds-lib@^2.2.0": | ||
version "2.2.3" | ||
resolved "https://packages.atlassian.com/api/npm/npm-remote/@atlaskit/ds-lib/-/ds-lib-2.2.3.tgz#fc65a829b45ee0a26c9c6c97072e2d570214aec7" | ||
|
@@ -468,6 +478,20 @@ | |
"@babel/runtime" "^7.0.0" | ||
"@emotion/react" "^11.7.1" | ||
|
||
"@atlaskit/tabs@^13.4.9": | ||
version "13.4.9" | ||
resolved "https://packages.atlassian.com/api/npm/npm-remote/@atlaskit/tabs/-/tabs-13.4.9.tgz#0cf7df8dfdd690a1f720470b4d76219f76ac88fb" | ||
integrity sha512-8Fu7HQWbdkfMRnQ1ICFw6zvgiaR2rtrUNwYmnyHcqZg7fLyqv6jeclVLqtsq50fodJnFTWX8FvljmbDoiYUqDA== | ||
dependencies: | ||
"@atlaskit/analytics-next" "^9.1.0" | ||
"@atlaskit/codemod-utils" "^4.2.0" | ||
"@atlaskit/ds-explorations" "^3.0.0" | ||
"@atlaskit/primitives" "^1.6.0" | ||
"@atlaskit/theme" "^12.6.0" | ||
"@atlaskit/tokens" "^1.26.0" | ||
"@babel/runtime" "^7.0.0" | ||
"@emotion/react" "^11.7.1" | ||
|
||
"@atlaskit/[email protected]": | ||
version "5.6.4" | ||
resolved "https://registry.yarnpkg.com/@atlaskit/textfield/-/textfield-5.6.4.tgz#6d874895f0a1e4a636c0ca78778927f8f0106bd1" | ||
|
@@ -558,7 +582,7 @@ | |
"@babel/types" "^7.20.0" | ||
bind-event-listener "^2.1.1" | ||
|
||
"@atlaskit/tokens@^1.28.1": | ||
"@atlaskit/tokens@^1.28.0", "@atlaskit/tokens@^1.28.1": | ||
version "1.28.1" | ||
resolved "https://packages.atlassian.com/api/npm/npm-remote/@atlaskit/tokens/-/tokens-1.28.1.tgz#f7cd63b9046f9b287710b8701357eecf011536a8" | ||
integrity sha512-0rkCRLQ+zsynpVx34F5OIy8YBI+OZ/Ejcf9shnCVvvTQyInFj+SF153lwRBr9HzV/561jD/YsUt7rFNS5MSqIw== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import resolver from './resolvers'; | ||
import { redirectFromGetStarted } from './utils/redirect-from-get-started'; | ||
import handleJenkinsRequest from './webtrigger/handle-jenkins-request'; | ||
import { handleResetJenkinsRequest } from './webtrigger/handle-reset-jenkins-request'; | ||
|
||
// webtriggers | ||
export { handleJenkinsRequest, handleResetJenkinsRequest }; | ||
|
||
// resolvers | ||
export { resolver, redirectFromGetStarted }; | ||
export { resolver }; |