[MM-50976] - Contact Support to redirect to Zendesk and pre-fill known information (#22640)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5215a0c30d
Коммит
865b3d75e7
@@ -4,51 +4,10 @@
|
||||
import {Invoice, Subscription} from '@mattermost/types/cloud';
|
||||
|
||||
import {getConfig} from 'mattermost-redux/selectors/entities/general';
|
||||
import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';
|
||||
import {createSelector} from 'reselect';
|
||||
|
||||
import {GlobalState} from 'types/store';
|
||||
|
||||
export enum InquiryType {
|
||||
Technical = 'technical',
|
||||
Sales = 'sales',
|
||||
Billing = 'billing',
|
||||
}
|
||||
|
||||
export enum TechnicalInquiryIssue {
|
||||
AdminConsole = 'admin_console',
|
||||
MattermostMessaging = 'mm_messaging',
|
||||
DataExport = 'data_export',
|
||||
Other = 'other',
|
||||
}
|
||||
|
||||
export enum SalesInquiryIssue {
|
||||
AboutPurchasing = 'about_purchasing',
|
||||
CancelAccount = 'cancel_account',
|
||||
PurchaseNonprofit = 'purchase_nonprofit',
|
||||
TrialQuestions = 'trial_questions',
|
||||
UpgradeEnterprise = 'upgrade_enterprise',
|
||||
SomethingElse = 'something_else',
|
||||
}
|
||||
|
||||
type Issue = SalesInquiryIssue | TechnicalInquiryIssue
|
||||
|
||||
export const getCloudContactUsLink: (state: GlobalState) => (inquiry: InquiryType, inquiryIssue?: Issue) => string = createSelector(
|
||||
'getCloudContactUsLink',
|
||||
getConfig,
|
||||
getCurrentUser,
|
||||
(config, user) => {
|
||||
// cloud/contact-us with query params for name, email and inquiry
|
||||
const cwsUrl = config.CWSURL;
|
||||
const fullName = `${user.first_name} ${user.last_name}`;
|
||||
return (inquiry: InquiryType, inquiryIssue?: Issue) => {
|
||||
const inquiryIssueQuery = inquiryIssue ? `&inquiry-issue=${inquiryIssue}` : '';
|
||||
|
||||
return `${cwsUrl}/cloud/contact-us?email=${encodeURIComponent(user.email)}&name=${encodeURIComponent(fullName)}&inquiry=${inquiry}${inquiryIssueQuery}`;
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
export const getExpandSeatsLink: (state: GlobalState) => (licenseId: string) => string = createSelector(
|
||||
'getExpandSeatsLink',
|
||||
getConfig,
|
||||
|
||||
Ссылка в новой задаче
Block a user