Skip to content

Commit

Permalink
Merge pull request #530 from yaacov/rm-old-providers-view
Browse files Browse the repository at this point in the history
Remove old version of provider views
  • Loading branch information
yaacov committed Jul 11, 2023
2 parents 423b5fc + 1c7cc0d commit 1a19254
Show file tree
Hide file tree
Showing 28 changed files with 25 additions and 5,913 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"{{groupCount}} Groups": "{{groupCount}} Groups",
"{{name}} Details": "{{name}} Details",
"{{vmDone}} of {{vmCount}} VMs migrated": "{{vmDone}} of {{vmCount}} VMs migrated",
"{resourceData.spec.type} provider <2>{resourceData?.metadata?.name}</2> will no longer be selectable as a migration source.": "{resourceData.spec.type} provider <2>{resourceData?.metadata?.name}</2> will no longer be selectable as a migration source.",
"{resourceData.spec.type} provider <2>{resourceData?.metadata?.name}</2> will no longer be selectable as a migration target.": "{resourceData.spec.type} provider <2>{resourceData?.metadata?.name}</2> will no longer be selectable as a migration target.",
"Actions": "Actions",
"Add source and target providers for the migration.": "Add source and target providers for the migration.",
"Allowed values are openshift, ovirt, vsphere, and openstack.": "Allowed values are openshift, ovirt, vsphere, and openstack.",
"Application Credential ID": "Application Credential ID",
"Application Credential Name": "Application Credential Name",
Expand All @@ -27,7 +24,6 @@
"Cannot delete migration plan": "Cannot delete migration plan",
"Cannot delete network mapping": "Cannot delete network mapping",
"Cannot delete storage mapping": "Cannot delete storage mapping",
"Cannot remove provider": "Cannot remove provider",
"Clear all filters": "Clear all filters",
"Click the update credentials button to save your changes, button is disabled until a change is detected.": "Click the update credentials button to save your changes, button is disabled until a change is detected.",
"Close": "Close",
Expand All @@ -37,7 +33,6 @@
"Connection Failed": "Connection Failed",
"Copied": "Copied",
"Copy": "Copy",
"Create a migration plan and select VMs from the source provider for migration.": "Create a migration plan and select VMs from the source provider for migration.",
"Create by using the form or manually entering YAML or JSON definitions, Provider CR stores attributes that enable MTV to connect to and interact with the source and target providers.": "Create by using the form or manually entering YAML or JSON definitions, Provider CR stores attributes that enable MTV to connect to and interact with the source and target providers.",
"Create NetworkMap": "Create NetworkMap",
"Create new provider": "Create new provider",
Expand All @@ -58,7 +53,6 @@
"Delete NetworkMap?": "Delete NetworkMap?",
"Delete Plan?": "Delete Plan?",
"Delete Provider": "Delete Provider",
"Delete Provider?": "Delete Provider?",
"Delete StorageMap?": "Delete StorageMap?",
"Deleting a migration plan does not remove temporary resources, it is recommended to <2>archive</2> the plan first before deleting it, to remove temporary resources.": "Deleting a migration plan does not remove temporary resources, it is recommended to <2>archive</2> the plan first before deleting it, to remove temporary resources.",
"Description": "Description",
Expand Down Expand Up @@ -122,15 +116,11 @@
"Manage Columns": "Manage Columns",
"managed": "managed",
"Managed": "Managed",
"Managed provider cannot be deleted": "Managed provider cannot be deleted",
"Managed provider cannot be edited": "Managed provider cannot be edited",
"Managed resource": "Managed resource",
"Manged mappings can not be deleted": "Manged mappings can not be deleted",
"Manged mappings can not be edited": "Manged mappings can not be edited",
"Map source datastores or storage domains or volume types and networks to target storage classes and networks.": "Map source datastores or storage domains or volume types and networks to target storage classes and networks.",
"Mapping graph": "Mapping graph",
"Message": "Message",
"Migrating virtualization workloads is a multi-step process:": "Migrating virtualization workloads is a multi-step process:",
"Migration network maps are used to map network interfaces between source and target virtualization providers, at least one source and one target provider must be available in order to create a migration storage map, <2>Learn more</2>.": "Migration network maps are used to map network interfaces between source and target virtualization providers, at least one source and one target provider must be available in order to create a migration storage map, <2>Learn more</2>.",
"Migration networks maps are used to map network interfaces between source and target workloads.": "Migration networks maps are used to map network interfaces between source and target workloads.",
"Migration plans are used to plan migration or virtualization workloads from source providers to target providers.": "Migration plans are used to plan migration or virtualization workloads from source providers to target providers.",
Expand All @@ -156,8 +146,6 @@
"No owner": "No owner",
"No Plans found in namespace <1>{namespace}</1>.": "No Plans found in namespace <1>{namespace}</1>.",
"No Plans found.": "No Plans found.",
"No Providers found in namespace <1>{namespace}</1>.": "No Providers found in namespace <1>{namespace}</1>.",
"No Providers found.": "No Providers found.",
"No results found": "No results found",
"No results match the filter criteria. Clear all filters and try again.": "No results match the filter criteria. Clear all filters and try again.",
"No secret": "No secret",
Expand Down Expand Up @@ -224,23 +212,19 @@
"Reveal values": "Reveal values",
"RH Virtualization engine REST API password credentials.": "RH Virtualization engine REST API password credentials.",
"RH Virtualization engine REST API user name.": "RH Virtualization engine REST API user name.",
"Run the migration plan.": "Run the migration plan.",
"Running - performing incremental data copies": "Running - performing incremental data copies",
"Running - preparing for cutover": "Running - preparing for cutover",
"Running - preparing for incremental data copies": "Running - preparing for incremental data copies",
"Running - preparing for migration": "Running - preparing for migration",
"Save": "Save",
"Secret": "Secret",
"Select a default migration network for the provider. This network will be used for migrating data to all namespaces to which it is attached.": "Select a default migration network for the provider. This network will be used for migrating data to all namespaces to which it is attached.",
"Select migration network": "Select migration network",
"Select provider type": "Select provider type",
"Selected columns will be displayed in the table.": "Selected columns will be displayed in the table.",
"Service account token": "Service account token",
"Show archived": "Show archived",
"Show managed": "Show managed",
"Skip certificate validation": "Skip certificate validation",
"source": "source",
"Source": "Source",
"Source Only": "Source Only",
"Source provider": "Source provider",
"Specify the API end point URL, for example, https://<engine_host>/ovirt-engine/api/ for RHV.": "Specify the API end point URL, for example, https://<engine_host>/ovirt-engine/api/ for RHV.",
Expand All @@ -256,8 +240,6 @@
"Storage domains": "Storage domains",
"StorageMaps": "StorageMaps",
"StorageMaps for virtualization": "StorageMaps for virtualization",
"target": "target",
"Target": "Target",
"Target and Source": "Target and Source",
"Target provider": "Target provider",
"The CA certificate is the /etc/pki/ovirt-engine/apache-ca.pem file on the Manager machine.": "The CA certificate is the /etc/pki/ovirt-engine/apache-ca.pem file on the Manager machine.",
Expand All @@ -272,8 +254,6 @@
"This plan cannot be edited because it is running must gather.": "This plan cannot be edited because it is running must gather.",
"This plan cannot be edited because the inventory data for its associated providers is not ready.": "This plan cannot be edited because the inventory data for its associated providers is not ready.",
"This plan cannot be restarted because it is running must gather service": "This plan cannot be restarted because it is running must gather service",
"This provider cannot be deleted because it has running migrations": "This provider cannot be deleted because it has running migrations",
"This provider cannot be edited because it has running migrations": "This provider cannot be edited because it has running migrations",
"This provider will be created in the default namespace, if you wish to choose another namespace please cancel, and choose a namespace from the top bar.": "This provider will be created in the default namespace, if you wish to choose another namespace please cancel, and choose a namespace from the top bar.",
"This resource is managed by <2></2> and any modifications may be overwritten. Edit the managing resource to preserve changes.": "This resource is managed by <2></2> and any modifications may be overwritten. Edit the managing resource to preserve changes.",
"To": "To",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { PROVIDERS_REFERENCE } from '@kubev2v/legacy/common/constants';
import { createK8sPath } from '@kubev2v/legacy/queries/helpers';
import { Button, Flex, FlexItem } from '@patternfly/react-core';

import { useHasSufficientProviders } from '../Providers/data';
import { useHasSufficientProviders } from '../Plans/data';

import { AddNetworkMappingButton } from './NetworkMappingsPage';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { CreatePlanButton } from '@kubev2v/legacy/Plans/components/CreatePlanBut
import { createK8sPath } from '@kubev2v/legacy/queries/helpers';
import { Button, Flex, FlexItem } from '@patternfly/react-core';

import { useHasSufficientProviders } from '../Providers/data';
import { useHasSufficientProviders } from './data';

const AutomationIcon = () => <img src={automationIcon} className="forklift-empty-state__icon" />;

Expand Down
22 changes: 22 additions & 0 deletions packages/forklift-console-plugin/src/modules/Plans/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,25 @@ export const useFlatPlans = ({ namespace, name = undefined }): [FlatPlan[], bool
// which triggers unnecessary re-renders
return useMemo(() => [merged, totalSuccess, totalError], [merged, totalSuccess, totalError]);
};

export const useHasSourceAndTargetProviders = (
namespace?: string,
): [boolean, boolean, boolean, unknown] => {
const [providers, providersLoaded, providersError] = useProviders({
namespace,
});

const hasSourceProviders = providers.some((p) => p?.spec?.type !== 'openshift');
const hasTargetProviders = providers.some((p) => p?.spec?.type === 'openshift');

return [hasSourceProviders, hasTargetProviders, providersLoaded, providersError];
};

export const useHasSufficientProviders = (namespace?: string) => {
const [hasSourceProviders, hasTargetProviders, providersLoaded, providersError] =
useHasSourceAndTargetProviders(namespace);
const hasSufficientProviders =
hasSourceProviders && hasTargetProviders && providersLoaded && !providersError;

return hasSufficientProviders;
};

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1a19254

Please sign in to comment.