diff --git a/config.ts b/config.ts index 7ebf8a53..f8096148 100644 --- a/config.ts +++ b/config.ts @@ -176,7 +176,7 @@ const conf: Config = { ], // The number of items per page applicable to main lists: - // replicas, migrations, endpoints, users etc. + // transfers, deployments, endpoints, users etc. mainListItemsPerPage: 20, maxMinionPoolEventsPerPage: 50, diff --git a/src/@types/Execution.ts b/src/@types/Execution.ts index 47283734..be6e4de8 100644 --- a/src/@types/Execution.ts +++ b/src/@types/Execution.ts @@ -22,10 +22,10 @@ export type Execution = { updated_at: string; deleted_at?: string; type: - | "replica_execution" - | "replica_disks_delete" - | "replica_deploy" - | "replica_update"; + | "transfer_execution" + | "transfer_disks_delete" + | "transfer_deploy" + | "transfer_update"; }; export type ExecutionTasks = Execution & { diff --git a/src/@types/MainItem.ts b/src/@types/MainItem.ts index 030718d3..bd7c442f 100644 --- a/src/@types/MainItem.ts +++ b/src/@types/MainItem.ts @@ -83,7 +83,7 @@ type BaseItem = { destination_environment: { [prop: string]: any }; source_environment: { [prop: string]: any }; transfer_result: { [prop: string]: Instance } | null; - replication_count?: number; + // replication_count?: number; storage_mappings?: StorageMapping | null; network_map?: TransferNetworkMap; last_execution_status: string; @@ -92,9 +92,9 @@ type BaseItem = { user_scripts?: UserScriptData; }; -export type ReplicaItem = BaseItem & { - type: "replica"; - scenario?: string; +export type TransferItem = BaseItem & { + type: "transfer"; + scenario: string; }; export type UserScriptData = { @@ -107,20 +107,10 @@ export type UserScriptData = { }; }; -export type MigrationItem = BaseItem & { - type: "migration"; - replica_id?: string; -}; - -export type MigrationItemOptions = MigrationItem & { - skip_os_morphing: boolean; - shutdown_instances: boolean; -}; - export type DeploymentItem = BaseItem & { type: "deployment"; - replica_id: string; - replica_scenario: string; + transfer_id: string; + transfer_scenario: string; }; export type DeploymentItemOptions = DeploymentItem & { @@ -128,23 +118,19 @@ export type DeploymentItemOptions = DeploymentItem & { shutdown_instances: boolean; }; -export type TransferItem = ReplicaItem | DeploymentItem; +export type ActionItem = TransferItem | DeploymentItem; -export type ReplicaItemDetails = ReplicaItem & { +export type TransferItemDetails = TransferItem & { executions: Execution[]; }; -export type MigrationItemDetails = MigrationItem & { - tasks: Task[]; -}; - export type DeploymentItemDetails = DeploymentItem & { tasks: Task[]; }; -export type TransferItemDetails = ReplicaItemDetails | DeploymentItemDetails; +export type ActionItemDetails = TransferItemDetails | DeploymentItemDetails; -export const getTransferItemTitle = (item: TransferItem | null) => { +export const getTransferItemTitle = (item: ActionItem | null) => { if (!item) { return null; } diff --git a/src/@types/Schedule.ts b/src/@types/Schedule.ts index d2010983..213bdc8f 100644 --- a/src/@types/Schedule.ts +++ b/src/@types/Schedule.ts @@ -31,6 +31,6 @@ export type Schedule = { }; export type ScheduleBulkItem = { - replicaId: string; + transferId: string; schedules: Schedule[]; }; diff --git a/src/components/App.tsx b/src/components/App.tsx index f71d7761..3f60eb92 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -21,9 +21,9 @@ import { observe } from "mobx"; import Fonts from "@src/components/ui/Fonts"; import NotificationsModule from "@src/components/modules/NotificationsModule"; import LoginPage from "@src/components/smart/LoginPage"; -import ReplicasPage from "@src/components/smart/ReplicasPage"; +import TransfersPage from "@src/components/smart/TransfersPage/TransfersPage"; import MessagePage from "@src/components/smart/MessagePage"; -import ReplicaDetailsPage from "@src/components/smart/ReplicaDetailsPage"; +import TransferDetailsPage from "@src/components/smart/TransferDetailsPage/TransferDetailsPage"; import DeploymentsPage from "@src/components/smart/DeploymentsPage"; import DeploymentDetailsPage from "@src/components/smart/DeploymentDetailsPage"; import MetalHubServersPage from "@src/components/smart/MetalHubServersPage"; @@ -211,9 +211,9 @@ class App extends React.Component, State> { } {renderRoute("/dashboard", DashboardPage)} - {renderRoute("/transfers", ReplicasPage, true)} - {renderRoute("/transfers/:id", ReplicaDetailsPage, true)} - {renderRoute("/transfers/:id/:page", ReplicaDetailsPage)} + {renderRoute("/transfers", TransfersPage, true)} + {renderRoute("/transfers/:id", TransferDetailsPage, true)} + {renderRoute("/transfers/:id/:page", TransferDetailsPage)} {renderRoute("/deployments", DeploymentsPage, true)} {renderRoute("/deployments/:id", DeploymentDetailsPage, true)} {renderRoute("/deployments/:id/:page", DeploymentDetailsPage)} diff --git a/src/components/modules/DashboardModule/DashboardActivity/DashboardActivity.tsx b/src/components/modules/DashboardModule/DashboardActivity/DashboardActivity.tsx index 155aa78f..e50b638a 100644 --- a/src/components/modules/DashboardModule/DashboardActivity/DashboardActivity.tsx +++ b/src/components/modules/DashboardModule/DashboardActivity/DashboardActivity.tsx @@ -23,7 +23,7 @@ import Button from "@src/components/ui/Button"; import { InfoColumn, MainItemInfo, - ItemReplicaBadge, + ItemTransferBadge, ItemTitle, ItemDescription, } from "@src/components/ui/Dropdowns/NotificationDropdown"; @@ -31,7 +31,7 @@ import { import type { NotificationItemData } from "@src/@types/NotificationItem"; import { ThemePalette, ThemeProps } from "@src/components/Theme"; -import replicaImage from "./images/replica.svg"; +import transferImage from "./images/transfer.svg"; const Wrapper = styled.div` flex-grow: 1; @@ -80,9 +80,9 @@ const NoItems = styled.div` align-items: center; width: 100%; `; -const ReplicaImage = styled.div` +const TransferImage = styled.div` ${ThemeProps.exactSize("148px")} - background: url('${replicaImage}') center no-repeat; + background: url('${transferImage}') center no-repeat; `; const Message = styled.div` text-align: center; @@ -105,12 +105,12 @@ class DashboardActivity extends React.Component { .filter((_, i) => i < (this.props.large ? 10 : 5)) .map((item, i) => { const actionHref = - item.type === "replica" + item.type === "transfer" ? "transfers" : "deployments" const executionsHref = item.status === "RUNNING" - ? item.type === "replica" + ? item.type === "transfer" ? "/executions" : item.type === "deployment" ? "/tasks" @@ -129,9 +129,9 @@ class DashboardActivity extends React.Component { - - {item.type === "replica" ? "TR" : "DE"} - + + {item.type === "transfer" ? "TR" : "DE"} + {item.name} {item.description} @@ -146,7 +146,7 @@ class DashboardActivity extends React.Component { renderNoItems() { return ( - + There is no recent activity
diff --git a/src/components/modules/DashboardModule/DashboardActivity/images/replica.svg b/src/components/modules/DashboardModule/DashboardActivity/images/transfer.svg similarity index 100% rename from src/components/modules/DashboardModule/DashboardActivity/images/replica.svg rename to src/components/modules/DashboardModule/DashboardActivity/images/transfer.svg diff --git a/src/components/modules/DashboardModule/DashboardContent/DashboardContent.spec.tsx b/src/components/modules/DashboardModule/DashboardContent/DashboardContent.spec.tsx index 5d0cee24..2af5e887 100644 --- a/src/components/modules/DashboardModule/DashboardContent/DashboardContent.spec.tsx +++ b/src/components/modules/DashboardModule/DashboardContent/DashboardContent.spec.tsx @@ -35,11 +35,11 @@ describe("DashboardContent", () => { beforeEach(() => { defaultProps = { - replicas: [], + transfers: [], migrations: [], endpoints: [], projects: [], - replicasLoading: false, + transfersLoading: false, migrationsLoading: false, endpointsLoading: false, usersLoading: false, @@ -52,7 +52,7 @@ describe("DashboardContent", () => { licenceError: null, notificationItems: [], isAdmin: false, - onNewReplicaClick: jest.fn(), + onNewTransferClick: jest.fn(), onNewEndpointClick: jest.fn(), onAddLicenceClick: jest.fn(), }; diff --git a/src/components/modules/DashboardModule/DashboardContent/DashboardContent.tsx b/src/components/modules/DashboardModule/DashboardContent/DashboardContent.tsx index 67607404..506edb33 100644 --- a/src/components/modules/DashboardModule/DashboardContent/DashboardContent.tsx +++ b/src/components/modules/DashboardModule/DashboardContent/DashboardContent.tsx @@ -30,7 +30,7 @@ import type { Project } from "@src/@types/Project"; import type { User } from "@src/@types/User"; import type { Licence, LicenceServerStatus } from "@src/@types/Licence"; import type { NotificationItemData } from "@src/@types/NotificationItem"; -import { ReplicaItem, DeploymentItem } from "@src/@types/MainItem"; +import { TransferItem, DeploymentItem } from "@src/@types/MainItem"; const MIDDLE_WIDTHS = ["264px", "264px", "264px"]; @@ -52,11 +52,11 @@ const MiddleMobileLayout = styled.div` `; type Props = { - replicas: ReplicaItem[]; + transfers: TransferItem[]; deployments: DeploymentItem[]; endpoints: Endpoint[]; projects: Project[]; - replicasLoading: boolean; + transfersLoading: boolean; deploymentsLoading: boolean; endpointsLoading: boolean; usersLoading: boolean; @@ -69,7 +69,7 @@ type Props = { licenceError: string | null; notificationItems: NotificationItemData[]; isAdmin: boolean; - onNewReplicaClick: () => void; + onNewTransferClick: () => void; onNewEndpointClick: () => void; onAddLicenceClick: () => void; }; @@ -122,14 +122,14 @@ class DashboardContent extends React.Component { width: MIDDLE_WIDTHS[0], } } - onNewClick={this.props.onNewReplicaClick} + onNewClick={this.props.onNewTransferClick} />, { } getReplicas() { - return this.props.replicas.filter( - (r: ReplicaItem) => r.scenario === "replica"); + return this.props.transfers.filter( + (r: TransferItem) => r.scenario === "replica"); } getLiveMigrations() { - return this.props.replicas.filter( - (r: ReplicaItem) => r.scenario === "live_migration"); + return this.props.transfers.filter( + (r: TransferItem) => r.scenario === "live_migration"); } render() { @@ -191,13 +191,13 @@ class DashboardContent extends React.Component { value: this.getReplicas().length, color: ThemePalette.alert, link: "/transfers", - loading: this.props.replicasLoading, + loading: this.props.transfersLoading, }, { label: "Migrations", value: this.getLiveMigrations().length, link: "/transfers", - loading: this.props.replicasLoading, + loading: this.props.transfersLoading, }, { label: "Endpoints", @@ -234,7 +234,7 @@ class DashboardContent extends React.Component { ); diff --git a/src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.spec.tsx b/src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.spec.tsx index ee2d869e..2ea33c1f 100644 --- a/src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.spec.tsx +++ b/src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.spec.tsx @@ -15,7 +15,7 @@ along with this program. If not, see . import { DateTime } from "luxon"; import React from "react"; -import { MigrationItem, ReplicaItem } from "@src/@types/MainItem"; +import { MigrationItem, TransferItem } from "@src/@types/MainItem"; import { render } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import TestUtils from "@tests/TestUtils"; @@ -23,7 +23,7 @@ import TestUtils from "@tests/TestUtils"; import DashboardExecutions from "./DashboardExecutions"; type BuildType = T extends "replica" - ? ReplicaItem + ? TransferItem : MigrationItem; const buildItem = ( diff --git a/src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.tsx b/src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.tsx index 6df9a835..b1b864fe 100644 --- a/src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.tsx +++ b/src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.tsx @@ -17,7 +17,7 @@ import { observer } from "mobx-react"; import * as React from "react"; import styled from "styled-components"; -import { MigrationItem, ReplicaItem, TransferItem } from "@src/@types/MainItem"; +import { TransferItem, ActionItem } from "@src/@types/MainItem"; import DashboardBarChart from "@src/components/modules/DashboardModule/DashboardBarChart"; import { ThemePalette, ThemeProps } from "@src/components/Theme"; import DropdownLink from "@src/components/ui/Dropdowns/DropdownLink"; @@ -129,8 +129,8 @@ const EmptyBackgroundImage = styled.div` type Props = { // eslint-disable-next-line react/no-unused-prop-types - replicas: ReplicaItem[]; - migrations: ReplicaItem[]; + replicas: TransferItem[]; + migrations: TransferItem[]; loading: boolean; }; type GroupedData = { @@ -169,7 +169,7 @@ class DashboardExecutions extends React.Component { } groupCreations(props: Props) { - let creations: ReplicaItem[] = [...props.replicas, ...props.migrations]; + let creations: TransferItem[] = [...props.replicas, ...props.migrations]; const periodUnit: any = this.state.selectedPeriod.split("-")[1]; const periodValue: any = Number(this.state.selectedPeriod.split("-")[0]); @@ -187,7 +187,7 @@ class DashboardExecutions extends React.Component { this.groupByPeriod(creations, periodUnit); } - groupByPeriod(transferItems: ReplicaItem[], periodUnit: string) { + groupByPeriod(transferItems: TransferItem[], periodUnit: string) { const groupedData: GroupedData[] = []; const periods: { [period: string]: { replicas: number; migrations: number }; diff --git a/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx b/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx index d12c8032..33715081 100644 --- a/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx +++ b/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx @@ -15,7 +15,7 @@ along with this program. If not, see . import React from "react"; import { Endpoint } from "@src/@types/Endpoint"; -import { MigrationItem, ReplicaItem } from "@src/@types/MainItem"; +import { MigrationItem, TransferItem } from "@src/@types/MainItem"; import { fireEvent, render } from "@testing-library/react"; import TestUtils from "@tests/TestUtils"; @@ -24,7 +24,7 @@ import DashboardTopEndpoints from "./DashboardTopEndpoints"; jest.mock("react-router-dom", () => ({ Link: "a" })); type BuildType = T extends "replica" - ? ReplicaItem + ? TransferItem : MigrationItem; const buildItem = ( @@ -64,7 +64,7 @@ const buildEndpoint = (id: string): Endpoint => ({ connection_info: {}, }); -const replicas: DashboardTopEndpoints["props"]["replicas"] = [ +const replicas: DashboardTopEndpoints["props"]["transfers"] = [ buildItem("replica", "a", "b"), buildItem("replica", "a", "b"), buildItem("replica", "c", "d"), @@ -86,7 +86,7 @@ const endpoints: DashboardTopEndpoints["props"]["endpoints"] = [ describe("DashboardTopEndpoints", () => { const defaultProps: DashboardTopEndpoints["props"] = { - replicas, + transfers: replicas, migrations, endpoints, style: {}, @@ -98,7 +98,7 @@ describe("DashboardTopEndpoints", () => { render( { render( @@ -125,7 +125,7 @@ describe("DashboardTopEndpoints", () => { diff --git a/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx b/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx index d2d6f44c..bf3d35b6 100644 --- a/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx +++ b/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx @@ -26,7 +26,7 @@ import { ThemePalette, ThemeProps } from "@src/components/Theme"; import type { Endpoint } from "@src/@types/Endpoint"; -import { ReplicaItem } from "@src/@types/MainItem"; +import { TransferItem } from "@src/@types/MainItem"; import endpointImage from "./images/endpoint.svg"; const Wrapper = styled.div` @@ -131,12 +131,12 @@ const Message = styled.div` type GroupedEndpoint = { endpoint: Endpoint; replicasCount: number; - deploymentsCount: number; + migrationsCount: number; value: number; }; type Props = { // eslint-disable-next-line react/no-unused-prop-types - replicas: ReplicaItem[]; + transfers: TransferItem[]; // eslint-disable-next-line react/no-unused-prop-types endpoints: Endpoint[]; style: React.CSSProperties; @@ -176,7 +176,7 @@ class DashboardTopEndpoints extends React.Component { calculateGroupedEndpoints(props: Props) { const groupedEndpoints: GroupedEndpoint[] = []; - const count = (mainItems: ReplicaItem[], endpointId: string, scenario: string) => + const count = (mainItems: TransferItem[], endpointId: string, scenario: string) => mainItems.filter( r => r.scenario === scenario && ( @@ -185,13 +185,13 @@ class DashboardTopEndpoints extends React.Component { ).length; props.endpoints.forEach(endpoint => { - const replicasCount = count(props.replicas, endpoint.id, "replica"); - const deploymentsCount = count(props.replicas, endpoint.id, "live_migration"); + const replicasCount = count(props.transfers, endpoint.id, "replica"); + const migrationsCount = count(props.transfers, endpoint.id, "live_migration"); groupedEndpoints.push({ endpoint, - replicasCount, - deploymentsCount, - value: replicasCount + deploymentsCount, + replicasCount: replicasCount, + migrationsCount: migrationsCount, + value: replicasCount + migrationsCount, }); }); this.setState({ groupedEndpoints }); @@ -262,7 +262,7 @@ class DashboardTopEndpoints extends React.Component { {groupedEndpoint.replicasCount} Replicas - {groupedEndpoint.deploymentsCount} Deployments + {groupedEndpoint.migrationsCount} Migrations {groupedEndpoint.value} Total diff --git a/src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx b/src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx index 5bacdbdd..3b10ee8f 100644 --- a/src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx +++ b/src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx @@ -20,7 +20,7 @@ import styled from "styled-components"; import { Field as FieldType } from "@src/@types/Field"; import { getTransferItemTitle, - ReplicaItem, + TransferItem, } from "@src/@types/MainItem"; import { Region } from "@src/@types/Region"; import EndpointLogos from "@src/components/modules/EndpointModule/EndpointLogos"; @@ -100,7 +100,7 @@ type Props = { regions: Region[]; connectionInfo: Endpoint["connection_info"] | null; loading: boolean; - replicas: ReplicaItem[], + transfers: TransferItem[], connectionInfoSchema: FieldType[]; onDeleteClick: () => void; onValidateClick: () => void; @@ -225,7 +225,7 @@ class EndpointDetailsContent extends React.Component { ); } - renderUsage(items: ReplicaItem[]) { + renderUsage(items: TransferItem[]) { return ( {items.map(item => ( @@ -288,8 +288,8 @@ class EndpointDetailsContent extends React.Component { )} - - {this.props.replicas.length > 0 ? this.renderUsage(this.props.replicas) : -} + + {this.props.transfers.length > 0 ? this.renderUsage(this.props.transfers) : -} {!this.props.connectionInfo ? this.renderConnectionInfoLoading() diff --git a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.spec.tsx b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.spec.tsx index 6c325f2b..15adefdd 100644 --- a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.spec.tsx +++ b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.spec.tsx @@ -44,7 +44,7 @@ describe("MinionPoolDetailsContent", () => { defaultProps = { item: MINION_POOL_DETAILS_MOCK, itemId: "minion-pool-id", - replicas: [REPLICA_MOCK], + transfers: [REPLICA_MOCK], migrations: [], endpoints: [OPENSTACK_ENDPOINT_MOCK], schema: [ diff --git a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx index 9655f9ac..36d9c096 100644 --- a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx +++ b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx @@ -20,7 +20,7 @@ import Button from "@src/components/ui/Button"; import DetailsNavigation from "@src/components/modules/NavigationModule/DetailsNavigation"; import type { Endpoint } from "@src/@types/Endpoint"; import type { Field } from "@src/@types/Field"; -import { ReplicaItem, DeploymentItem } from "@src/@types/MainItem"; +import { TransferItem, DeploymentItem } from "@src/@types/MainItem"; import { MinionPoolDetails } from "@src/@types/MinionPool"; import StatusImage from "@src/components/ui/StatusComponents/StatusImage"; import { ThemeProps } from "@src/components/Theme"; @@ -75,7 +75,7 @@ const NavigationItems = [ type Props = { item?: MinionPoolDetails | null; itemId: string; - replicas: ReplicaItem[]; + transfers: TransferItem[]; deployments: DeploymentItem[]; endpoints: Endpoint[]; schema: Field[]; @@ -144,7 +144,7 @@ class MinionPoolDetailsContent extends React.Component { return ( ); @@ -166,7 +166,7 @@ class MinionPoolDetailsContent extends React.Component { return ( { beforeEach(() => { defaultProps = { item: MINION_POOL_MOCK, - replicas: [REPLICA_MOCK], + transfers: [REPLICA_MOCK], migrations: [MIGRATION_MOCK], }; }); diff --git a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx index b80e60fb..54234f0d 100644 --- a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx +++ b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx @@ -17,12 +17,12 @@ import { Collapse } from "react-collapse"; import { Link } from "react-router-dom"; import styled, { createGlobalStyle, css } from "styled-components"; -import { DeploymentItem, ReplicaItem, TransferItem } from "@src/@types/MainItem"; +import { DeploymentItem, TransferItem, ActionItem } from "@src/@types/MainItem"; import { MinionMachine, MinionPool } from "@src/@types/MinionPool"; import { ThemePalette, ThemeProps } from "@src/components/Theme"; import Arrow from "@src/components/ui/Arrow"; import DropdownLink from "@src/components/ui/Dropdowns/DropdownLink"; -import { ItemReplicaBadge } from "@src/components/ui/Dropdowns/NotificationDropdown"; +import { ItemTransferBadge } from "@src/components/ui/Dropdowns/NotificationDropdown"; import StatusPill from "@src/components/ui/StatusComponents/StatusPill"; import DateUtils from "@src/utils/DateUtils"; @@ -144,7 +144,7 @@ const ValueLink = styled(Link)` type FilterType = "all" | "allocated" | "not-allocated"; type Props = { item?: MinionPool | null; - replicas: ReplicaItem[]; + transfers: TransferItem[]; deployments: DeploymentItem[]; }; type State = { @@ -278,10 +278,10 @@ class MinionPoolMachines extends React.Component { return ( {this.filteredMachines.map(machine => { - const findTransferItem = (transferItems: TransferItem[]) => + const findTransferItem = (transferItems: ActionItem[]) => transferItems.find(i => i.id === machine.allocated_action); const allocatedAction = machine.allocated_action - ? findTransferItem(this.props.replicas) || + ? findTransferItem(this.props.transfers) || findTransferItem(this.props.deployments) : null; return ( @@ -329,11 +329,11 @@ class MinionPoolMachines extends React.Component { Allocated Action: {allocatedAction ? ( <> - - {allocatedAction.type === "replica" ? "TR" : "DE"} - + + {allocatedAction.type === "transfer" ? "TR" : "DE"} + {allocatedAction.instances[0]} diff --git a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.spec.tsx b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.spec.tsx index 9b71a09e..260f33f3 100644 --- a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.spec.tsx +++ b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.spec.tsx @@ -35,7 +35,7 @@ describe("MinionPoolMainDetails", () => { beforeEach(() => { defaultProps = { item: MINION_POOL_MOCK, - replicas: [REPLICA_MOCK], + transfers: [REPLICA_MOCK], migrations: [MIGRATION_MOCK], schema: [], schemaLoading: false, diff --git a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx index 76d2aa8f..1d658e7c 100644 --- a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx +++ b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx @@ -18,7 +18,7 @@ import { Link } from "react-router-dom"; import styled, { css } from "styled-components"; import fieldHelper from "@src/@types/Field"; -import { DeploymentItem, ReplicaItem, TransferItem } from "@src/@types/MainItem"; +import { DeploymentItem, TransferItem, ActionItem } from "@src/@types/MainItem"; import { MinionPool } from "@src/@types/MinionPool"; import EndpointLogos from "@src/components/modules/EndpointModule/EndpointLogos"; import { ThemePalette, ThemeProps } from "@src/components/Theme"; @@ -101,7 +101,7 @@ const PropertyValue = styled.div` type Props = { item?: MinionPool | null; - replicas: ReplicaItem[]; + transfers: TransferItem[]; deployments: DeploymentItem[]; schema: FieldType[]; schemaLoading: boolean; @@ -235,10 +235,10 @@ class MinionPoolMainDetails extends React.Component { ); } - renderUsage(items: TransferItem[]) { + renderUsage(items: ActionItem[]) { return items.map(item => { const actionHref = - item.type === "replica" + item.type === "transfer" ? "transfers" : "deployments" return (
@@ -267,7 +267,7 @@ class MinionPoolMainDetails extends React.Component { : []; }; - const usage: TransferItem[] = this.props.replicas.concat( + const usage: ActionItem[] = this.props.transfers.concat( this.props.deployments as any[] ); diff --git a/src/components/modules/NavigationModule/Navigation/Navigation.tsx b/src/components/modules/NavigationModule/Navigation/Navigation.tsx index 6f3862cf..ca23a271 100644 --- a/src/components/modules/NavigationModule/Navigation/Navigation.tsx +++ b/src/components/modules/NavigationModule/Navigation/Navigation.tsx @@ -29,7 +29,7 @@ import cbsImage from "./images/cbsl-logo.svg"; import cbsImageSmall from "./images/cbsl-logo-small.svg"; import tinyLogo from "./images/logo-small.svg"; -import replicaImage from "./images/replica-menu.svg"; +import transferImage from "./images/transfer-menu.svg"; import endpointImage from "./images/endpoint-menu.svg"; import planningImage from "./images/planning-menu.svg"; import projectImage from "./images/project-menu.svg"; @@ -179,7 +179,7 @@ const SmallMenuItemBullet = styled.div` border-radius: 50%; position: absolute; left: -12px; - background: ${props => (props.bullet === "replica" ? "#E62565" : "#0044CA")}; + background: ${props => (props.bullet === "transfer" ? "#E62565" : "#0044CA")}; `; const MenuImage = styled.div` @@ -407,12 +407,12 @@ class Navigation extends React.Component { style = { width: "19px", height: "19px" }; break; case "transfers": - bullet = "replica"; - menuImage = replicaImage; + bullet = "transfer"; + menuImage = transferImage; break; case "deployments": bullet = "deployment"; - menuImage = replicaImage; + menuImage = transferImage; break; case "endpoints": menuImage = endpointImage; diff --git a/src/components/modules/NavigationModule/Navigation/images/replica-menu.svg b/src/components/modules/NavigationModule/Navigation/images/transfer-menu.svg similarity index 100% rename from src/components/modules/NavigationModule/Navigation/images/replica-menu.svg rename to src/components/modules/NavigationModule/Navigation/images/transfer-menu.svg diff --git a/src/components/modules/TransferModule/DeleteReplicaModal/package.json b/src/components/modules/TransferModule/DeleteReplicaModal/package.json deleted file mode 100644 index e9ade791..00000000 --- a/src/components/modules/TransferModule/DeleteReplicaModal/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "DeleteReplicaModal", - "version": "0.0.0", - "private": true, - "main": "./DeleteReplicaModal.tsx" -} diff --git a/src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.spec.tsx b/src/components/modules/TransferModule/DeleteTransferModal/DeleteReplicaModal.spec.tsx similarity index 78% rename from src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.spec.tsx rename to src/components/modules/TransferModule/DeleteTransferModal/DeleteReplicaModal.spec.tsx index eb5348de..1c4ef29e 100644 --- a/src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.spec.tsx +++ b/src/components/modules/TransferModule/DeleteTransferModal/DeleteReplicaModal.spec.tsx @@ -17,27 +17,27 @@ import React from "react"; import { render } from "@testing-library/react"; import TestUtils from "@tests/TestUtils"; -import DeleteReplicaModal from "./"; +import DeleteTransferModal from "./DeleteTransferModal"; describe("DeleteReplicaModal", () => { - let defaultProps: DeleteReplicaModal["props"]; + let defaultProps: DeleteTransferModal["props"]; beforeEach(() => { defaultProps = { hasDisks: false, - onDeleteReplica: jest.fn(), + onDeleteTransfer: jest.fn(), onDeleteDisks: jest.fn(), onRequestClose: jest.fn(), }; }); it("renders without crashing", () => { - const { getByText } = render(); + const { getByText } = render(); expect(getByText("Delete Replica")).toBeTruthy(); }); it("renders with disks", () => { - render(); + render(); expect( TestUtils.select("DeleteReplicaModal__ExtraMessage")?.textContent ).toContain("has been executed at least once"); @@ -45,7 +45,7 @@ describe("DeleteReplicaModal", () => { it("is multiple replica selection with disks", () => { render( - + ); expect( TestUtils.select("DeleteReplicaModal__ExtraMessage")?.textContent @@ -53,7 +53,7 @@ describe("DeleteReplicaModal", () => { }); it("renders loading", () => { - render(); + render(); expect(TestUtils.select("DeleteReplicaModal__Loading")).toBeTruthy(); }); }); diff --git a/src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.tsx b/src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal.tsx similarity index 90% rename from src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.tsx rename to src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal.tsx index 73034e26..e59068e0 100644 --- a/src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.tsx +++ b/src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal.tsx @@ -71,18 +71,18 @@ const LoadingSubtitle = styled.div` type Props = { hasDisks: boolean; - isMultiReplicaSelection?: boolean; + isMultiTransferSelection?: boolean; loading?: boolean; - onDeleteReplica: () => void; + onDeleteTransfer: () => void; onDeleteDisks: () => void; onRequestClose: () => void; }; @observer -class DeleteReplicaModal extends React.Component { +class DeleteTransferModal extends React.Component { renderExtraMessage() { if (this.props.hasDisks) { - if (this.props.isMultiReplicaSelection) { + if (this.props.isMultiTransferSelection) { return ( Some of the selected Transfer have been executed at least once and @@ -124,7 +124,7 @@ class DeleteReplicaModal extends React.Component { } renderContent() { - const message = this.props.isMultiReplicaSelection + const message = this.props.isMultiTransferSelection ? "Are you sure you want to delete the selected transfers?" : "Are you sure you want to delete this transfer?"; @@ -148,8 +148,8 @@ class DeleteReplicaModal extends React.Component { Delete Transfer Disks ) : null} - @@ -158,7 +158,7 @@ class DeleteReplicaModal extends React.Component { } render() { - const title = this.props.isMultiReplicaSelection + const title = this.props.isMultiTransferSelection ? "Delete Selected Transfers?" : "Delete Transfer?"; return ( @@ -169,4 +169,4 @@ class DeleteReplicaModal extends React.Component { } } -export default DeleteReplicaModal; +export default DeleteTransferModal; diff --git a/src/components/modules/TransferModule/DeleteTransferModal/package.json b/src/components/modules/TransferModule/DeleteTransferModal/package.json new file mode 100644 index 00000000..4a59dc88 --- /dev/null +++ b/src/components/modules/TransferModule/DeleteTransferModal/package.json @@ -0,0 +1,6 @@ +{ + "name": "DeleteTransferModal", + "version": "0.0.0", + "private": true, + "main": "./DeleteTransferModal.tsx" +} diff --git a/src/components/modules/TransferModule/ReplicaDeploymentOptions/replicaDeploymentFields.ts b/src/components/modules/TransferModule/DeploymentOptions/DeploymentFields.ts similarity index 91% rename from src/components/modules/TransferModule/ReplicaDeploymentOptions/replicaDeploymentFields.ts rename to src/components/modules/TransferModule/DeploymentOptions/DeploymentFields.ts index 77aa95f6..9926418c 100644 --- a/src/components/modules/TransferModule/ReplicaDeploymentOptions/replicaDeploymentFields.ts +++ b/src/components/modules/TransferModule/DeploymentOptions/DeploymentFields.ts @@ -14,7 +14,7 @@ along with this program. If not, see . import { Field } from "@src/@types/Field"; -const replicaDeploymentFields: Field[] = [ +const deploymentFields: Field[] = [ { name: "clone_disks", type: "boolean", @@ -30,4 +30,4 @@ const replicaDeploymentFields: Field[] = [ }, ]; -export default replicaDeploymentFields; +export default deploymentFields; diff --git a/src/components/modules/TransferModule/ReplicaDeploymentOptions/ReplicaDeploymentOptions.tsx b/src/components/modules/TransferModule/DeploymentOptions/DeploymentOptions.tsx similarity index 95% rename from src/components/modules/TransferModule/ReplicaDeploymentOptions/ReplicaDeploymentOptions.tsx rename to src/components/modules/TransferModule/DeploymentOptions/DeploymentOptions.tsx index 374f5e6c..aca05ae0 100644 --- a/src/components/modules/TransferModule/ReplicaDeploymentOptions/ReplicaDeploymentOptions.tsx +++ b/src/components/modules/TransferModule/DeploymentOptions/DeploymentOptions.tsx @@ -16,7 +16,7 @@ import { observer } from "mobx-react"; import React from "react"; import styled from "styled-components"; -import { TransferItemDetails } from "@src/@types/MainItem"; +import { ActionItemDetails } from "@src/@types/MainItem"; import { MinionPool } from "@src/@types/MinionPool"; import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from "@src/components/modules/WizardModule/WizardOptions"; import WizardScripts from "@src/components/modules/WizardModule/WizardScripts"; @@ -28,8 +28,8 @@ import ToggleButtonBar from "@src/components/ui/ToggleButtonBar"; import KeyboardManager from "@src/utils/KeyboardManager"; import LabelDictionary from "@src/utils/LabelDictionary"; -import replicaDeploymentImage from "./images/replica-deployment.svg"; -import replicaDeploymentFields from "./replicaDeploymentFields"; +import deploymentImage from "./images/deployment.svg"; +import deploymentFields from "./DeploymentFields"; import type { Field } from "@src/@types/Field"; import type { Instance, InstanceScript } from "@src/@types/Instance"; @@ -43,7 +43,7 @@ const Wrapper = styled.div` const Image = styled.div` ${ThemeProps.exactWidth("288px")} ${ThemeProps.exactHeight("96px")} - background: url('${replicaDeploymentImage}') center no-repeat; + background: url('${deploymentImage}') center no-repeat; margin: 80px 0; `; const OptionsBody = styled.div` @@ -78,7 +78,7 @@ const FieldInputStyled = styled(FieldInput)` type Props = { instances: Instance[]; - transferItem: TransferItemDetails | null; + transferItem: ActionItemDetails | null; minionPools: MinionPool[]; loadingInstances: boolean; defaultSkipOsMorphing?: boolean | null; @@ -101,7 +101,7 @@ type State = { }; @observer -class ReplicaDeploymentOptions extends React.Component { +class DeploymentOptions extends React.Component { state: State = { fields: [], selectedBarButton: "options", @@ -117,7 +117,7 @@ class ReplicaDeploymentOptions extends React.Component { this.props.transferItem?.instance_osmorphing_minion_pool_mappings || {}; this.setState({ - fields: replicaDeploymentFields.map(f => + fields: deploymentFields.map(f => f.name === "skip_os_morphing" ? { ...f, value: this.props.defaultSkipOsMorphing || null } : f @@ -340,4 +340,4 @@ class ReplicaDeploymentOptions extends React.Component { } } -export default ReplicaDeploymentOptions; +export default DeploymentOptions; diff --git a/src/components/modules/TransferModule/ReplicaDeploymentOptions/ReplicaDeploymentOptions.spec.tsx b/src/components/modules/TransferModule/DeploymentOptions/ReplicaDeploymentOptions.spec.tsx similarity index 99% rename from src/components/modules/TransferModule/ReplicaDeploymentOptions/ReplicaDeploymentOptions.spec.tsx rename to src/components/modules/TransferModule/DeploymentOptions/ReplicaDeploymentOptions.spec.tsx index 7c306d73..0ef9f3ec 100644 --- a/src/components/modules/TransferModule/ReplicaDeploymentOptions/ReplicaDeploymentOptions.spec.tsx +++ b/src/components/modules/TransferModule/DeploymentOptions/ReplicaDeploymentOptions.spec.tsx @@ -21,7 +21,7 @@ import { MINION_POOL_MOCK } from "@tests/mocks/MinionPoolMock"; import { REPLICA_ITEM_DETAILS_MOCK } from "@tests/mocks/TransferMock"; import TestUtils from "@tests/TestUtils"; -import ReplicaDeploymentOptions from "./"; +import ReplicaDeploymentOptions from "."; jest.mock("@src/plugins/default/ContentPlugin", () => jest.fn(() => null)); jest.mock("@src/components/modules/WizardModule/WizardScripts", () => ({ diff --git a/src/components/modules/TransferModule/ReplicaDeploymentOptions/images/replica-deployment.svg b/src/components/modules/TransferModule/DeploymentOptions/images/deployment.svg similarity index 100% rename from src/components/modules/TransferModule/ReplicaDeploymentOptions/images/replica-deployment.svg rename to src/components/modules/TransferModule/DeploymentOptions/images/deployment.svg diff --git a/src/components/modules/TransferModule/DeploymentOptions/package.json b/src/components/modules/TransferModule/DeploymentOptions/package.json new file mode 100644 index 00000000..054fb709 --- /dev/null +++ b/src/components/modules/TransferModule/DeploymentOptions/package.json @@ -0,0 +1,6 @@ +{ + "name": "DeploymentOptions", + "version": "0.0.0", + "private": true, + "main": "./DeploymentOptions.tsx" +} diff --git a/src/components/modules/TransferModule/ReplicaDeploymentOptions/story.tsx b/src/components/modules/TransferModule/DeploymentOptions/story.tsx similarity index 100% rename from src/components/modules/TransferModule/ReplicaDeploymentOptions/story.tsx rename to src/components/modules/TransferModule/DeploymentOptions/story.tsx diff --git a/src/components/modules/TransferModule/MainDetails/MainDetails.tsx b/src/components/modules/TransferModule/MainDetails/MainDetails.tsx index b1e5e6be..1932266d 100644 --- a/src/components/modules/TransferModule/MainDetails/MainDetails.tsx +++ b/src/components/modules/TransferModule/MainDetails/MainDetails.tsx @@ -18,7 +18,7 @@ import { Link } from "react-router-dom"; import styled, { css } from "styled-components"; import fieldHelper from "@src/@types/Field"; -import { TransferItem } from "@src/@types/MainItem"; +import { ActionItem } from "@src/@types/MainItem"; import { MinionPool } from "@src/@types/MinionPool"; import EndpointLogos from "@src/components/modules/EndpointModule/EndpointLogos"; import TransferDetailsTable from "@src/components/modules/TransferModule/TransferDetailsTable"; @@ -128,7 +128,7 @@ const PropertyValue = styled.div` `; type Props = { - item?: TransferItem | null; + item?: ActionItem | null; minionPools: MinionPool[]; storageBackends: StorageBackend[]; destinationSchema: FieldType[]; @@ -423,13 +423,13 @@ class MainDetails extends React.Component { ) : null} - {this.props.item?.type === "migration" && - this.props.item.replica_id ? ( + {this.props.item?.type === "deployment" && + this.props.item.transfer_id ? ( - - {this.props.item.replica_id} + + {this.props.item.transfer_id} diff --git a/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.spec.tsx b/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.spec.tsx deleted file mode 100644 index c2e4bc9a..00000000 --- a/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.spec.tsx +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright (C) 2023 Cloudbase Solutions SRL -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . -*/ - -import React from "react"; - -import { render } from "@testing-library/react"; - -import MigrationDetailsContent from "."; -import { MIGRATION_ITEM_DETAILS_MOCK } from "@tests/mocks/TransferMock"; -import { MINION_POOL_MOCK } from "@tests/mocks/MinionPoolMock"; -import { STORAGE_BACKEND_MOCK } from "@tests/mocks/StoragesMock"; -import { INSTANCE_MOCK } from "@tests/mocks/InstancesMock"; -import { NETWORK_MOCK } from "@tests/mocks/NetworksMock"; -import { - OPENSTACK_ENDPOINT_MOCK, - VMWARE_ENDPOINT_MOCK, -} from "@tests/mocks/EndpointsMock"; - -jest.mock("@src/components/modules/EndpointModule/EndpointLogos", () => ({ - __esModule: true, - default: (props: any) =>
{props.endpoint}
, -})); -jest.mock("react-router-dom", () => ({ Link: "a" })); - -describe("MigrationDetailsContent", () => { - let defaultProps: MigrationDetailsContent["props"]; - - beforeEach(() => { - defaultProps = { - item: MIGRATION_ITEM_DETAILS_MOCK, - itemId: MIGRATION_ITEM_DETAILS_MOCK.id, - minionPools: [MINION_POOL_MOCK], - detailsLoading: false, - storageBackends: [STORAGE_BACKEND_MOCK], - instancesDetails: [INSTANCE_MOCK], - instancesDetailsLoading: false, - networks: [NETWORK_MOCK], - sourceSchema: [], - sourceSchemaLoading: false, - destinationSchema: [], - destinationSchemaLoading: false, - endpoints: [OPENSTACK_ENDPOINT_MOCK, VMWARE_ENDPOINT_MOCK], - page: "", - onDeleteMigrationClick: jest.fn(), - }; - }); - - it("renders without crashing", () => { - const { getByText } = render(); - expect(getByText(MIGRATION_ITEM_DETAILS_MOCK.id)).toBeTruthy(); - }); - - it("renders tasks page", () => { - const { getByText } = render( - - ); - expect( - getByText( - MIGRATION_ITEM_DETAILS_MOCK.tasks[0].task_type.replace("_", " ") - ) - ).toBeTruthy(); - }); -}); diff --git a/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.tsx b/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.tsx deleted file mode 100644 index 27cb7711..00000000 --- a/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.tsx +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright (C) 2017 Cloudbase Solutions SRL -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . -*/ - -import { observer } from "mobx-react"; -import React from "react"; -import styled from "styled-components"; - -import { MigrationItemDetails } from "@src/@types/MainItem"; -import { MinionPool } from "@src/@types/MinionPool"; -import { Network } from "@src/@types/Network"; -import DetailsNavigation from "@src/components/modules/NavigationModule/DetailsNavigation"; -import MainDetails from "@src/components/modules/TransferModule/MainDetails"; -import Tasks from "@src/components/modules/TransferModule/Tasks"; -import { ThemeProps } from "@src/components/Theme"; -import Button from "@src/components/ui/Button"; - -import type { Instance } from "@src/@types/Instance"; -import type { Endpoint, StorageBackend } from "@src/@types/Endpoint"; -import type { Field } from "@src/@types/Field"; -const Wrapper = styled.div` - display: flex; - justify-content: center; -`; - -const Buttons = styled.div` - margin-top: 24px; - & > button:last-child { - float: right; - } -`; -const DetailsBody = styled.div` - ${ThemeProps.exactWidth(ThemeProps.contentWidth)} -`; - -const NavigationItems = [ - { - label: "Migration", - value: "", - }, - { - label: "Tasks", - value: "tasks", - }, -]; - -type Props = { - item: MigrationItemDetails | null; - itemId: string; - minionPools: MinionPool[]; - detailsLoading: boolean; - storageBackends: StorageBackend[]; - instancesDetails: Instance[]; - instancesDetailsLoading: boolean; - networks: Network[]; - sourceSchema: Field[]; - sourceSchemaLoading: boolean; - destinationSchema: Field[]; - destinationSchemaLoading: boolean; - endpoints: Endpoint[]; - page: string; - onDeleteMigrationClick: () => void; -}; -@observer -class MigrationDetailsContent extends React.Component { - renderBottomControls() { - return ( - - - - ); - } - - renderMainDetails() { - if (this.props.page !== "") { - return null; - } - - return ( - - ); - } - - renderTasks() { - if (this.props.page !== "tasks" || !this.props.item?.tasks) { - return null; - } - - return ( - - ); - } - - render() { - return ( - - - - {this.renderMainDetails()} - {this.renderTasks()} - - - ); - } -} - -export default MigrationDetailsContent; diff --git a/src/components/modules/TransferModule/MigrationDetailsContent/package.json b/src/components/modules/TransferModule/MigrationDetailsContent/package.json deleted file mode 100644 index 3f60d51d..00000000 --- a/src/components/modules/TransferModule/MigrationDetailsContent/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "MigrationDetailsContent", - "version": "0.0.0", - "private": true, - "main": "./MigrationDetailsContent.tsx" -} diff --git a/src/components/modules/TransferModule/MigrationDetailsContent/story.tsx b/src/components/modules/TransferModule/MigrationDetailsContent/story.tsx deleted file mode 100644 index 99a6e7f6..00000000 --- a/src/components/modules/TransferModule/MigrationDetailsContent/story.tsx +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright (C) 2017 Cloudbase Solutions SRL -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . -*/ - -/* eslint-disable react/jsx-props-no-spreading */ - -import React from "react"; -import { storiesOf } from "@storybook/react"; -import MigrationDetailsContent from "."; - -const tasks: any = [ - { - progress_updates: [ - { message: "the task has a progress of 10%", created_at: new Date() }, - ], - exception_details: "Exception details", - status: "COMPLETED", - created_at: new Date(), - depends_on: ["depends on id"], - id: "task-1", - task_type: "Task name 1", - }, - { - progress_updates: [ - { message: "the task has a progress of 50%", created_at: new Date() }, - { message: "the task is almost done", created_at: new Date() }, - ], - exception_details: "Exception details", - status: "RUNNING", - created_at: new Date(), - depends_on: ["depends on id"], - id: "task-2", - task_type: "Task name 2", - }, -]; -const endpoints: any = [ - { id: "endpoint-1", name: "Endpoint OPS", type: "openstack" }, - { id: "endpoint-2", name: "Endpoint AZURE", type: "azure" }, -]; -const item: any = { - origin_endpoint_id: "endpoint-1", - destination_endpoint_id: "endpoint-2", - id: "item-id", - created_at: new Date(2017, 10, 24, 16, 15), - info: { - instance: { - export_info: { devices: { nics: [{ network_name: "map_1" }] } }, - }, - }, - tasks, - destination_environment: { - description: "A description", - network_map: { - map_1: "Mapping 1", - }, - }, - type: "Migration", -}; -const props: any = {}; -storiesOf("MigrationDetailsContent", module) - .add("default", () => ( - - )) - .add("details loading", () => ( - - )) - .add("tasks", () => ( - - )); diff --git a/src/components/modules/TransferModule/ReplicaDeploymentOptions/package.json b/src/components/modules/TransferModule/ReplicaDeploymentOptions/package.json deleted file mode 100644 index 5581f77b..00000000 --- a/src/components/modules/TransferModule/ReplicaDeploymentOptions/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ReplicaDeploymentOptions", - "version": "0.0.0", - "private": true, - "main": "./ReplicaDeploymentOptions.tsx" -} diff --git a/src/components/modules/TransferModule/ReplicaDetailsContent/package.json b/src/components/modules/TransferModule/ReplicaDetailsContent/package.json deleted file mode 100644 index 340a812a..00000000 --- a/src/components/modules/TransferModule/ReplicaDetailsContent/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ReplicaDetailsContent", - "version": "0.0.0", - "private": true, - "main": "./ReplicaDetailsContent.tsx" -} diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/package.json b/src/components/modules/TransferModule/ReplicaExecutionOptions/package.json deleted file mode 100644 index 94805486..00000000 --- a/src/components/modules/TransferModule/ReplicaExecutionOptions/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ReplicaExecutionOptions", - "version": "0.0.0", - "private": true, - "main": "./ReplicaExecutionOptions.tsx" -} diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.spec.tsx b/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.spec.tsx deleted file mode 100644 index f78f5728..00000000 --- a/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.spec.tsx +++ /dev/null @@ -1,154 +0,0 @@ -/* -Copyright (C) 2023 Cloudbase Solutions SRL -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . -*/ - -import React from "react"; - -import WizardScripts from "@src/components/modules/WizardModule/WizardScripts"; -import { fireEvent, render } from "@testing-library/react"; -import { INSTANCE_MOCK } from "@tests/mocks/InstancesMock"; -import { MINION_POOL_MOCK } from "@tests/mocks/MinionPoolMock"; -import { REPLICA_ITEM_DETAILS_MOCK } from "@tests/mocks/TransferMock"; -import TestUtils from "@tests/TestUtils"; - -import ReplicaMigrationOptions from "./"; - -jest.mock("@src/plugins/default/ContentPlugin", () => jest.fn(() => null)); -jest.mock("@src/components/modules/WizardModule/WizardScripts", () => ({ - __esModule: true, - default: (props: WizardScripts["props"]) => ( -
-
- {props.uploadedScripts.map(s => s.scriptContent).join(", ")} -
-
{ - props.onScriptDataRemove(props.uploadedScripts[0]); - }} - /> -
- {props.removedScripts.map(s => s.scriptContent).join(", ")} -
-
{ - props.onCancelScript("windows", null); - props.scrollableRef && - props.scrollableRef(null as any as HTMLElement); - }} - /> -
{ - props.onScriptUpload({ - scriptContent: `script-content-${Math.random()}`, - fileName: `script-name.ps1`, - global: "windows", - }); - }} - /> -
- ), -})); - -describe("ReplicaMigrationOptions", () => { - let defaultProps: ReplicaMigrationOptions["props"]; - - beforeEach(() => { - defaultProps = { - instances: [INSTANCE_MOCK], - transferItem: REPLICA_ITEM_DETAILS_MOCK, - minionPools: [ - MINION_POOL_MOCK, - { ...MINION_POOL_MOCK, id: "pool2", name: "Pool2" }, - ], - loadingInstances: false, - onCancelClick: jest.fn(), - onMigrateClick: jest.fn(), - onResizeUpdate: jest.fn(), - }; - }); - - it("renders without crashing", () => { - const { getByText } = render(); - expect(getByText("Migrate")).toBeTruthy(); - }); - - it("executes on Enter", () => { - render(); - fireEvent.keyDown(document.body, { key: "Enter" }); - expect(defaultProps.onMigrateClick).toHaveBeenCalled(); - }); - - it("calls onResizeUpdate on selectedBarButton state change", () => { - render(); - fireEvent.click(TestUtils.selectAll("ToggleButtonBar__Item-")[1]); - expect(defaultProps.onResizeUpdate).toHaveBeenCalled(); - }); - - it("handles value change", () => { - render(); - expect(TestUtils.select("Switch__Wrapper")?.textContent).toBe("Yes"); - fireEvent.click(TestUtils.select("Switch__InputWrapper")!); - expect(TestUtils.select("Switch__Wrapper")?.textContent).toBe("No"); - }); - - it("handles script operations", () => { - const { getByTestId } = render( - - ); - fireEvent.click(TestUtils.selectAll("ToggleButtonBar__Item-")[1]); - fireEvent.click(getByTestId("ScriptsUpload")); - expect(getByTestId("ScriptsUploaded").textContent).toContain( - "script-content" - ); - fireEvent.click(getByTestId("ScriptsCancel")); - expect(getByTestId("ScriptsUploaded").textContent).toBe(""); - - fireEvent.click(getByTestId("ScriptsUpload")); - expect(getByTestId("ScriptsUploaded").textContent).toContain( - "script-content" - ); - expect(getByTestId("ScriptsRemoved").textContent).toBe(""); - fireEvent.click(getByTestId("ScriptsRemove")); - expect(getByTestId("ScriptsRemoved").textContent).toContain( - "script-content" - ); - }); - - it("doesn't render minion pool mappings", () => { - const { rerender } = render(); - expect(document.body.textContent).toContain("Minion Pool Mappings"); - - rerender(); - expect(document.body.textContent).not.toContain("Minion Pool Mappings"); - }); - - it("changes minion pool mappings value", () => { - render(); - fireEvent.click(TestUtils.select("DropdownButton__Wrapper-")!); - const dropdownItem = TestUtils.selectAll("Dropdown__ListItem-")[2]; - expect(dropdownItem.textContent).toBe("Pool2"); - fireEvent.click(dropdownItem); - expect(TestUtils.select("DropdownButton__Label-")?.textContent).toBe( - "Pool2" - ); - }); - - it("handles migrate click", () => { - const { getByText } = render(); - fireEvent.click(getByText("Migrate")); - expect(defaultProps.onMigrateClick).toHaveBeenCalled(); - }); -}); diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.tsx b/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.tsx deleted file mode 100644 index 0dce1170..00000000 --- a/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.tsx +++ /dev/null @@ -1,343 +0,0 @@ -/* -Copyright (C) 2017 Cloudbase Solutions SRL -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . -*/ - -import { observer } from "mobx-react"; -import React from "react"; -import styled from "styled-components"; - -import { TransferItemDetails } from "@src/@types/MainItem"; -import { MinionPool } from "@src/@types/MinionPool"; -import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from "@src/components/modules/WizardModule/WizardOptions"; -import WizardScripts from "@src/components/modules/WizardModule/WizardScripts"; -import { ThemeProps } from "@src/components/Theme"; -import Button from "@src/components/ui/Button"; -import FieldInput from "@src/components/ui/FieldInput"; -import LoadingButton from "@src/components/ui/LoadingButton"; -import ToggleButtonBar from "@src/components/ui/ToggleButtonBar"; -import KeyboardManager from "@src/utils/KeyboardManager"; -import LabelDictionary from "@src/utils/LabelDictionary"; - -import replicaMigrationImage from "./images/replica-migration.svg"; -import replicaMigrationFields from "./replicaMigrationFields"; - -import type { Field } from "@src/@types/Field"; -import type { Instance, InstanceScript } from "@src/@types/Instance"; -const Wrapper = styled.div` - display: flex; - flex-direction: column; - align-items: center; - padding: 0 32px 32px 32px; - min-height: 0; -`; -const Image = styled.div` - ${ThemeProps.exactWidth("288px")} - ${ThemeProps.exactHeight("96px")} - background: url('${replicaMigrationImage}') center no-repeat; - margin: 80px 0; -`; -const OptionsBody = styled.div` - display: flex; - flex-direction: column; -`; -const ScriptsBody = styled.div` - display: flex; - flex-direction: column; - width: 100%; - overflow: auto; - min-height: 0; - margin-bottom: 32px; -`; -const Form = styled.div` - display: flex; - flex-wrap: wrap; - margin-left: -64px; - justify-content: space-between; - margin: 0 auto; -`; -const Buttons = styled.div` - display: flex; - justify-content: space-between; - width: 100%; -`; -const FieldInputStyled = styled(FieldInput)` - width: 224px; - justify-content: space-between; - margin-bottom: 32px; -`; - -type Props = { - instances: Instance[]; - transferItem: TransferItemDetails | null; - minionPools: MinionPool[]; - loadingInstances: boolean; - defaultSkipOsMorphing?: boolean | null; - migrating?: boolean; - onCancelClick: () => void; - onMigrateClick: (opts: { - fields: Field[]; - uploadedUserScripts: InstanceScript[]; - removedUserScripts: InstanceScript[]; - minionPoolMappings: { [instance: string]: string }; - }) => void; - onResizeUpdate?: (scrollableRef: HTMLElement, scrollOffset?: number) => void; -}; -type State = { - fields: Field[]; - selectedBarButton: string; - uploadedScripts: InstanceScript[]; - removedScripts: InstanceScript[]; - minionPoolMappings: { [instance: string]: string }; -}; - -@observer -class ReplicaMigrationOptions extends React.Component { - state: State = { - fields: [], - selectedBarButton: "options", - uploadedScripts: [], - removedScripts: [], - minionPoolMappings: {}, - }; - - scrollableRef!: HTMLElement; - - UNSAFE_componentWillMount() { - const mappings = - this.props.transferItem?.instance_osmorphing_minion_pool_mappings || {}; - - this.setState({ - fields: replicaMigrationFields.map(f => - f.name === "skip_os_morphing" - ? { ...f, value: this.props.defaultSkipOsMorphing || null } - : f - ), - minionPoolMappings: { ...mappings }, - }); - } - - componentDidMount() { - KeyboardManager.onEnter( - "migration-options", - () => { - this.migrate(); - }, - 2 - ); - } - - componentDidUpdate(_: Props, prevState: State) { - if (prevState.selectedBarButton !== this.state.selectedBarButton) { - if (this.props.onResizeUpdate) { - this.props.onResizeUpdate(this.scrollableRef, 0); - } - } - } - - componentWillUnmount() { - KeyboardManager.removeKeyDown("migration-options"); - } - - migrate() { - this.props.onMigrateClick({ - fields: this.state.fields, - uploadedUserScripts: this.state.uploadedScripts, - removedUserScripts: this.state.removedScripts, - minionPoolMappings: this.state.minionPoolMappings, - }); - } - - handleValueChange(field: Field, value: boolean) { - this.setState(prevState => { - const fields = prevState.fields.map(f => { - const newField = { ...f }; - if (f.name === field.name) { - newField.value = value; - } - return newField; - }); - - return { fields }; - }); - } - - handleCancelScript(global: string | null, instanceName: string | null) { - this.setState(prevState => ({ - uploadedScripts: prevState.uploadedScripts.filter(s => - global ? s.global !== global : s.instanceId !== instanceName - ), - })); - } - - handleScriptUpload(script: InstanceScript) { - this.setState(prevState => ({ - uploadedScripts: [...prevState.uploadedScripts, script], - })); - } - - handleScriptRemove(script: InstanceScript) { - this.setState(prevState => ({ - removedScripts: [...prevState.removedScripts, script], - })); - } - - renderField(field: Field) { - return ( - this.handleValueChange(field, value)} - description={LabelDictionary.getDescription(field.name)} - /> - ); - } - - renderMinionPoolMappings() { - const minionPools = this.props.minionPools.filter( - m => m.endpoint_id === this.props.transferItem?.destination_endpoint_id - ); - if (!minionPools.length) { - return null; - } - - const properties: Field[] = this.props.instances.map(instance => ({ - name: instance.instance_name || instance.id, - label: instance.name, - type: "string", - enum: minionPools.map(minionPool => ({ - name: minionPool.name, - id: minionPool.id, - })), - })); - - return ( - - this.state.minionPoolMappings && - this.state.minionPoolMappings[field.name] - } - layout="page" - label="Instance OSMorphing Minion Pool Mappings" - onChange={(value, field) => - this.setState(prevState => { - const minionPoolMappings = { ...prevState.minionPoolMappings }; - minionPoolMappings[field!.name] = value; - return { minionPoolMappings }; - }) - } - properties={properties} - labelRenderer={(propName: string) => - propName.indexOf("/") > -1 - ? propName.split("/")[propName.split("/").length - 1] - : propName - } - /> - ); - } - - renderOptions() { - return ( - <> -
{this.state.fields.map(field => this.renderField(field))}
- {this.renderMinionPoolMappings()} - - ); - } - - renderScripts() { - return ( - { - this.handleScriptUpload(s); - }} - onScriptDataRemove={s => { - this.handleScriptRemove(s); - }} - onCancelScript={(g, i) => { - this.handleCancelScript(g, i); - }} - uploadedScripts={this.state.uploadedScripts} - removedScripts={this.state.removedScripts} - userScriptData={this.props.transferItem?.user_scripts} - scrollableRef={(r: HTMLElement) => { - this.scrollableRef = r; - }} - layout="modal" - /> - ); - } - - renderBody() { - const Body = - this.state.selectedBarButton === "options" ? OptionsBody : ScriptsBody; - - return ( - - { - this.setState({ selectedBarButton: item.value }); - }} - style={{ marginBottom: "32px" }} - /> - {this.state.selectedBarButton === "options" - ? this.renderOptions() - : this.renderScripts()} - - ); - } - - render() { - return ( - - - {this.renderBody()} - - - {this.props.migrating ? ( - Migrating ... - ) : ( - - )} - - - ); - } -} - -export default ReplicaMigrationOptions; diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/images/replica-migration.svg b/src/components/modules/TransferModule/ReplicaMigrationOptions/images/replica-migration.svg deleted file mode 100644 index f34c9d29..00000000 --- a/src/components/modules/TransferModule/ReplicaMigrationOptions/images/replica-migration.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Created with Sketch. - - - - - - - - - - - - - - - - - - - - diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/package.json b/src/components/modules/TransferModule/ReplicaMigrationOptions/package.json deleted file mode 100644 index 5f158d0c..00000000 --- a/src/components/modules/TransferModule/ReplicaMigrationOptions/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ReplicaMigrationOptions", - "version": "0.0.0", - "private": true, - "main": "./ReplicaMigrationOptions.tsx" -} diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/replicaMigrationFields.ts b/src/components/modules/TransferModule/ReplicaMigrationOptions/replicaMigrationFields.ts deleted file mode 100644 index 634c840a..00000000 --- a/src/components/modules/TransferModule/ReplicaMigrationOptions/replicaMigrationFields.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (C) 2020 Cloudbase Solutions SRL -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . -*/ - -import { Field } from "@src/@types/Field"; - -const replicaMigrationFields: Field[] = [ - { - name: "clone_disks", - type: "boolean", - value: true, - }, - { - name: "force", - type: "boolean", - }, - { - name: "skip_os_morphing", - type: "boolean", - }, -]; - -export default replicaMigrationFields; diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/story.tsx b/src/components/modules/TransferModule/ReplicaMigrationOptions/story.tsx deleted file mode 100644 index 1eea2ca6..00000000 --- a/src/components/modules/TransferModule/ReplicaMigrationOptions/story.tsx +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2017 Cloudbase Solutions SRL -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . -*/ - -import React from "react"; -import { storiesOf } from "@storybook/react"; -import ReplicaMigrationOptions from "."; - -const props: any = {}; -storiesOf("ReplicaMigrationOptions", module).add("default", () => ( - // eslint-disable-next-line react/jsx-props-no-spreading -
- -
-)); diff --git a/src/components/modules/TransferModule/Schedule/Schedule.tsx b/src/components/modules/TransferModule/Schedule/Schedule.tsx index 5897ffdb..522a6b21 100644 --- a/src/components/modules/TransferModule/Schedule/Schedule.tsx +++ b/src/components/modules/TransferModule/Schedule/Schedule.tsx @@ -17,7 +17,7 @@ import { observer } from "mobx-react"; import React from "react"; import styled from "styled-components"; -import ReplicaExecutionOptions from "@src/components/modules/TransferModule/ReplicaExecutionOptions"; +import TransferExecutionOptions from "@src/components/modules/TransferModule/TransferExecutionOptions"; import ScheduleItem from "@src/components/modules/TransferModule/ScheduleItem"; import { ThemePalette, ThemeProps } from "@src/components/Theme"; import AlertModal from "@src/components/ui/AlertModal"; @@ -407,7 +407,7 @@ class Schedule extends React.Component { this.handleCloseOptionsModal(); }} > - { diff --git a/src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.spec.tsx b/src/components/modules/TransferModule/TransferDetailsContent/ReplicaDetailsContent.spec.tsx similarity index 99% rename from src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.spec.tsx rename to src/components/modules/TransferModule/TransferDetailsContent/ReplicaDetailsContent.spec.tsx index f2b017c0..0624df7f 100644 --- a/src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.spec.tsx +++ b/src/components/modules/TransferModule/TransferDetailsContent/ReplicaDetailsContent.spec.tsx @@ -31,7 +31,7 @@ import { NETWORK_MOCK } from "@tests/mocks/NetworksMock"; import { STORAGE_BACKEND_MOCK } from "@tests/mocks/StoragesMock"; import { REPLICA_ITEM_DETAILS_MOCK } from "@tests/mocks/TransferMock"; -import ReplicaDetailsContent from "./"; +import ReplicaDetailsContent from "."; const scheduleStoreMock = jest.createMockFromModule( "@src/stores/ScheduleStore" diff --git a/src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.tsx b/src/components/modules/TransferModule/TransferDetailsContent/TransferDetailsContent.tsx similarity index 96% rename from src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.tsx rename to src/components/modules/TransferModule/TransferDetailsContent/TransferDetailsContent.tsx index fbf5ad3b..4cf1cf89 100644 --- a/src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.tsx +++ b/src/components/modules/TransferModule/TransferDetailsContent/TransferDetailsContent.tsx @@ -16,7 +16,7 @@ import { observer } from "mobx-react"; import React from "react"; import styled from "styled-components"; -import { ReplicaItemDetails } from "@src/@types/MainItem"; +import { TransferItemDetails } from "@src/@types/MainItem"; import { MinionPool } from "@src/@types/MinionPool"; import DetailsNavigation from "@src/components/modules/NavigationModule/DetailsNavigation"; import Executions from "@src/components/modules/TransferModule/Executions"; @@ -74,7 +74,7 @@ const NavigationItems = [ type TimezoneValue = "utc" | "local"; type Props = { - item?: ReplicaItemDetails | null; + item?: TransferItemDetails | null; itemId: string; endpoints: Endpoint[]; sourceSchema: Field[]; @@ -101,7 +101,7 @@ type Props = { onDeleteExecutionClick: (execution: Execution | null) => void; onExecuteClick: () => void; onCreateDeploymentClick: () => void; - onDeleteReplicaClick: () => void; + onDeleteTransferClick: () => void; onAddScheduleClick: (schedule: ScheduleType) => void; onScheduleChange: ( scheduleId: string | null, @@ -115,7 +115,7 @@ type State = { timezone: TimezoneValue; }; @observer -class ReplicaDetailsContent extends React.Component { +class TransferDetailsContent extends React.Component { state: State = { timezone: "local", }; @@ -164,7 +164,7 @@ class ReplicaDetailsContent extends React.Component { - @@ -268,4 +268,4 @@ class ReplicaDetailsContent extends React.Component { } } -export default ReplicaDetailsContent; +export default TransferDetailsContent; diff --git a/src/components/modules/TransferModule/TransferDetailsContent/package.json b/src/components/modules/TransferModule/TransferDetailsContent/package.json new file mode 100644 index 00000000..17f2b80d --- /dev/null +++ b/src/components/modules/TransferModule/TransferDetailsContent/package.json @@ -0,0 +1,6 @@ +{ + "name": "TransferDetailsContent", + "version": "0.0.0", + "private": true, + "main": "./TransferDetailsContent.tsx" +} diff --git a/src/components/modules/TransferModule/ReplicaDetailsContent/story.tsx b/src/components/modules/TransferModule/TransferDetailsContent/story.tsx similarity index 100% rename from src/components/modules/TransferModule/ReplicaDetailsContent/story.tsx rename to src/components/modules/TransferModule/TransferDetailsContent/story.tsx diff --git a/src/components/modules/TransferModule/TransferDetailsTable/TransferDetailsTable.tsx b/src/components/modules/TransferModule/TransferDetailsTable/TransferDetailsTable.tsx index 9f1ca9f7..ef2c51a8 100644 --- a/src/components/modules/TransferModule/TransferDetailsTable/TransferDetailsTable.tsx +++ b/src/components/modules/TransferModule/TransferDetailsTable/TransferDetailsTable.tsx @@ -20,7 +20,7 @@ import { EndpointUtils, StorageBackend } from "@src/@types/Endpoint"; import { isNetworkMapSecurityGroups, isNetworkMapSourceDest, - TransferItem, + ActionItem, TransferNetworkMap, } from "@src/@types/MainItem"; import { MinionPool } from "@src/@types/MinionPool"; @@ -156,7 +156,7 @@ export const ArrowIcon = styled.div` `; export type Props = { - item?: TransferItem | null; + item?: ActionItem | null; instancesDetails: Instance[]; networks?: Network[]; minionPools: MinionPool[]; @@ -338,7 +338,7 @@ class TransferDetailsTable extends React.Component { destinationBody = destinationBody.concat(getBody(transferDisk)); } } else if ( - this.props.item?.type === "migration" && + this.props.item?.type === "deployment" && (this.props.item.last_execution_status === "RUNNING" || this.props.item.last_execution_status === "AWAITING_MINION_ALLOCATIONS") @@ -446,7 +446,7 @@ class TransferDetailsTable extends React.Component { destinationBody = getBody(destinationNic); } } else if ( - this.props.item?.type === "migration" && + this.props.item?.type === "deployment" && (this.props.item.last_execution_status === "RUNNING" || this.props.item.last_execution_status === "AWAITING_MINION_ALLOCATIONS") @@ -501,7 +501,7 @@ class TransferDetailsTable extends React.Component { destinationName = transferResult.instance_name || transferResult.name; destinationBody = getBody(transferResult); } else if ( - this.props.item?.type === "migration" && + this.props.item?.type === "deployment" && (this.props.item.last_execution_status === "RUNNING" || this.props.item.last_execution_status === "AWAITING_MINION_ALLOCATIONS") ) { diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.spec.tsx b/src/components/modules/TransferModule/TransferExecutionOptions/ReplicaExecutionOptions.spec.tsx similarity index 98% rename from src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.spec.tsx rename to src/components/modules/TransferModule/TransferExecutionOptions/ReplicaExecutionOptions.spec.tsx index 40e11391..729a1b8a 100644 --- a/src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.spec.tsx +++ b/src/components/modules/TransferModule/TransferExecutionOptions/ReplicaExecutionOptions.spec.tsx @@ -17,7 +17,7 @@ import React from "react"; import { fireEvent, render } from "@testing-library/react"; import TestUtils from "@tests/TestUtils"; -import ReplicaExecutionOptions from "./"; +import ReplicaExecutionOptions from "."; jest.mock("@src/plugins/default/ContentPlugin", () => jest.fn(() => null)); diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.tsx b/src/components/modules/TransferModule/TransferExecutionOptions/TransferExecutionOptions.tsx similarity index 97% rename from src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.tsx rename to src/components/modules/TransferModule/TransferExecutionOptions/TransferExecutionOptions.tsx index 1372b5f8..108e69a1 100644 --- a/src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.tsx +++ b/src/components/modules/TransferModule/TransferExecutionOptions/TransferExecutionOptions.tsx @@ -65,7 +65,7 @@ type State = { fields: Field[]; }; @observer -class ReplicaExecutionOptions extends React.Component { +class TransferExecutionOptions extends React.Component { static defaultProps = { executionLabel: "Execute", executing: false, @@ -157,4 +157,4 @@ class ReplicaExecutionOptions extends React.Component { } } -export default ReplicaExecutionOptions; +export default TransferExecutionOptions; diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/images/execution.svg b/src/components/modules/TransferModule/TransferExecutionOptions/images/execution.svg similarity index 100% rename from src/components/modules/TransferModule/ReplicaExecutionOptions/images/execution.svg rename to src/components/modules/TransferModule/TransferExecutionOptions/images/execution.svg diff --git a/src/components/modules/TransferModule/TransferExecutionOptions/package.json b/src/components/modules/TransferModule/TransferExecutionOptions/package.json new file mode 100644 index 00000000..d3a07135 --- /dev/null +++ b/src/components/modules/TransferModule/TransferExecutionOptions/package.json @@ -0,0 +1,6 @@ +{ + "name": "TransferExecutionOptions", + "version": "0.0.0", + "private": true, + "main": "./TransferExecutionOptions.tsx" +} diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/story.tsx b/src/components/modules/TransferModule/TransferExecutionOptions/story.tsx similarity index 100% rename from src/components/modules/TransferModule/ReplicaExecutionOptions/story.tsx rename to src/components/modules/TransferModule/TransferExecutionOptions/story.tsx diff --git a/src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx b/src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx index ea5e51fc..ce9c4837 100644 --- a/src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx +++ b/src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx @@ -19,8 +19,7 @@ import styled from "styled-components"; import providerStore, { getFieldChangeOptions, } from "@src/stores/ProviderStore"; -import replicaStore from "@src/stores/ReplicaStore"; -import migrationStore from "@src/stores/MigrationStore"; +import transferStore from "@src/stores/TransferStore"; import endpointStore from "@src/stores/EndpointStore"; import { OptionsSchemaPlugin } from "@src/plugins"; @@ -39,8 +38,8 @@ import WizardStorage from "@src/components/modules/WizardModule/WizardStorage"; import type { UpdateData, - TransferItemDetails, - MigrationItemDetails, + ActionItemDetails, + DeploymentItemDetails, } from "@src/@types/MainItem"; import { Endpoint, @@ -57,7 +56,7 @@ import { SecurityGroup, } from "@src/@types/Network"; -import { providerTypes, migrationFields } from "@src/constants"; +import { providerTypes } from "@src/constants"; import configLoader from "@src/utils/Config"; import LoadingButton from "@src/components/ui/LoadingButton"; import minionPoolStore from "@src/stores/MinionPoolStore"; @@ -105,11 +104,11 @@ const Buttons = styled.div` type Width = "normal" | "wide"; type Props = { - type?: "replica" | "migration"; + type?: "transfer" | "deployment"; isOpen: boolean; onRequestClose: () => void; onUpdateComplete: (redirectTo: string) => void; - replica: TransferItemDetails; + transfer: ActionItemDetails; destinationEndpoint: Endpoint; sourceEndpoint: Endpoint; instancesDetails: Instance[]; @@ -187,7 +186,7 @@ class TransferItemModal extends React.Component { getStorageMap(storageBackends: StorageBackend[]): StorageMap[] { const storageMap: StorageMap[] = []; - const currentStorage = this.props.replica.storage_mappings; + const currentStorage = this.props.transfer.storage_mappings; const buildStorageMap = ( type: "backend" | "disk", mapping: any @@ -246,7 +245,7 @@ class TransferItemModal extends React.Component { getSelectedNetworks(): NetworkMap[] { const selectedNetworks: NetworkMap[] = []; - const networkMap: any = this.props.replica.network_map; + const networkMap: any = this.props.transfer.network_map; if (networkMap) { Object.keys(networkMap).forEach(sourceNetworkName => { @@ -334,8 +333,8 @@ class TransferItemModal extends React.Component { return defaultStorage; }; - if (this.props.replica.storage_mappings?.default) { - return buildDefaultStorage(this.props.replica.storage_mappings.default); + if (this.props.transfer.storage_mappings?.default) { + return buildDefaultStorage(this.props.transfer.storage_mappings.default); } if (endpointStore.storageConfigDefault) { @@ -354,8 +353,8 @@ class TransferItemModal extends React.Component { const currentData = type === "source" ? this.state.sourceData : this.state.destinationData; - const replicaMinionMappings = - this.props.replica[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS]; + const transferMinionMappings = + this.props.transfer[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS]; if (parentFieldName) { if ( @@ -366,10 +365,10 @@ class TransferItemModal extends React.Component { } if ( parentFieldName === INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS && - replicaMinionMappings && - replicaMinionMappings[fieldName] !== undefined + transferMinionMappings && + transferMinionMappings[fieldName] !== undefined ) { - return replicaMinionMappings[fieldName]; + return transferMinionMappings[fieldName]; } } @@ -378,8 +377,8 @@ class TransferItemModal extends React.Component { } if (fieldName === "title") { - if (this.props.replica.notes) { - return this.props.replica.notes; + if (this.props.transfer.notes) { + return this.props.transfer.notes; } let title = this.props.instancesDetails?.[0]?.name; if ( @@ -393,22 +392,22 @@ class TransferItemModal extends React.Component { if (fieldName === "minion_pool_id") { return type === "source" - ? this.props.replica.origin_minion_pool_id - : this.props.replica.destination_minion_pool_id; + ? this.props.transfer.origin_minion_pool_id + : this.props.transfer.destination_minion_pool_id; } - const replicaData: any = + const transferData: any = type === "source" - ? this.props.replica.source_environment - : this.props.replica.destination_environment; + ? this.props.transfer.source_environment + : this.props.transfer.destination_environment; if (parentFieldName) { - if (replicaData[parentFieldName]?.[fieldName] !== undefined) { - return replicaData[parentFieldName][fieldName]; + if (transferData[parentFieldName]?.[fieldName] !== undefined) { + return transferData[parentFieldName][fieldName]; } } - if (replicaData[fieldName] !== undefined) { - return replicaData[fieldName]; + if (transferData[fieldName] !== undefined) { + return transferData[fieldName]; } const endpoint = type === "source" @@ -419,16 +418,10 @@ class TransferItemModal extends React.Component { const osMapping = /^(windows|linux)/.exec(fieldName); if (osMapping) { const osData = - replicaData[`${plugin.migrationImageMapFieldName}/${osMapping[0]}`]; + transferData[`${plugin.migrationImageMapFieldName}/${osMapping[0]}`]; return osData; } - const anyData = this.props.replica as any; - if (migrationFields.find(f => f.name === fieldName) && anyData[fieldName]) { - return anyData[fieldName]; - } - if (fieldName === "skip_os_morphing" && this.props.type === "migration") { - return migrationStore.getDefaultSkipOsMorphing(anyData); - } + return defaultValue; } @@ -474,11 +467,9 @@ class TransferItemModal extends React.Component { useCache, }); } catch (err) { - if (optionsType === "destination" || this.props.type === "migration") { + if (optionsType === "destination") { const destinationFailedMessage = - this.props.type === "replica" - ? "An error has occurred during the loading of the Replica's options for editing. There could be connection issues with the destination platform. Please retry the operation." - : "An error has occurred during loading of the source or destination platforms' environment options for editing of the Migration's parameters. You may still recreate the Migration with the same parameters as the original one by clicking \"Create\"."; + "An error has occurred during the loading of the Transfer's options for editing. There could be connection issues with the destination platform. Please retry the operation."; this.setState({ destinationFailedMessage }); } throw err; @@ -505,8 +496,8 @@ class TransferItemModal extends React.Component { : this.props.destinationEndpoint; const env = ObjectUtils.clone( type === "source" - ? this.props.replica.source_environment - : this.props.replica.destination_environment + ? this.props.transfer.source_environment + : this.props.transfer.destination_environment ); const stateEnv = type === "source" ? this.state.sourceData : this.state.destinationData; @@ -555,7 +546,7 @@ class TransferItemModal extends React.Component { isUpdateDisabled() { const isDestFailed = - this.props.type === "replica" && this.state.destinationFailedMessage; + this.props.type === "transfer" && this.state.destinationFailedMessage; return this.state.updateDisabled || isDestFailed; } @@ -593,8 +584,8 @@ class TransferItemModal extends React.Component { validateOptions(type: "source" | "destination") { const env = ObjectUtils.clone( type === "source" - ? this.props.replica.source_environment - : this.props.replica.destination_environment + ? this.props.transfer.source_environment + : this.props.transfer.destination_environment ); const data = @@ -632,13 +623,13 @@ class TransferItemModal extends React.Component { ? { ...this.state.sourceData } : { ...this.state.destinationData }; - const replicaData: any = + const transferData: any = type === "source" - ? this.props.replica.source_environment - : this.props.replica.destination_environment; + ? this.props.transfer.source_environment + : this.props.transfer.destination_environment; if (field.type === "array") { const currentValues: string[] = data[field.name] || []; - const oldValues: string[] = replicaData[field.name] || []; + const oldValues: string[] = transferData[field.name] || []; let values: string[] = currentValues; if (!currentValues.length) { values = [...oldValues]; @@ -658,7 +649,7 @@ class TransferItemModal extends React.Component { // existing fields from Object options from the previous Migration/Replica, // we always re-merge all the values on an object field update. data[parentFieldName] = - data[parentFieldName] || replicaData[parentFieldName] || {}; + data[parentFieldName] || transferData[parentFieldName] || {}; data[parentFieldName][field.name] = value; } else { data[field.name] = value; @@ -706,51 +697,21 @@ class TransferItemModal extends React.Component { uploadedScripts: this.state.uploadedScripts, removedScripts: this.state.removedScripts, }; - if (this.props.type === "replica") { - try { - await replicaStore.update({ - replica: this.props.replica as any, - sourceEndpoint: this.props.sourceEndpoint, - destinationEndpoint: this.props.destinationEndpoint, - updateData, - defaultStorage: this.getDefaultStorage(), - storageConfigDefault: endpointStore.storageConfigDefault, - }); - this.props.onRequestClose(); - this.props.onUpdateComplete( - `/transfers/${this.props.replica.id}/executions` - ); - } catch (err) { - this.setState({ updating: false }); - } - } else { - try { - const defaultStorage = EndpointUtils.getBusTypeStorageId( - endpointStore.storageBackends, - this.props.replica.storage_mappings?.default || null - ); - const replicaDefaultStorage: { - value: string | null; - busType?: string | null; - } = { - value: defaultStorage.id, - busType: defaultStorage.busType, - }; - const migration: MigrationItemDetails = await migrationStore.recreate({ - migration: this.props.replica as any, - sourceEndpoint: this.props.sourceEndpoint, - destEndpoint: this.props.destinationEndpoint, - updateData, - defaultStorage: replicaDefaultStorage, - updatedDefaultStorage: this.state.defaultStorage, - replicationCount: this.props.replica.replication_count, - }); - migrationStore.clearDetails(); - this.props.onRequestClose(); - this.props.onUpdateComplete(`/migrations/${migration.id}/tasks`); - } catch (err) { - this.setState({ updating: false }); - } + try { + await transferStore.update({ + transfer: this.props.transfer as any, + sourceEndpoint: this.props.sourceEndpoint, + destinationEndpoint: this.props.destinationEndpoint, + updateData, + defaultStorage: this.getDefaultStorage(), + storageConfigDefault: endpointStore.storageConfigDefault, + }); + this.props.onRequestClose(); + this.props.onUpdateComplete( + `/transfers/${this.props.transfer.id}/executions` + ); + } catch (err) { + this.setState({ updating: false }); } } @@ -842,7 +803,7 @@ class TransferItemModal extends React.Component { ? providerStore.sourceSchema : providerStore.destinationSchema; const fields = - this.props.type === "replica" ? schema.filter(f => !f.readOnly) : schema; + this.props.type === "transfer" ? schema.filter(f => !f.readOnly) : schema; const extraOptionsConfig = configLoader.config.extraOptionsApiCalls.find( o => { const provider = @@ -870,7 +831,7 @@ class TransferItemModal extends React.Component { return ( this.getFieldValue({ type, @@ -918,7 +879,6 @@ class TransferItemModal extends React.Component { "description", "execute_now", "execute_now_options", - ...migrationFields.map(f => f.name), ]} dictionaryKey={dictionaryKey} executeNowOptionsDisabled={ @@ -989,7 +949,7 @@ class TransferItemModal extends React.Component { }} uploadedScripts={this.state.uploadedScripts} removedScripts={this.state.removedScripts} - userScriptData={this.props.replica?.user_scripts} + userScriptData={this.props.transfer?.user_scripts} scrollableRef={(r: HTMLElement) => { this.scrollableRef = r; }} @@ -1030,7 +990,7 @@ class TransferItemModal extends React.Component { Loading ... ) : this.state.updating ? ( - {this.props.type === "replica" ? "Updating" : "Creating"} ... + {this.props.type === "transfer" ? "Updating" : "Creating"} ... ) : ( )} diff --git a/src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx b/src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx index bb4332f1..c9c35a98 100644 --- a/src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx +++ b/src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx @@ -16,7 +16,7 @@ import { observer } from "mobx-react"; import React from "react"; import styled from "styled-components"; -import { getTransferItemTitle, TransferItem } from "@src/@types/MainItem"; +import { getTransferItemTitle, ActionItem } from "@src/@types/MainItem"; import EndpointLogos from "@src/components/modules/EndpointModule/EndpointLogos"; import { ThemePalette, ThemeProps } from "@src/components/Theme"; import Checkbox from "@src/components/ui/Checkbox"; @@ -106,10 +106,10 @@ const Column = styled.div` `; type Props = { - item: TransferItem; + item: ActionItem; onClick: () => void; selected: boolean; - getListItemImage: (item: TransferItem) => string; + getListItemImage: (item: ActionItem) => string; showScheduleIcon?: boolean; endpointType: (endpointId: string) => string; getUserName: (userId: string) => string | undefined; @@ -122,19 +122,14 @@ class TransferListItem extends React.Component { return this.props.item.last_execution_status; } - getReplicaScenarioType() { + getTransferScenarioType() { let scenario = ""; switch(this.props.item.type) { - case "replica": + case "transfer": scenario = this.props.item.scenario; break; case "deployment": - scenario = this.props.item.replica_scenario; - break; - case "migration": - if (this.props.item.replica_id) { - scenario = "replica"; - } + scenario = this.props.item.transfer_scenario; break; default: } @@ -223,7 +218,7 @@ class TransferListItem extends React.Component { ) : null} {this.props.showScheduleIcon ? ( - + ) : null} diff --git a/src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx b/src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx index 2acbfcf2..8e5752a2 100644 --- a/src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx +++ b/src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx @@ -24,7 +24,7 @@ import { ThemePalette, ThemeProps } from "@src/components/Theme"; import FieldInput from "@src/components/ui/FieldInput"; import StatusImage from "@src/components/ui/StatusComponents/StatusImage"; import ToggleButtonBar from "@src/components/ui/ToggleButtonBar"; -import { executionOptions, migrationFields } from "@src/constants"; +import { executionOptions } from "@src/constants"; import { MinionPoolStoreUtils } from "@src/stores/MinionPoolStore"; import configLoader from "@src/utils/Config"; import LabelDictionary from "@src/utils/LabelDictionary"; @@ -297,10 +297,7 @@ class WizardOptions extends React.Component { }); } - if ( - this.props.wizardType === "migration" || - this.props.wizardType === "migration-destination-options-edit" - ) { + if (this.props.wizardType === "migration-destination-options-edit") { fieldsSchema.push({ name: "skip_os_morphing", type: "boolean", @@ -351,24 +348,6 @@ class WizardOptions extends React.Component { : `Set the options for ${this.props.wizardType} execution`, }); } - // } else if ( - // this.props.wizardType === "migration" || - // this.props.wizardType === "migration-destination-options-edit" - // ) { - // const shutdownInstanceField = migrationFields.find( - // f => f.name === "shutdown_instances" - // )!; - // shutdownInstanceField.disabled = this.props.executeNowOptionsDisabled; - // shutdownInstanceField.description = this.props.executeNowOptionsDisabled - // ? "The 'Shutdown Instances' option is disabled for the source provider" - // : shutdownInstanceField.description; - // fieldsSchema = [ - // ...fieldsSchema, - // ...migrationFields.map(f => - // f.name === "shutdown_instances" ? shutdownInstanceField : f - // ), - // ]; - // } return fieldsSchema; } diff --git a/src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx b/src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx index 7601ef48..bdad4437 100644 --- a/src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx +++ b/src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx @@ -35,7 +35,7 @@ import { ThemePalette, ThemeProps } from "@src/components/Theme"; import Button from "@src/components/ui/Button"; import InfoIcon from "@src/components/ui/InfoIcon"; import LoadingButton from "@src/components/ui/LoadingButton"; -import { migrationFields, providerTypes, wizardPages } from "@src/constants"; +import { providerTypes, wizardPages } from "@src/constants"; import endpointStore from "@src/stores/EndpointStore"; import instanceStore from "@src/stores/InstanceStore"; import minionPoolStore from "@src/stores/MinionPoolStore"; @@ -197,8 +197,8 @@ class WizardPageContent extends React.Component { getProvidersType(type: string) { return type === "source" - ? providerTypes.SOURCE_REPLICA - : providerTypes.TARGET_REPLICA; + ? providerTypes.SOURCE_TRANSFER + : providerTypes.TARGET_TRANSFER; } getProviders(direction: string): ProviderTypes[] { @@ -524,7 +524,6 @@ class WizardPageContent extends React.Component { "title", "execute_now", "execute_now_options", - ...migrationFields.map(f => f.name), ]} selectedInstances={this.props.wizardData.selectedInstances} showSeparatePerVm={Boolean( diff --git a/src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx b/src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx index 93fbdda3..41ad90aa 100644 --- a/src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx +++ b/src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx @@ -24,7 +24,6 @@ import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from "@src/components/module import { getDisks } from "@src/components/modules/WizardModule/WizardStorage"; import { ThemePalette, ThemeProps } from "@src/components/Theme"; import StatusPill from "@src/components/ui/StatusComponents/StatusPill"; -import { migrationFields } from "@src/constants"; import configLoader from "@src/utils/Config"; import DateUtils from "@src/utils/DateUtils"; import LabelDictionary from "@src/utils/LabelDictionary"; @@ -448,25 +447,6 @@ class WizardSummary extends React.Component { ); - // const migrationOptions = [ - // , - // , - // ]; - const renderDefaultStorageOption = () => (