From 7e70e4fc84bce3c12a5bf2c6c98370335d3302ff Mon Sep 17 00:00:00 2001 From: Mamadou DICKO <63923024+mamadoudicko@users.noreply.github.com> Date: Thu, 26 Oct 2023 09:48:41 +0200 Subject: [PATCH] feat: add new signin/login page (#1492) Issue https://github.com/StanGirard/quivr/issues/1404 https://github.com/StanGirard/quivr/assets/63923024/703fedf3-2f39-407b-afc2-78318829ca0f --- .../app/(auth)/login/__tests__/page.test.tsx | 8 +- .../login/components/GoogleLogin/index.tsx | 4 +- .../MagicLinkLogin/hooks/useMagicLinkLogin.ts | 11 +- .../login/components/MagicLinkLogin/index.tsx | 4 +- .../hooks/__tests__/usePassword.test.ts | 50 ------- .../hooks/usePasswordForgotten.ts | 59 -------- .../components/PasswordForgotten/index.tsx | 33 ----- .../login/hooks/__tests__/useLogin.test.ts | 38 ----- frontend/app/(auth)/login/hooks/useLogin.ts | 48 +------ frontend/app/(auth)/login/page.tsx | 77 ++++------ .../recover-password/__tests__/page.test.tsx | 131 ------------------ frontend/app/(auth)/recover-password/page.tsx | 91 ------------ .../app/(auth)/signup/__tests__/page.test.tsx | 66 --------- frontend/app/(auth)/signup/hooks/useSignUp.ts | 50 ------- frontend/app/(auth)/signup/page.tsx | 64 --------- .../components/HomeHeader/HomeHeader.tsx | 2 +- .../components/PopoverMenuMobile.tsx | 3 +- .../HomeHeader/hooks/useHomeHeader.tsx | 2 +- .../Sections/DemoSection/DemoSection.tsx | 6 +- .../components/Sections/FooterSection.tsx | 6 +- .../components/Sections/IntroSection.tsx | 6 +- .../SecuritySection/SecuritySection.tsx | 6 +- .../(home)/components/UseCases/UseCases.tsx | 6 +- .../components => lib/assets}/QuivrLogo.tsx | 0 frontend/lib/components/Footer/index.tsx | 8 +- .../NavItems/components/AuthButtons.tsx | 4 +- frontend/lib/components/NavBar/index.tsx | 3 +- frontend/lib/config/LocaleConfig/resources.ts | 26 ---- frontend/public/locales/en/login.json | 17 +-- frontend/public/locales/en/signUp.json | 13 -- frontend/public/locales/en/translation.json | 1 - .../public/locales/en/updatePassword.json | 5 - frontend/public/locales/es/login.json | 19 +-- frontend/public/locales/es/signUp.json | 13 -- frontend/public/locales/es/translation.json | 1 - .../public/locales/es/updatePassword.json | 5 - frontend/public/locales/fr/login.json | 19 +-- frontend/public/locales/fr/signUp.json | 13 -- frontend/public/locales/fr/translation.json | 1 - .../public/locales/fr/updatePassword.json | 5 - frontend/public/locales/pt-br/login.json | 19 +-- frontend/public/locales/pt-br/signUp.json | 13 -- .../public/locales/pt-br/translation.json | 1 - .../public/locales/pt-br/updatePassword.json | 5 - frontend/public/locales/ru/login.json | 21 +-- frontend/public/locales/ru/signUp.json | 13 -- frontend/public/locales/ru/translation.json | 1 - .../public/locales/ru/updatePassword.json | 5 - frontend/public/locales/zh-cn/login.json | 19 +-- frontend/public/locales/zh-cn/signUp.json | 13 -- .../public/locales/zh-cn/translation.json | 1 - .../public/locales/zh-cn/updatePassword.json | 5 - frontend/tailwind.config.js | 1 + 53 files changed, 109 insertions(+), 932 deletions(-) delete mode 100644 frontend/app/(auth)/login/components/PasswordForgotten/hooks/__tests__/usePassword.test.ts delete mode 100644 frontend/app/(auth)/login/components/PasswordForgotten/hooks/usePasswordForgotten.ts delete mode 100644 frontend/app/(auth)/login/components/PasswordForgotten/index.tsx delete mode 100644 frontend/app/(auth)/login/hooks/__tests__/useLogin.test.ts delete mode 100644 frontend/app/(auth)/recover-password/__tests__/page.test.tsx delete mode 100644 frontend/app/(auth)/recover-password/page.tsx delete mode 100644 frontend/app/(auth)/signup/__tests__/page.test.tsx delete mode 100644 frontend/app/(auth)/signup/hooks/useSignUp.ts delete mode 100644 frontend/app/(auth)/signup/page.tsx rename frontend/{app/(home)/components/HomeHeader/components => lib/assets}/QuivrLogo.tsx (100%) delete mode 100644 frontend/public/locales/en/signUp.json delete mode 100644 frontend/public/locales/en/updatePassword.json delete mode 100644 frontend/public/locales/es/signUp.json delete mode 100644 frontend/public/locales/es/updatePassword.json delete mode 100644 frontend/public/locales/fr/signUp.json delete mode 100644 frontend/public/locales/fr/updatePassword.json delete mode 100644 frontend/public/locales/pt-br/signUp.json delete mode 100644 frontend/public/locales/pt-br/updatePassword.json delete mode 100644 frontend/public/locales/ru/signUp.json delete mode 100644 frontend/public/locales/ru/updatePassword.json delete mode 100644 frontend/public/locales/zh-cn/signUp.json delete mode 100644 frontend/public/locales/zh-cn/updatePassword.json diff --git a/frontend/app/(auth)/login/__tests__/page.test.tsx b/frontend/app/(auth)/login/__tests__/page.test.tsx index 8723f301f..7b4d6a195 100644 --- a/frontend/app/(auth)/login/__tests__/page.test.tsx +++ b/frontend/app/(auth)/login/__tests__/page.test.tsx @@ -19,13 +19,17 @@ vi.mock("@/lib/context/SupabaseProvider", () => ({ useSupabase: () => mockUseSupabase(), })); +vi.mock("@/lib/assets/QuivrLogo", () => ({ + QuivrLogo: () =>
LOGO
, +})); + vi.mock("@/services/analytics/june/useEventTracking", () => ({ useEventTracking: () => ({ track: vi.fn() }), })); describe("Login component", () => { afterEach(() => { - vi.clearAllMocks(); + vi.restoreAllMocks(); }); it("redirects to /upload if user is already signed in and is not coming from another page", () => { @@ -68,7 +72,7 @@ describe("Login component", () => { session: { user: undefined }, }); const { getByTestId } = render(); - const signInForm = getByTestId("sign-in-form"); + const signInForm = getByTestId("sign-in-card"); expect(signInForm).toBeDefined(); }); }); diff --git a/frontend/app/(auth)/login/components/GoogleLogin/index.tsx b/frontend/app/(auth)/login/components/GoogleLogin/index.tsx index 5cb04a6c2..497802b37 100644 --- a/frontend/app/(auth)/login/components/GoogleLogin/index.tsx +++ b/frontend/app/(auth)/login/components/GoogleLogin/index.tsx @@ -1,4 +1,5 @@ import { useTranslation } from "react-i18next"; +import { FcGoogle } from "react-icons/fc"; import Button from "@/lib/components/ui/Button"; @@ -12,10 +13,11 @@ export const GoogleLoginButton = (): JSX.Element => { ); diff --git a/frontend/app/(auth)/login/components/MagicLinkLogin/hooks/useMagicLinkLogin.ts b/frontend/app/(auth)/login/components/MagicLinkLogin/hooks/useMagicLinkLogin.ts index 906fe6e70..699880ba5 100644 --- a/frontend/app/(auth)/login/components/MagicLinkLogin/hooks/useMagicLinkLogin.ts +++ b/frontend/app/(auth)/login/components/MagicLinkLogin/hooks/useMagicLinkLogin.ts @@ -1,13 +1,14 @@ import { useState } from "react"; +import { useTranslation } from "react-i18next"; + +import { useSupabase } from "@/lib/context/SupabaseProvider"; +import { useToast } from "@/lib/hooks"; type UseMagicLinkLoginProps = { email: string; setEmail: (email: string) => void; }; -import { useSupabase } from "@/lib/context/SupabaseProvider"; -import { useToast } from "@/lib/hooks"; - export const useMagicLinkLogin = ({ email, setEmail, @@ -17,14 +18,14 @@ export const useMagicLinkLogin = ({ } => { const { supabase } = useSupabase(); const [isPending, setIsPending] = useState(false); - + const { t } = useTranslation("login"); const { publish } = useToast(); const handleMagicLinkLogin = async () => { if (email === "") { publish({ variant: "danger", - text: "Please enter your email address", + text: t("errorMailMissed"), }); return; diff --git a/frontend/app/(auth)/login/components/MagicLinkLogin/index.tsx b/frontend/app/(auth)/login/components/MagicLinkLogin/index.tsx index 229f40eb4..1fb56a3c3 100644 --- a/frontend/app/(auth)/login/components/MagicLinkLogin/index.tsx +++ b/frontend/app/(auth)/login/components/MagicLinkLogin/index.tsx @@ -24,11 +24,11 @@ export const MagicLinkLogin = ({ return ( ); }; diff --git a/frontend/app/(auth)/login/components/PasswordForgotten/hooks/__tests__/usePassword.test.ts b/frontend/app/(auth)/login/components/PasswordForgotten/hooks/__tests__/usePassword.test.ts deleted file mode 100644 index 32e9172d5..000000000 --- a/frontend/app/(auth)/login/components/PasswordForgotten/hooks/__tests__/usePassword.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { act, renderHook } from "@testing-library/react"; -import { describe, expect, it, vi } from "vitest"; - -import { usePasswordForgotten } from "../usePasswordForgotten"; - -const mockResetPasswordForEmail = vi.fn(() => ({ error: null })); - -const mockUseSupabase = () => ({ - supabase: { - auth: { - resetPasswordForEmail: mockResetPasswordForEmail, - }, - }, -}); - -vi.mock("@/lib/context/SupabaseProvider", () => ({ - useSupabase: () => mockUseSupabase(), -})); - -const setEmail = vi.fn(); - -describe("usePassword", () => { - it("should not call resetPasswordForEmail if email is empty", async () => { - const { result } = renderHook(() => - usePasswordForgotten({ - email: "", - setEmail, - }) - ); - - await act(() => result.current.handleRecoverPassword()); - expect(mockResetPasswordForEmail).toHaveBeenCalledTimes(0); - }); - - it("should call resetPasswordForEmail with proper arguments", async () => { - const email = "user@quivr.app"; - const { result } = renderHook(() => - usePasswordForgotten({ - email, - setEmail, - }) - ); - - await act(() => result.current.handleRecoverPassword()); - expect(mockResetPasswordForEmail).toHaveBeenCalledTimes(1); - expect(mockResetPasswordForEmail).toHaveBeenCalledWith(email, { - redirectTo: `${window.location.origin}/recover-password`, - }); - }); -}); diff --git a/frontend/app/(auth)/login/components/PasswordForgotten/hooks/usePasswordForgotten.ts b/frontend/app/(auth)/login/components/PasswordForgotten/hooks/usePasswordForgotten.ts deleted file mode 100644 index f95250dd7..000000000 --- a/frontend/app/(auth)/login/components/PasswordForgotten/hooks/usePasswordForgotten.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { useState } from "react"; -import { useTranslation } from "react-i18next"; - -import { useSupabase } from "@/lib/context/SupabaseProvider"; -import { useToast } from "@/lib/hooks"; - -type UsePasswordForgottenProps = { - email: string; - setEmail: (email: string) => void; -}; -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -export const usePasswordForgotten = ({ - email, - setEmail, -}: UsePasswordForgottenProps) => { - const [isPending, setIsPending] = useState(false); - const { supabase } = useSupabase(); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const {t, i18n} = useTranslation(["login"]); - - const { publish } = useToast(); - - const handleRecoverPassword = async () => { - if (email === "") { - publish({ - variant: "danger", - text: t("errorMailMissed",{ ns: 'login' }) - }); - - return; - } - - setIsPending(true); - - const { error } = await supabase.auth.resetPasswordForEmail(email, { - redirectTo: `${window.location.origin}/recover-password`, - }); - - if (error) { - publish({ - variant: "danger", - text: error.message, - }); - } else { - publish({ - variant: "success", - text: t("recoveryMailSended",{ ns: 'login' }) - }); - - setEmail(""); - } - setIsPending(false); - }; - - return { - isPending, - handleRecoverPassword, - }; -}; diff --git a/frontend/app/(auth)/login/components/PasswordForgotten/index.tsx b/frontend/app/(auth)/login/components/PasswordForgotten/index.tsx deleted file mode 100644 index bb6a398f9..000000000 --- a/frontend/app/(auth)/login/components/PasswordForgotten/index.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/* eslint-disable */ -"use client"; - -import Button from "@/lib/components/ui/Button"; -import { usePasswordForgotten } from "./hooks/usePasswordForgotten"; -import { useTranslation } from "react-i18next"; - -type PasswordForgottenProps = { - email: string; - setEmail: (email: string) => void; -}; - -export const PasswordForgotten = ({ - email, - setEmail, -}: PasswordForgottenProps) => { - const { isPending, handleRecoverPassword } = usePasswordForgotten({ - email, - setEmail, - }); - const {t, i18n} = useTranslation(["login"]); - - return ( - - ); -}; diff --git a/frontend/app/(auth)/login/hooks/__tests__/useLogin.test.ts b/frontend/app/(auth)/login/hooks/__tests__/useLogin.test.ts deleted file mode 100644 index 112359f53..000000000 --- a/frontend/app/(auth)/login/hooks/__tests__/useLogin.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { act, renderHook } from "@testing-library/react"; -import { describe, expect, it, vi } from "vitest"; - -import { useLogin } from "../useLogin"; - -const mockSignInWithPassword = vi.fn(() => ({ error: null })); - -const mockUseSupabase = () => ({ - supabase: { - auth: { - signInWithPassword: mockSignInWithPassword, - }, - }, -}); - -vi.mock("@/lib/context/SupabaseProvider", () => ({ - useSupabase: () => mockUseSupabase(), -})); - -describe("useLogin", () => { - it("should call signInWithPassword with user email and password", async () => { - const { result } = renderHook(() => useLogin()); - - const email = "user@quivr.com"; - const password = "password"; - - act(() => result.current.setEmail(email)); - act(() => result.current.setPassword(password)); - - await act(() => result.current.handleLogin()); - - expect(mockSignInWithPassword).toHaveBeenCalledTimes(1); - expect(mockSignInWithPassword).toHaveBeenCalledWith({ - email, - password, - }); - }); -}); diff --git a/frontend/app/(auth)/login/hooks/useLogin.ts b/frontend/app/(auth)/login/hooks/useLogin.ts index 4b0b0945c..5aa26e7f8 100644 --- a/frontend/app/(auth)/login/hooks/useLogin.ts +++ b/frontend/app/(auth)/login/hooks/useLogin.ts @@ -1,56 +1,16 @@ import { useEffect, useState } from "react"; -import { useTranslation } from "react-i18next"; import { useSupabase } from "@/lib/context/SupabaseProvider"; import { redirectToPreviousPageOrChatPage } from "@/lib/helpers/redirectToPreviousPageOrChatPage"; -import { useToast } from "@/lib/hooks"; import { useEventTracking } from "@/services/analytics/june/useEventTracking"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const useLogin = () => { const [email, setEmail] = useState(""); - const [password, setPassword] = useState(""); - const [isPending, setIsPending] = useState(false); - const { publish } = useToast(); - const { supabase, session } = useSupabase(); + + const { session } = useSupabase(); const { track } = useEventTracking(); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { t } = useTranslation(["login"]); - - const handleLogin = async () => { - setIsPending(true); - const { error } = await supabase.auth.signInWithPassword({ - email: email, - password: password, - }); - if (error) { - console.log(error.message); - if (error.message.includes("Failed")) { - publish({ - variant: "danger", - text: t("Failedtofetch", { ns: "login" }), - }); - } else if (error.message.includes("Invalid")) { - publish({ - variant: "danger", - text: t("Invalidlogincredentials", { ns: "login" }), - }); - } else { - publish({ - variant: "danger", - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call - text: error.message, - }); - } - } else { - publish({ - variant: "success", - text: t("loginSuccess", { ns: "login" }), - }); - } - setIsPending(false); - }; useEffect(() => { if (session?.user !== undefined) { @@ -60,11 +20,7 @@ export const useLogin = () => { }, [session?.user]); return { - handleLogin, setEmail, - setPassword, email, - isPending, - password, }; }; diff --git a/frontend/app/(auth)/login/page.tsx b/frontend/app/(auth)/login/page.tsx index 5f4061b08..6942239d1 100644 --- a/frontend/app/(auth)/login/page.tsx +++ b/frontend/app/(auth)/login/page.tsx @@ -3,78 +3,49 @@ import Link from "next/link"; import { Suspense } from "react"; import { useTranslation } from "react-i18next"; -import Button from "@/lib/components/ui/Button"; -import Card from "@/lib/components/ui/Card"; +import { QuivrLogo } from "@/lib/assets/QuivrLogo"; import { Divider } from "@/lib/components/ui/Divider"; import Field from "@/lib/components/ui/Field"; -import PageHeading from "@/lib/components/ui/PageHeading"; import { GoogleLoginButton } from "./components/GoogleLogin"; import { MagicLinkLogin } from "./components/MagicLinkLogin"; -import { PasswordForgotten } from "./components/PasswordForgotten"; import { useLogin } from "./hooks/useLogin"; const Main = (): JSX.Element => { - const { handleLogin, setEmail, setPassword, email, isPending, password } = - useLogin(); + const { setEmail, email } = useLogin(); const { t } = useTranslation(["translation", "login"]); return ( -
-
- - -
{ - e.preventDefault(); - void handleLogin(); - }} - className="flex flex-col gap-2" - > +
+
+
+ + + +

+ {t("talk_to", { ns: "login" })}{" "} + Quivr +

+
setEmail(e.target.value)} value={email} + label="Email" + inputClassName="py-1 mt-1 mb-3" /> - setPassword(e.target.value)} - placeholder={t("password")} - /> - -
- - - - {t("signup", { ns: "login" })} -
- - -
- -
- - - -
-
+ + +
+

+ {t("restriction_message", { ns: "login" })} +

+
+
+ ); }; diff --git a/frontend/app/(auth)/recover-password/__tests__/page.test.tsx b/frontend/app/(auth)/recover-password/__tests__/page.test.tsx deleted file mode 100644 index 912a27731..000000000 --- a/frontend/app/(auth)/recover-password/__tests__/page.test.tsx +++ /dev/null @@ -1,131 +0,0 @@ -/* eslint-disable max-lines */ -import { fireEvent, render } from "@testing-library/react"; -import { describe, expect, it, vi } from "vitest"; - -import RecoverPassword from "../page"; - -const mockUsePathname = vi.fn(() => "/previous-page"); -const mockRedirect = vi.fn((url: string) => ({ url })); - -vi.mock("next/navigation", () => ({ - redirect: (url: string) => mockRedirect(url), - usePathname: () => mockUsePathname(), -})); - -const mockUseSupabase = vi.fn(() => ({ - supabase: { - auth: { - updateUser: vi.fn(), - }, - }, - session: { - user: {}, - }, -})); - -vi.mock("@/lib/context/SupabaseProvider", () => ({ - useSupabase: () => mockUseSupabase(), -})); - -const mockPublish = vi.fn(); - -vi.mock("@/lib/hooks/useToast", () => ({ - useToast: () => ({ - publish: mockPublish, - }), -})); - -const mockTrack = vi.fn(); - -vi.mock("@/services/analytics/useEventTracking", () => ({ - useEventTracking: () => ({ - track: mockTrack, - }), -})); - -describe("RecoverPassword component", () => { - it("should render the password update form", () => { - mockUseSupabase.mockReturnValue({ - //@ts-expect-error doing this for testing purposes - session: { user: undefined }, - }); - const { getByTestId } = render(); - const passwordField = getByTestId("password-field"); - const updateButton = getByTestId("update-button"); - - expect(passwordField).toBeDefined(); - expect(updateButton).toBeDefined(); - }); - - it.skip("should update the password and shows success toast", async () => { - const updateUserMock = vi.fn(() => ({ - data: {}, - })); - mockUseSupabase.mockReturnValue({ - supabase: { - auth: { - updateUser: updateUserMock, - }, - }, - session: { user: {} }, - }); - const { getByTestId } = render(); - const passwordField = getByTestId("password-field"); - const updateButton = getByTestId("update-button"); - - const newPassword = "new-password"; - fireEvent.change(passwordField, { target: { value: newPassword } }); - fireEvent.click(updateButton); - - expect(mockTrack).toHaveBeenCalledTimes(1); - expect(mockTrack).toHaveBeenCalledWith("UPDATE_PASSWORD"); - - return new Promise((resolve) => { - setTimeout(() => { - expect(mockPublish).toHaveBeenCalledTimes(1); - expect(mockPublish).toHaveBeenCalledWith({ - variant: "success", - text: "Password updated successfully!", - }); - expect(updateUserMock).toHaveBeenCalledTimes(1); - expect(updateUserMock).toHaveBeenCalledWith({ - password: newPassword, - }); - resolve(); - }, 0); - }); - }); - - it.skip("should show error toast when password update fails", async () => { - const errorMessage = "Password update failed"; - const updateUserMock = vi.fn(() => ({ - error: { message: errorMessage }, - })); - mockUseSupabase.mockReturnValue({ - supabase: { - auth: { - updateUser: updateUserMock, - }, - }, - session: { user: {} }, - }); - const { getByTestId } = render(); - const passwordField = getByTestId("password-field"); - const updateButton = getByTestId("update-button"); - - fireEvent.change(passwordField, { target: { value: "new-password" } }); - fireEvent.click(updateButton); - - expect(mockPublish).toHaveBeenCalledTimes(1); - - return new Promise((resolve) => { - setTimeout(() => { - expect(mockPublish).toHaveBeenCalledWith({ - variant: "danger", - text: `Error: ${errorMessage}`, - }); - resolve(); - }, 0); - }); - }); -}); diff --git a/frontend/app/(auth)/recover-password/page.tsx b/frontend/app/(auth)/recover-password/page.tsx deleted file mode 100644 index 71f810587..000000000 --- a/frontend/app/(auth)/recover-password/page.tsx +++ /dev/null @@ -1,91 +0,0 @@ -/* eslint-disable */ -"use client"; -import { useState } from "react"; - -import Button from "@/lib/components/ui/Button"; -import Card from "@/lib/components/ui/Card"; -import Field from "@/lib/components/ui/Field"; -import PageHeading from "@/lib/components/ui/PageHeading"; -import { useSupabase } from "@/lib/context/SupabaseProvider"; -import { useToast } from "@/lib/hooks/useToast"; -import { redirectToLogin } from "@/lib/router/redirectToLogin"; -import { useEventTracking } from "@/services/analytics/june/useEventTracking"; -import { Suspense } from "react"; -import { useTranslation } from "react-i18next"; - -export default function RecoverPassword() { - const { supabase, session } = useSupabase(); - const [password, setPassword] = useState(""); - const [isPending, setIsPending] = useState(false); - const { track } = useEventTracking(); - - const { t } = useTranslation(["translation", "updatePassword"]); - - const { publish } = useToast(); - - function ChangePassword() { - const handleChangePassword = async () => { - void track("UPDATE_PASSWORD"); - setIsPending(true); - const { error } = await supabase.auth.updateUser({ - password: password, - }); - - if (error) { - console.error("Error while resetting password:", error.message); - publish({ - variant: "danger", - text: `Error: ${error.message}`, - }); - } else { - publish({ - variant: "success", - text: t("passwordUpdated", { ns: "updatePassword" }), - }); - } - setIsPending(false); - }; - - if (session?.user === undefined) { - redirectToLogin(); - } - - return ( -
-
- - -
{ - e.preventDefault(); - handleChangePassword(); - }} - className="flex flex-col gap-2" - > - setPassword(e.target.value)} - placeholder={t("newPassword", { ns: "updatePassword" })} - data-testid="password-field" - /> -
- -
- -
-
-
- ); - } - - return ( - - - - ); -} diff --git a/frontend/app/(auth)/signup/__tests__/page.test.tsx b/frontend/app/(auth)/signup/__tests__/page.test.tsx deleted file mode 100644 index 1fdb4c7de..000000000 --- a/frontend/app/(auth)/signup/__tests__/page.test.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { fireEvent, render } from "@testing-library/react"; -import { describe, expect, it, vi } from "vitest"; - -import SignUp from "../page"; - -const mockHandleSignUp = vi.fn(() => ({})); - -vi.mock("next/navigation", () => ({ - useRouter: () => ({ replace: vi.fn() }), -})); - -vi.mock("@/lib/context/SupabaseProvider", () => ({ - useSupabase: () => ({}), -})); - -describe("SignUp component", () => { - it("should render correctly", () => { - const { getByTestId } = render(); - const signUpPage = getByTestId("sign-up-page"); - expect(signUpPage).toBeDefined(); - - const signUpForm = getByTestId("sign-up-form"); - expect(signUpForm).toBeDefined(); - - const emailInput = getByTestId("email-field"); - expect(emailInput).toBeDefined(); - - const passwordInput = getByTestId("password-field"); - expect(passwordInput).toBeDefined(); - - const signUpButton = getByTestId("sign-up-button"); - expect(signUpButton).toBeDefined(); - }); - - it("should correctly fill the email and password fields", () => { - const { getByTestId } = render(); - const emailInput = getByTestId("email-field") as HTMLInputElement; - const passwordInput = getByTestId("password-field") as HTMLInputElement; - - fireEvent.change(emailInput, { target: { value: "user@quivr.app" } }); - fireEvent.change(passwordInput, { target: { value: "password123" } }); - expect(emailInput.value).toBe("user@quivr.app"); - expect(passwordInput.value).toBe("password123"); - }); - - it("should call handleSignUp on submit", () => { - vi.mock("../hooks/useSignUp", async () => { - const functions = await vi.importActual< - typeof import("../hooks/useSignUp") - >("../hooks/useSignUp"); - - return { - useSignUp: () => ({ - ...functions.useSignUp(), - handleSignUp: () => mockHandleSignUp(), - }), - }; - }); - - const { getByTestId } = render(); - const submitForm = getByTestId("sign-up-form") as HTMLFormElement; - - fireEvent.submit(submitForm); - expect(mockHandleSignUp).toHaveBeenCalled(); - }); -}); diff --git a/frontend/app/(auth)/signup/hooks/useSignUp.ts b/frontend/app/(auth)/signup/hooks/useSignUp.ts deleted file mode 100644 index eb4762ad0..000000000 --- a/frontend/app/(auth)/signup/hooks/useSignUp.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { useState } from "react"; -import { useTranslation } from "react-i18next"; - -import { useSupabase } from "@/lib/context/SupabaseProvider"; -import { useToast } from "@/lib/hooks/useToast"; -import { useEventTracking } from "@/services/analytics/june/useEventTracking"; - -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -export const useSignUp = () => { - const { supabase } = useSupabase(); - const [email, setEmail] = useState(""); - const [password, setPassword] = useState(""); - const [isPending, setIsPending] = useState(false); - const { track } = useEventTracking(); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { t } = useTranslation(["signUp"]); - - const { publish } = useToast(); - const handleSignUp = async () => { - void track("SIGNUP"); - setIsPending(true); - const { error } = await supabase.auth.signUp({ - email: email, - password: password, - }); - - if (error) { - console.error("Error signing up:", error.message); - publish({ - variant: "danger", - text: t("errorSignUp", { errorMessage: error.message }), - }); - } else { - publish({ - variant: "success", - text: t("mailSended"), - }); - } - setIsPending(false); - }; - - return { - handleSignUp, - setEmail, - password, - setPassword, - isPending, - email, - }; -}; diff --git a/frontend/app/(auth)/signup/page.tsx b/frontend/app/(auth)/signup/page.tsx deleted file mode 100644 index d097448f8..000000000 --- a/frontend/app/(auth)/signup/page.tsx +++ /dev/null @@ -1,64 +0,0 @@ -"use client"; -import Link from "next/link"; -import { useTranslation } from "react-i18next"; - -import Button from "@/lib/components/ui/Button"; -import Card from "@/lib/components/ui/Card"; -import Field from "@/lib/components/ui/Field"; -import PageHeading from "@/lib/components/ui/PageHeading"; - -import { useSignUp } from "./hooks/useSignUp"; - -const SignUp = (): JSX.Element => { - const { handleSignUp, isPending, email, password, setEmail, setPassword } = - useSignUp(); - const { t } = useTranslation(["translation", "signUp"]); - - return ( -
-
- - -
{ - e.preventDefault(); - void handleSignUp(); - }} - className="flex flex-col gap-2" - data-testid="sign-up-form" - > - setEmail(e.target.value)} - data-testid="email-field" - /> - setPassword(e.target.value)} - placeholder={t("password")} - data-testid="password-field" - /> -
- - {t("login", { ns: "signUp" })} -
- -
-
-
- ); -}; - -export default SignUp; diff --git a/frontend/app/(home)/components/HomeHeader/HomeHeader.tsx b/frontend/app/(home)/components/HomeHeader/HomeHeader.tsx index 319236a22..fe3ae9ec2 100644 --- a/frontend/app/(home)/components/HomeHeader/HomeHeader.tsx +++ b/frontend/app/(home)/components/HomeHeader/HomeHeader.tsx @@ -1,9 +1,9 @@ import Link from "next/link"; +import { QuivrLogo } from "@/lib/assets/QuivrLogo"; import { cn } from "@/lib/utils"; import { PopoverMenuMobile } from "./components/PopoverMenuMobile"; -import { QuivrLogo } from "./components/QuivrLogo"; import { useHomeHeader } from "./hooks/useHomeHeader"; import { linkStyle } from "./styles"; diff --git a/frontend/app/(home)/components/HomeHeader/components/PopoverMenuMobile.tsx b/frontend/app/(home)/components/HomeHeader/components/PopoverMenuMobile.tsx index 9067fca27..bfb4858ae 100644 --- a/frontend/app/(home)/components/HomeHeader/components/PopoverMenuMobile.tsx +++ b/frontend/app/(home)/components/HomeHeader/components/PopoverMenuMobile.tsx @@ -1,10 +1,9 @@ import * as Popover from "@radix-ui/react-popover"; import { LuMenu, LuX } from "react-icons/lu"; +import { QuivrLogo } from "@/lib/assets/QuivrLogo"; import { cn } from "@/lib/utils"; -import { QuivrLogo } from "./QuivrLogo"; - type PopoverMenuMobileProps = { navLinks: JSX.Element[]; color?: "white" | "black"; diff --git a/frontend/app/(home)/components/HomeHeader/hooks/useHomeHeader.tsx b/frontend/app/(home)/components/HomeHeader/hooks/useHomeHeader.tsx index afd298ed8..7c0a6cb07 100644 --- a/frontend/app/(home)/components/HomeHeader/hooks/useHomeHeader.tsx +++ b/frontend/app/(home)/components/HomeHeader/hooks/useHomeHeader.tsx @@ -33,7 +33,7 @@ export const useHomeHeader = ({ color }: UseHomeHeaderProps) => { rightIcon: null, }, { href: "/blog", label: t("blog"), rightIcon: null, newTab: true }, - { href: "/signup", label: t("sign_up") }, + { href: "/login", label: t("sign_up") }, { href: "/login", label: t("sign_in") }, ]; diff --git a/frontend/app/(home)/components/Sections/DemoSection/DemoSection.tsx b/frontend/app/(home)/components/Sections/DemoSection/DemoSection.tsx index 904eb6dfe..889da6dbf 100644 --- a/frontend/app/(home)/components/Sections/DemoSection/DemoSection.tsx +++ b/frontend/app/(home)/components/Sections/DemoSection/DemoSection.tsx @@ -31,11 +31,11 @@ export const DemoSection = (): JSX.Element => { )} { onLinkClick({ - href: "/signup", - label: "SIGN_UP", + href: "/login", + label: "SIGN_IN", event, }); }} diff --git a/frontend/app/(home)/components/Sections/FooterSection.tsx b/frontend/app/(home)/components/Sections/FooterSection.tsx index 09ff80561..0fba2b8c2 100644 --- a/frontend/app/(home)/components/Sections/FooterSection.tsx +++ b/frontend/app/(home)/components/Sections/FooterSection.tsx @@ -21,11 +21,11 @@ export const FooterSection = (): JSX.Element => {

{ onLinkClick({ - href: "/signup", - label: "SIGN_UP", + href: "/login", + label: "SIGN_IN", event, }); }} diff --git a/frontend/app/(home)/components/Sections/IntroSection.tsx b/frontend/app/(home)/components/Sections/IntroSection.tsx index 07d8f36fc..2aa062bdd 100644 --- a/frontend/app/(home)/components/Sections/IntroSection.tsx +++ b/frontend/app/(home)/components/Sections/IntroSection.tsx @@ -26,11 +26,11 @@ export const IntroSection = (): JSX.Element => {
onLinkClick({ - href: "/signup", - label: "SIGN_UP", + href: "/login", + label: "SIGN_IN", event, }) } diff --git a/frontend/app/(home)/components/SecuritySection/SecuritySection.tsx b/frontend/app/(home)/components/SecuritySection/SecuritySection.tsx index ede5c335a..5fef3c7ea 100644 --- a/frontend/app/(home)/components/SecuritySection/SecuritySection.tsx +++ b/frontend/app/(home)/components/SecuritySection/SecuritySection.tsx @@ -57,11 +57,11 @@ export const SecuritySection = (): JSX.Element => {
{ onLinkClick({ - href: "/signup", - label: "SIGN_UP", + href: "/login", + label: "SIGN_IN", event, }); }} diff --git a/frontend/app/(home)/components/UseCases/UseCases.tsx b/frontend/app/(home)/components/UseCases/UseCases.tsx index d466661f0..53245dcb5 100644 --- a/frontend/app/(home)/components/UseCases/UseCases.tsx +++ b/frontend/app/(home)/components/UseCases/UseCases.tsx @@ -22,11 +22,11 @@ export const UseCases = (): JSX.Element => {
{ onLinkClick({ - href: "/signup", - label: "SIGN_UP", + href: "/login", + label: "SIGN_IN", event, }); }} diff --git a/frontend/app/(home)/components/HomeHeader/components/QuivrLogo.tsx b/frontend/lib/assets/QuivrLogo.tsx similarity index 100% rename from frontend/app/(home)/components/HomeHeader/components/QuivrLogo.tsx rename to frontend/lib/assets/QuivrLogo.tsx diff --git a/frontend/lib/components/Footer/index.tsx b/frontend/lib/components/Footer/index.tsx index 735aa0ec9..0c99da94f 100644 --- a/frontend/lib/components/Footer/index.tsx +++ b/frontend/lib/components/Footer/index.tsx @@ -10,8 +10,14 @@ const Footer = (): JSX.Element => { const path = usePathname(); const isHomePage = path === "/"; const isContactPage = path === "/contact"; + const isLoginPage = path === "/login"; - if (session?.user !== undefined || isHomePage || isContactPage) { + if ( + session?.user !== undefined || + isHomePage || + isContactPage || + isLoginPage + ) { return <>; } diff --git a/frontend/lib/components/NavBar/components/NavItems/components/AuthButtons.tsx b/frontend/lib/components/NavBar/components/NavItems/components/AuthButtons.tsx index dc43f0592..da8e36420 100644 --- a/frontend/lib/components/NavBar/components/NavItems/components/AuthButtons.tsx +++ b/frontend/lib/components/NavBar/components/NavItems/components/AuthButtons.tsx @@ -8,7 +8,7 @@ export const AuthButtons = (): JSX.Element => { const pathname = usePathname(); const { t } = useTranslation(); - if (pathname === "/signup") { + if (pathname === "/login") { return ( @@ -17,7 +17,7 @@ export const AuthButtons = (): JSX.Element => { } if (pathname === "/login") { return ( - + ); diff --git a/frontend/lib/components/NavBar/index.tsx b/frontend/lib/components/NavBar/index.tsx index 797470ead..9f6cbda25 100644 --- a/frontend/lib/components/NavBar/index.tsx +++ b/frontend/lib/components/NavBar/index.tsx @@ -16,8 +16,9 @@ export const NavBar = (): JSX.Element => { const isHomePage = path === "/"; const isContactPage = path === "/contact"; + const isLoginPage = path === "/login"; - if (pageHasSidebar || isHomePage || isContactPage) { + if (pageHasSidebar || isHomePage || isContactPage || isLoginPage) { return <>; } diff --git a/frontend/lib/config/LocaleConfig/resources.ts b/frontend/lib/config/LocaleConfig/resources.ts index 0a6040c48..31a526841 100644 --- a/frontend/lib/config/LocaleConfig/resources.ts +++ b/frontend/lib/config/LocaleConfig/resources.ts @@ -12,9 +12,7 @@ import knowlegde_en from "../../../public/locales/en/knowledge.json"; import login_en from "../../../public/locales/en/login.json"; import logout_en from "../../../public/locales/en/logout.json"; import monetization_en from "../../../public/locales/en/monetization.json"; -import signUp_en from "../../../public/locales/en/signUp.json"; import translation_en from "../../../public/locales/en/translation.json"; -import updatePassword_en from "../../../public/locales/en/updatePassword.json"; import upload_en from "../../../public/locales/en/upload.json"; import user_en from "../../../public/locales/en/user.json"; // import all namespaces Spanish @@ -30,9 +28,7 @@ import knowlegde_es from "../../../public/locales/es/knowledge.json"; import login_es from "../../../public/locales/es/login.json"; import logout_es from "../../../public/locales/es/logout.json"; import monetization_es from "../../../public/locales/es/monetization.json"; -import signUp_es from "../../../public/locales/es/signUp.json"; import translation_es from "../../../public/locales/es/translation.json"; -import updatePassword_es from "../../../public/locales/es/updatePassword.json"; import upload_es from "../../../public/locales/es/upload.json"; import user_es from "../../../public/locales/es/user.json"; // import all namespaces French @@ -48,9 +44,7 @@ import knowlegde_fr from "../../../public/locales/fr/knowledge.json"; import login_fr from "../../../public/locales/fr/login.json"; import logout_fr from "../../../public/locales/fr/logout.json"; import monetization_fr from "../../../public/locales/fr/monetization.json"; -import signUp_fr from "../../../public/locales/fr/signUp.json"; import translation_fr from "../../../public/locales/fr/translation.json"; -import updatePassword_fr from "../../../public/locales/fr/updatePassword.json"; import upload_fr from "../../../public/locales/fr/upload.json"; import user_fr from "../../../public/locales/fr/user.json"; // import all namespaces Portuguese @@ -66,9 +60,7 @@ import knowlegde_ptbr from "../../../public/locales/pt-br/knowledge.json"; import login_ptbr from "../../../public/locales/pt-br/login.json"; import logout_ptbr from "../../../public/locales/pt-br/logout.json"; import monetization_ptbr from "../../../public/locales/pt-br/monetization.json"; -import signUp_ptbr from "../../../public/locales/pt-br/signUp.json"; import translation_ptbr from "../../../public/locales/pt-br/translation.json"; -import updatePassword_ptbr from "../../../public/locales/pt-br/updatePassword.json"; import upload_ptbr from "../../../public/locales/pt-br/upload.json"; import user_ptbr from "../../../public/locales/pt-br/user.json"; // import all namespaces Russian @@ -84,9 +76,7 @@ import knowlegde_ru from "../../../public/locales/ru/knowledge.json"; import login_ru from "../../../public/locales/ru/login.json"; import logout_ru from "../../../public/locales/ru/logout.json"; import monetization_ru from "../../../public/locales/ru/monetization.json"; -import signUp_ru from "../../../public/locales/ru/signUp.json"; import translation_ru from "../../../public/locales/ru/translation.json"; -import updatePassword_ru from "../../../public/locales/ru/updatePassword.json"; import upload_ru from "../../../public/locales/ru/upload.json"; import user_ru from "../../../public/locales/ru/user.json"; // import all namespaces Simplified Chinese @@ -102,9 +92,7 @@ import knowlegde_zh_cn from "../../../public/locales/zh-cn/knowledge.json"; import login_zh_cn from "../../../public/locales/zh-cn/login.json"; import logout_zh_cn from "../../../public/locales/zh-cn/logout.json"; import monetization_zh_cn from "../../../public/locales/zh-cn/monetization.json"; -import signUp_zh_cn from "../../../public/locales/zh-cn/signUp.json"; import translation_zh_cn from "../../../public/locales/zh-cn/translation.json"; -import updatePassword_zh_cn from "../../../public/locales/zh-cn/updatePassword.json"; import upload_zh_cn from "../../../public/locales/zh-cn/upload.json"; import user_zh_cn from "../../../public/locales/zh-cn/user.json"; @@ -121,9 +109,7 @@ export type Translations = { login: typeof import("../../../public/locales/en/login.json"); logout: typeof import("../../../public/locales/en/logout.json"); monetization: typeof import("../../../public/locales/en/monetization.json"); - signUp: typeof import("../../../public/locales/en/signUp.json"); translation: typeof import("../../../public/locales/en/translation.json"); - updatePassword: typeof import("../../../public/locales/en/updatePassword.json"); upload: typeof import("../../../public/locales/en/upload.json"); user: typeof import("../../../public/locales/en/user.json"); knowledge: typeof import("../../../public/locales/en/knowledge.json"); @@ -151,9 +137,7 @@ export const resources: Record = { login: login_en, logout: logout_en, monetization: monetization_en, - signUp: signUp_en, translation: translation_en, - updatePassword: updatePassword_en, upload: upload_en, user: user_en, delete_or_unsubscribe_from_brain: delete_brain_en, @@ -170,9 +154,7 @@ export const resources: Record = { login: login_es, logout: logout_es, monetization: monetization_es, - signUp: signUp_es, translation: translation_es, - updatePassword: updatePassword_es, upload: upload_es, user: user_es, delete_or_unsubscribe_from_brain: delete_brain_es, @@ -189,9 +171,7 @@ export const resources: Record = { login: login_fr, logout: logout_fr, monetization: monetization_fr, - signUp: signUp_fr, translation: translation_fr, - updatePassword: updatePassword_fr, upload: upload_fr, user: user_fr, delete_or_unsubscribe_from_brain: delete_brain_fr, @@ -208,9 +188,7 @@ export const resources: Record = { login: login_ptbr, logout: logout_ptbr, monetization: monetization_ptbr, - signUp: signUp_ptbr, translation: translation_ptbr, - updatePassword: updatePassword_ptbr, upload: upload_ptbr, user: user_ptbr, delete_or_unsubscribe_from_brain: delete_brain_ptbr, @@ -227,9 +205,7 @@ export const resources: Record = { login: login_ru, logout: logout_ru, monetization: monetization_ru, - signUp: signUp_ru, translation: translation_ru, - updatePassword: updatePassword_ru, upload: upload_ru, user: user_ru, delete_or_unsubscribe_from_brain: delete_brain_ru, @@ -246,9 +222,7 @@ export const resources: Record = { login: login_zh_cn, logout: logout_zh_cn, monetization: monetization_zh_cn, - signUp: signUp_zh_cn, translation: translation_zh_cn, - updatePassword: updatePassword_zh_cn, upload: upload_zh_cn, user: user_zh_cn, delete_or_unsubscribe_from_brain: delete_brain_zh_cn, diff --git a/frontend/public/locales/en/login.json b/frontend/public/locales/en/login.json index f82b95847..e20904c6e 100644 --- a/frontend/public/locales/en/login.json +++ b/frontend/public/locales/en/login.json @@ -1,15 +1,8 @@ { - "title": "Login", - "subtitle": "Welcome back", - "signup": "Don't have an account? Sign up", - "forgottenPassword": "Password forgotten", - "googleLogin": "Login with Google", - "magicLink": "Send Magic Link", - "loginSuccess": "Successfully logged in", + "googleLogin": "Continue with Google", + "magicLink": "Continue with email", "errorMailMissed": "Please enter your email address", - "recoveryMailSended": "Recovery mail will be sent if email recognized", - "Invalidlogincredentials" : "Invalid login credentials", - "password.updated": "Password updated successfully!", - "new_password": "New Password", - "Failedtofetch": "Failed to fetch data" + "talk_to": "Talk to", + "restriction_message": "Unpaid users have access to a free and limited demo of Quivr", + "email":"Email address" } \ No newline at end of file diff --git a/frontend/public/locales/en/signUp.json b/frontend/public/locales/en/signUp.json deleted file mode 100644 index 895c08e07..000000000 --- a/frontend/public/locales/en/signUp.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "title": "Sign Up", - "subtitle": "Create your account", - "email": "Email", - "password": "Password", - "loginButton": "Login", - "signUpButton": "Sign up", - "or": "or", - "login": "Already registered? Sign in", - "googleLogin": "Login with Google", - "errorSignUp": "Error signing up: {{errorMessage}}", - "mailSended": "Confirmation Email sent, please check your email" -} \ No newline at end of file diff --git a/frontend/public/locales/en/translation.json b/frontend/public/locales/en/translation.json index 069466a63..dde77f8fd 100644 --- a/frontend/public/locales/en/translation.json +++ b/frontend/public/locales/en/translation.json @@ -4,7 +4,6 @@ "description": "Quivr is your second brain in the cloud, designed to easily store and retrieve unstructured information.", "toastDismiss": "dismiss", "email": "Email", - "password": "Password", "or": "or", "and": "and", "loginButton": "Login", diff --git a/frontend/public/locales/en/updatePassword.json b/frontend/public/locales/en/updatePassword.json deleted file mode 100644 index c9817d031..000000000 --- a/frontend/public/locales/en/updatePassword.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "title": "Update Password", - "passwordUpdated": "Password updated successfully!", - "newPassword": "New Password" -} \ No newline at end of file diff --git a/frontend/public/locales/es/login.json b/frontend/public/locales/es/login.json index 9fa7ae0aa..6ae97fc87 100644 --- a/frontend/public/locales/es/login.json +++ b/frontend/public/locales/es/login.json @@ -1,15 +1,8 @@ { - "errorMailMissed": "Por favor ingresa tu dirección de email", - "Failedtofetch": "Error al obtener datos", - "forgottenPassword": "Olvidé mi contraseña", - "googleLogin": "Iniciar con Google", - "Invalidlogincredentials": "Credenciales inválidas", - "loginSuccess": "Sesión iniciada correctamente", - "magicLink": "Enviar Enlace Mágico", - "new_password": "Nueva contraseña", - "password.updated": "¡Contraseña actualizada!", - "recoveryMailSended": "El correo de recuperación será enviado si el email es reconocido", - "signup": "¿No tienes una cuenta? Registrate aquí", - "subtitle": "Un gusto tenerte de vuelta", - "title": "Iniciar sesión" +"googleLogin": "Continuar con Google", +"magicLink": "Continuar con correo electrónico", +"errorMailMissed": "Por favor, ingrese su dirección de correo electrónico", +"talk_to": "Hablar con", +"restriction_message": "Los usuarios no pagos tienen acceso a una demostración gratuita y limitada de Quivr", +"email":"Dirección de correo electrónico" } \ No newline at end of file diff --git a/frontend/public/locales/es/signUp.json b/frontend/public/locales/es/signUp.json deleted file mode 100644 index 52f7339c1..000000000 --- a/frontend/public/locales/es/signUp.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "email": "Correo electrónico", - "errorSignUp": "Error al registrarse: {{errorMessage}}", - "googleLogin": "Iniciar con Google", - "login": "¿Ya tienes una cuenta? Inicia sesión", - "loginButton": "Iniciar sesión", - "mailSended": "Correo de confirmación enviado, por favor verifica tu buzón", - "or": "o", - "password": "Contraseña", - "signUpButton": "Registrarse", - "subtitle": "Crea tu cuenta", - "title": "Registrarse" -} \ No newline at end of file diff --git a/frontend/public/locales/es/translation.json b/frontend/public/locales/es/translation.json index 569b0dfb0..e73abf05a 100644 --- a/frontend/public/locales/es/translation.json +++ b/frontend/public/locales/es/translation.json @@ -18,7 +18,6 @@ "or": "o", "and": "y", "Owner": "Propietario", - "password": "Contraseña", "resetButton": "Restaurar", "shareButton": "Compartir", "signUpButton": "Registrarse", diff --git a/frontend/public/locales/es/updatePassword.json b/frontend/public/locales/es/updatePassword.json deleted file mode 100644 index 59419e8ea..000000000 --- a/frontend/public/locales/es/updatePassword.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "newPassword": "Nueva contraseña", - "passwordUpdated": "¡Contraseña actualizada!", - "title": "Actualizar Contraseña" -} \ No newline at end of file diff --git a/frontend/public/locales/fr/login.json b/frontend/public/locales/fr/login.json index e0d15b930..f7c95fc76 100644 --- a/frontend/public/locales/fr/login.json +++ b/frontend/public/locales/fr/login.json @@ -1,15 +1,8 @@ { - "title": "Connexion", - "subtitle": "Bienvenue", - "signup": "Vous n'avez pas de compte ? Inscrivez-vous", - "forgottenPassword": "Mot de passe oublié", - "googleLogin": "Connexion avec Google", - "magicLink": "Envoyer le lien magique", - "loginSuccess": "Connexion réussie", - "errorMailMissed": "Veuillez entrer votre adresse e-mail", - "recoveryMailSended": "Un mail de récupération sera envoyé si l'email est reconnu", - "Invalidlogincredentials": "Identifiants de connexion invalides", - "password.updated": "Mot de passe mis à jour avec succès !", - "new_password": "Nouveau mot de passe", - "Failedtofetch": "Échec de la récupération" +"googleLogin": "Continuer avec Google", +"magicLink": "Continuer avec e-mail", +"errorMailMissed": "Veuillez saisir votre adresse e-mail", +"talk_to": "Parler à", +"restriction_message": "Les utilisateurs non payants ont accès à une démonstration gratuite et limitée de Quivr", +"email":"Adresse e-mail" } \ No newline at end of file diff --git a/frontend/public/locales/fr/signUp.json b/frontend/public/locales/fr/signUp.json deleted file mode 100644 index 3243ad4c3..000000000 --- a/frontend/public/locales/fr/signUp.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "title": "Inscription", - "subtitle": "Créez votre compte", - "email": "Email", - "password": "Mot de passe", - "loginButton": "Connexion", - "signUpButton": "S'inscrire", - "or": "ou", - "login": "Déjà inscrit ? Connectez-vous", - "googleLogin": "Connexion avec Google", - "errorSignUp": "Erreur lors de l'inscription : {{errorMessage}}", - "mailSended": "Email de confirmation envoyé, veuillez vérifier votre email" -} \ No newline at end of file diff --git a/frontend/public/locales/fr/translation.json b/frontend/public/locales/fr/translation.json index d525e3f15..206a906e4 100644 --- a/frontend/public/locales/fr/translation.json +++ b/frontend/public/locales/fr/translation.json @@ -4,7 +4,6 @@ "description": "Quivr est votre deuxième cerveau dans le nuage, conçu pour stocker et récupérer facilement des informations non structurées.", "toastDismiss": "ignorer", "email": "Email", - "password": "Mot de passe", "or": "ou", "and": "et", "loginButton": "Connexion", diff --git a/frontend/public/locales/fr/updatePassword.json b/frontend/public/locales/fr/updatePassword.json deleted file mode 100644 index d76adff66..000000000 --- a/frontend/public/locales/fr/updatePassword.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "title": "Mettre à jour le mot de passe", - "passwordUpdated": "Mot de passe mis à jour avec succès !", - "newPassword": "Nouveau mot de passe" -} \ No newline at end of file diff --git a/frontend/public/locales/pt-br/login.json b/frontend/public/locales/pt-br/login.json index fb7270215..2a5244183 100644 --- a/frontend/public/locales/pt-br/login.json +++ b/frontend/public/locales/pt-br/login.json @@ -1,15 +1,8 @@ { - "title": "Login", - "subtitle": "Bem-vindo de volta", - "signup": "Não tem uma conta? Cadastre-se", - "forgottenPassword": "Esqueci a senha", - "googleLogin": "Entrar com o Google", - "magicLink": "Enviar Link Mágico", - "loginSuccess": "Login realizado com sucesso", - "errorMailMissed": "Por favor, insira seu endereço de email", - "recoveryMailSended": "Um email de recuperação será enviado se o email for reconhecido", - "Invalidlogincredentials": "Credenciais de login inválidas", - "password.updated": "Senha atualizada com sucesso!", - "new_password": "Nova Senha", - "Failedtofetch": "Falha ao buscar os dados" +"googleLogin": "Continuar com o Google", +"magicLink": "Continuar com o e-mail", +"errorMailMissed": "Por favor, insira seu endereço de e-mail", +"talk_to": "Converse com", +"restriction_message": "Usuários não pagos têm acesso a uma demonstração gratuita e limitada do Quivr", +"email":"Email address" } \ No newline at end of file diff --git a/frontend/public/locales/pt-br/signUp.json b/frontend/public/locales/pt-br/signUp.json deleted file mode 100644 index 2593e3c23..000000000 --- a/frontend/public/locales/pt-br/signUp.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "title": "Cadastro", - "subtitle": "Crie sua conta", - "email": "Email", - "password": "Senha", - "loginButton": "Login", - "signUpButton": "Cadastre-se", - "or": "ou", - "login": "Já possui cadastro? Faça login", - "googleLogin": "Entrar com o Google", - "errorSignUp": "Erro ao se cadastrar: {{errorMessage}}", - "mailSended": "Email de confirmação enviado, por favor verifique seu email" -} \ No newline at end of file diff --git a/frontend/public/locales/pt-br/translation.json b/frontend/public/locales/pt-br/translation.json index c56e0609b..6870538d7 100644 --- a/frontend/public/locales/pt-br/translation.json +++ b/frontend/public/locales/pt-br/translation.json @@ -4,7 +4,6 @@ "description": "Quivr é o seu segundo cérebro na nuvem, projetado para armazenar e recuperar facilmente informações não estruturadas.", "toastDismiss": "fechar", "email": "Email", - "password": "Senha", "or": "ou", "and": "e", "loginButton": "Entrar", diff --git a/frontend/public/locales/pt-br/updatePassword.json b/frontend/public/locales/pt-br/updatePassword.json deleted file mode 100644 index 61839b600..000000000 --- a/frontend/public/locales/pt-br/updatePassword.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "title": "Atualizar Senha", - "passwordUpdated": "Senha atualizada com sucesso!", - "newPassword": "Nova Senha" -} diff --git a/frontend/public/locales/ru/login.json b/frontend/public/locales/ru/login.json index d40b182c4..4e6e5d02e 100644 --- a/frontend/public/locales/ru/login.json +++ b/frontend/public/locales/ru/login.json @@ -1,15 +1,8 @@ { - "title": "Вход", - "subtitle": "С возвращением", - "signup": "Нет аккаунта? Зарегистрируйтесь", - "forgottenPassword": "Забыли пароль", - "googleLogin": "Войти с Google", - "magicLink": "Отправить магическую ссылку", - "loginSuccess": "Успешный вход", - "errorMailMissed": "Пожалуйста, введите ваш адрес электронной почты", - "recoveryMailSended": "Восстановительное письмо будет отправлено, если адрес электронной почты распознан", - "Invalidlogincredentials": "Недопустимые учетные данные для входа", - "password.updated": "Пароль успешно обновлен!", - "new_password": "Новый пароль", - "Failedtofetch": "Не удалось получить данные" -} +"googleLogin": "Продолжить с Google", +"magicLink": "Продолжить с электронной почтой", +"errorMailMissed": "Пожалуйста, введите ваш адрес электронной почты", +"talk_to": "Общение с", +"restriction_message": "Неоплаченным пользователям доступен бесплатный и ограниченный демонстрационный доступ к Quivr", +"email":"Адрес электронной почты" +} \ No newline at end of file diff --git a/frontend/public/locales/ru/signUp.json b/frontend/public/locales/ru/signUp.json deleted file mode 100644 index 827879dca..000000000 --- a/frontend/public/locales/ru/signUp.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "title": "Регистрация", - "subtitle": "Создайте свой аккаунт", - "email": "Email", - "password": "Пароль", - "loginButton": "Вход", - "signUpButton": "Зарегистрироваться", - "or": "или", - "login": "Уже зарегистрированы? Войти", - "googleLogin": "Войти с Google", - "errorSignUp": "Ошибка при регистрации: {{errorMessage}}", - "mailSended": "Письмо с подтверждением отправлено, пожалуйста, проверьте вашу почту" -} diff --git a/frontend/public/locales/ru/translation.json b/frontend/public/locales/ru/translation.json index 113713a99..5ab81356c 100644 --- a/frontend/public/locales/ru/translation.json +++ b/frontend/public/locales/ru/translation.json @@ -4,7 +4,6 @@ "description": "Quivr - это ваш второй мозг в облаке, предназначенный для легкого хранения и извлечения неструктурированной информации.", "toastDismiss": "закрыть", "email": "Email", - "password": "Пароль", "or": "или", "and": "и", "loginButton": "Войти", diff --git a/frontend/public/locales/ru/updatePassword.json b/frontend/public/locales/ru/updatePassword.json deleted file mode 100644 index 0f63f15ed..000000000 --- a/frontend/public/locales/ru/updatePassword.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "title": "Обновление пароля", - "passwordUpdated": "Пароль успешно обновлен!", - "newPassword": "Новый пароль" -} diff --git a/frontend/public/locales/zh-cn/login.json b/frontend/public/locales/zh-cn/login.json index af1d0b62a..8c7a2678f 100644 --- a/frontend/public/locales/zh-cn/login.json +++ b/frontend/public/locales/zh-cn/login.json @@ -1,15 +1,8 @@ { - "title": "登录", - "subtitle": "欢迎回来", - "signup": "没有账户吗?注册", - "forgottenPassword": "忘记密码", - "googleLogin": "使用Google登录", - "magicLink": "Send Magic Link", - "loginSuccess": "登录成功", - "errorMailMissed": "请输入您的电子邮件地址", - "recoveryMailSended": "如果电子邮件被识别,将发送恢复邮件", - "Invalidlogincredentials": "无效的登录凭据", - "password.updated": "密码更新成功!", - "new_password": "新密码", - "Failedtofetch": "获取数据失败" +"googleLogin": "使用Google继续", +"magicLink": "使用电子邮件继续", +"errorMailMissed": "请输入您的电子邮件地址", +"talk_to": "与之交谈", +"restriction_message": "未付费用户可以访问 Quivr 的免费和有限演示", +"email":"电子邮件地址" } \ No newline at end of file diff --git a/frontend/public/locales/zh-cn/signUp.json b/frontend/public/locales/zh-cn/signUp.json deleted file mode 100644 index f0ae7110e..000000000 --- a/frontend/public/locales/zh-cn/signUp.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "title": "注册", - "subtitle": "创建您的帐户", - "email": "Email", - "password": "Password", - "loginButton": "登录", - "signUpButton": "注册", - "or": "或", - "login": "已经注册?登录", - "googleLogin": "使用Google登录", - "errorSignUp": "注册时出错: {{errorMessage}}", - "mailSended": "确认邮件已发送,请检查您的邮箱" -} \ No newline at end of file diff --git a/frontend/public/locales/zh-cn/translation.json b/frontend/public/locales/zh-cn/translation.json index 8a1effb0e..054425f42 100644 --- a/frontend/public/locales/zh-cn/translation.json +++ b/frontend/public/locales/zh-cn/translation.json @@ -4,7 +4,6 @@ "description": "Quivr 是您在云中的第二个大脑,让您轻松存储和检索非结构化信息。", "toastDismiss": "dismiss", "email": "Email", - "password": "密码", "or": "或", "and": "和", "loginButton": "登录", diff --git a/frontend/public/locales/zh-cn/updatePassword.json b/frontend/public/locales/zh-cn/updatePassword.json deleted file mode 100644 index 5ef124630..000000000 --- a/frontend/public/locales/zh-cn/updatePassword.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "title": "更新密码", - "passwordUpdated": "密码更新成功!", - "newPassword": "新密码" -} \ No newline at end of file diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index 5acb20937..7fd26b3a3 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -22,6 +22,7 @@ module.exports = { "msg-header-gray": "#8F8F8F", "msg-purple": "#E0DDFC", "onboarding-yellow-bg": "#F6EFDE", + ivory: "#FCFAF6", }, }, },