Login:App:Confirm: some fixes on pages

This commit is contained in:
Darya Umrikhina 2024-08-01 15:21:44 +04:00
parent 496000a67c
commit 5431148168
6 changed files with 25 additions and 17 deletions

View File

@ -24,14 +24,14 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import EmailActivationForm from "@/components/EmailActivationForm"; import EmailActivationHandler from "@/components/EmailActivationHandler";
type EmailActivationProps = { type EmailActivationProps = {
searchParams: { [key: string]: string }; searchParams: { [key: string]: string };
}; };
async function Page({ searchParams }: EmailActivationProps) { async function Page({ searchParams }: EmailActivationProps) {
return <EmailActivationForm />; return <EmailActivationHandler />;
} }
export default Page; export default Page;

View File

@ -30,11 +30,11 @@ import { GreetingContainer } from "@/components/GreetingContainer";
import PasswordChangeForm from "@/components/PasswordChangeForm"; import PasswordChangeForm from "@/components/PasswordChangeForm";
import { getSettings } from "@/utils/actions"; import { getSettings } from "@/utils/actions";
type EmailActivationProps = { type PasswordChangProps = {
searchParams: { [key: string]: string }; searchParams: { [key: string]: string };
}; };
async function Page({ searchParams }: EmailActivationProps) { async function Page({ searchParams }: PasswordChangProps) {
const settings = await getSettings(); const settings = await getSettings();
return ( return (
@ -42,7 +42,7 @@ async function Page({ searchParams }: EmailActivationProps) {
{settings && typeof settings !== "string" && ( {settings && typeof settings !== "string" && (
<> <>
<GreetingContainer greetingSettings={settings?.greetingSettings} /> <GreetingContainer greetingSettings={settings?.greetingSettings} />
<FormWrapper> <FormWrapper id="password-change-form">
<PasswordChangeForm passwordHash={settings.passwordHash} /> <PasswordChangeForm passwordHash={settings.passwordHash} />
</FormWrapper> </FormWrapper>
</> </>

View File

@ -49,7 +49,7 @@ async function Page({ searchParams }: PortalOwnerChangeProps) {
{settings && typeof settings !== "string" && ( {settings && typeof settings !== "string" && (
<> <>
<GreetingContainer greetingSettings={settings.greetingSettings} /> <GreetingContainer greetingSettings={settings.greetingSettings} />
<FormWrapper id="login-form"> <FormWrapper id="owner-change-form">
<ChangeOwnerForm newOwner={user?.displayName} /> <ChangeOwnerForm newOwner={user?.displayName} />
</FormWrapper> </FormWrapper>
</> </>

View File

@ -25,6 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import TfaActivationForm from "@/components/TfaActivationForm"; import TfaActivationForm from "@/components/TfaActivationForm";
import { StyledForm } from "@/components/TfaActivationForm/TfaActivationForm.styled";
import { getStringFromSearchParams } from "@/utils"; import { getStringFromSearchParams } from "@/utils";
import { import {
getColorTheme, getColorTheme,
@ -33,11 +34,11 @@ import {
getUserFromConfirm, getUserFromConfirm,
} from "@/utils/actions"; } from "@/utils/actions";
type PortalOwnerChangeProps = { type TfaActivationProps = {
searchParams: { [key: string]: string }; searchParams: { [key: string]: string };
}; };
async function Page({ searchParams }: PortalOwnerChangeProps) { async function Page({ searchParams }: TfaActivationProps) {
const colorTheme = await getColorTheme(); const colorTheme = await getColorTheme();
const currentColorScheme = colorTheme?.themes.find((theme) => { const currentColorScheme = colorTheme?.themes.find((theme) => {
@ -54,7 +55,7 @@ async function Page({ searchParams }: PortalOwnerChangeProps) {
return ( return (
<> <>
{settings && typeof settings !== "string" && ( {settings && typeof settings !== "string" && (
<> <StyledForm className="set-app-container">
<TfaActivationForm <TfaActivationForm
secretKey={res.manualEntryKey} secretKey={res.manualEntryKey}
qrCode={res.qrCodeSetupImageUrl} qrCode={res.qrCodeSetupImageUrl}
@ -62,7 +63,7 @@ async function Page({ searchParams }: PortalOwnerChangeProps) {
userName={user?.userName} userName={user?.userName}
currentColorScheme={currentColorScheme} currentColorScheme={currentColorScheme}
/> />
</> </StyledForm>
)} )}
</> </>
); );

View File

@ -24,15 +24,17 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import { GreetingContainer } from "@/components/GreetingContainer";
import TfaAuthForm from "@/components/TfaAuthForm"; import TfaAuthForm from "@/components/TfaAuthForm";
import { getStringFromSearchParams } from "@/utils"; import { getStringFromSearchParams } from "@/utils";
import { getSettings, getUserFromConfirm } from "@/utils/actions"; import { getSettings, getUserFromConfirm } from "@/utils/actions";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
type PortalOwnerChangeProps = { type TfaAuthProps = {
searchParams: { [key: string]: string }; searchParams: { [key: string]: string };
}; };
async function Page({ searchParams }: PortalOwnerChangeProps) { async function Page({ searchParams }: TfaAuthProps) {
const confirmKey = getStringFromSearchParams(searchParams); const confirmKey = getStringFromSearchParams(searchParams);
const uid = searchParams.uid; const uid = searchParams.uid;
@ -43,10 +45,13 @@ async function Page({ searchParams }: PortalOwnerChangeProps) {
<> <>
{settings && typeof settings !== "string" && ( {settings && typeof settings !== "string" && (
<> <>
<TfaAuthForm <GreetingContainer />
passwordHash={settings.passwordHash} <FormWrapper id="tfa-auth-form">
userName={user?.userName} <TfaAuthForm
/> passwordHash={settings.passwordHash}
userName={user?.userName}
/>
</FormWrapper>
</> </>
)} )}
</> </>

View File

@ -32,6 +32,7 @@ import CreateUserForm from "@/components/CreateUserForm";
import { GreetingCleateUserContainer } from "@/components/GreetingContainer"; import { GreetingCleateUserContainer } from "@/components/GreetingContainer";
import { getStringFromSearchParams } from "@/utils"; import { getStringFromSearchParams } from "@/utils";
import { getSettings, getUserFromConfirm } from "@/utils/actions"; import { getSettings, getUserFromConfirm } from "@/utils/actions";
import LanguageComboboxWrapper from "@/components/LanguageCombobox";
type LinkInviteProps = { type LinkInviteProps = {
searchParams: { [key: string]: string }; searchParams: { [key: string]: string };
@ -53,6 +54,7 @@ async function Page({ searchParams, params }: LinkInviteProps) {
return ( return (
<> <>
<LanguageComboboxWrapper />
{settings && typeof settings !== "string" && ( {settings && typeof settings !== "string" && (
<> <>
<GreetingCleateUserContainer <GreetingCleateUserContainer
@ -60,7 +62,7 @@ async function Page({ searchParams, params }: LinkInviteProps) {
firstName={user?.firstName} firstName={user?.firstName}
lastName={user?.lastName} lastName={user?.lastName}
/> />
<FormWrapper id="login-form"> <FormWrapper id="invite-form">
<CreateUserForm <CreateUserForm
userNameRegex={settings.userNameRegex} userNameRegex={settings.userNameRegex}
passwordHash={settings.passwordHash} passwordHash={settings.passwordHash}