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
// 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 = {
searchParams: { [key: string]: string };
};
async function Page({ searchParams }: EmailActivationProps) {
return <EmailActivationForm />;
return <EmailActivationHandler />;
}
export default Page;

View File

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

View File

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

View File

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

View File

@ -24,15 +24,17 @@
// 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
import { GreetingContainer } from "@/components/GreetingContainer";
import TfaAuthForm from "@/components/TfaAuthForm";
import { getStringFromSearchParams } from "@/utils";
import { getSettings, getUserFromConfirm } from "@/utils/actions";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
type PortalOwnerChangeProps = {
type TfaAuthProps = {
searchParams: { [key: string]: string };
};
async function Page({ searchParams }: PortalOwnerChangeProps) {
async function Page({ searchParams }: TfaAuthProps) {
const confirmKey = getStringFromSearchParams(searchParams);
const uid = searchParams.uid;
@ -43,10 +45,13 @@ async function Page({ searchParams }: PortalOwnerChangeProps) {
<>
{settings && typeof settings !== "string" && (
<>
<TfaAuthForm
passwordHash={settings.passwordHash}
userName={user?.userName}
/>
<GreetingContainer />
<FormWrapper id="tfa-auth-form">
<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 { getStringFromSearchParams } from "@/utils";
import { getSettings, getUserFromConfirm } from "@/utils/actions";
import LanguageComboboxWrapper from "@/components/LanguageCombobox";
type LinkInviteProps = {
searchParams: { [key: string]: string };
@ -53,6 +54,7 @@ async function Page({ searchParams, params }: LinkInviteProps) {
return (
<>
<LanguageComboboxWrapper />
{settings && typeof settings !== "string" && (
<>
<GreetingCleateUserContainer
@ -60,7 +62,7 @@ async function Page({ searchParams, params }: LinkInviteProps) {
firstName={user?.firstName}
lastName={user?.lastName}
/>
<FormWrapper id="login-form">
<FormWrapper id="invite-form">
<CreateUserForm
userNameRegex={settings.userNameRegex}
passwordHash={settings.passwordHash}