Skip to content

Commit

Permalink
Add link to return to Assisted Migration when credentials were accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
ammont82 committed Nov 8, 2024
1 parent d344804 commit accf365
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/agent/src/login-form/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ export const LoginForm: React.FC<LoginForm.Props> = (props) => {
>
Login
</Button>
{vm.formState === FormStates.CredentialsAccepted && (
<Button
variant="secondary"
onClick={vm.handleReturnToAssistedMigration}
style={{ marginLeft: '16px' }}
>
Return to Assisted Migration
</Button>)}
</SplitItem>
<SplitItem isFilled></SplitItem>
<SplitItem style={{ paddingRight: "2rem" }}>
Expand Down
4 changes: 4 additions & 0 deletions apps/agent/src/login-form/hooks/UseViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface LoginFormViewModelInterface {
alertActionLinkText?: string;
shouldDisplayAlert: boolean;
handleSubmit: React.FormEventHandler<HTMLFormElement>;
handleReturnToAssistedMigration: () => void;
}

const _computeFormControlVariant = (
Expand Down Expand Up @@ -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
}, []),
};
};

0 comments on commit accf365

Please sign in to comment.