@@ -9,7 +9,7 @@ import { Billing, UserOrderableServiceVo } from '../../../../xpanse-api/generate
9
9
import NavigateOrderSubmission from './NavigateOrderSubmission' ;
10
10
import CspSelect from '../formElements/CspSelect' ;
11
11
import GoToSubmit from './GoToSubmit' ;
12
- import { Select , Skeleton , Space , Tabs } from 'antd' ;
12
+ import { Form , Select , Skeleton , Tabs } from 'antd' ;
13
13
import { Tab } from 'rc-tabs/lib/interface' ;
14
14
import { servicesSubPageRoute } from '../../../utils/constants' ;
15
15
import { OrderSubmitProps } from './OrderSubmit' ;
@@ -27,6 +27,8 @@ import { getCspListForVersion } from '../formDataHelpers/cspHelper';
27
27
import { getBilling } from '../formDataHelpers/billingHelper' ;
28
28
import '../../../../styles/service_order.css' ;
29
29
import { BillingInfo } from '../common/BillingInfo' ;
30
+ import { RegionInfo } from '../common/RegionInfo' ;
31
+ import { FlavorInfo } from '../common/FlavorInfo' ;
30
32
31
33
function CreateService ( ) : React . JSX . Element {
32
34
const [ urlParams ] = useSearchParams ( ) ;
@@ -344,92 +346,77 @@ function CreateService(): React.JSX.Element {
344
346
if ( selectCsp ) {
345
347
return (
346
348
< >
347
- < div >
348
- < NavigateOrderSubmission text = { '<< Back' } to = { servicePageUrl as To } props = { undefined } />
349
- < div className = { 'Line' } />
350
- </ div >
351
- < div className = { 'generic-table-container' } >
352
- < div className = { 'content-title' } >
353
- Service: { serviceName } Version:
354
- < Select
355
- value = { selectVersion }
356
- className = { 'version-drop-down' }
357
- onChange = { onChangeVersion }
358
- options = { versionList }
359
- />
360
- </ div >
361
- < br />
362
- < CspSelect
363
- selectCsp = { selectCsp }
364
- cspList = { cspList }
365
- onChangeHandler = { ( csp : UserOrderableServiceVo . csp ) => {
366
- onChangeCloudProvider ( csp ) ;
367
- } }
368
- />
369
- < br />
370
- < ServiceHostingSelection
371
- serviceHostingTypes = { serviceHostTypes }
372
- updateServiceHostingType = { onChangeServiceHostingType }
373
- disabledAlways = { false }
374
- previousSelection = { selectServiceHostType }
375
- > </ ServiceHostingSelection >
376
- < br />
377
- < br />
378
- < div className = { 'cloud-provider-tab-class content-title' } >
379
- < Tabs
380
- type = 'card'
381
- size = 'middle'
382
- activeKey = { selectArea }
383
- tabPosition = { 'top' }
384
- items = { areaList }
385
- onChange = { ( area ) => {
386
- onChangeAreaValue ( area ) ;
387
- } }
388
- />
349
+ < Form layout = 'vertical' initialValues = { { selectRegion, selectFlavor } } >
350
+ < div >
351
+ < NavigateOrderSubmission text = { '<< Back' } to = { servicePageUrl as To } props = { undefined } />
352
+ < div className = { 'Line' } />
389
353
</ div >
390
- < div className = { 'cloud-provider-tab-class region-flavor-content' } > Region: </ div >
391
- < div className = { 'cloud-provider-tab-class region-flavor- content' } >
392
- < Space wrap >
354
+ < div className = { 'generic-table-container' } >
355
+ < div className = { 'content-title ' } >
356
+ Service: { serviceName } Version:
393
357
< Select
394
- className = { 'select-box-class' }
395
- defaultValue = { selectRegion }
396
- value = { selectRegion }
397
- style = { { width : 450 } }
398
- onChange = { onChangeRegion }
399
- options = { regionList }
358
+ value = { selectVersion }
359
+ className = { 'version-drop-down' }
360
+ onChange = { onChangeVersion }
361
+ options = { versionList }
400
362
/>
401
- </ Space >
402
- </ div >
403
- < div className = { 'cloud-provider-tab-class region-flavor-content' } > Flavor:</ div >
404
- < div className = { 'cloud-provider-tab-class region-flavor-content' } >
405
- < Space wrap >
406
- < Select
407
- className = { 'select-box-class' }
408
- value = { selectFlavor }
409
- style = { { width : 450 } }
410
- onChange = { ( newFlavor ) => {
411
- onChangeFlavor ( newFlavor ) ;
363
+ </ div >
364
+ < br />
365
+ < CspSelect
366
+ selectCsp = { selectCsp }
367
+ cspList = { cspList }
368
+ onChangeHandler = { ( csp : UserOrderableServiceVo . csp ) => {
369
+ onChangeCloudProvider ( csp ) ;
370
+ } }
371
+ />
372
+ < br />
373
+ < ServiceHostingSelection
374
+ serviceHostingTypes = { serviceHostTypes }
375
+ updateServiceHostingType = { onChangeServiceHostingType }
376
+ disabledAlways = { false }
377
+ previousSelection = { selectServiceHostType }
378
+ > </ ServiceHostingSelection >
379
+ < br />
380
+ < br />
381
+ < div className = { 'cloud-provider-tab-class content-title' } >
382
+ < Tabs
383
+ type = 'card'
384
+ size = 'middle'
385
+ activeKey = { selectArea }
386
+ tabPosition = { 'top' }
387
+ items = { areaList }
388
+ onChange = { ( area ) => {
389
+ onChangeAreaValue ( area ) ;
412
390
} }
413
- options = { flavorList }
414
391
/>
415
- </ Space >
416
- </ div >
417
- < BillingInfo priceValue = { priceValue } billing = { currentBilling } />
418
- </ div >
419
- { selectServiceHostType ? (
420
- < div >
421
- < div className = { 'Line' } />
422
- < GoToSubmit
423
- selectVersion = { selectVersion }
424
- selectCsp = { selectCsp }
392
+ </ div >
393
+ < RegionInfo
425
394
selectRegion = { selectRegion }
426
- selectArea = { selectArea }
395
+ onChangeRegion = { onChangeRegion }
396
+ regionList = { regionList }
397
+ />
398
+ < FlavorInfo
427
399
selectFlavor = { selectFlavor }
428
- versionMapper = { versionMapper . current }
429
- selectServiceHostingType = { selectServiceHostType }
400
+ flavorList = { flavorList }
401
+ onChangeFlavor = { onChangeFlavor }
430
402
/>
403
+ < BillingInfo priceValue = { priceValue } billing = { currentBilling } />
431
404
</ div >
432
- ) : null }
405
+ { selectServiceHostType ? (
406
+ < div >
407
+ < div className = { 'Line' } />
408
+ < GoToSubmit
409
+ selectVersion = { selectVersion }
410
+ selectCsp = { selectCsp }
411
+ selectRegion = { selectRegion }
412
+ selectArea = { selectArea }
413
+ selectFlavor = { selectFlavor }
414
+ versionMapper = { versionMapper . current }
415
+ selectServiceHostingType = { selectServiceHostType }
416
+ />
417
+ </ div >
418
+ ) : null }
419
+ </ Form >
433
420
</ >
434
421
) ;
435
422
}
0 commit comments