Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/meteor/app/cloud/server/functions/getCheckoutUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SystemLogger } from '../../../../server/lib/logger/system';
import { settings } from '../../../settings/server';
import { getURL } from '../../../utils/server/getURL';

export const fallback = `https://go.rocket.chat/i/contact-sales`;
export const fallback = 'https://go.rocket.chat/i/contact-sales';

export const getCheckoutUrl = async (): Promise<{
url: string;
Expand Down
13 changes: 9 additions & 4 deletions apps/meteor/client/components/FingerprintChangeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import DOMPurify from 'dompurify';
import type { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import { links } from '../lib/links';

type FingerprintChangeModalProps = {
onConfirm: () => void;
onCancel: () => void;
Expand Down Expand Up @@ -33,10 +35,13 @@ const FingerprintChangeModal = ({ onConfirm, onCancel, onClose }: FingerprintCha
is='p'
mbe={16}
dangerouslySetInnerHTML={{
__html: DOMPurify.sanitize(t('Unique_ID_change_detected_learn_more_link'), {
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a'],
ALLOWED_ATTR: ['href', 'title'],
}),
__html: DOMPurify.sanitize(
t('Unique_ID_change_detected_learn_more_link', { fingerPrintChangedFaq: links.go.fingerPrintChangedFaq }),
{
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a'],
ALLOWED_ATTR: ['href', 'title'],
},
),
}}
/>
</GenericModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import DOMPurify from 'dompurify';
import type { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import { links } from '../lib/links';

type FingerprintChangeModalConfirmationProps = {
onConfirm: () => void;
onCancel: () => void;
Expand Down Expand Up @@ -41,10 +43,13 @@ const FingerprintChangeModalConfirmation = ({
is='p'
mbe={16}
dangerouslySetInnerHTML={{
__html: DOMPurify.sanitize(t('Unique_ID_change_detected_learn_more_link'), {
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a'],
ALLOWED_ATTR: ['href', 'title'],
}),
__html: DOMPurify.sanitize(
t('Unique_ID_change_detected_learn_more_link', { fingerPrintChangedFaq: links.go.fingerPrintChangedFaq }),
{
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a'],
ALLOWED_ATTR: ['href', 'title'],
},
),
}}
/>
</GenericModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { useCallback } from 'react';

import { useExternalLink } from '../../../hooks/useExternalLink';
import { useIsEnterprise } from '../../../hooks/useIsEnterprise';
import { links } from '../../../lib/links';
import { useCheckoutUrl } from '../../../views/admin/subscription/hooks/useCheckoutUrl';

const TALK_TO_SALES_URL = 'https://go.rocket.chat/i/contact-sales';
const TALK_TO_SALES_URL = links.go.contactSales;

export const useUpsellActions = (hasLicenseModule = false) => {
const setModal = useSetModal();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export const OUTBOUND_DOCS_LINK = 'https://docs.rocket.chat/docs/p2p-outbound-messaging';
export const CONTACT_SALES_LINK = 'https://go.rocket.chat/i/contact-sales';
import { links } from '../../../lib/links';

export const OUTBOUND_DOCS_LINK = links.outboundDocs;
export const CONTACT_SALES_LINK = links.go.contactSales;
8 changes: 5 additions & 3 deletions apps/meteor/client/lib/createSidebarItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import type { Keys as IconName } from '@rocket.chat/icons';
import type { LocationPathname } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';

import { GO_ROCKET_CHAT_PREFIX } from './links';

export type Item = {
i18nLabel: string;
href?: LocationPathname | `https://go.rocket.chat/i/${string}`;
href?: LocationPathname | `${typeof GO_ROCKET_CHAT_PREFIX}${string}`;
icon?: IconName;
tag?: 'Alpha' | 'Beta';
permissionGranted?: () => boolean;
Expand All @@ -17,8 +19,8 @@ export type SidebarDivider = { divider: boolean; i18nLabel: string };
export type SidebarItem = Item | SidebarDivider;
export const isSidebarItem = (item: SidebarItem): item is Item => !('divider' in item);

export const isGoRocketChatLink = (link: string): link is `https://go.rocket.chat/i/${string}` =>
link.startsWith('https://go.rocket.chat/i/');
export const isGoRocketChatLink = (link: string): link is `${typeof GO_ROCKET_CHAT_PREFIX}${string}` =>
link.startsWith(GO_ROCKET_CHAT_PREFIX);

export const createSidebarItems = (
initialItems: SidebarItem[] = [],
Expand Down
57 changes: 57 additions & 0 deletions apps/meteor/client/lib/links.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
export const GO_ROCKET_CHAT_PREFIX = 'https://go.rocket.chat';

export const links = {
go: {
accessibilityAndAppearance: `${GO_ROCKET_CHAT_PREFIX}/i/accessibility-and-appearance`,
accessibilityStatement: `${GO_ROCKET_CHAT_PREFIX}/i/accessibility-statement`,
airgappedRestriction: `${GO_ROCKET_CHAT_PREFIX}/i/airgapped-restriction`,
appsDocumentation: `${GO_ROCKET_CHAT_PREFIX}/i/developing-an-app`,
contactSales: `${GO_ROCKET_CHAT_PREFIX}/i/contact-sales`,
contactSalesProduct: `${GO_ROCKET_CHAT_PREFIX}/i/contact-sales-product`,
desktopAppWindows: `${GO_ROCKET_CHAT_PREFIX}/i/hp-desktop-app-windows`,
desktopAppMac: `${GO_ROCKET_CHAT_PREFIX}/i/hp-desktop-app-mac`,
desktopAppLinux: `${GO_ROCKET_CHAT_PREFIX}/i/hp-desktop-app-linux`,
documentation: `${GO_ROCKET_CHAT_PREFIX}/i/hp-documentation`,
downgrade: `${GO_ROCKET_CHAT_PREFIX}/i/docs-downgrade`,
e2eeGuide: `${GO_ROCKET_CHAT_PREFIX}/i/e2ee-guide`,
fingerPrintChangedFaq: `${GO_ROCKET_CHAT_PREFIX}/i/fingerprint-changed-faq`,
getAddons: `${GO_ROCKET_CHAT_PREFIX}/i/get-addons`,
glossary: `${GO_ROCKET_CHAT_PREFIX}/i/glossary`,
homepage: `${GO_ROCKET_CHAT_PREFIX}/home`,
invite: `${GO_ROCKET_CHAT_PREFIX}/invite?host=open.rocket.chat&path=invite%2F5sBs3a`,
ldapDocs: `${GO_ROCKET_CHAT_PREFIX}/i/ldap-docs`,
matrixFederation: `${GO_ROCKET_CHAT_PREFIX}/i/matrix-federation`,
mobileAppGoogle: `${GO_ROCKET_CHAT_PREFIX}/i/hp-mobile-app-google`,
mobileAppApple: `${GO_ROCKET_CHAT_PREFIX}/i/hp-mobile-app-apple`,
omnichannelDocs: `${GO_ROCKET_CHAT_PREFIX}/i/omnichannel-docs`,
pricing: `${GO_ROCKET_CHAT_PREFIX}/i/see-paid-plan-customize-homepage`,
pricingProduct: `${GO_ROCKET_CHAT_PREFIX}/i/pricing-product`,
registerInfoCollected: `${GO_ROCKET_CHAT_PREFIX}/i/register-info-collected`,
supportPrerequisites: `${GO_ROCKET_CHAT_PREFIX}/i/support-prerequisites`,
trial: `${GO_ROCKET_CHAT_PREFIX}/i/docs-trial`,
versionSupport: `${GO_ROCKET_CHAT_PREFIX}/i/version-support`,
updateProduct: `${GO_ROCKET_CHAT_PREFIX}/i/update-product`,
},
/** @deprecated use `go.rocket.chat` links */
desktopAppDownload: 'https://rocket.chat/download',
/** @deprecated use `go.rocket.chat` links */
enterprise: 'https://www.rocket.chat/enterprise',
/** @deprecated use `go.rocket.chat` links */
outboundDocs: 'https://docs.rocket.chat/docs/p2p-outbound-messaging',
/** @deprecated use `go.rocket.chat` links */
privacy: 'https://rocket.chat/privacy',
/** @deprecated use `go.rocket.chat` links */
retentionPolicy: 'https://docs.rocket.chat/use-rocket.chat/workspace-administration/settings/retention-policies',
/** @deprecated use `go.rocket.chat` links */
rocketChat: 'https://rocket.chat/',
/** @deprecated use `go.rocket.chat` links */
rocketChatUpdated: 'https://rocket.chat/updated',
/** @deprecated use `go.rocket.chat` links */
scaling: 'https://docs.rocket.chat/deploy/scaling-rocket.chat',
/** @deprecated use `go.rocket.chat` links */
terms: 'https://rocket.chat/terms',
/** @deprecated use `go.rocket.chat` links */
updatingRocketChat: 'https://docs.rocket.chat/v1/docs/en/updating-rocketchat',
/** @deprecated use `go.rocket.chat` links */
webhooks: 'https://docs.rocket.chat/use-rocket.chat/omnichannel/webhooks',
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import { usePagination } from '../../components/GenericTable/hooks/usePagination';
import { useSort } from '../../components/GenericTable/hooks/useSort';
import { useFormatDateAndTime } from '../../hooks/useFormatDateAndTime';
import { links } from '../../lib/links';

type Scope = 'global' | 'department' | 'user';

Expand Down Expand Up @@ -141,7 +142,7 @@ const CannedResponsesTable = () => {
description={t('No_Canned_Responses_Yet-description')}
buttonTitle={t('Create_canned_response')}
buttonAction={handleAddNew}
linkHref='https://go.rocket.chat/i/omnichannel-docs'
linkHref={links.go.omnichannelDocs}
linkText={t('Learn_more_about_canned_responses')}
/>
)}
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/client/omnichannel/monitors/MonitorsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
} from '../../components/GenericTable';
import { usePagination } from '../../components/GenericTable/hooks/usePagination';
import { useSort } from '../../components/GenericTable/hooks/useSort';
import { links } from '../../lib/links';

const MonitorsTable = () => {
const t = useTranslation();
Expand Down Expand Up @@ -164,7 +165,7 @@ const MonitorsTable = () => {
icon='shield-blank'
title={t('No_monitors_yet')}
description={t('No_monitors_yet_description')}
linkHref='https://go.rocket.chat/i/omnichannel-docs'
linkHref={links.go.omnichannelDocs}
linkText={t('Learn_more_about_monitors')}
/>
)}
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/client/omnichannel/slaPolicies/SlaTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '../../components/GenericTable';
import { usePagination } from '../../components/GenericTable/hooks/usePagination';
import { useSort } from '../../components/GenericTable/hooks/useSort';
import { links } from '../../lib/links';

const SlaTable = ({ reload }: { reload: MutableRefObject<() => void> }) => {
const t = useTranslation();
Expand Down Expand Up @@ -108,7 +109,7 @@ const SlaTable = ({ reload }: { reload: MutableRefObject<() => void> }) => {
description={t('No_SLA_policies_yet_description')}
buttonTitle={t('Create_SLA_policy')}
buttonAction={handleAddNew}
linkHref='https://go.rocket.chat/i/omnichannel-docs'
linkHref={links.go.omnichannelDocs}
linkText={t('Learn_more_about_SLA_policies')}
/>
)}
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/client/omnichannel/tags/TagsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from '../../components/GenericTable';
import { usePagination } from '../../components/GenericTable/hooks/usePagination';
import { useSort } from '../../components/GenericTable/hooks/useSort';
import { links } from '../../lib/links';

const TagsTable = () => {
const t = useTranslation();
Expand Down Expand Up @@ -94,7 +95,7 @@ const TagsTable = () => {
description={t('No_tags_yet_description')}
buttonTitle={t('Create_tag')}
buttonAction={handleAddNew}
linkHref='https://go.rocket.chat/i/omnichannel-docs'
linkHref={links.go.omnichannelDocs}
linkText={t('Learn_more_about_tags')}
/>
)}
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/client/omnichannel/units/UnitsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
} from '../../components/GenericTable';
import { usePagination } from '../../components/GenericTable/hooks/usePagination';
import { useSort } from '../../components/GenericTable/hooks/useSort';
import { links } from '../../lib/links';

const UnitsTable = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -87,7 +88,7 @@ const UnitsTable = () => {
icon='business'
title={t('No_units_yet')}
description={t('No_units_yet_description')}
linkHref='https://go.rocket.chat/i/omnichannel-docs'
linkHref={links.go.omnichannelDocs}
buttonAction={handleAddNew}
buttonTitle={t('Create_unit')}
linkText={t('Learn_more_about_units')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import { useLicense, useLicenseName } from '../../hooks/useLicense';
import { links } from '../../lib/links';

export const SidebarFooterWatermark = (): ReactElement | null => {
const { t } = useTranslation();
Expand All @@ -27,7 +28,7 @@ export const SidebarFooterWatermark = (): ReactElement | null => {

return (
<Box pi={16} pbe={8}>
<Box is='a' href='https://rocket.chat/' target='_blank' rel='noopener noreferrer'>
<Box is='a' href={links.rocketChat} target='_blank' rel='noopener noreferrer'>
<Box fontScale='micro' color='hint' pbe={4}>
{t('Powered_by_RocketChat')}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { ExternalLink } from '@rocket.chat/ui-client';
import { useTranslation } from 'react-i18next';

import AirGappedRestrictionWarning from './AirGappedRestrictionWarning';
import { links } from '../../../lib/links';

const AirGappedRestrictionSection = ({ isRestricted, remainingDays }: { isRestricted: boolean; remainingDays: number }) => {
const { t } = useTranslation();

return (
<SidebarBanner
text={<AirGappedRestrictionWarning isRestricted={isRestricted} remainingDays={remainingDays} />}
description={<ExternalLink to='https://go.rocket.chat/i/airgapped-restriction'>{t('Learn_more')}</ExternalLink>}
description={<ExternalLink to={links.go.airgappedRestriction}>{t('Learn_more')}</ExternalLink>}
/>
);
};
Expand Down
7 changes: 4 additions & 3 deletions apps/meteor/client/sidebar/sections/OverMacLimitSection.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Icon, SidebarBanner } from '@rocket.chat/fuselage';
import { useEffectEvent } from '@rocket.chat/fuselage-hooks';
import type { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import { links } from '../../lib/links';

export const OverMacLimitSection = (): ReactElement => {
const { t } = useTranslation();

const handleClick = () => {
window.open('https://rocket.chat/pricing', '_blank');
};
const handleClick = useEffectEvent(() => window.open(links.go.pricing));

return (
<SidebarBanner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import { useLicense, useLicenseName } from '../../hooks/useLicense';
import { links } from '../../lib/links';

export const SidebarFooterWatermark = (): ReactElement | null => {
const { t } = useTranslation();
Expand All @@ -27,7 +28,7 @@ export const SidebarFooterWatermark = (): ReactElement | null => {

return (
<Box pi={16} pbe={8}>
<Box is='a' href='https://rocket.chat/' target='_blank' rel='noopener noreferrer'>
<Box is='a' href={links.rocketChat} target='_blank' rel='noopener noreferrer'>
<Box fontScale='micro' color='hint' pbe={4}>
{t('Powered_by_RocketChat')}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { SidebarV2Banner } from '@rocket.chat/fuselage';
import { useTranslation } from 'react-i18next';

import AirGappedRestrictionWarning from './AirGappedRestrictionWarning';
import { links } from '../../../lib/links';

const AirGappedRestrictionSection = ({ isRestricted, remainingDays }: { isRestricted: boolean; remainingDays: number }) => {
const { t } = useTranslation();
Expand All @@ -13,7 +14,7 @@ const AirGappedRestrictionSection = ({ isRestricted, remainingDays }: { isRestri
linkProps={{
target: '_blank',
rel: 'noopener noreferrer',
href: 'https://go.rocket.chat/i/airgapped-restriction',
href: links.go.airgappedRestriction,
}}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { useCreateFontStyleElement } from './hooks/useCreateFontStyleElement';
import { themeItems as themes } from './themeItems';
import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../components/Page';
import { getDirtyFields } from '../../../lib/getDirtyFields';
import { links } from '../../../lib/links';

const AccessibilityPage = () => {
const t = useTranslation();
Expand Down Expand Up @@ -96,15 +97,13 @@ const AccessibilityPage = () => {
<p id={linkListId}>{t('Learn_more_about_accessibility')}</p>
<ul aria-labelledby={linkListId}>
<li>
<ExternalLink to='https://go.rocket.chat/i/accessibility-statement'>{t('Accessibility_statement')}</ExternalLink>
<ExternalLink to={links.go.accessibilityStatement}>{t('Accessibility_statement')}</ExternalLink>
</li>
<li>
<ExternalLink to='https://go.rocket.chat/i/glossary'>{t('Glossary_of_simplified_terms')}</ExternalLink>
<ExternalLink to={links.go.glossary}>{t('Glossary_of_simplified_terms')}</ExternalLink>
</li>
<li>
<ExternalLink to='https://go.rocket.chat/i/accessibility-and-appearance'>
{t('Accessibility_feature_documentation')}
</ExternalLink>
<ExternalLink to={links.go.accessibilityAndAppearance}>{t('Accessibility_feature_documentation')}</ExternalLink>
</li>
</ul>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Trans, useTranslation } from 'react-i18next';

import { ContextualbarContent, ContextualbarFooter } from '../../../components/Contextualbar';
import { useIsEnterprise } from '../../../hooks/useIsEnterprise';
import { links } from '../../../lib/links';
import { useActiveConnections } from '../../hooks/useActiveConnections';

const CustomUserStatusService = () => {
Expand Down Expand Up @@ -88,7 +89,7 @@ const CustomUserStatusService = () => {
<Box fontScale='p2' mb={8}>
<Trans i18nKey='Larger_amounts_of_active_connections'>
For larger amounts of active connections you can consider our
<Box is='a' href='https://docs.rocket.chat/deploy/scaling-rocket.chat' target='_blank' color='info'>
<Box is='a' href={links.scaling} target='_blank' color='info'>
multiple instance solutions
</Box>
.
Expand All @@ -110,7 +111,7 @@ const CustomUserStatusService = () => {
{!license?.isEnterprise && (
<ContextualbarFooter borderBlockStartWidth='default' borderBlockColor='extra-light'>
<ButtonGroup stretch vertical>
<Button primary width='100%' is='a' href='https://www.rocket.chat/enterprise' target='_blank'>
<Button primary width='100%' is='a' href={links.enterprise} target='_blank'>
{t('More_about_Premium_plans')}
</Button>
</ButtonGroup>
Expand Down
Loading
Loading