Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3585 from suomiy/kubevirt.vmWizardEnhancements2
kubevirt: make VM Wizard errors more explicit
- Loading branch information
Showing
29 changed files
with
272 additions
and
96 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/create-vm-wizard-footer.scss
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,5 +1,4 @@ | ||
.kubevirt-create-vm-modal__footer-error { | ||
width: 100%; | ||
margin-bottom: 1em; | ||
align-items: center; | ||
} |
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
5 changes: 4 additions & 1 deletion
5
...lugin/src/components/create-vm-wizard/redux/initial-state/cloud-init-tab-initial-state.ts
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,11 +1,14 @@ | ||
import { CloudInitField } from '../../types'; | ||
import { InitialStepStateGetter } from './types'; | ||
|
||
export const getCloudInitInitialState = () => ({ | ||
export const getCloudInitInitialState: InitialStepStateGetter = () => ({ | ||
value: { | ||
[CloudInitField.IS_FORM]: { | ||
value: true, | ||
}, | ||
}, | ||
error: null, | ||
isValid: true, | ||
hasAllRequiredFilled: true, | ||
isLocked: false, | ||
}); |
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
3 changes: 2 additions & 1 deletion
3
...gin/src/components/create-vm-wizard/redux/initial-state/providers/vmware-initial-state.ts
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
7 changes: 6 additions & 1 deletion
7
...rt-plugin/src/components/create-vm-wizard/redux/initial-state/result-tab-initial-state.ts
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,9 +1,14 @@ | ||
export const getResultInitialState = () => ({ | ||
import { InitialStepStateGetter } from './types'; | ||
|
||
export const getResultInitialState: InitialStepStateGetter = () => ({ | ||
value: { | ||
mainError: null, | ||
errors: [], | ||
requestResults: [], | ||
}, | ||
error: null, | ||
isLocked: false, | ||
hasAllRequiredFilled: null, | ||
isValid: null, | ||
isPending: false, | ||
}); |
6 changes: 5 additions & 1 deletion
6
...rt-plugin/src/components/create-vm-wizard/redux/initial-state/review-tab-initial-state.ts
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,5 +1,9 @@ | ||
export const getReviewInitialState = () => ({ | ||
import { InitialStepStateGetter } from './types'; | ||
|
||
export const getReviewInitialState: InitialStepStateGetter = () => ({ | ||
value: {}, | ||
error: null, | ||
isValid: true, | ||
hasAllRequiredFilled: true, | ||
isLocked: false, | ||
}); |
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
32 changes: 32 additions & 0 deletions
32
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/redux/initial-state/types.ts
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { CommonData, VMImportProvider, VMSettingsField, VMWareProviderField } from '../../types'; | ||
|
||
export type StepState = { | ||
value: any; | ||
error: string; | ||
isValid: boolean; | ||
isLocked: boolean; | ||
hasAllRequiredFilled: boolean; | ||
}; | ||
|
||
export type InitialStepStateGetter = (data: CommonData) => StepState; | ||
|
||
export type FieldMultiFlag = { [k: string]: boolean }; | ||
|
||
type SettingsField = { | ||
key?: VMSettingsField | VMWareProviderField; | ||
value?: any; | ||
isHidden?: FieldMultiFlag; | ||
isRequired?: FieldMultiFlag; | ||
skipValidation?: boolean; | ||
}; | ||
|
||
export type VMwareSettings = { [key in VMWareProviderField]: SettingsField } & { | ||
[VMWareProviderField.V2V_NAME]: string; | ||
[VMWareProviderField.NEW_VCENTER_NAME]: string; | ||
}; | ||
|
||
export type VMSettings = { [key in VMSettingsField]: SettingsField } & { | ||
[VMSettingsField.PROVIDERS_DATA]: { | ||
[VMImportProvider.VMWARE]?: VMwareSettings; | ||
}; | ||
}; |
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
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
Oops, something went wrong.