Skip to content

Commit

Permalink
chore(urls): use tchap urls for links
Browse files Browse the repository at this point in the history
  • Loading branch information
marc.sirisak committed Oct 24, 2024
1 parent 8085466 commit 936f26f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { doesRoomHaveUnreadMessages } from "../../../Unread";
import SettingsFlag from "../elements/SettingsFlag";

import TchapUIFeature from "../../../../../../src/tchap/util/TchapUIFeature"; // :tchap: tchap-features-from-config
import TchapUrls from "../../../../../../src/tchap/util/TchapUrls"; //:TCHAP: email-notification-setting-caption

// TODO: this "view" component still has far too much application logic in it,
// which should be factored out to other files.
Expand Down Expand Up @@ -701,7 +702,7 @@ export default class Notifications extends React.PureComponent<IProps, IState> {
{},
{
a: (sub) => (
<AccessibleButton kind="link_inline" onClick={() => {window.open("https://aide.tchap.beta.gouv.fr/fr/article/notification-par-email-draft-6k7k89/","_blank")}}>
<AccessibleButton kind="link_inline" onClick={() => {window.open(TchapUrls.helpEmailNotification, "_blank")}}>
{sub}
</AccessibleButton>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts";
import defaultDispatcher from "../../../dispatcher/dispatcher";
import { Action } from "../../../dispatcher/actions";
import { Filter } from "../dialogs/spotlight/Filter";
import TchapUrls from "../../../../../../src/tchap/util/TchapUrls"; // :TCHAP: space-remove-public-and-subspace

export const createSpace = async (
client: MatrixClient,
Expand Down Expand Up @@ -348,7 +349,7 @@ const SpaceCreateMenu: React.FC<{
{_t("create_space|add_details_prompt")} {_t("create_space|add_details_prompt_2", {}, {
a: (sub) => (
<AccessibleButton kind="link_inline" onClick={() => {
window.open("https://aide.tchap.beta.gouv.fr/fr/article/comment-creer-un-espace-sur-tchap-1wmlenx","_blank")
window.open(TchapUrls.helpCreateSpace, "_blank")
}}>
{sub}
</AccessibleButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { UseCase } from "../settings/enums/UseCase";
import { useSettingValue } from "./useSettings";
import { UserOnboardingContext } from "./useUserOnboardingContext";
import { accessSecretStorage } from "../SecurityManager"; // :TCHAP: onboarding-add-secure-backup
import TchapUrls from "../../../../src/tchap/util/TchapUrls"; // :TCHAP: onboarding-add-tchap-guide

interface UserOnboardingTask {
id: string;
Expand Down Expand Up @@ -153,7 +154,7 @@ const tasks: UserOnboardingTask[] = [
label: _t("onboarding|check_user_guide_action"),
onClick: (ev: ButtonEvent) => {
window.localStorage.setItem('tchap_user_guide_checked', 'true');
window.open("https://aide.tchap.beta.gouv.fr/fr/article/guide-de-prise-en-main-de-tchap-oswyn1/", "_blank");
window.open( TchapUrls.helpUserOnboarding, "_blank");
},
},
}, /** end :TCHAP: onboarding-add-tchap-guide */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { _t } from "matrix-react-sdk/src/languageHandler";
import { TchapAnchor } from "../../../../components/views/common/TchapAnchor";
import KeySavedImage from "../../../../../../res/img/tchap/key-saved.svg";
import "../../../../../../res/css/views/dialogs/_TchapExportE2eKeysSuccessDialog.pcss";
import TchapUrls from "../../../../util/TchapUrls";

interface IProps {
allowLogout: boolean;
Expand Down Expand Up @@ -65,7 +66,7 @@ export default class TchapExportE2eKeysSuccessDialog extends React.Component<IPr
{
a: (sub) => (
<TchapAnchor
href="https://aide.tchap.beta.gouv.fr/fr/article/comment-importer-manuellement-mes-cles-tchap-cles-de-chiffrement-web-xh376r"
href={TchapUrls.helpManuallyImportKeys}
openInNewTab
>
{sub}
Expand Down
3 changes: 2 additions & 1 deletion src/tchap/components/views/common/QuickFaq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import classNames from 'classnames';
import { _t } from '../../../../languageHandler';
import "../../../../../res/css/common/_TchapLeftPanel.pcss";
import IconizedContextMenu, { IconizedContextMenuOption, IconizedContextMenuOptionList } from 'matrix-react-sdk/src/components/views/context_menus/IconizedContextMenu';
import TchapUrls from '../../../util/TchapUrls';

const QuickFaqButton: React.FC<{
isPanelCollapsed: boolean;
Expand Down Expand Up @@ -43,7 +44,7 @@ const QuickFaqButton: React.FC<{
iconClassName="mx_UserMenu_iconHome"
label={_t("quick_faq|guides")}
onClick={(e) => {
window.open("https://aide.tchap.beta.gouv.fr/fr/article/guide-de-prise-en-main-de-tchap-oswyn1/", '_blank')
window.open(TchapUrls.helpUserOnboarding, '_blank')
}}
/>
</IconizedContextMenuOptionList>
Expand Down
12 changes: 12 additions & 0 deletions src/tchap/util/TchapUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,16 @@ export default class TchapUrls {

// 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/";

// help page for notification by email
public static helpEmailNotification = "https://aide.tchap.beta.gouv.fr/fr/article/notification-par-email-draft-6k7k89/";

// help create space
public static helpCreateSpace = "https://aide.tchap.beta.gouv.fr/fr/article/comment-creer-un-espace-sur-tchap-1wmlenx";

// help user onboarding
public static helpUserOnboarding = "https://aide.tchap.beta.gouv.fr/fr/article/guide-de-prise-en-main-de-tchap-oswyn1/";

// 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"
}

0 comments on commit 936f26f

Please sign in to comment.