[CLD-7567] Deprecate Self Serve: Second Pass (#26853)

* Deprecate Self Serve: First Pass

* Fix ci

* Fix more ci

* Remmove outdated server tests

* Fix a missed spot opening purchase modal in Self Hosted

* Fix i18n

* Clean up some more server code, fix webapp test

* Fix alignment of button

* Fix linter

* Fix i18n server side

* Deprecate in product true up

* Add back translation

* Remove client functions

* Put back client functions

* webapp deprecation

* Deprecate Self Serve: Second Pass

* Fix various pipeline issues

* Fix linter

* Fix pipelines

* Fix handlers_test.go

* Fix console.error around hostedCustomer in reducer

* PICKY LINTER PLEASE

* Fix webapp tests, various other fixes for the CI pipelines

* Fix i18n

* Updates to accomadate enterprise code removal

* Fix mocks

* More removal

* Fix

* Adjustments from PR

* Fixes for QA Feedback

* Update

* Add migrations to remove true up review history

* Fix migrations check

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: maria.nunez <maria.nunez@mattermost.com>
Этот коммит содержится в:
Nick Misasi
2024-05-02 09:15:15 -04:00
коммит произвёл GitHub
родитель 6028cbe4e2
Коммит f1019d076e
127 изменённых файлов: 169 добавлений и 8222 удалений

Просмотреть файл

@@ -37,10 +37,6 @@ import type {
NotifyAdminRequest,
Subscription,
ValidBusinessEmail,
LicenseSelfServeStatus,
CreateSubscriptionRequest,
Feedback,
WorkspaceDeletionRequest,
NewsletterRequestBody,
Installation,
} from '@mattermost/types/cloud';
@@ -83,13 +79,6 @@ import type {
GetGroupsForUserParams,
GroupStats,
} from '@mattermost/types/groups';
import type {
SelfHostedSignupForm,
SelfHostedSignupCustomerResponse,
SelfHostedSignupSuccessResponse,
SelfHostedSignupBootstrapResponse,
SelfHostedExpansionRequest,
} from '@mattermost/types/hosted_customer';
import type {PostActionResponse} from '@mattermost/types/integration_actions';
import type {
Command,
@@ -3905,53 +3894,12 @@ export default class Client4 {
);
};
bootstrapSelfHostedSignup = (reset?: boolean) => {
let query = '';
// reset will drop the old token
if (reset) {
query = '?reset=true';
}
return this.doFetch<SelfHostedSignupBootstrapResponse>(
`${this.getHostedCustomerRoute()}/bootstrap${query}`,
{method: 'post'},
);
};
getAvailabilitySelfHostedSignup = () => {
return this.doFetch<void>(
`${this.getHostedCustomerRoute()}/signup_available`,
{method: 'get'},
);
};
getSelfHostedProducts = () => {
return this.doFetch<Product[]>(
`${this.getCloudRoute()}/products/selfhosted`, {method: 'get'},
);
};
createCustomerSelfHostedSignup = (form: SelfHostedSignupForm) => {
return this.doFetch<SelfHostedSignupCustomerResponse>(
`${this.getHostedCustomerRoute()}/customer`,
{method: 'post', body: JSON.stringify(form)},
);
};
confirmSelfHostedSignup = (setupIntentId: string, createSubscriptionRequest: CreateSubscriptionRequest) => {
return this.doFetch<SelfHostedSignupSuccessResponse>(
`${this.getHostedCustomerRoute()}/confirm`,
{method: 'post', body: JSON.stringify({stripe_setup_intent_id: setupIntentId, subscription: createSubscriptionRequest})},
);
};
confirmSelfHostedExpansion = (setupIntentId: string, expandRequest: SelfHostedExpansionRequest) => {
return this.doFetch<SelfHostedSignupSuccessResponse>(
`${this.getHostedCustomerRoute()}/confirm-expand`,
{method: 'post', body: JSON.stringify({stripe_setup_intent_id: setupIntentId, expand_request: expandRequest})},
);
};
subscribeToNewsletter = (newletterRequestBody: NewsletterRequestBody) => {
return this.doFetch<StatusOK>(
`${this.getHostedCustomerRoute()}/subscribe-newsletter`,
@@ -3959,10 +3907,10 @@ export default class Client4 {
);
};
createPaymentMethod = async () => {
return this.doFetch(
`${this.getCloudRoute()}/payment`,
{method: 'post'},
cwsAvailabilityCheck = () => {
return this.doFetchWithResponse(
`${this.getCloudRoute()}/check-cws-connection`,
{method: 'get'},
);
};
@@ -3972,12 +3920,6 @@ export default class Client4 {
);
};
getLicenseSelfServeStatus = () => {
return this.doFetch<LicenseSelfServeStatus>(
`${this.getCloudRoute()}/subscription/self-serve-status`, {method: 'get'},
);
};
updateCloudCustomer = (customerPatch: CloudCustomerPatch) => {
return this.doFetch<CloudCustomer>(
`${this.getCloudRoute()}/customer`,
@@ -3999,39 +3941,6 @@ export default class Client4 {
);
};
confirmPaymentMethod = async (stripeSetupIntentID: string) => {
return this.doFetch(
`${this.getCloudRoute()}/payment/confirm`,
{method: 'post', body: JSON.stringify({stripe_setup_intent_id: stripeSetupIntentID})},
);
};
subscribeCloudProduct = (productId: string, shippingAddress?: Address, seats = 0, downgradeFeedback?: Feedback, customerPatch?: CloudCustomerPatch) => {
const body = {
product_id: productId,
seats,
downgrade_feedback: downgradeFeedback,
} as any;
if (shippingAddress) {
body.shipping_address = shippingAddress;
}
if (customerPatch) {
body.customer = customerPatch;
}
return this.doFetch<Subscription>(
`${this.getCloudRoute()}/subscription`,
{method: 'put', body: JSON.stringify(body)},
);
};
requestCloudTrial = (subscriptionId: string, email = '') => {
return this.doFetchWithResponse<Subscription>(
`${this.getCloudRoute()}/request-trial`,
{method: 'put', body: JSON.stringify({email, subscription_id: subscriptionId})},
);
};
validateBusinessEmail = (email = '') => {
return this.doFetchWithResponse<ValidBusinessEmail>(
`${this.getCloudRoute()}/validate-business-email`,
@@ -4060,13 +3969,6 @@ export default class Client4 {
);
};
getRenewalLink = () => {
return this.doFetch<{renewal_link: string}>(
`${this.getBaseRoute()}/license/renewal`,
{method: 'get'},
);
};
getInvoices = () => {
return this.doFetch<Invoice[]>(
`${this.getCloudRoute()}/subscription/invoices`,
@@ -4078,17 +3980,6 @@ export default class Client4 {
return `${this.getCloudRoute()}/subscription/invoices/${invoiceId}/pdf`;
};
getSelfHostedInvoices = () => {
return this.doFetch<Invoice[]>(
`${this.getHostedCustomerRoute()}/invoices`,
{method: 'get'},
);
};
getSelfHostedInvoicePdfUrl = (invoiceId: string) => {
return `${this.getHostedCustomerRoute()}/invoices/${invoiceId}/pdf`;
};
getCloudLimits = () => {
return this.doFetch<Limits>(
`${this.getCloudRoute()}/limits`,
@@ -4329,34 +4220,6 @@ export default class Client4 {
);
};
submitTrueUpReview = () => {
return this.doFetch(
`${this.getBaseRoute()}/license/review`,
{method: 'post'},
);
};
getTrueUpReviewStatus = () => {
return this.doFetch(
`${this.getBaseRoute()}/license/review/status`,
{method: 'get'},
);
};
cwsAvailabilityCheck = () => {
return this.doFetchWithResponse(
`${this.getCloudRoute()}/check-cws-connection`,
{method: 'get'},
);
};
deleteWorkspace = (deletionRequest: WorkspaceDeletionRequest) => {
return this.doFetch<StatusOK>(
`${this.getCloudRoute()}/delete-workspace`,
{method: 'delete', body: JSON.stringify(deletionRequest)},
);
};
getGroupMessageMembersCommonTeams = (channelId: string) => {
return this.doFetchWithResponse<Team[]>(
`${this.getChannelRoute(channelId)}/common_teams`,