From 162c009b28a51fdc3fa8d2fd2e1fb05f72aadda9 Mon Sep 17 00:00:00 2001 From: Ivo Date: Mon, 12 Jun 2023 13:41:38 -0400 Subject: [PATCH] fix: admin redirects and translations (#19) * fix: translations and redirects * chore(release): 2.0.3-next.1 [skip ci] ## [2.0.3-next.1](https://github.com/LABIOQUIM/visualdynamics/compare/v2.0.2...v2.0.3-next.1) (2023-06-12) ### :bug: Fixes * translations and redirects ([9e379fd](https://github.com/LABIOQUIM/visualdynamics/commit/9e379fd6e95a6faa91443e2b6fe5e77f6d83faba)) * Update Crowdin configuration file --------- Co-authored-by: semantic-release-bot --- apps/client/i18n.js | 4 ++-- ...count-signup.json => account-register.json} | 3 ++- apps/client/locales/en-US/home.json | 6 +++--- ...count-signup.json => account-register.json} | 3 ++- apps/client/locales/pt-BR/home.json | 14 +++++++------- apps/client/package.json | 2 +- .../account/form-register/schema.zod.ts | 8 +++++++- .../src/components/general/sidebar/content.tsx | 2 +- .../simulations/running/realtime-log/index.tsx | 2 +- .../simulations/running/step-list/index.tsx | 6 +++--- apps/client/src/pages/simulations/running.tsx | 18 +++++++++--------- 11 files changed, 38 insertions(+), 30 deletions(-) rename apps/client/locales/en-US/{account-signup.json => account-register.json} (87%) rename apps/client/locales/pt-BR/{account-signup.json => account-register.json} (88%) diff --git a/apps/client/i18n.js b/apps/client/i18n.js index 0b5bf35e..dc0b6984 100644 --- a/apps/client/i18n.js +++ b/apps/client/i18n.js @@ -15,8 +15,8 @@ module.exports = { // Admin "/admin/user-validation": ["admin-user-validation"], - "/admin/running": ["admin-running"], - "/admin/md-config": ["admin-mdpr-update"], + "/admin/active-simulations": ["admin-active-simulations"], + "/admin/settings": ["admin-md-config"], // Simulations "/simulations": ["simulations"], diff --git a/apps/client/locales/en-US/account-signup.json b/apps/client/locales/en-US/account-register.json similarity index 87% rename from apps/client/locales/en-US/account-signup.json rename to apps/client/locales/en-US/account-register.json index 15229424..e669e75f 100644 --- a/apps/client/locales/en-US/account-signup.json +++ b/apps/client/locales/en-US/account-register.json @@ -26,7 +26,8 @@ "title": "Username", "placeholder": "johndoe", "errors": { - "empty": "Can't be empty" + "empty": "Can't be empty", + "invalid": "Alphanumeric only (a-z, A-Z, 0-9), between 4 and 10 characters" } } } diff --git a/apps/client/locales/en-US/home.json b/apps/client/locales/en-US/home.json index a8e94d61..d3ac3f5d 100644 --- a/apps/client/locales/en-US/home.json +++ b/apps/client/locales/en-US/home.json @@ -1,8 +1,8 @@ { "title": "Home", - "callout": "Molecular Dynamics made easy", + "callout": "", "slogan": "The new home to MD generation and execution", - "description": "Welcome to the new Visual Dynamics.\nWith a revamped interface and a new methodology of generating and running GROMACS simulations we aim to provide faster, more reliable and replicable simulations, all this, through a new, more understandable and scalable codebase.", + "description": "Welcome to the new Visual Dynamics.\nWith a renewed interface and a new methodology for generating and running GROMACS simulations, we seek to run simulations with more control in less time.", "features": { "runs-on-cloud": { "title": "Runs on Cloud", @@ -10,7 +10,7 @@ }, "open-source": { "title": "Free for... everyone", - "description": "We know running a MD is not something easy, with this in mind, we develop this piece of software as a free and open-source software. Run on our hardware, your hardware, deploy your own, it is totally up to you." + "description": "We know running a MD is not something easy, with this in mind, we develop this piece of software to automate as a free and open-source software. Run on our hardware, your hardware, deploy your own, it is totally up to you." } } } diff --git a/apps/client/locales/pt-BR/account-signup.json b/apps/client/locales/pt-BR/account-register.json similarity index 88% rename from apps/client/locales/pt-BR/account-signup.json rename to apps/client/locales/pt-BR/account-register.json index 6afd11db..1cae8b0c 100644 --- a/apps/client/locales/pt-BR/account-signup.json +++ b/apps/client/locales/pt-BR/account-register.json @@ -26,7 +26,8 @@ "title": "Nome de usuário", "placeholder": "johndoe", "errors": { - "empty": "Não pode estar em branco" + "empty": "Não pode estar em branco", + "invalid": "Apenas alfanumérico (a-z, A-Z, 0-9), entre 4 e 10 caracteres" } } } diff --git a/apps/client/locales/pt-BR/home.json b/apps/client/locales/pt-BR/home.json index a34698f5..3e4fac93 100644 --- a/apps/client/locales/pt-BR/home.json +++ b/apps/client/locales/pt-BR/home.json @@ -1,16 +1,16 @@ { "title": "Início", - "callout": "Dinâmica Molecular do jeito fácil", - "slogan": "O novo ponto de partida para geração e execução de MD", - "description": "Bem-vindo ao novo Visual Dynamics.\nCom uma interface renovada e uma nova metodologia de geração e execução de simulações GROMACS, buscamos executar simulações mais confiáveis, replicáveis e ágeis, tudo isso, através de um código novo, mais compreensível e escalável.", + "callout": "Feito pela comunidade, para a comunidade.", + "slogan": "Uma nova abordagem em automação de dinâmica molecular com GROMACS.", + "description": "Bem-vindo ao novo Visual Dynamics.\nCom uma interface renovada e uma nova metodologia de geração e execução de simulações GROMACS, buscamos executar simulações com mais controle em menor tempo.", "features": { "runs-on-cloud": { - "title": "Executa em nuvem", - "description": "O MD exige tempo, poder computacional e ainda mais poder computacional, então você pode confiar em nós para isso. Nós rodamos 3 MDs simultâneos, com 10 núcleos de CPU cada." + "title": "Execução em nuvem ou local", + "description": "Dinâmicas moleculares exigem bastante poder computacional, por isso também oferecemos uma forma de execução em nuvem. Nós rodamos 3 MDs simultâneos, com 10 núcleos de CPU cada." }, "open-source": { - "title": "Grátis para... Todos", - "description": "Sabemos que executar um MD não é algo fácil, com isso em mente, desenvolvemos esse software como um software livre e de código aberto. Execute simulações em nosso hardware, seu hardware, implante o seu próprio Visual Dynamics, isso depende totalmente de você." + "title": "Código Aberto", + "description": "Sabemos que executar um MD não é algo fácil, com isso em mente, mantemos o desenvolvimento deste software de automação em código aberto, feito pela comunidade, para a comunidade." } } } diff --git a/apps/client/package.json b/apps/client/package.json index 78a155d0..c43c17be 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -1,6 +1,6 @@ { "name": "client", - "version": "2.0.2", + "version": "2.0.3-next.1", "private": true, "scripts": { "build": "next build", diff --git a/apps/client/src/components/account/form-register/schema.zod.ts b/apps/client/src/components/account/form-register/schema.zod.ts index 0599db72..7a792a77 100644 --- a/apps/client/src/components/account/form-register/schema.zod.ts +++ b/apps/client/src/components/account/form-register/schema.zod.ts @@ -1,7 +1,13 @@ import { z } from "zod"; export const SignUpFormSchema = z.object({ - username: z.string().min(1, "account-register:username.errors.empty"), + username: z + .string() + .min(1, "account-register:username.errors.empty") + .regex( + new RegExp("^[a-zA-Z0-9]{4,10}$"), + "account-register:username.errors.invalid" + ), email: z .string() .min(1, "account-register:email.errors.empty") diff --git a/apps/client/src/components/general/sidebar/content.tsx b/apps/client/src/components/general/sidebar/content.tsx index ef113bee..ba2121cc 100644 --- a/apps/client/src/components/general/sidebar/content.tsx +++ b/apps/client/src/components/general/sidebar/content.tsx @@ -110,7 +110,7 @@ export function SidebarContent() { }, { label: "navigation:admin.active-simulations", - href: "/admin/running" + href: "/admin/active-simulations" }, { label: "navigation:admin.settings", diff --git a/apps/client/src/components/simulations/running/realtime-log/index.tsx b/apps/client/src/components/simulations/running/realtime-log/index.tsx index b5466c9c..2cf38170 100644 --- a/apps/client/src/components/simulations/running/realtime-log/index.tsx +++ b/apps/client/src/components/simulations/running/realtime-log/index.tsx @@ -17,7 +17,7 @@ export function SimulationRealtimeLog({

- {t("running:logs.title")} + {t("simulations-runninglogs.title")}

{isRefetching ? : null}
diff --git a/apps/client/src/components/simulations/running/step-list/index.tsx b/apps/client/src/components/simulations/running/step-list/index.tsx index 9e43b44f..e4a25e91 100644 --- a/apps/client/src/components/simulations/running/step-list/index.tsx +++ b/apps/client/src/components/simulations/running/step-list/index.tsx @@ -26,7 +26,7 @@ function Step({ step }: { active: boolean; - running: boolean; + simulations-running boolean; step: string; }) { const { t } = useTranslation(); @@ -51,7 +51,7 @@ function Step({ {running ? ( ) : null} -

{t(`running:steps.${step}`)}

+

{t(`simulations-runningsteps.${step}`)}

); } @@ -62,7 +62,7 @@ export function SimulationStepList({ activeSteps }: SimulationStepListProps) { return (

- {t("running:steps.title")} + {t("simulations-runningsteps.title")}

{steps.map((step, index) => ( diff --git a/apps/client/src/pages/simulations/running.tsx b/apps/client/src/pages/simulations/running.tsx index ff0eb859..601ee30f 100644 --- a/apps/client/src/pages/simulations/running.tsx +++ b/apps/client/src/pages/simulations/running.tsx @@ -51,7 +51,7 @@ export default function Running({ user }: { user: User }) { return ( - +

- {t("running:description")} + {t("simulations-runningdescription")}

-

{t("running:taskId")}:

+

{t("simulations-runningtaskId")}:

{data.info.celeryId}

-

{t("running:type")}:

+

{t("simulations-runningtype")}:

{data.info.type}

-

{t("running:molecule")}:

+

{t("simulations-runningmolecule")}:

{data.info.molecule}

-

{t("running:createdAt")}:

+

{t("simulations-runningcreatedAt")}:

{Intl.DateTimeFormat(router.locale, { day: "2-digit", @@ -106,11 +106,11 @@ export default function Running({ user }: { user: User }) { return ( - +

-

{t("running:not-running.title")}

- {t("running:not-running.description")} +

{t("simulations-runningnot-running.title")}

+ {t("simulations-runningnot-running.description")}