From 2dcc12d242ed70f0d7203a991b09eb9ed0c512a2 Mon Sep 17 00:00:00 2001 From: Conor Macpherson Date: Tue, 28 Mar 2023 11:30:15 -0400 Subject: [PATCH] fix links, types. --- .../common/hooks/useControlSelfHostedExpansionModal.ts | 2 +- .../components/self_hosted_expansion_modal/error_page.tsx | 5 ++--- .../components/self_hosted_expansion_modal/index.test.tsx | 8 ++++++++ .../src/components/self_hosted_expansion_modal/index.tsx | 2 +- .../src/components/self_hosted_purchase_modal/index.tsx | 1 + webapp/channels/src/utils/constants.tsx | 4 ++-- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/webapp/channels/src/components/common/hooks/useControlSelfHostedExpansionModal.ts b/webapp/channels/src/components/common/hooks/useControlSelfHostedExpansionModal.ts index acca8853e0..ce77aff2a8 100644 --- a/webapp/channels/src/components/common/hooks/useControlSelfHostedExpansionModal.ts +++ b/webapp/channels/src/components/common/hooks/useControlSelfHostedExpansionModal.ts @@ -26,7 +26,7 @@ export default function useControlSelfHostedExpansionModal(options: HookOptions) const dispatch = useDispatch(); const currentUser = useSelector(getCurrentUser); const controlModal = useControlModal({ - modalId: ModalIdentifiers.SELF_HOSTED_EXPANSION, + modalId: ModalIdentifiers.EXPANSION_IN_PROGRESS, dialogType: SelfHostedExpansionModal, }); diff --git a/webapp/channels/src/components/self_hosted_expansion_modal/error_page.tsx b/webapp/channels/src/components/self_hosted_expansion_modal/error_page.tsx index 76b9af34d4..c811fc4c5c 100644 --- a/webapp/channels/src/components/self_hosted_expansion_modal/error_page.tsx +++ b/webapp/channels/src/components/self_hosted_expansion_modal/error_page.tsx @@ -4,9 +4,8 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {useSelector} from 'react-redux'; +import {useOpenSelfHostedZendeskSupportForm} from 'components/common/hooks/useOpenZendeskForm'; -import {getCloudContactUsLink, InquiryType} from 'selectors/cloud'; import PaymentFailedSvg from 'components/common/svg_images_components/payment_failed_svg'; import IconMessage from 'components/purchase_modal/icon_message'; @@ -14,7 +13,7 @@ import IconMessage from 'components/purchase_modal/icon_message'; import './error_page.scss'; export default function SelfHostedExpansionErrorPage() { - const contactSupportLink = useSelector(getCloudContactUsLink)(InquiryType.Technical); + const [, contactSupportLink] = useOpenSelfHostedZendeskSupportForm('Purchase error'); const formattedTitle = ( { state: 'string', country: 'string', postalCode: '12345', + shippingAddress: 'string', + shippingAddress2: 'string', + shippingCity: 'string', + shippingState: 'string', + shippingCountry: 'string', + shippingPostalCode: '12345', + shippingSame: false, + agreedTerms: true, cardName: 'string', organization: 'string', cardFilled: true, diff --git a/webapp/channels/src/components/self_hosted_expansion_modal/index.tsx b/webapp/channels/src/components/self_hosted_expansion_modal/index.tsx index da54d4ce65..00672eddf2 100644 --- a/webapp/channels/src/components/self_hosted_expansion_modal/index.tsx +++ b/webapp/channels/src/components/self_hosted_expansion_modal/index.tsx @@ -336,7 +336,7 @@ export default function SelfHostedExpansionModal() { show={show} ariaLabelledBy='self_hosted_expansion_modal_title' onClose={() => { - dispatch(closeModal(ModalIdentifiers.SELF_HOSTED_EXPANSION)); + dispatch(closeModal(ModalIdentifiers.EXPANSION_IN_PROGRESS)); resetToken(); }} > diff --git a/webapp/channels/src/components/self_hosted_purchase_modal/index.tsx b/webapp/channels/src/components/self_hosted_purchase_modal/index.tsx index 6dd1332b49..aa8f41fdd4 100644 --- a/webapp/channels/src/components/self_hosted_purchase_modal/index.tsx +++ b/webapp/channels/src/components/self_hosted_purchase_modal/index.tsx @@ -71,6 +71,7 @@ import {SetPrefix, UnionSetActions} from './types'; import './self_hosted_purchase_modal.scss'; import {STORAGE_KEY_PURCHASE_IN_PROGRESS} from './constants'; +import {inferNames} from 'utils/hosted_customer'; export interface State { diff --git a/webapp/channels/src/utils/constants.tsx b/webapp/channels/src/utils/constants.tsx index 9febc6e1c6..e20039599e 100644 --- a/webapp/channels/src/utils/constants.tsx +++ b/webapp/channels/src/utils/constants.tsx @@ -461,7 +461,7 @@ export const ModalIdentifiers = { DELETE_WORKSPACE_RESULT: 'delete_workspace_result', SCREENING_IN_PROGRESS: 'screening_in_progress', CONFIRM_SWITCH_TO_YEARLY: 'confirm_switch_to_yearly', - SELF_HOSTED_EXPANSION: 'self_hosted_expansion', + EXPANSION_IN_PROGRESS: 'expansion_in_progress', }; export const UserStatuses = { @@ -1071,7 +1071,6 @@ export const CloudLinks = { SELF_HOSTED_SIGNUP: 'https://customers.mattermost.com/signup', DELINQUENCY_DOCS: 'https://docs.mattermost.com/about/cloud-subscriptions.html#failed-or-late-payments', SELF_HOSTED_PRICING: 'https://mattermost.com/pricing/#self-hosted', - SELF_HOSTED_BILLING: 'https://docs.mattermost.com/manage/self-hosted-billing.html', }; export const HostedCustomerLinks = { @@ -1091,6 +1090,7 @@ export const DocLinks = { ONBOARD_LDAP: 'https://docs.mattermost.com/onboard/ad-ldap.html', ONBOARD_SSO: 'https://docs.mattermost.com/onboard/sso-saml.html', TRUE_UP_REVIEW: 'https://mattermost.com/pl/true-up-documentation', + SELF_HOSTED_BILLING: 'https://docs.mattermost.com/manage/self-hosted-billing.html', }; export const LicenseLinks = {