Skip to content

Commit

Permalink
feat(verify_device): add help on modal verify device after login
Browse files Browse the repository at this point in the history
  • Loading branch information
marc.sirisak committed Oct 24, 2024
1 parent 8cbff06 commit 8085466
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import defaultDispatcher from "../../../dispatcher/dispatcher";
import { Action } from "matrix-react-sdk/src/dispatcher/actions";
import { UserTab } from "matrix-react-sdk/src/components/views/dialogs/UserTab";
import { OpenToTabPayload } from "matrix-react-sdk/src/dispatcher/payloads/OpenToTabPayload";
import TchapUrls from "../../../../../../src/tchap/util/TchapUrls"; // :TCHAP: help-access-verify-device

function keyHasPassphrase(keyInfo: SecretStorageKeyDescription): boolean {
return Boolean(keyInfo.passphrase && keyInfo.passphrase.salt && keyInfo.passphrase.iterations);
Expand Down Expand Up @@ -201,13 +202,34 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState>
);
}

// :TCHAP:
const translationHelpLink = (sub) => (
<AccessibleButton kind="link_inline" onClick={() => {
window.open(TchapUrls.helpVerifyDevicesPage,"_blank")
}}>
{sub}
</AccessibleButton>
)
const tchapHelpButton = (
<AccessibleButton kind="primary_outline" onClick={() => { window.open(TchapUrls.helpVerifyDevicesPage,"_blank") }}>
{_t("common|help")}
</AccessibleButton>
)
// end :TCHAP:
return (
<div>
<p>{_t("encryption|verification|verification_description")}</p>

{/*:TCHAP: help-access-verify-device - <p>{_t("encryption|verification|verification_description")} */}
<p>{_t("encryption|verification|verification_description")} {_t("encryption|verification|help_link", {}, {
a: translationHelpLink,
})}
</p>
{/* end :TCHAP: */}
<div className="mx_CompleteSecurity_actionRow">
{verifyButton}
{useRecoveryKeyButton}
{/* :TCHAP: help-access-verify-device */}
{tchapHelpButton}
{/* end :TCHAP: */}
</div>
<div className="mx_SetupEncryptionBody_reset">
{_t("encryption|reset_all_button", undefined, {
Expand Down
8 changes: 8 additions & 0 deletions modules/tchap-translations/tchap_translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -877,5 +877,13 @@
"auth|proconnect|error_sso_inactive": {
"en": "ProConnect is disabled for your domain",
"fr": "ProConnect est désactivé pour votre domaine"
},
"encryption|verification|help_link": {
"en": "<a>Learn more and get help<a>",
"fr": "<a>En savoir plus et obtenir de l'aide <a>"
},
"encryption|verification|help_button": {
"en": "<a>Help<a>",
"fr": "<a>Aide <a>"
}
}
4 changes: 4 additions & 0 deletions patches/subtree-modifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,9 @@
"src/components/views/right_panel/RightPanelTabs.tsx",
"src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx"
]
},
"help-access-verify-device": {
"issue": "https://github.com/tchapgouv/tchap-web-v4/issues/1140",
"files": []
}
}
3 changes: 3 additions & 0 deletions src/tchap/util/TchapUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ export default class TchapUrls {

//tchap FAQ page on locked messages. Should redirect to the appropriate crisp page on https://aide.tchap.beta.gouv.fr
public static lockedMessagesPage = "https://tchap.beta.gouv.fr/faq/messages-verrouilles";

// help page to verify decices, used
public static helpVerifyDevicesPage = "https://aide.tchap.beta.gouv.fr/fr/article/comment-verifier-un-nouvel-appareil-sur-tchap-xm0b0y/";
}

0 comments on commit 8085466

Please sign in to comment.