|
1 | 1 | import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react'; |
2 | | -import { useApiResourceMutation } from '../../lib/api/useApiResource'; |
| 2 | + |
3 | 3 | import IllustrationMessageType from '@ui5/webcomponents-fiori/dist/types/IllustrationMessageType.js'; |
4 | | -import { useAuthOnboarding } from '../../spaces/onboarding/auth/AuthContextOnboarding.tsx'; |
5 | | -import { Member, MemberRoles } from '../../lib/api/types/shared/members.ts'; |
| 4 | + |
6 | 5 | import type { WizardStepChangeEventDetail } from '@ui5/webcomponents-fiori/dist/Wizard.js'; |
7 | 6 | import { zodResolver } from '@hookform/resolvers/zod'; |
8 | 7 | import { useForm } from 'react-hook-form'; |
9 | | -import { validationSchemaCreateManagedControlPlane } from '../../lib/api/validations/schemas.ts'; |
10 | | -import { OnCreatePayload } from '../Dialogs/CreateProjectWorkspaceDialog.tsx'; |
| 8 | + |
11 | 9 | import { |
12 | 10 | Bar, |
13 | 11 | Button, |
14 | 12 | Dialog, |
15 | 13 | Form, |
16 | 14 | FormGroup, |
17 | | - Grid, |
18 | | - List, |
19 | | - ListItemStandard, |
20 | | - Title, |
21 | 15 | Ui5CustomEvent, |
22 | 16 | Wizard, |
23 | 17 | WizardDomRef, |
24 | 18 | WizardStep, |
25 | 19 | } from '@ui5/webcomponents-react'; |
26 | | -import YamlViewer from '../Yaml/YamlViewer.tsx'; |
27 | | -import { stringify } from 'yaml'; |
28 | | -import { APIError } from '../../lib/api/error.ts'; |
| 20 | + |
| 21 | +import { SummarizeStep } from './SummarizeStep.tsx'; |
| 22 | +import { useTranslation } from 'react-i18next'; |
| 23 | +import { useAuthOnboarding } from '../../../spaces/onboarding/auth/AuthContextOnboarding.tsx'; |
| 24 | +import { |
| 25 | + ErrorDialog, |
| 26 | + ErrorDialogHandle, |
| 27 | +} from '../../Shared/ErrorMessageBox.tsx'; |
| 28 | +import { CreateDialogProps } from '../../Dialogs/CreateWorkspaceDialogContainer.tsx'; |
| 29 | +import { validationSchemaCreateManagedControlPlane } from '../../../lib/api/validations/schemas.ts'; |
| 30 | +import { Member, MemberRoles } from '../../../lib/api/types/shared/members.ts'; |
| 31 | +import { useApiResourceMutation } from '../../../lib/api/useApiResource.ts'; |
29 | 32 | import { |
30 | 33 | ComponentsListItem, |
31 | 34 | CreateManagedControlPlane, |
32 | 35 | CreateManagedControlPlaneResource, |
33 | 36 | CreateManagedControlPlaneType, |
34 | | -} from '../../lib/api/types/crate/createManagedControlPlane.ts'; |
35 | | -import { ErrorDialog, ErrorDialogHandle } from '../Shared/ErrorMessageBox.tsx'; |
36 | | -import { EditMembers } from '../Members/EditMembers.tsx'; |
37 | | -import { useTranslation } from 'react-i18next'; |
38 | | -import { MetadataForm } from '../Dialogs/MetadataForm.tsx'; |
39 | | -import { IllustratedBanner } from '../Ui/IllustratedBanner/IllustratedBanner.tsx'; |
40 | | -import { |
41 | | - ComponentsSelectionContainer, |
42 | | - getSelectedComponents, |
43 | | -} from '../ComponentsSelection/ComponentsSelectionContainer.tsx'; |
44 | | -import { CreateDialogProps } from '../Dialogs/CreateWorkspaceDialogContainer.tsx'; |
45 | | -import { idpPrefix } from '../../utils/idpPrefix.ts'; |
| 37 | +} from '../../../lib/api/types/crate/createManagedControlPlane.ts'; |
| 38 | +import { OnCreatePayload } from '../../Dialogs/CreateProjectWorkspaceDialog.tsx'; |
| 39 | +import { idpPrefix } from '../../../utils/idpPrefix.ts'; |
| 40 | +import { APIError } from '../../../lib/api/error.ts'; |
| 41 | +import { MetadataForm } from '../../Dialogs/MetadataForm.tsx'; |
| 42 | +import { EditMembers } from '../../Members/EditMembers.tsx'; |
| 43 | +import { ComponentsSelectionContainer } from '../../ComponentsSelection/ComponentsSelectionContainer.tsx'; |
| 44 | +import { IllustratedBanner } from '../../Ui/IllustratedBanner/IllustratedBanner.tsx'; |
46 | 45 |
|
47 | 46 | type CreateManagedControlPlaneWizardContainerProps = { |
48 | 47 | isOpen: boolean; |
@@ -347,69 +346,12 @@ export const CreateManagedControlPlaneWizardContainer: FC< |
347 | 346 | selected={selectedStep === 'summarize'} |
348 | 347 | data-step="summarize" |
349 | 348 | > |
350 | | - <Title>{t('common.summarize')}</Title> |
351 | | - <Grid defaultSpan="XL6 L6 M6 S6"> |
352 | | - <div> |
353 | | - <List headerText={t('common.metadata')}> |
354 | | - <ListItemStandard |
355 | | - text={t('common.name')} |
356 | | - additionalText={getValues('name')} |
357 | | - /> |
358 | | - <ListItemStandard |
359 | | - text={t('common.displayName')} |
360 | | - additionalText={getValues('displayName')} |
361 | | - /> |
362 | | - <ListItemStandard |
363 | | - text={t('CreateProjectWorkspaceDialog.chargingTargetLabel')} |
364 | | - additionalText={getValues('chargingTarget')} |
365 | | - /> |
366 | | - <ListItemStandard |
367 | | - text={t('common.namespace')} |
368 | | - additionalText={`${projectName}--ws-${workspaceName}`} |
369 | | - /> |
370 | | - </List> |
371 | | - <br /> |
372 | | - <List headerText={t('common.members')}> |
373 | | - {getValues('members').map((member) => ( |
374 | | - <ListItemStandard |
375 | | - key={member.name} |
376 | | - text={member.name} |
377 | | - additionalText={member.roles[0]} |
378 | | - /> |
379 | | - ))} |
380 | | - </List> |
381 | | - <br /> |
382 | | - <List headerText={t('common.components')}> |
383 | | - {getSelectedComponents(componentsList ?? []).map( |
384 | | - (component) => ( |
385 | | - <ListItemStandard |
386 | | - key={component.name} |
387 | | - text={component.name} |
388 | | - additionalText={component.selectedVersion} |
389 | | - /> |
390 | | - ), |
391 | | - )} |
392 | | - </List> |
393 | | - </div> |
394 | | - <div> |
395 | | - <YamlViewer |
396 | | - yamlString={stringify( |
397 | | - CreateManagedControlPlane( |
398 | | - getValues('name'), |
399 | | - `${projectName}--ws-${workspaceName}`, |
400 | | - { |
401 | | - displayName: getValues('displayName'), |
402 | | - chargingTarget: getValues('chargingTarget'), |
403 | | - members: getValues('members'), |
404 | | - componentsList: componentsList ?? [], |
405 | | - }, |
406 | | - idpPrefix, |
407 | | - ), |
408 | | - )} |
409 | | - filename={`mcp_${projectName}--ws-${workspaceName}`} |
410 | | - /> |
411 | | - </div> |
412 | | - </Grid> |
| 349 | + <SummarizeStep |
| 350 | + getValues={getValues} |
| 351 | + workspaceName={workspaceName} |
| 352 | + projectName={projectName} |
| 353 | + componentsList={componentsList} |
| 354 | + /> |
413 | 355 | </WizardStep> |
414 | 356 | <WizardStep |
415 | 357 | icon="activities" |
|
0 commit comments