From d13770ddf91e7cabf3cfbecb9e4b5257eba4a548 Mon Sep 17 00:00:00 2001
From: Tom Moor
Date: Thu, 3 Apr 2025 22:24:46 -0400
Subject: [PATCH] Authorize styling, scope conversion
---
app/scenes/Login/OAuthAuthorize.tsx | 35 +-
app/scenes/Login/OAuthHelper.ts | 48 +
shared/i18n/locales/en_US/translation.json | 1167 +-------------------
3 files changed, 73 insertions(+), 1177 deletions(-)
create mode 100644 app/scenes/Login/OAuthHelper.ts
diff --git a/app/scenes/Login/OAuthAuthorize.tsx b/app/scenes/Login/OAuthAuthorize.tsx
index 04ba056211..151f103324 100644
--- a/app/scenes/Login/OAuthAuthorize.tsx
+++ b/app/scenes/Login/OAuthAuthorize.tsx
@@ -8,12 +8,14 @@ import { Avatar, AvatarSize } from "~/components/Avatar";
import ButtonLarge from "~/components/ButtonLarge";
import ChangeLanguage from "~/components/ChangeLanguage";
import Heading from "~/components/Heading";
+import PageTitle from "~/components/PageTitle";
import Text from "~/components/Text";
import useCurrentTeam from "~/hooks/useCurrentTeam";
import useQuery from "~/hooks/useQuery";
import useRequest from "~/hooks/useRequest";
import { client } from "~/utils/ApiClient";
import { detectLanguage } from "~/utils/language";
+import { OAuthHelper } from "./OAuthHelper";
import { Background } from "./components/Background";
import { Centered } from "./components/Centered";
@@ -58,7 +60,7 @@ function Authorize() {
- {t("Error")}
+ {t("An error occurred")}
{t("Required OAuth parameters are missing")}
@@ -80,8 +82,8 @@ function Authorize() {
- {t("Error")}
- {t("Unable to load OAuth client")}
+ {t("An error occurred")}
+ {t("Unable to load details of OAuth client")}
);
@@ -94,6 +96,7 @@ function Authorize() {
return (
+
@@ -110,16 +113,26 @@ function Authorize() {
- {response.data.name} wants to access {team.name}
+ {t(`{{ appName }} wants to access {{ teamName }}`, {
+ appName: response.data.name,
+ teamName: team.name,
+ })}
-
- {scopes.map((item) => (
- <>
- {item}
-
- >
+
+ {t(
+ "{{ appName }} will be able to access your account and perform the following actions:",
+ {
+ appName: response.data.name,
+ }
+ )}
+
+
+ {OAuthHelper.normalizeScopes(scopes).map((item) => (
+ -
+ {item}
+
))}
-
+