Skip to content

Commit

Permalink
Merge pull request #1197 from tchapgouv/1193-proconnect-information-i…
Browse files Browse the repository at this point in the history
…nstance

TCHAP: add proconnect instance faq welcome page
  • Loading branch information
MarcWadai authored Dec 31, 2024
2 parents 45e81e8 + 6d98bcb commit 13f1c18
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 8 deletions.
8 changes: 8 additions & 0 deletions modules/tchap-translations/tchap_translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,10 @@
"en": "Login with ProConnect",
"fr": "Se connecter avec ProConnect"
},
"auth|proconnect|button_title": {
"en": "Login with <br/><b>ProConnect </b>",
"fr": "Se connecter avec <br/><b>ProConnect </b>"
},
"auth|proconnect|continue": {
"en": "Continue with ProConnect",
"fr": "Continuer avec ProConnect"
Expand All @@ -858,6 +862,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"
Expand Down
4 changes: 3 additions & 1 deletion patches/tchap-modifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions res/css/views/sso/TchapSSO.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
.tc_ButtonProconnect {
background-color: var(--accent);
color: white !important;
text-align: left;
}

.tc_Button_iconPC {
Expand Down
14 changes: 10 additions & 4 deletions res/welcome_sso.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
background-color: #000091;
color: white !important;
margin-bottom: 10px;
text-align: left;
}

.tc_Button {
Expand Down Expand Up @@ -263,11 +264,16 @@ <h1 class="mx_Header_title">_t("Welcome to Tchap")<br />
<div class="mx_ButtonGroup">
<div class="tc_ButtonCol">
<a href="#/email-precheck-sso" class="tc_ButtonParent tc_ButtonProconnect tc_Button_iconPC">
<div class="mx_ButtonLabel">_t("auth|proconnect|email_title")</div>
</a>
<a href="https://www.proconnect.gouv.fr/" class="tc_ButtonProconnect_explanation ">
<div>_t("welcome|sso|proconnect_explanation")</div>
<div class="mx_ButtonLabel">_t("auth|proconnect|button_title")</div>
</a>
<div>
<a href="https://www.proconnect.gouv.fr/" target="_blank" rel="noopener" class="tc_ButtonProconnect_explanation">
<div>_t("welcome|sso|proconnect_explanation")</div>
</a>
<a href="$proconnectFaq" target="_blank" rel="noopener" class="tc_ButtonProconnect_explanation ">
_t("welcome|sso|proconnect_instance_availability")
</a>
</div>
<a href="#/login" class="tc_ButtonParent tc_Button tc_ButtonBorder">
<div>_t("auth|proconnect|sign_in_password_instead")</div>
</a>
Expand Down
3 changes: 3 additions & 0 deletions src/Views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
6 changes: 3 additions & 3 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1136,13 +1136,13 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
}

// :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:

Expand Down Expand Up @@ -1915,7 +1915,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
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
Expand Down
3 changes: 3 additions & 0 deletions src/components/views/auth/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand All @@ -41,6 +43,7 @@ export default class Welcome extends React.PureComponent<IProps> {
replaceMap["$logoUrl"] = logoUrl;
// :TCHAP: sso-agentconnect-flow - pageUrl = "welcome.html";
pageUrl = TchapUIFeature.isSSOFlowActive() ? "welcome_sso.html" : "welcome.html";
replaceMap["$proconnectFaq"] = TchapUrls.helpProconnectInstances;
// end :TCHAP:
}

Expand Down
5 changes: 5 additions & 0 deletions src/dispatcher/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 2 additions & 0 deletions src/tchap/util/TchapUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

0 comments on commit 13f1c18

Please sign in to comment.