-
Notifications
You must be signed in to change notification settings - Fork 35
Axon 72 new onboarding auth UI #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c417491
Checkpoint
bwieger-atlassian-com 139a508
UX works, but Auth not set up yet
bwieger-atlassian-com 376eae9
callbacks for signin
bwieger-atlassian-com c53db48
call back working correctly
bwieger-atlassian-com cf50a32
Cloud auth
bwieger-atlassian-com 500c077
server auth
bwieger-atlassian-com 891488f
AXON-72: updated auth flow styles
cabella-dot 6c181c4
AXON-72: fix linting errors
cabella-dot fe4e0be
AXON-72: add logo and use vscode native components
cabella-dot 5e5c96e
AXON-72: logo files
cabella-dot 383c248
AXON-72: fixed stepping bug and handle back bug
cabella-dot 4131cad
AXON-72: added error logging when invalid sign in flow
cabella-dot 60b4c4f
AXON-72: remove console logs
cabella-dot 165e727
AXON-72: clean up for readability + use constant values
cabella-dot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
export type Product = 'Jira' | 'Bitbucket'; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
151 changes: 151 additions & 0 deletions
151
src/react/atlascode/onboarding/JiraBitbucketOnboarding.tsx
This file contains hidden or 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,151 @@ | ||
import React, { useCallback } from 'react'; | ||
import { Container, Typography, Box, Card, CardActionArea, CardContent } from '@material-ui/core'; | ||
import { Product } from '../common/types'; | ||
import { VSCodeRadio, VSCodeButton } from '@vscode/webview-ui-toolkit/react'; | ||
import { BitbucketOnboardingLogo } from '../icons/BitbucketOnboardingLogo'; | ||
import { JiraOnboardingLogo } from '../icons/JiraOnboardingLogo'; | ||
|
||
type Props = { | ||
product: Product; | ||
handleOptionChange: (value: string) => void; | ||
executeSetup: () => void; | ||
handleNext: () => void; | ||
handleBack?: () => void; | ||
signInText: string; | ||
valueSet: { | ||
cloud: string; | ||
server: string; | ||
none: string; | ||
}; | ||
}; | ||
const OnboardingRadio = ({ | ||
checked, | ||
handleValueChange, | ||
value, | ||
title, | ||
description, | ||
}: { | ||
checked: string; | ||
handleValueChange: (v: string) => void; | ||
value: string; | ||
title: string; | ||
description?: string; | ||
}) => { | ||
return ( | ||
<Card variant="outlined" style={{ width: '100%' }}> | ||
<CardActionArea | ||
onClick={() => { | ||
handleValueChange(value); | ||
}} | ||
> | ||
<CardContent style={formControlStyles}> | ||
<VSCodeRadio checked={checked === value} /> | ||
<Box flexDirection={'column'}> | ||
<Typography style={{ fontWeight: 'bold' }}>{title}</Typography> | ||
{description && <Typography>{description}</Typography>} | ||
</Box> | ||
</CardContent> | ||
</CardActionArea> | ||
</Card> | ||
); | ||
}; | ||
|
||
export const JiraBitbucketOnboarding: React.FC<Props> = ({ | ||
cabella-dot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
product, | ||
handleOptionChange, | ||
executeSetup, | ||
handleNext, | ||
handleBack, | ||
signInText, | ||
valueSet, | ||
}) => { | ||
const [checked, setChecked] = React.useState(valueSet.cloud); | ||
cabella-dot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const handleValueChange = useCallback( | ||
(value: string) => { | ||
setChecked(value); | ||
handleOptionChange(value); | ||
}, | ||
[handleOptionChange], | ||
); | ||
|
||
return ( | ||
cabella-dot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<Container style={{ justifyContent: 'center' }} maxWidth="xs"> | ||
<Box style={wrapperStyles} flexDirection="column"> | ||
{product === 'Jira' ? <JiraOnboardingLogo /> : <BitbucketOnboardingLogo />} | ||
<Typography variant="h2">What version of {product} do you use?</Typography> | ||
<Box flexDirection="column" style={radioGroupStyles}> | ||
<OnboardingRadio | ||
checked={checked} | ||
handleValueChange={handleValueChange} | ||
value={valueSet.cloud} | ||
title="Cloud" | ||
description="For most of our users. The URL for accessing your site will typically be in the format mysite.atlassian.net" | ||
/> | ||
<OnboardingRadio | ||
checked={checked} | ||
handleValueChange={handleValueChange} | ||
value={valueSet.server} | ||
title="Server" | ||
description="For users with a custom site. The URL is usually a custom domain or IP address set up by your organization" | ||
/> | ||
<OnboardingRadio | ||
checked={checked} | ||
handleValueChange={handleValueChange} | ||
value={valueSet.none} | ||
title={product === 'Jira' ? "I don't have Jira" : "I don't have Bitbucket"} | ||
/> | ||
</Box> | ||
<Box | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
alignItems: 'flex-start', | ||
alignSelf: 'stretch', | ||
}} | ||
> | ||
<VSCodeButton | ||
disabled={!handleBack} | ||
onClick={() => { | ||
handleBack && handleBack(); | ||
}} | ||
appearance="secondary" | ||
> | ||
Back | ||
</VSCodeButton> | ||
<VSCodeButton | ||
onClick={() => { | ||
executeSetup(); | ||
handleNext(); | ||
}} | ||
> | ||
{signInText} | ||
</VSCodeButton> | ||
</Box> | ||
</Box> | ||
</Container> | ||
); | ||
}; | ||
|
||
const wrapperStyles = { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
gap: '24px', | ||
}; | ||
|
||
const formControlStyles = { | ||
display: 'flex', | ||
padding: '12px', | ||
alignItems: 'flex-start', | ||
gap: '8px', | ||
alignSelf: 'stretch', | ||
borderRadius: '4px', | ||
}; | ||
|
||
const radioGroupStyles = { | ||
display: 'flex', | ||
gap: '8px', | ||
alignItems: 'flex-start', | ||
alignSelf: 'stretch', | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.