From c770f91ab45f974d5581382d04220aec24f79295 Mon Sep 17 00:00:00 2001 From: "marc.sirisak" Date: Wed, 18 Dec 2024 16:44:18 +0100 Subject: [PATCH 1/2] TCHAP: add proconnect instance faq welcome page --- modules/tchap-translations/tchap_translations.json | 4 ++++ res/welcome_sso.html | 11 ++++++++--- src/components/views/auth/Welcome.tsx | 3 +++ src/tchap/util/TchapUrls.ts | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/tchap-translations/tchap_translations.json b/modules/tchap-translations/tchap_translations.json index b4bf069fad..3dcd3bf3f5 100644 --- a/modules/tchap-translations/tchap_translations.json +++ b/modules/tchap-translations/tchap_translations.json @@ -858,6 +858,10 @@ "en": "-> What is ProConnect ?", "fr": "-> Qu'est-ce que ProConnect ?" }, + "welcome|sso|proconnect_instance_availability": { + "en": "-> Is it available for my administration ?", + "fr": "-> Est-ce activé pour mon administration ?" + }, "auth|proconnect|error": { "en": "An error occured during SSO login", "fr": "Une erreur est survenue lors de la connexion" diff --git a/res/welcome_sso.html b/res/welcome_sso.html index c0049fe218..519ab12caf 100644 --- a/res/welcome_sso.html +++ b/res/welcome_sso.html @@ -265,9 +265,14 @@

_t("Welcome to Tchap")
_t("auth|proconnect|email_title")
- -
_t("welcome|sso|proconnect_explanation")
-
+
+ +
_t("welcome|sso|proconnect_explanation")
+
+ + _t("welcome|sso|proconnect_instance_availability") + +
_t("auth|proconnect|sign_in_password_instead")
diff --git a/src/components/views/auth/Welcome.tsx b/src/components/views/auth/Welcome.tsx index bdc2c38b0c..f9d219ccdb 100644 --- a/src/components/views/auth/Welcome.tsx +++ b/src/components/views/auth/Welcome.tsx @@ -15,7 +15,9 @@ import { UIFeature } from "../../../settings/UIFeature"; import LanguageSelector from "./LanguageSelector"; import EmbeddedPage from "../../structures/EmbeddedPage"; import { MATRIX_LOGO_HTML } from "../../structures/static-page-vars"; + import TchapUIFeature from "~tchap-web/src/tchap/util/TchapUIFeature"; +import TchapUrls from "~tchap-web/src/tchap/util/TchapUrls"; interface IProps {} @@ -41,6 +43,7 @@ export default class Welcome extends React.PureComponent { replaceMap["$logoUrl"] = logoUrl; // :TCHAP: sso-agentconnect-flow - pageUrl = "welcome.html"; pageUrl = TchapUIFeature.isSSOFlowActive() ? "welcome_sso.html" : "welcome.html"; + replaceMap["$proconnectFaq"] = TchapUrls.helpProconnectInstances; // end :TCHAP: } diff --git a/src/tchap/util/TchapUrls.ts b/src/tchap/util/TchapUrls.ts index c8a173c65f..a2e49c75c9 100644 --- a/src/tchap/util/TchapUrls.ts +++ b/src/tchap/util/TchapUrls.ts @@ -25,4 +25,6 @@ export default class TchapUrls { // help manually import tchap keys public static helpManuallyImportKeys= "https://aide.tchap.beta.gouv.fr/fr/article/comment-importer-manuellement-mes-cles-tchap-cles-de-chiffrement-web-xh376r" + + public static helpProconnectInstances = "https://aide.tchap.beta.gouv.fr/fr/article/se-connecter-a-tchap-avec-proconnect-1dh1peg"; } From 6d98bcb37ce7fdd8ce3be62f33ad5e7422cc82a1 Mon Sep 17 00:00:00 2001 From: "marc.sirisak" Date: Tue, 31 Dec 2024 15:57:24 +0100 Subject: [PATCH 2/2] TCHAP: fix proconnect button ddesign and page navigation --- modules/tchap-translations/tchap_translations.json | 4 ++++ patches/tchap-modifications.json | 4 +++- res/css/views/sso/TchapSSO.pcss | 1 + res/welcome_sso.html | 3 ++- src/Views.ts | 3 +++ src/components/structures/MatrixChat.tsx | 6 +++--- src/dispatcher/actions.ts | 5 +++++ 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/modules/tchap-translations/tchap_translations.json b/modules/tchap-translations/tchap_translations.json index 3dcd3bf3f5..92a683cb97 100644 --- a/modules/tchap-translations/tchap_translations.json +++ b/modules/tchap-translations/tchap_translations.json @@ -846,6 +846,10 @@ "en": "Login with ProConnect", "fr": "Se connecter avec ProConnect" }, + "auth|proconnect|button_title": { + "en": "Login with
ProConnect ", + "fr": "Se connecter avec
ProConnect " + }, "auth|proconnect|continue": { "en": "Continue with ProConnect", "fr": "Continuer avec ProConnect" diff --git a/patches/tchap-modifications.json b/patches/tchap-modifications.json index 5f35bd2423..88ec6c2576 100644 --- a/patches/tchap-modifications.json +++ b/patches/tchap-modifications.json @@ -85,7 +85,9 @@ "src/components/structures/MatrixChat.tsx", "src/components/structures/auth/Registration.tsx", "src/components/structures/auth/Login.tsx", - "src/components/views/auth/Welcome.tsx" + "src/components/views/auth/Welcome.tsx", + "src/dispatcher/actions.ts", + "src/Views.ts" ] }, "hide-widgets-settings": { diff --git a/res/css/views/sso/TchapSSO.pcss b/res/css/views/sso/TchapSSO.pcss index 0ac6876071..0089edb60d 100644 --- a/res/css/views/sso/TchapSSO.pcss +++ b/res/css/views/sso/TchapSSO.pcss @@ -29,6 +29,7 @@ .tc_ButtonProconnect { background-color: var(--accent); color: white !important; + text-align: left; } .tc_Button_iconPC { diff --git a/res/welcome_sso.html b/res/welcome_sso.html index 519ab12caf..a2814a6edc 100644 --- a/res/welcome_sso.html +++ b/res/welcome_sso.html @@ -218,6 +218,7 @@ background-color: #000091; color: white !important; margin-bottom: 10px; + text-align: left; } .tc_Button { @@ -263,7 +264,7 @@

_t("Welcome to Tchap")
-
_t("auth|proconnect|email_title")
+
_t("auth|proconnect|button_title")
diff --git a/src/Views.ts b/src/Views.ts index 68e1feb230..a675c21aec 100644 --- a/src/Views.ts +++ b/src/Views.ts @@ -46,6 +46,9 @@ enum Views { // Another instance of the application has started up. We just show an error page. LOCK_STOLEN, + + // :TCHAP: sso-agentconnect-flow email precheck screen from proconnect login + EMAIL_PRECHECK_SSO } export default Views; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 8aca0ebf70..48f56fc77e 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1136,13 +1136,13 @@ export default class MatrixChat extends React.PureComponent { } // :TCHAP: sso-agentconnect-flow - private viewEmailPrecheckSSO() { + private viewEmailPrecheckSSO(): void { this.setStateForNewView({ view: Views.EMAIL_PRECHECK_SSO }); this.notifyNewScreen("email-precheck-sso"); ThemeController.isLogin = true; - this.themeWatcher.recheck(); + this.themeWatcher?.recheck(); } // end :TCHAP: @@ -1915,7 +1915,7 @@ export default class MatrixChat extends React.PureComponent { subAction: params?.action, }); // :TCHAP: sso-agentconnect-flow - } else if (screen = "email-precheck-sso") { + } else if (screen === "email-precheck-sso") { dis.dispatch({ action: "email_precheck_sso", params diff --git a/src/dispatcher/actions.ts b/src/dispatcher/actions.ts index 718f592e6a..b54880661d 100644 --- a/src/dispatcher/actions.ts +++ b/src/dispatcher/actions.ts @@ -379,4 +379,9 @@ export enum Action { * Opens right panel room summary and focuses the search input */ FocusMessageSearch = "focus_search", + + /** + * :TCHAP: sso-agentconnect-flow - Open new page to check email instance before launching SSO + */ + EmailPrecheckSSO = "email_precheck_sso" }