@@ -18,8 +18,9 @@ import { AtlascodeErrorBoundary } from '../common/ErrorBoundary';
18
18
import { AnalyticsView } from 'src/analyticsTypes' ;
19
19
import { Features } from 'src/util/featureFlags' ;
20
20
import { CommonMessageType } from 'src/lib/ipc/toUI/common' ;
21
- import { JiraBitbucketOnboarding } from './JiraBitbucketOnboarding' ;
22
21
import { OnboardingActionType } from 'src/lib/ipc/fromUI/onboarding' ;
22
+ import { JiraOnboarding } from './JiraOnboarding' ;
23
+ import { BitbucketOnboarding } from './BitbucketOnboarding' ;
23
24
24
25
const useStyles = makeStyles ( ( theme : Theme ) => ( {
25
26
root : {
@@ -62,8 +63,8 @@ export const OnboardingPage: React.FunctionComponent = () => {
62
63
const [ useAuthUI , setUseAuthUI ] = React . useState ( false ) ;
63
64
const [ jiraSignInText , setJiraSignInText ] = useState ( 'Sign In to Jira Cloud' ) ;
64
65
const [ bitbucketSignInText , setBitbucketSignInText ] = useState ( 'Sign In to Bitbucket Cloud' ) ;
65
- const [ jiraSignInFlow , setJiraSignInFlow ] = useState ( 'error' ) ;
66
- const [ bitbucketSignInFlow , setBitbucketSignInFlow ] = useState ( 'bitbucket-setup-radio- cloud' ) ;
66
+ const [ jiraSignInFlow , setJiraSignInFlow ] = useState ( jiraValueSet . cloud ) ;
67
+ const [ bitbucketSignInFlow , setBitbucketSignInFlow ] = useState ( bitbucketValueSet . cloud ) ;
67
68
68
69
React . useEffect ( ( ) => {
69
70
window . addEventListener ( 'message' , ( event ) => {
@@ -147,13 +148,13 @@ export const OnboardingPage: React.FunctionComponent = () => {
147
148
const executeBitbucketSignInFlow = useCallback ( ( ) => {
148
149
console . log ( bitbucketSignInFlow ) ;
149
150
switch ( bitbucketSignInFlow ) {
150
- case 'bitbucket-setup-radio- cloud' :
151
+ case bitbucketValueSet . cloud :
151
152
handleCloudSignIn ( ProductBitbucket ) ;
152
153
break ;
153
- case 'bitbucket-setup-radio- server' :
154
+ case bitbucketValueSet . server :
154
155
handleServerSignIn ( ProductBitbucket ) ;
155
156
break ;
156
- case 'bitbucket-setup-radio- none' :
157
+ case bitbucketValueSet . none :
157
158
handleNext ( ) ;
158
159
break ;
159
160
default :
@@ -167,13 +168,13 @@ export const OnboardingPage: React.FunctionComponent = () => {
167
168
168
169
const executeJiraSignInFlow = useCallback ( ( ) => {
169
170
switch ( jiraSignInFlow ) {
170
- case 'jira-setup-radio- cloud' :
171
+ case jiraValueSet . cloud :
171
172
handleCloudSignIn ( ProductJira ) ;
172
173
break ;
173
- case 'jira-setup-radio- server' :
174
+ case jiraValueSet . server :
174
175
handleServerSignIn ( ProductJira ) ;
175
176
break ;
176
- case 'jira-setup-radio- none' :
177
+ case jiraValueSet . none :
177
178
handleNext ( ) ;
178
179
break ;
179
180
default :
@@ -187,9 +188,9 @@ export const OnboardingPage: React.FunctionComponent = () => {
187
188
188
189
const handleJiraOptionChange = useCallback ( ( value : string ) => {
189
190
setJiraSignInFlow ( value ) ;
190
- if ( value === 'jira-setup-radio- cloud' ) {
191
+ if ( value === jiraValueSet . cloud ) {
191
192
setJiraSignInText ( 'Sign in to Jira Cloud' ) ;
192
- } else if ( value === 'jira-setup-radio- server' ) {
193
+ } else if ( value === jiraValueSet . server ) {
193
194
setJiraSignInText ( 'Sign in to Jira Server' ) ;
194
195
} else {
195
196
setJiraSignInText ( 'Next' ) ;
@@ -198,18 +199,18 @@ export const OnboardingPage: React.FunctionComponent = () => {
198
199
199
200
const handleBitbucketOptionChange = useCallback ( ( value : string ) => {
200
201
setBitbucketSignInFlow ( value ) ;
201
- if ( value === 'bitbucket-setup-radio- cloud' ) {
202
+ if ( value === bitbucketValueSet . cloud ) {
202
203
setBitbucketSignInText ( 'Sign in to Bitbucket Cloud' ) ;
203
- } else if ( value === 'bitbucket-setup-radio- server' ) {
204
+ } else if ( value === bitbucketValueSet . server ) {
204
205
setBitbucketSignInText ( 'Sign in to Bitbucket Server' ) ;
205
206
} else {
206
207
setBitbucketSignInText ( 'Next' ) ;
207
208
}
208
209
} , [ ] ) ;
209
210
210
211
const handleBack = useCallback ( ( ) => {
211
- handleJiraOptionChange ( 'jira-setup-radio- cloud' ) ;
212
- handleBitbucketOptionChange ( 'bitbucket-setup-radio- cloud' ) ;
212
+ handleJiraOptionChange ( jiraValueSet . cloud ) ;
213
+ handleBitbucketOptionChange ( bitbucketValueSet . cloud ) ;
213
214
214
215
if ( activeStep === 2 ) {
215
216
setActiveStep ( ( prevActiveStep ) => prevActiveStep - 2 ) ;
@@ -305,18 +306,16 @@ export const OnboardingPage: React.FunctionComponent = () => {
305
306
const authUI_v1 = (
306
307
< div >
307
308
{ activeStep === 0 && (
308
- < JiraBitbucketOnboarding //jira
309
+ < JiraOnboarding
309
310
valueSet = { jiraValueSet }
310
- product = "Jira"
311
311
handleOptionChange = { handleJiraOptionChange }
312
312
executeSetup = { executeJiraSignInFlow }
313
313
signInText = { jiraSignInText }
314
314
/>
315
315
) }
316
316
{ activeStep === 1 && (
317
- < JiraBitbucketOnboarding //bitbucket
317
+ < BitbucketOnboarding
318
318
valueSet = { bitbucketValueSet }
319
- product = "Bitbucket"
320
319
handleOptionChange = { handleBitbucketOptionChange }
321
320
executeSetup = { executeBitbucketSignInFlow }
322
321
handleBack = { handleBack }
0 commit comments