Skip to content

Commit 2086657

Browse files
authored
fix: Billing fixes (tolgee#2460)
- Remove subscribe button for free plans in the UI - Throw proper error on backend - Move billing frontend to ee directory
1 parent 571f307 commit 2086657

File tree

58 files changed

+156
-103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+156
-103
lines changed

backend/data/src/main/kotlin/io/tolgee/constants/Message.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ enum class Message {
235235
SLACK_WORKSPACE_ALREADY_CONNECTED,
236236
SLACK_CONNECTION_ERROR,
237237
EMAIL_VERIFICATION_CODE_NOT_VALID,
238+
CANNOT_SUBSCRIBE_TO_FREE_PLAN,
239+
PLAN_AUTO_ASSIGNMENT_ONLY_FOR_FREE_PLANS,
240+
PLAN_AUTO_ASSIGNMENT_ONLY_FOR_PRIVATE_PLANS,
241+
PLAN_AUTO_ASSIGNMENT_ORGANIZATION_IDS_NOT_IN_FOR_ORGANIZATION_IDS,
238242
;
239243

240244
val code: String

e2e/cypress/support/dataCyType.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
declare namespace DataCy {
2-
export type Value =
2+
export type Value =
33
"account-security-initial-password-set" |
44
"account-security-set-password-instructions-sent" |
55
"active-plan-license-key-input" |
@@ -9,7 +9,6 @@ declare namespace DataCy {
99
"activity-detail-dialog" |
1010
"add-box" |
1111
"administration-access-message" |
12-
"administration-cloud-plan-field-auto-assign-to-selected" |
1312
"administration-cloud-plan-field-feature" |
1413
"administration-cloud-plan-field-free" |
1514
"administration-cloud-plan-field-included-mt-credits" |
@@ -23,6 +22,7 @@ declare namespace DataCy {
2322
"administration-cloud-plan-field-stripe-product" |
2423
"administration-cloud-plan-field-type" |
2524
"administration-cloud-plan-field-type-item" |
25+
"administration-cloud-plan-organization-assign-switch" |
2626
"administration-cloud-plan-submit-button" |
2727
"administration-cloud-plans-item" |
2828
"administration-cloud-plans-item-delete" |
@@ -558,4 +558,4 @@ declare namespace DataCy {
558558
"webhooks-item-test" |
559559
"webhooks-list-item" |
560560
"webhooks-subtitle"
561-
}
561+
}

webapp/src/component/billing/ActiveSubscription/SelfHostedEeEstimatedCosts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FC } from 'react';
22
import { components } from 'tg.service/billingApiSchema.generated';
33
import { useBillingApiQuery } from 'tg.service/http/useQueryApi';
4-
import { PlanUsageEstimatedCosts } from 'tg.views/organizations/billing/common/usage/PlanUsageEstimatedCosts';
4+
import { PlanUsageEstimatedCosts } from 'tg.ee/billing/common/usage/PlanUsageEstimatedCosts';
55
import { useOrganization } from 'tg.views/organizations/useOrganization';
66

77
export const SelfHostedEeEstimatedCosts: FC<{
File renamed without changes.

webapp/src/views/organizations/billing/CurrentUsage/CurrentUsage.tsx renamed to webapp/src/ee/billing/CurrentUsage/CurrentUsage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { PlanMetric } from './PlanMetric';
1515
import { MtHint } from 'tg.component/billing/MtHint';
1616
import { EstimatedCosts } from '../common/usage/EstimatedCosts';
1717
import { useBillingApiQuery } from 'tg.service/http/useQueryApi';
18-
import { useOrganization } from '../../useOrganization';
18+
import { useOrganization } from 'tg.views/organizations/useOrganization';
1919
import { getProgressData } from 'tg.component/billing/utils';
2020
import { StringsHint } from 'tg.component/billing/Hints';
2121

webapp/src/views/organizations/billing/CurrentUsage/PlanMetric.tsx renamed to webapp/src/ee/billing/CurrentUsage/PlanMetric.tsx

File renamed without changes.

webapp/src/views/organizations/billing/CustomerPortal/CustomerPortal.tsx renamed to webapp/src/ee/billing/CustomerPortal/CustomerPortal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { Button, styled, Typography, Box } from '@mui/material';
1+
import { Box, Button, styled, Typography } from '@mui/material';
22
import { useTranslate } from '@tolgee/react';
33

44
import { useBillingApiMutation } from 'tg.service/http/useQueryApi';
55
import { useOrganization } from 'tg.views/organizations/useOrganization';
66
import {
77
StyledBillingSection,
8-
StyledBillingSectionTitle,
98
StyledBillingSectionHeader,
9+
StyledBillingSectionTitle,
1010
} from '../BillingSection';
1111
import StripeLogoSvg from 'tg.svgs/stripeLogo.svg?react';
1212

webapp/src/views/organizations/billing/Invoices/DownloadButton.tsx renamed to webapp/src/ee/billing/Invoices/DownloadButton.tsx

File renamed without changes.

webapp/src/views/organizations/billing/Invoices/InvoiceUsage.tsx renamed to webapp/src/ee/billing/Invoices/InvoiceUsage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { components } from 'tg.service/billingApiSchema.generated';
1111
import { useTranslate } from '@tolgee/react';
1212
import { useBillingApiQuery } from 'tg.service/http/useQueryApi';
1313
import Dialog from '@mui/material/Dialog';
14-
import { useOrganization } from '../../useOrganization';
14+
import { useOrganization } from 'tg.views/organizations/useOrganization';
1515
import { EmptyListMessage } from 'tg.component/common/EmptyListMessage';
1616
import { TotalTable } from '../common/usage/TotalTable';
1717
import { UsageTable } from '../common/usage/UsageTable';
File renamed without changes.

0 commit comments

Comments
 (0)