From e9141a4dfa0addee4ba5b4fb2028fe1c670e0714 Mon Sep 17 00:00:00 2001 From: Montse Ortega Date: Fri, 8 Nov 2024 11:51:59 +0100 Subject: [PATCH 1/5] Add link to return to Assisted Migration when credentials were accepted Signed-off-by: Montse Ortega --- apps/agent/src/login-form/LoginForm.tsx | 8 ++++++++ apps/agent/src/login-form/hooks/UseViewModel.ts | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/apps/agent/src/login-form/LoginForm.tsx b/apps/agent/src/login-form/LoginForm.tsx index b2ecb03..99780d0 100644 --- a/apps/agent/src/login-form/LoginForm.tsx +++ b/apps/agent/src/login-form/LoginForm.tsx @@ -189,6 +189,14 @@ export const LoginForm: React.FC = (props) => { > Login + {vm.formState === FormStates.CredentialsAccepted && ( + )} diff --git a/apps/agent/src/login-form/hooks/UseViewModel.ts b/apps/agent/src/login-form/hooks/UseViewModel.ts index 4b26a84..6f17cfd 100644 --- a/apps/agent/src/login-form/hooks/UseViewModel.ts +++ b/apps/agent/src/login-form/hooks/UseViewModel.ts @@ -33,6 +33,7 @@ export interface LoginFormViewModelInterface { alertActionLinkText?: string; shouldDisplayAlert: boolean; handleSubmit: React.FormEventHandler; + handleReturnToAssistedMigration: () => void; } const _computeFormControlVariant = ( @@ -218,5 +219,8 @@ export const useViewModel = (): LoginFormViewModelInterface => { }, [agentApi, navigateTo] ), + handleReturnToAssistedMigration: useCallback(() => { + window.open('http://localhost:3000/migrate', '_blank', 'noopener,noreferrer'); // Abre en una nueva pestaña + }, []), }; }; From 4c1983bbff98b880793964f90ae4172f4403fc2f Mon Sep 17 00:00:00 2001 From: Montse Ortega Date: Mon, 11 Nov 2024 10:17:14 +0100 Subject: [PATCH 2/5] Add APP_ASSISTED_MIGRATION_URL environment variable Signed-off-by: Montse Ortega --- apps/agent/.env.development | 1 + apps/agent/.env.production | 1 + apps/agent/src/login-form/hooks/UseViewModel.ts | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 apps/agent/.env.development create mode 100644 apps/agent/.env.production diff --git a/apps/agent/.env.development b/apps/agent/.env.development new file mode 100644 index 0000000..8aca29b --- /dev/null +++ b/apps/agent/.env.development @@ -0,0 +1 @@ +APP_ASSISTED_MIGRATION_URL=http://localhost:3000/migrate \ No newline at end of file diff --git a/apps/agent/.env.production b/apps/agent/.env.production new file mode 100644 index 0000000..20247e5 --- /dev/null +++ b/apps/agent/.env.production @@ -0,0 +1 @@ +APP_ASSISTED_MIGRATION_URL=http://console.redhat.com/assisted-migration \ No newline at end of file diff --git a/apps/agent/src/login-form/hooks/UseViewModel.ts b/apps/agent/src/login-form/hooks/UseViewModel.ts index 6f17cfd..0b3be2d 100644 --- a/apps/agent/src/login-form/hooks/UseViewModel.ts +++ b/apps/agent/src/login-form/hooks/UseViewModel.ts @@ -220,7 +220,8 @@ export const useViewModel = (): LoginFormViewModelInterface => { [agentApi, navigateTo] ), handleReturnToAssistedMigration: useCallback(() => { - window.open('http://localhost:3000/migrate', '_blank', 'noopener,noreferrer'); // Abre en una nueva pestaña + const assistedMigrationUrl = import.meta.env.ASSISTED_MIGRATION_URL || 'http://localhost:3000/migrate'; + window.open(assistedMigrationUrl, '_blank', 'noopener,noreferrer'); }, []), }; }; From cc30b702a8e11f79aad0e0bbcea55477b38faaa5 Mon Sep 17 00:00:00 2001 From: Montse Ortega Date: Mon, 11 Nov 2024 14:00:45 +0100 Subject: [PATCH 3/5] Change APP_ASSISTED_MIGRATION_URL to go to the sources page directly Signed-off-by: Montse Ortega --- apps/agent/.env.development | 2 +- apps/agent/src/login-form/hooks/UseViewModel.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/agent/.env.development b/apps/agent/.env.development index 8aca29b..e7e093f 100644 --- a/apps/agent/.env.development +++ b/apps/agent/.env.development @@ -1 +1 @@ -APP_ASSISTED_MIGRATION_URL=http://localhost:3000/migrate \ No newline at end of file +APP_ASSISTED_MIGRATION_URL=http://localhost:3000/migrate/wizard \ No newline at end of file diff --git a/apps/agent/src/login-form/hooks/UseViewModel.ts b/apps/agent/src/login-form/hooks/UseViewModel.ts index 0b3be2d..3b6d178 100644 --- a/apps/agent/src/login-form/hooks/UseViewModel.ts +++ b/apps/agent/src/login-form/hooks/UseViewModel.ts @@ -220,7 +220,7 @@ export const useViewModel = (): LoginFormViewModelInterface => { [agentApi, navigateTo] ), handleReturnToAssistedMigration: useCallback(() => { - const assistedMigrationUrl = import.meta.env.ASSISTED_MIGRATION_URL || 'http://localhost:3000/migrate'; + const assistedMigrationUrl = import.meta.env.ASSISTED_MIGRATION_URL || 'http://localhost:3000/migrate/wizard'; window.open(assistedMigrationUrl, '_blank', 'noopener,noreferrer'); }, []), }; From 35e3e6b414a34009dda665754322d0338af5fbed Mon Sep 17 00:00:00 2001 From: Montse Ortega Date: Tue, 12 Nov 2024 10:53:10 +0100 Subject: [PATCH 4/5] Change APP_ASSISTED_MIGRATION_URL to production URL Signed-off-by: Montse Ortega --- apps/agent/.env.production | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/agent/.env.production b/apps/agent/.env.production index 20247e5..1562563 100644 --- a/apps/agent/.env.production +++ b/apps/agent/.env.production @@ -1 +1 @@ -APP_ASSISTED_MIGRATION_URL=http://console.redhat.com/assisted-migration \ No newline at end of file +APP_ASSISTED_MIGRATION_URL=http://console.redhat.com/migration-assessment/migrate/wizard \ No newline at end of file From 1f5424b08efa77786aa1e67e8db3737cc9e454a5 Mon Sep 17 00:00:00 2001 From: Montse Ortega Date: Thu, 14 Nov 2024 13:40:54 +0100 Subject: [PATCH 5/5] Changes related with the new design Signed-off-by: Montse Ortega --- apps/agent/src/login-form/FormStates.ts | 1 + apps/agent/src/login-form/LoginForm.tsx | 97 ++++++++++++++----- .../src/login-form/hooks/UseViewModel.ts | 5 +- 3 files changed, 80 insertions(+), 23 deletions(-) diff --git a/apps/agent/src/login-form/FormStates.ts b/apps/agent/src/login-form/FormStates.ts index b0ec753..bc36f66 100644 --- a/apps/agent/src/login-form/FormStates.ts +++ b/apps/agent/src/login-form/FormStates.ts @@ -5,4 +5,5 @@ export const enum FormStates { CredentialsAccepted = "credentialsAccepted", CredentialsRejected = "credentialsRejected", InvalidCredentials = "invalidCredentials", + GatheringInventory = "gatheringInventory" } diff --git a/apps/agent/src/login-form/LoginForm.tsx b/apps/agent/src/login-form/LoginForm.tsx index 99780d0..1b4f0fe 100644 --- a/apps/agent/src/login-form/LoginForm.tsx +++ b/apps/agent/src/login-form/LoginForm.tsx @@ -21,9 +21,12 @@ import { Spinner, SplitItem, Split, + Icon, } from "@patternfly/react-core"; import { LoginFormViewModelInterface } from "./hooks/UseViewModel"; import { FormStates } from "./FormStates"; +import { CheckCircleIcon } from "@patternfly/react-icons"; +import globalSuccessColor100 from "@patternfly/react-tokens/dist/esm/global_success_color_100"; // eslint-disable-next-line @typescript-eslint/no-namespace export namespace LoginForm { @@ -34,7 +37,7 @@ export namespace LoginForm { export const LoginForm: React.FC = (props) => { const { vm } = props; - + console.log(vm.formState); return ( = (props) => { > - Migration Planner + Migration Discovery VM - The Migration Planner requires access to your VMware environment to - execute a comprehensive discovery process that gathers essential - data, including network topology, storage configuration, and virtual - machine inventory. The process leverages this information to provide - tailored recommendations for a seamless workload transition to - OpenShift Virtualization. + The migration discovery VM requires access to your VMware + environment to execute a discovery process that gathers essential + data, including network topology, storage configuration, and VM + inventory. The process leverages this information to provide + recommendations for a seamless migration to OpenShift + Virtualization. - +
- + - +
+ + {vm.formState !== FormStates.CredentialsAccepted && vm.formState !== FormStates.GatheringInventory && ( - {vm.formState === FormStates.CredentialsAccepted && ( - )} + Log in + )} + {(vm.formState === FormStates.CredentialsAccepted || vm.formState === FormStates.GatheringInventory) && ( + + )} diff --git a/apps/agent/src/login-form/hooks/UseViewModel.ts b/apps/agent/src/login-form/hooks/UseViewModel.ts index 3b6d178..64e41a1 100644 --- a/apps/agent/src/login-form/hooks/UseViewModel.ts +++ b/apps/agent/src/login-form/hooks/UseViewModel.ts @@ -75,6 +75,8 @@ export const useViewModel = (): LoginFormViewModelInterface => { setFormState(FormStates.WaitingForCredentials); break; case SourceStatus.SourceStatusGatheringInitialInventory: + setFormState(FormStates.GatheringInventory); + break; case SourceStatus.SourceStatusUpToDate: setFormState(FormStates.CredentialsAccepted); break; @@ -135,7 +137,7 @@ export const useViewModel = (): LoginFormViewModelInterface => { return [ { id: 1, - text: "The Migration Planner has connected to your VMware environment", + text: "The migration discovery WM is connected to your VMware environment", }, ]; case FormStates.InvalidCredentials: @@ -161,6 +163,7 @@ export const useViewModel = (): LoginFormViewModelInterface => { FormStates.CheckingStatus, FormStates.WaitingForCredentials, FormStates.Submitting, + FormStates.GatheringInventory ].includes(formState), [formState] ),