-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
46 additions
and
76 deletions.
There are no files selected for viewing
43 changes: 25 additions & 18 deletions
43
...packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/advanced-tab.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 |
---|---|---|
@@ -1,36 +1,43 @@ | ||
import * as React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { Grid, GridItem } from '@patternfly/react-core'; | ||
import { iGetVmSettings } from '../../selectors/immutable/vm-settings'; | ||
import { FormFieldReviewMemoRow } from '../../form/form-field-review-row'; | ||
import { VMSettingsField } from '../../types'; | ||
import { getField } from './utils'; | ||
import { FormFieldType } from '../../form/form-field'; | ||
import { Grid, GridItem, Title } from '@patternfly/react-core'; | ||
import { VMWizardStorage } from '../../types'; | ||
import { getStorages } from '../../selectors/selectors'; | ||
import { VolumeWrapper } from '../../../../k8s/wrapper/vm/volume-wrapper'; | ||
import { VolumeType } from '../../../../constants/vm/storage'; | ||
import {getBooleanAsEnabledValue} from '../../../../utils/strings'; | ||
|
||
import './review-tab.scss'; | ||
|
||
const AdvancedReviewConnected: React.FC<AdvancedReviewConnectedProps> = (props) => { | ||
const { vmSettings } = props; | ||
const { storages } = props; | ||
|
||
const cloudInitEnabledValue = getBooleanAsEnabledValue( | ||
storages.filter( | ||
(storage) => new VolumeWrapper(storage.volume).getType() === VolumeType.CLOUD_INIT_NO_CLOUD, | ||
).length > 0, | ||
); | ||
|
||
// TODO Fill with actual values | ||
return ( | ||
<Grid> | ||
<GridItem span={2}> | ||
{' '} | ||
<FormFieldReviewMemoRow | ||
key={VMSettingsField.PROVISION_SOURCE_TYPE} | ||
field={getField(VMSettingsField.PROVISION_SOURCE_TYPE, vmSettings)} | ||
fieldType={FormFieldType.SELECT} | ||
/> | ||
<Grid className="kubevirt-create-vm-modal__review-tab-section-container"> | ||
<GridItem span={1}> | ||
<Title headingLevel="h4" size="sm"> | ||
Cloud Init | ||
</Title> | ||
</GridItem> | ||
<GridItem span={11}>{cloudInitEnabledValue}</GridItem> | ||
</Grid> | ||
); | ||
}; | ||
|
||
type AdvancedReviewConnectedProps = { | ||
vmSettings: any; | ||
storages: VMWizardStorage[]; | ||
// vmSettings: any; | ||
}; | ||
|
||
const stateToProps = (state, { wizardReduxID }) => ({ | ||
vmSettings: iGetVmSettings(state, wizardReduxID), | ||
storages: getStorages(state, wizardReduxID), | ||
// vmSettings: iGetVmSettings(state, wizardReduxID), | ||
}); | ||
|
||
export const AdvancedReviewTab = connect(stateToProps)(AdvancedReviewConnected); |
3 changes: 0 additions & 3 deletions
3
...packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.scss
This file was deleted.
Oops, something went wrong.
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
14 changes: 0 additions & 14 deletions
14
...packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/review-list.scss
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/review-list.tsx
This file was deleted.
Oops, something went wrong.
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
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