Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNV-39682: Add tooltip cant create vm #1962

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions locales/en/plugin__kubevirt-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"Are you sure you want to leave this page?": "Are you sure you want to leave this page?",
"Are you sure you want to restore {{vmName}} from snapshot {{snapshotName}}?<6><0>Note: </0>Data from the last snapshot taken will be lost. To prevent losing current data, take another snapshot before restoring from this one.</6>": "Are you sure you want to restore {{vmName}} from snapshot {{snapshotName}}?<6><0>Note: </0>Data from the last snapshot taken will be lost. To prevent losing current data, take another snapshot before restoring from this one.</6>",
"As new versions of a DataSource become available older versions will be replaced": "As new versions of a DataSource become available older versions will be replaced",
"Ask your cluster administrator for access permissions.": "Ask your cluster administrator for access permissions.",
"Assigns an external IP address to the VirtualMachine. This option requires a LoadBalancer Service backend": "Assigns an external IP address to the VirtualMachine. This option requires a LoadBalancer Service backend",
"Attach a virtual function network device to the VirtualMachine for high performance": "Attach a virtual function network device to the VirtualMachine for high performance",
"Attach existing": "Attach existing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
SplitItem,
Stack,
StackItem,
Tooltip,
} from '@patternfly/react-core';

import { AUTOMATIC_UPDATE_FEATURE_NAME } from '../../../../clusteroverview/SettingsTab/ClusterTab/components/GuestManagmentSection/AutomaticSubscriptionRHELGuests/utils/constants';
Expand Down Expand Up @@ -176,6 +177,9 @@ const CreateVMFooter: FC = () => {
}
};

const isDisabled =
isSubmitting || isEmpty(selectedBootableVolume) || !canCreateVM || !hasNameAndInstanceType;

return (
<footer className="create-vm-instance-type-footer">
<Stack hasGutter>
Expand All @@ -195,19 +199,23 @@ const CreateVMFooter: FC = () => {
<StackItem>
<Split hasGutter>
<SplitItem>
<Button
isDisabled={
isSubmitting ||
isEmpty(selectedBootableVolume) ||
!canCreateVM ||
!hasNameAndInstanceType
<Tooltip
content={
<Stack className="cpu-helper-text__body-content">
{t('Ask your cluster administrator for access permissions.')}
</Stack>
}
isLoading={isSubmitting}
onClick={handleSubmit}
variant={ButtonVariant.primary}
hidden={!isDisabled}
>
{t('Create VirtualMachine')}
</Button>
<Button
isAriaDisabled={isDisabled}
isLoading={isSubmitting}
onClick={handleSubmit}
variant={ButtonVariant.primary}
>
{t('Create VirtualMachine')}
</Button>
</Tooltip>
</SplitItem>
<SplitItem>
<Button
Expand Down
Loading