From 01d0466b6a33637910f76ecd11f6a80f2469e56b Mon Sep 17 00:00:00 2001 From: Alexandre Monjol Date: Wed, 4 Dec 2024 15:32:25 +0100 Subject: [PATCH] misc: move integration tabs options to a const file --- .../customers/CustomerInvoicesList.tsx | 2 +- src/components/invoices/InvoicesList.tsx | 2 +- src/components/plans/PlanItem.tsx | 2 +- .../settings/integrations/AddAdyenDialog.tsx | 2 +- .../settings/integrations/AddAnrokDialog.tsx | 2 +- .../integrations/AddCashfreeDialog.tsx | 2 +- .../integrations/AddGocardlessDialog.tsx | 2 +- .../integrations/AddHubspotDialog.tsx | 2 +- .../AddLagoTaxManagementDialog.tsx | 2 +- .../integrations/AddNetsuiteDialog.tsx | 2 +- .../integrations/AddSalesforceDialog.tsx | 2 +- .../settings/integrations/AddStripeDialog.tsx | 2 +- .../settings/integrations/AddXeroDialog.tsx | 2 +- .../integrations/AnrokIntegrationSettings.tsx | 2 +- .../NetsuiteIntegrationSettings.tsx | 2 +- .../integrations/XeroIntegrationSettings.tsx | 2 +- .../SubscriptionInformations.tsx | 2 +- src/core/constants/tabsOptions.ts | 19 +++++++++++++++++++ src/hooks/plans/usePlanForm.tsx | 2 +- src/layouts/CustomerInvoiceDetails.tsx | 6 +----- src/layouts/Settings.tsx | 2 +- src/pages/CreateCreditNote.tsx | 2 +- src/pages/CreatePlan.tsx | 7 ++++--- src/pages/CreateSubscription.tsx | 3 +-- src/pages/CreditNoteDetails.tsx | 2 +- src/pages/PlanDetails.tsx | 6 +----- src/pages/PlansList.tsx | 3 +-- src/pages/SubscriptionDetails.tsx | 8 +------- .../settings/AdyenIntegrationDetails.tsx | 3 +-- src/pages/settings/AdyenIntegrations.tsx | 3 +-- .../settings/AnrokIntegrationDetails.tsx | 3 +-- src/pages/settings/AnrokIntegrations.tsx | 2 +- .../settings/CashfreeIntegrationDetails.tsx | 3 +-- src/pages/settings/CashfreeIntegrations.tsx | 3 +-- .../settings/GocardlessIntegrationDetails.tsx | 3 +-- .../GocardlessIntegrationOauthCallback.tsx | 3 +-- src/pages/settings/GocardlessIntegrations.tsx | 3 +-- .../settings/HubspotIntegrationDetails.tsx | 3 +-- src/pages/settings/HubspotIntegrations.tsx | 3 +-- src/pages/settings/Integrations.tsx | 6 +----- .../settings/LagoTaxManagementIntegration.tsx | 3 +-- .../settings/NetsuiteIntegrationDetails.tsx | 3 +-- src/pages/settings/NetsuiteIntegrations.tsx | 2 +- .../settings/SalesforceIntegrationDetails.tsx | 3 +-- src/pages/settings/SalesforceIntegrations.tsx | 3 +-- .../settings/StripeIntegrationDetails.tsx | 3 +-- src/pages/settings/StripeIntegrations.tsx | 3 +-- src/pages/settings/XeroIntegrationDetails.tsx | 3 +-- src/pages/settings/XeroIntegrations.tsx | 2 +- 49 files changed, 70 insertions(+), 87 deletions(-) create mode 100644 src/core/constants/tabsOptions.ts diff --git a/src/components/customers/CustomerInvoicesList.tsx b/src/components/customers/CustomerInvoicesList.tsx index ac8d03410..b39967938 100644 --- a/src/components/customers/CustomerInvoicesList.tsx +++ b/src/components/customers/CustomerInvoicesList.tsx @@ -6,6 +6,7 @@ import styled from 'styled-components' import { Chip, InfiniteScroll, Status, Table, Tooltip, Typography } from '~/components/designSystem' import { addToast, hasDefinedGQLError } from '~/core/apolloClient' import { invoiceStatusMapping, paymentStatusMapping } from '~/core/constants/statusInvoiceMapping' +import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { intlFormatNumber } from '~/core/formats/intlFormatNumber' import { CUSTOMER_INVOICE_DETAILS_ROUTE } from '~/core/router' import { deserializeAmount } from '~/core/serializers/serializeAmount' @@ -26,7 +27,6 @@ import { } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { usePermissions } from '~/hooks/usePermissions' -import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/layouts/CustomerInvoiceDetails' import { theme } from '~/styles' import { diff --git a/src/components/invoices/InvoicesList.tsx b/src/components/invoices/InvoicesList.tsx index c49a7970f..295bd9bec 100644 --- a/src/components/invoices/InvoicesList.tsx +++ b/src/components/invoices/InvoicesList.tsx @@ -22,6 +22,7 @@ import { import { VoidInvoiceDialog, VoidInvoiceDialogRef } from '~/components/invoices/VoidInvoiceDialog' import { addToast, hasDefinedGQLError } from '~/core/apolloClient' import { invoiceStatusMapping, paymentStatusMapping } from '~/core/constants/statusInvoiceMapping' +import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { intlFormatNumber } from '~/core/formats/intlFormatNumber' import { CUSTOMER_INVOICE_DETAILS_ROUTE, INVOICE_SETTINGS_ROUTE } from '~/core/router' import { deserializeAmount } from '~/core/serializers/serializeAmount' @@ -39,7 +40,6 @@ import { } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { usePermissions } from '~/hooks/usePermissions' -import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/layouts/CustomerInvoiceDetails' import { Filters } from '../designSystem/Filters/Filters' import { AvailableFiltersEnum, AvailableQuickFilters } from '../designSystem/Filters/types' diff --git a/src/components/plans/PlanItem.tsx b/src/components/plans/PlanItem.tsx index cb26b149d..8ac2f1cb4 100644 --- a/src/components/plans/PlanItem.tsx +++ b/src/components/plans/PlanItem.tsx @@ -14,12 +14,12 @@ import { Typography, } from '~/components/designSystem' import { updateDuplicatePlanVar } from '~/core/apolloClient/reactiveVars/duplicatePlanVar' +import { PlanDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CREATE_PLAN_ROUTE, PLAN_DETAILS_ROUTE, UPDATE_PLAN_ROUTE } from '~/core/router' import { DeletePlanDialogFragmentDoc, PlanItemFragment } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { ListKeyNavigationItemProps } from '~/hooks/ui/useListKeyNavigation' import { useOrganizationInfos } from '~/hooks/useOrganizationInfos' -import { PlanDetailsTabsOptionsEnum } from '~/pages/PlanDetails' import { BaseListItem, ItemContainer, diff --git a/src/components/settings/integrations/AddAdyenDialog.tsx b/src/components/settings/integrations/AddAdyenDialog.tsx index c64fc5748..651b65c05 100644 --- a/src/components/settings/integrations/AddAdyenDialog.tsx +++ b/src/components/settings/integrations/AddAdyenDialog.tsx @@ -10,6 +10,7 @@ import { object, string } from 'yup' import { Button, Dialog, DialogRef } from '~/components/designSystem' import { TextInputField } from '~/components/form' import { addToast } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { ADYEN_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { AddAdyenPaymentProviderInput, @@ -21,7 +22,6 @@ import { useUpdateAdyenApiKeyMutation, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { theme } from '~/styles' import { DeleteAdyenIntegrationDialogRef } from './DeleteAdyenIntegrationDialog' diff --git a/src/components/settings/integrations/AddAnrokDialog.tsx b/src/components/settings/integrations/AddAnrokDialog.tsx index 82b1fb0c2..22004d17d 100644 --- a/src/components/settings/integrations/AddAnrokDialog.tsx +++ b/src/components/settings/integrations/AddAnrokDialog.tsx @@ -10,6 +10,7 @@ import { object, string } from 'yup' import { Button, Dialog, DialogRef } from '~/components/designSystem' import { TextInputField } from '~/components/form' import { addToast, envGlobalVar, hasDefinedGQLError } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { ANROK_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { AddAnrokIntegrationDialogFragment, @@ -23,7 +24,6 @@ import { } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { AnrokIntegrationDetailsTabs } from '~/pages/settings/AnrokIntegrationDetails' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { theme } from '~/styles' import { DeleteAnrokIntegrationDialogRef } from './DeleteAnrokIntegrationDialog' diff --git a/src/components/settings/integrations/AddCashfreeDialog.tsx b/src/components/settings/integrations/AddCashfreeDialog.tsx index 12670ba91..76a9182f8 100644 --- a/src/components/settings/integrations/AddCashfreeDialog.tsx +++ b/src/components/settings/integrations/AddCashfreeDialog.tsx @@ -9,6 +9,7 @@ import { object, string } from 'yup' import { Button, Dialog, DialogRef } from '~/components/designSystem' import { TextInputField } from '~/components/form' import { addToast } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CASHFREE_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { AddCashfreePaymentProviderInput, @@ -20,7 +21,6 @@ import { useUpdateCashfreeApiKeyMutation, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { DeleteCashfreeIntegrationDialogRef } from './DeleteCashfreeIntegrationDialog' diff --git a/src/components/settings/integrations/AddGocardlessDialog.tsx b/src/components/settings/integrations/AddGocardlessDialog.tsx index b12b1df4a..2ecc37ebf 100644 --- a/src/components/settings/integrations/AddGocardlessDialog.tsx +++ b/src/components/settings/integrations/AddGocardlessDialog.tsx @@ -11,6 +11,7 @@ import { Button, Dialog, DialogRef } from '~/components/designSystem' import { TextInputField } from '~/components/form' import { addToast, envGlobalVar } from '~/core/apolloClient' import { buildGocardlessAuthUrl } from '~/core/constants/externalUrls' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { GOCARDLESS_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { AddGocardlessPaymentProviderInput, @@ -21,7 +22,6 @@ import { useUpdateGocardlessApiKeyMutation, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { theme } from '~/styles' import { DeleteGocardlessIntegrationDialogRef } from './DeleteGocardlessIntegrationDialog' diff --git a/src/components/settings/integrations/AddHubspotDialog.tsx b/src/components/settings/integrations/AddHubspotDialog.tsx index d8de247f3..23a6a183b 100644 --- a/src/components/settings/integrations/AddHubspotDialog.tsx +++ b/src/components/settings/integrations/AddHubspotDialog.tsx @@ -11,6 +11,7 @@ import { Checkbox, CheckboxField, ComboBoxField, TextInputField } from '~/compon import { DeleteHubspotIntegrationDialogRef } from '~/components/settings/integrations/DeleteHubspotIntegrationDialog' import { addToast, envGlobalVar, hasDefinedGQLError } from '~/core/apolloClient' import { getHubspotTargetedObjectTranslationKey } from '~/core/constants/form' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { HUBSPOT_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { CreateHubspotIntegrationInput, @@ -21,7 +22,6 @@ import { useUpdateHubspotIntegrationMutation, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { tw } from '~/styles/utils' gql` diff --git a/src/components/settings/integrations/AddLagoTaxManagementDialog.tsx b/src/components/settings/integrations/AddLagoTaxManagementDialog.tsx index add1efd42..8e73e98f7 100644 --- a/src/components/settings/integrations/AddLagoTaxManagementDialog.tsx +++ b/src/components/settings/integrations/AddLagoTaxManagementDialog.tsx @@ -9,6 +9,7 @@ import { Alert, Button, Dialog, DialogRef, Typography } from '~/components/desig import { ComboBoxField } from '~/components/form' import { addToast } from '~/core/apolloClient' import { LAGO_TAX_DOCUMENTATION_URL } from '~/core/constants/externalUrls' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { countryDataForCombobox } from '~/core/formats/countryDataForCombobox' import { TAX_MANAGEMENT_INTEGRATION_ROUTE } from '~/core/router' import { @@ -18,7 +19,6 @@ import { } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { useIntegrations } from '~/hooks/useIntegrations' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { theme } from '~/styles' gql` diff --git a/src/components/settings/integrations/AddNetsuiteDialog.tsx b/src/components/settings/integrations/AddNetsuiteDialog.tsx index fdc240075..f6ff27276 100644 --- a/src/components/settings/integrations/AddNetsuiteDialog.tsx +++ b/src/components/settings/integrations/AddNetsuiteDialog.tsx @@ -12,6 +12,7 @@ import { boolean, object, string } from 'yup' import { Alert, Button, Chip, Dialog, DialogRef, Typography } from '~/components/designSystem' import { Checkbox, CheckboxField, TextInputField } from '~/components/form' import { addToast, envGlobalVar, hasDefinedGQLError } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { NETSUITE_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { CreateNetsuiteIntegrationInput, @@ -20,7 +21,6 @@ import { useUpdateNetsuiteIntegrationMutation, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { NetsuiteIntegrationDetailsTabs } from '~/pages/settings/NetsuiteIntegrationDetails' import { theme } from '~/styles' diff --git a/src/components/settings/integrations/AddSalesforceDialog.tsx b/src/components/settings/integrations/AddSalesforceDialog.tsx index 0d843c3aa..8f57ca95d 100644 --- a/src/components/settings/integrations/AddSalesforceDialog.tsx +++ b/src/components/settings/integrations/AddSalesforceDialog.tsx @@ -8,6 +8,7 @@ import { object, string } from 'yup' import { Alert, Button, Dialog, DialogRef } from '~/components/designSystem' import { TextInputField } from '~/components/form' import { addToast, hasDefinedGQLError } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { SALESFORCE_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { CreateSalesforceIntegrationInput, @@ -17,7 +18,6 @@ import { useUpdateSalesforceIntegrationMutation, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { tw } from '~/styles/utils' import { DeleteSalesforceIntegrationDialogRef } from './DeleteSalesforceIntegrationDialog' diff --git a/src/components/settings/integrations/AddStripeDialog.tsx b/src/components/settings/integrations/AddStripeDialog.tsx index 690cbaaa6..01c8af5cd 100644 --- a/src/components/settings/integrations/AddStripeDialog.tsx +++ b/src/components/settings/integrations/AddStripeDialog.tsx @@ -10,6 +10,7 @@ import { object, string } from 'yup' import { Button, Dialog, DialogRef } from '~/components/designSystem' import { TextInputField } from '~/components/form' import { addToast } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { STRIPE_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { AddStripePaymentProviderInput, @@ -21,7 +22,6 @@ import { useUpdateStripeApiKeyMutation, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { theme } from '~/styles' import { DeleteStripeIntegrationDialogRef } from './DeleteStripeIntegrationDialog' diff --git a/src/components/settings/integrations/AddXeroDialog.tsx b/src/components/settings/integrations/AddXeroDialog.tsx index 8c21141c6..2eda3cc2c 100644 --- a/src/components/settings/integrations/AddXeroDialog.tsx +++ b/src/components/settings/integrations/AddXeroDialog.tsx @@ -12,6 +12,7 @@ import { boolean, object, string } from 'yup' import { Alert, Button, Chip, Dialog, DialogRef, Typography } from '~/components/designSystem' import { Checkbox, CheckboxField, TextInputField } from '~/components/form' import { addToast, envGlobalVar, hasDefinedGQLError } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { XERO_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { CreateXeroIntegrationInput, @@ -20,7 +21,6 @@ import { XeroForCreateDialogDialogFragment, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { XeroIntegrationDetailsTabs } from '~/pages/settings/XeroIntegrationDetails' import { theme } from '~/styles' diff --git a/src/components/settings/integrations/AnrokIntegrationSettings.tsx b/src/components/settings/integrations/AnrokIntegrationSettings.tsx index 6101d1acd..4cd81bd12 100644 --- a/src/components/settings/integrations/AnrokIntegrationSettings.tsx +++ b/src/components/settings/integrations/AnrokIntegrationSettings.tsx @@ -6,6 +6,7 @@ import styled from 'styled-components' import { Alert, Avatar, Button, Icon, Skeleton, Typography } from '~/components/designSystem' import { addToast } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { ANROK_INTEGRATION_DETAILS_ROUTE, ANROK_INTEGRATION_ROUTE, @@ -20,7 +21,6 @@ import { } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { AnrokIntegrationDetailsTabs } from '~/pages/settings/AnrokIntegrationDetails' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { NAV_HEIGHT, theme } from '~/styles' import { AddAnrokDialog, AddAnrokDialogRef } from './AddAnrokDialog' diff --git a/src/components/settings/integrations/NetsuiteIntegrationSettings.tsx b/src/components/settings/integrations/NetsuiteIntegrationSettings.tsx index 120cdb580..d044f7077 100644 --- a/src/components/settings/integrations/NetsuiteIntegrationSettings.tsx +++ b/src/components/settings/integrations/NetsuiteIntegrationSettings.tsx @@ -4,6 +4,7 @@ import { generatePath, useNavigate, useParams } from 'react-router-dom' import styled from 'styled-components' import { Alert, Avatar, Button, Icon, Skeleton, Typography } from '~/components/designSystem' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, NETSUITE_INTEGRATION_DETAILS_ROUTE, @@ -17,7 +18,6 @@ import { useGetNetsuiteIntegrationsSettingsQuery, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { NetsuiteIntegrationDetailsTabs } from '~/pages/settings/NetsuiteIntegrationDetails' import { NAV_HEIGHT, theme } from '~/styles' diff --git a/src/components/settings/integrations/XeroIntegrationSettings.tsx b/src/components/settings/integrations/XeroIntegrationSettings.tsx index 443739d70..ddd665e33 100644 --- a/src/components/settings/integrations/XeroIntegrationSettings.tsx +++ b/src/components/settings/integrations/XeroIntegrationSettings.tsx @@ -4,6 +4,7 @@ import { generatePath, useNavigate, useParams } from 'react-router-dom' import styled from 'styled-components' import { Alert, Avatar, Button, Icon, Skeleton, Typography } from '~/components/designSystem' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, XERO_INTEGRATION_DETAILS_ROUTE, @@ -17,7 +18,6 @@ import { XeroIntegrationSettingsFragment, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { XeroIntegrationDetailsTabs } from '~/pages/settings/XeroIntegrationDetails' import { NAV_HEIGHT, theme } from '~/styles' diff --git a/src/components/subscriptions/SubscriptionInformations.tsx b/src/components/subscriptions/SubscriptionInformations.tsx index 959d8caab..997b72a76 100644 --- a/src/components/subscriptions/SubscriptionInformations.tsx +++ b/src/components/subscriptions/SubscriptionInformations.tsx @@ -3,6 +3,7 @@ import { DateTime } from 'luxon' import { generatePath, Link } from 'react-router-dom' import styled from 'styled-components' +import { PlanDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CUSTOMER_DETAILS_ROUTE, CUSTOMER_SUBSCRIPTION_PLAN_DETAILS } from '~/core/router' import { StatusTypeEnum, @@ -10,7 +11,6 @@ import { } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { useOrganizationInfos } from '~/hooks/useOrganizationInfos' -import { PlanDetailsTabsOptionsEnum } from '~/pages/PlanDetails' import { theme } from '~/styles' import { DetailsInfoGrid, DetailsInfoItem, DetailsSectionTitle } from '~/styles/detailsPage' diff --git a/src/core/constants/tabsOptions.ts b/src/core/constants/tabsOptions.ts new file mode 100644 index 000000000..3721b1794 --- /dev/null +++ b/src/core/constants/tabsOptions.ts @@ -0,0 +1,19 @@ +export enum CustomerInvoiceDetailsTabsOptionsEnum { + overview = 'overview', + creditNotes = 'credit-notes', +} + +export enum CustomerSubscriptionDetailsTabsOptionsEnum { + overview = 'overview', + usage = 'usage', +} + +export enum IntegrationsTabsOptionsEnum { + Lago = 'lago', + Community = 'community', +} + +export enum PlanDetailsTabsOptionsEnum { + overview = 'overview', + subscriptions = 'subscriptions', +} diff --git a/src/hooks/plans/usePlanForm.tsx b/src/hooks/plans/usePlanForm.tsx index f2b220473..c8d62fe5b 100644 --- a/src/hooks/plans/usePlanForm.tsx +++ b/src/hooks/plans/usePlanForm.tsx @@ -14,6 +14,7 @@ import { useDuplicatePlanVar, } from '~/core/apolloClient/reactiveVars/duplicatePlanVar' import { FORM_ERRORS_ENUM, FORM_TYPE_ENUM } from '~/core/constants/form' +import { PlanDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CUSTOMER_SUBSCRIPTION_DETAILS_ROUTE, ERROR_404_ROUTE, @@ -36,7 +37,6 @@ import { useGetSinglePlanQuery, useUpdatePlanMutation, } from '~/generated/graphql' -import { PlanDetailsTabsOptionsEnum } from '~/pages/PlanDetails' import { CustomerSubscriptionDetailsTabsOptionsEnum } from '~/pages/SubscriptionDetails' import { useInternationalization } from '../core/useInternationalization' diff --git a/src/layouts/CustomerInvoiceDetails.tsx b/src/layouts/CustomerInvoiceDetails.tsx index 8d5e0d5f0..bef4b43e1 100644 --- a/src/layouts/CustomerInvoiceDetails.tsx +++ b/src/layouts/CustomerInvoiceDetails.tsx @@ -34,6 +34,7 @@ import { VoidInvoiceDialog, VoidInvoiceDialogRef } from '~/components/invoices/V import { PremiumWarningDialog, PremiumWarningDialogRef } from '~/components/PremiumWarningDialog' import { addToast, LagoGQLError } from '~/core/apolloClient' import { invoiceStatusMapping, paymentStatusMapping } from '~/core/constants/statusInvoiceMapping' +import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { intlFormatNumber } from '~/core/formats/intlFormatNumber' import { CUSTOMER_CREDIT_NOTE_DETAILS_ROUTE, @@ -235,11 +236,6 @@ gql` ${SalesforceIntegrationInfosForInvoiceOverviewFragmentDoc} ` -export enum CustomerInvoiceDetailsTabsOptionsEnum { - overview = 'overview', - creditNotes = 'credit-notes', -} - const getErrorMessageFromErrorDetails = ( errors: AllInvoiceDetailsForCustomerInvoiceDetailsFragment['errorDetails'], ): string | undefined => { diff --git a/src/layouts/Settings.tsx b/src/layouts/Settings.tsx index 7bc17d034..4696ebffa 100644 --- a/src/layouts/Settings.tsx +++ b/src/layouts/Settings.tsx @@ -4,6 +4,7 @@ import { generatePath, Outlet } from 'react-router-dom' import styled from 'styled-components' import { Button, Typography, VerticalMenu } from '~/components/designSystem' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { AUTHENTICATION_ROUTE, CREATE_DUNNING_ROUTE, @@ -24,7 +25,6 @@ import { import { useInternationalization } from '~/hooks/core/useInternationalization' import { useLocationHistory } from '~/hooks/core/useLocationHistory' import { usePermissions } from '~/hooks/usePermissions' -import { IntegrationsTabsOptionsEnum } from '~/pages/settings/Integrations' import { theme } from '~/styles' const NAV_WIDTH = 240 diff --git a/src/pages/CreateCreditNote.tsx b/src/pages/CreateCreditNote.tsx index 0f1a06781..f9b78ed17 100644 --- a/src/pages/CreateCreditNote.tsx +++ b/src/pages/CreateCreditNote.tsx @@ -27,6 +27,7 @@ import { import { Checkbox, ComboBoxField, TextInputField } from '~/components/form' import { WarningDialog, WarningDialogRef } from '~/components/WarningDialog' import { hasDefinedGQLError } from '~/core/apolloClient' +import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { intlFormatNumber } from '~/core/formats/intlFormatNumber' import { CUSTOMER_INVOICE_DETAILS_ROUTE } from '~/core/router' import { deserializeAmount } from '~/core/serializers/serializeAmount' @@ -45,7 +46,6 @@ import { } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { useCreateCreditNote } from '~/hooks/useCreateCreditNote' -import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/layouts/CustomerInvoiceDetails' import { HEADER_TABLE_HEIGHT, PageHeader, theme } from '~/styles' import { Content, Main, Side, Subtitle, Title } from '~/styles/mainObjectsForm' diff --git a/src/pages/CreatePlan.tsx b/src/pages/CreatePlan.tsx index e7270cab5..5d90db7ee 100644 --- a/src/pages/CreatePlan.tsx +++ b/src/pages/CreatePlan.tsx @@ -25,6 +25,10 @@ import { REDIRECTION_ORIGIN_SUBSCRIPTION_USAGE } from '~/components/subscription import { WarningDialog, WarningDialogRef } from '~/components/WarningDialog' import { useDuplicatePlanVar } from '~/core/apolloClient' import { FORM_TYPE_ENUM } from '~/core/constants/form' +import { + CustomerSubscriptionDetailsTabsOptionsEnum, + PlanDetailsTabsOptionsEnum, +} from '~/core/constants/tabsOptions' import { CUSTOMER_SUBSCRIPTION_DETAILS_ROUTE, PLAN_DETAILS_ROUTE, @@ -42,9 +46,6 @@ import { usePlanForm } from '~/hooks/plans/usePlanForm' import { NAV_HEIGHT, PageHeader, theme } from '~/styles' import { Content, Main, MAIN_PADDING, Side, SkeletonHeader } from '~/styles/mainObjectsForm' -import { PlanDetailsTabsOptionsEnum } from './PlanDetails' -import { CustomerSubscriptionDetailsTabsOptionsEnum } from './SubscriptionDetails' - gql` fragment TaxForPlanAndChargesInPlanForm on Tax { id diff --git a/src/pages/CreateSubscription.tsx b/src/pages/CreateSubscription.tsx index 664c6746a..38cf63127 100644 --- a/src/pages/CreateSubscription.tsx +++ b/src/pages/CreateSubscription.tsx @@ -48,6 +48,7 @@ import { PremiumWarningDialog, PremiumWarningDialogRef } from '~/components/Prem import { REDIRECTION_ORIGIN_SUBSCRIPTION_USAGE } from '~/components/subscriptions/SubscriptionUsageLifetimeGraph' import { WarningDialog, WarningDialogRef } from '~/components/WarningDialog' import { dateErrorCodes, FORM_TYPE_ENUM } from '~/core/constants/form' +import { CustomerSubscriptionDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CUSTOMER_DETAILS_ROUTE, CUSTOMER_SUBSCRIPTION_DETAILS_ROUTE, @@ -74,8 +75,6 @@ import { useSalesForceConfig } from '~/hooks/useSalesForceConfig' import ThinkingManeki from '~/public/images/maneki/thinking.svg' import { BREAKPOINT_LG, NAV_HEIGHT, PageHeader, theme } from '~/styles' -import { CustomerSubscriptionDetailsTabsOptionsEnum } from './SubscriptionDetails' - gql` fragment AddSubscriptionPlan on Plan { id diff --git a/src/pages/CreditNoteDetails.tsx b/src/pages/CreditNoteDetails.tsx index 46e8a05e5..b889e38dc 100644 --- a/src/pages/CreditNoteDetails.tsx +++ b/src/pages/CreditNoteDetails.tsx @@ -28,6 +28,7 @@ import { buildNetsuiteCreditNoteUrl, buildXeroCreditNoteUrl, } from '~/core/constants/externalUrls' +import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import formatCreditNotesItems from '~/core/formats/formatCreditNotesItems' import { composeChargeFilterDisplayName, @@ -63,7 +64,6 @@ import { import { useInternationalization } from '~/hooks/core/useInternationalization' import { useLocationHistory } from '~/hooks/core/useLocationHistory' import { usePermissions } from '~/hooks/usePermissions' -import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/layouts/CustomerInvoiceDetails' import ErrorImage from '~/public/images/maneki/error.svg' import { MenuPopper, PageHeader, theme } from '~/styles' import { SectionHeader } from '~/styles/customer' diff --git a/src/pages/PlanDetails.tsx b/src/pages/PlanDetails.tsx index 6486d26eb..568604c5d 100644 --- a/src/pages/PlanDetails.tsx +++ b/src/pages/PlanDetails.tsx @@ -16,6 +16,7 @@ import { DeletePlanDialog, DeletePlanDialogRef } from '~/components/plans/Delete import PlanDetailsOverview from '~/components/plans/details/PlanDetailsOverview' import PlanSubscriptionList from '~/components/plans/details/PlanSubscriptionList' import { updateDuplicatePlanVar } from '~/core/apolloClient' +import { PlanDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CREATE_PLAN_ROUTE, CUSTOMER_SUBSCRIPTION_DETAILS_ROUTE, @@ -33,11 +34,6 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import { usePermissions } from '~/hooks/usePermissions' import { MenuPopper, PageHeader, theme } from '~/styles' -export enum PlanDetailsTabsOptionsEnum { - overview = 'overview', - subscriptions = 'subscriptions', -} - gql` query getPlanForDetails($planId: ID!) { plan(id: $planId) { diff --git a/src/pages/PlansList.tsx b/src/pages/PlansList.tsx index 89dd8197e..d978b72b0 100644 --- a/src/pages/PlansList.tsx +++ b/src/pages/PlansList.tsx @@ -8,6 +8,7 @@ import { GenericPlaceholder } from '~/components/GenericPlaceholder' import { DeletePlanDialog, DeletePlanDialogRef } from '~/components/plans/DeletePlanDialog' import { PlanItem, PlanItemSkeleton } from '~/components/plans/PlanItem' import { SearchInput } from '~/components/SearchInput' +import { PlanDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CREATE_PLAN_ROUTE, PLAN_DETAILS_ROUTE } from '~/core/router' import { PlanItemFragmentDoc, usePlansLazyQuery } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' @@ -18,8 +19,6 @@ import EmptyImage from '~/public/images/maneki/empty.svg' import ErrorImage from '~/public/images/maneki/error.svg' import { ListContainer, ListHeader, PageHeader, theme } from '~/styles' -import { PlanDetailsTabsOptionsEnum } from './PlanDetails' - gql` query plans($page: Int, $limit: Int, $searchTerm: String) { plans(page: $page, limit: $limit, searchTerm: $searchTerm) { diff --git a/src/pages/SubscriptionDetails.tsx b/src/pages/SubscriptionDetails.tsx index 61173a7f0..5ca451d4e 100644 --- a/src/pages/SubscriptionDetails.tsx +++ b/src/pages/SubscriptionDetails.tsx @@ -20,6 +20,7 @@ import SkeletonDetailsPage, { LoadingSkeletonWrapper } from '~/components/Skelet import SubscriptionDetailsOverview from '~/components/subscriptions/SubscriptionDetailsOverview' import SubscriptionUsageTabContent from '~/components/subscriptions/SubscriptionUsageTabContent' import { addToast } from '~/core/apolloClient' +import { PlanDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CUSTOMER_DETAILS_ROUTE, CUSTOMER_SUBSCRIPTION_DETAILS_ROUTE, @@ -34,13 +35,6 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import { usePermissions } from '~/hooks/usePermissions' import { MenuPopper, PageHeader, theme } from '~/styles' -import { PlanDetailsTabsOptionsEnum } from './PlanDetails' - -export enum CustomerSubscriptionDetailsTabsOptionsEnum { - overview = 'overview', - usage = 'usage', -} - gql` query getSubscriptionForDetails($subscriptionId: ID!) { subscription(id: $subscriptionId) { diff --git a/src/pages/settings/AdyenIntegrationDetails.tsx b/src/pages/settings/AdyenIntegrationDetails.tsx index e7aed3f70..540822c13 100644 --- a/src/pages/settings/AdyenIntegrationDetails.tsx +++ b/src/pages/settings/AdyenIntegrationDetails.tsx @@ -26,6 +26,7 @@ import { DeleteAdyenIntegrationDialog, DeleteAdyenIntegrationDialogRef, } from '~/components/settings/integrations/DeleteAdyenIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { ADYEN_INTEGRATION_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { AddAdyenProviderDialogFragmentDoc, @@ -40,8 +41,6 @@ import { usePermissions } from '~/hooks/usePermissions' import Adyen from '~/public/images/adyen.svg' import { MenuPopper, NAV_HEIGHT, PageHeader, PopperOpener, theme } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - const PROVIDER_CONNECTION_LIMIT = 2 gql` diff --git a/src/pages/settings/AdyenIntegrations.tsx b/src/pages/settings/AdyenIntegrations.tsx index 0b8b847f9..ced487bda 100644 --- a/src/pages/settings/AdyenIntegrations.tsx +++ b/src/pages/settings/AdyenIntegrations.tsx @@ -27,6 +27,7 @@ import { DeleteAdyenIntegrationDialog, DeleteAdyenIntegrationDialogRef, } from '~/components/settings/integrations/DeleteAdyenIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { ADYEN_INTEGRATION_DETAILS_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { AddAdyenProviderDialogFragmentDoc, @@ -49,8 +50,6 @@ import { theme, } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - gql` fragment AdyenIntegrations on AdyenProvider { id diff --git a/src/pages/settings/AnrokIntegrationDetails.tsx b/src/pages/settings/AnrokIntegrationDetails.tsx index 55149d531..32011bd59 100644 --- a/src/pages/settings/AnrokIntegrationDetails.tsx +++ b/src/pages/settings/AnrokIntegrationDetails.tsx @@ -27,6 +27,7 @@ import { DeleteAnrokIntegrationDialog, DeleteAnrokIntegrationDialogRef, } from '~/components/settings/integrations/DeleteAnrokIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { ANROK_INTEGRATION_DETAILS_ROUTE, ANROK_INTEGRATION_ROUTE, @@ -44,8 +45,6 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import Anrok from '~/public/images/anrok.svg' import { MenuPopper, PageHeader, theme } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - const PROVIDER_CONNECTION_LIMIT = 2 export enum AnrokIntegrationDetailsTabs { diff --git a/src/pages/settings/AnrokIntegrations.tsx b/src/pages/settings/AnrokIntegrations.tsx index 80d67cf02..03387fcae 100644 --- a/src/pages/settings/AnrokIntegrations.tsx +++ b/src/pages/settings/AnrokIntegrations.tsx @@ -23,6 +23,7 @@ import { DeleteAnrokIntegrationDialog, DeleteAnrokIntegrationDialogRef, } from '~/components/settings/integrations/DeleteAnrokIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { ANROK_INTEGRATION_DETAILS_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { AddAnrokIntegrationDialogFragmentDoc, @@ -44,7 +45,6 @@ import { } from '~/styles' import { AnrokIntegrationDetailsTabs } from './AnrokIntegrationDetails' -import { IntegrationsTabsOptionsEnum } from './Integrations' gql` fragment AnrokIntegrations on AnrokIntegration { diff --git a/src/pages/settings/CashfreeIntegrationDetails.tsx b/src/pages/settings/CashfreeIntegrationDetails.tsx index 8651f43f2..a0aeb9c7d 100644 --- a/src/pages/settings/CashfreeIntegrationDetails.tsx +++ b/src/pages/settings/CashfreeIntegrationDetails.tsx @@ -24,6 +24,7 @@ import { DeleteCashfreeIntegrationDialogRef, } from '~/components/settings/integrations/DeleteCashfreeIntegrationDialog' import { addToast, envGlobalVar, getItemFromLS, ORGANIZATION_LS_KEY_ID } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CASHFREE_INTEGRATION_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { copyToClipboard } from '~/core/utils/copyToClipboard' import { @@ -38,8 +39,6 @@ import { usePermissions } from '~/hooks/usePermissions' import Cashfree from '~/public/images/cashfree.svg' import { MenuPopper, PageHeader } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - const PROVIDER_CONNECTION_LIMIT = 2 gql` diff --git a/src/pages/settings/CashfreeIntegrations.tsx b/src/pages/settings/CashfreeIntegrations.tsx index bec17a9ab..3e3458f5a 100644 --- a/src/pages/settings/CashfreeIntegrations.tsx +++ b/src/pages/settings/CashfreeIntegrations.tsx @@ -25,6 +25,7 @@ import { DeleteCashfreeIntegrationDialog, DeleteCashfreeIntegrationDialogRef, } from '~/components/settings/integrations/DeleteCashfreeIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { CASHFREE_INTEGRATION_DETAILS_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { AddCashfreeProviderDialogFragmentDoc, @@ -39,8 +40,6 @@ import { usePermissions } from '~/hooks/usePermissions' import Cashfree from '~/public/images/cashfree.svg' import { ListItemLink, MenuPopper, PageHeader, PopperOpener } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - gql` fragment CashfreeIntegrations on CashfreeProvider { id diff --git a/src/pages/settings/GocardlessIntegrationDetails.tsx b/src/pages/settings/GocardlessIntegrationDetails.tsx index 9ede7d3d1..deb5372bf 100644 --- a/src/pages/settings/GocardlessIntegrationDetails.tsx +++ b/src/pages/settings/GocardlessIntegrationDetails.tsx @@ -29,6 +29,7 @@ import { } from '~/components/settings/integrations/DeleteGocardlessIntegrationDialog' import { addToast, envGlobalVar } from '~/core/apolloClient' import { buildGocardlessAuthUrl } from '~/core/constants/externalUrls' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { GOCARDLESS_INTEGRATION_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { copyToClipboard } from '~/core/utils/copyToClipboard' import { @@ -43,8 +44,6 @@ import { usePermissions } from '~/hooks/usePermissions' import GoCardless from '~/public/images/gocardless-large.svg' import { MenuPopper, NAV_HEIGHT, PageHeader, PopperOpener, theme } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - const PROVIDER_CONNECTION_LIMIT = 2 gql` diff --git a/src/pages/settings/GocardlessIntegrationOauthCallback.tsx b/src/pages/settings/GocardlessIntegrationOauthCallback.tsx index 8e37c7fa8..51c3e6fd7 100644 --- a/src/pages/settings/GocardlessIntegrationOauthCallback.tsx +++ b/src/pages/settings/GocardlessIntegrationOauthCallback.tsx @@ -6,6 +6,7 @@ import styled from 'styled-components' import { Avatar, ButtonLink, Chip, Icon, Skeleton, Typography } from '~/components/designSystem' import { GenericPlaceholder } from '~/components/GenericPlaceholder' import { addToast } from '~/core/apolloClient' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { GOCARDLESS_INTEGRATION_DETAILS_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { AddGocardlessProviderDialogFragmentDoc, @@ -16,8 +17,6 @@ import Gocardless from '~/public/images/gocardless.svg' import ErrorImage from '~/public/images/maneki/error.svg' import { PageHeader, theme } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - gql` fragment GocardlessIntegrationOauthCallback on GocardlessProvider { id diff --git a/src/pages/settings/GocardlessIntegrations.tsx b/src/pages/settings/GocardlessIntegrations.tsx index 589866a7f..6e8877bb4 100644 --- a/src/pages/settings/GocardlessIntegrations.tsx +++ b/src/pages/settings/GocardlessIntegrations.tsx @@ -27,6 +27,7 @@ import { DeleteGocardlessIntegrationDialog, DeleteGocardlessIntegrationDialogRef, } from '~/components/settings/integrations/DeleteGocardlessIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { GOCARDLESS_INTEGRATION_DETAILS_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { AddGocardlessProviderDialogFragmentDoc, @@ -49,8 +50,6 @@ import { theme, } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - gql` fragment GocardlessIntegrations on GocardlessProvider { id diff --git a/src/pages/settings/HubspotIntegrationDetails.tsx b/src/pages/settings/HubspotIntegrationDetails.tsx index 1ff005081..c836cbcec 100644 --- a/src/pages/settings/HubspotIntegrationDetails.tsx +++ b/src/pages/settings/HubspotIntegrationDetails.tsx @@ -21,6 +21,7 @@ import { DeleteHubspotIntegrationDialog, DeleteHubspotIntegrationDialogRef, } from '~/components/settings/integrations/DeleteHubspotIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { HUBSPOT_INTEGRATION_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { DeleteHubspotIntegrationDialogFragmentDoc, @@ -33,8 +34,6 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import Hubspot from '~/public/images/hubspot.svg' import { MenuPopper, PageHeader } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - const PROVIDER_CONNECTION_LIMIT = 2 gql` diff --git a/src/pages/settings/HubspotIntegrations.tsx b/src/pages/settings/HubspotIntegrations.tsx index 4b3055125..2ee79fe89 100644 --- a/src/pages/settings/HubspotIntegrations.tsx +++ b/src/pages/settings/HubspotIntegrations.tsx @@ -21,6 +21,7 @@ import { DeleteHubspotIntegrationDialog, DeleteHubspotIntegrationDialogRef, } from '~/components/settings/integrations/DeleteHubspotIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { HUBSPOT_INTEGRATION_DETAILS_ROUTE, INTEGRATIONS_ROUTE } from '~/core/router' import { HubspotForCreateDialogFragmentDoc, @@ -32,8 +33,6 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import Hubspot from '~/public/images/hubspot.svg' import { ListItemLink, MenuPopper, PageHeader, PopperOpener } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - gql` fragment HubspotIntegrations on HubspotIntegration { id diff --git a/src/pages/settings/Integrations.tsx b/src/pages/settings/Integrations.tsx index 550f9db52..6f88e6a52 100644 --- a/src/pages/settings/Integrations.tsx +++ b/src/pages/settings/Integrations.tsx @@ -55,6 +55,7 @@ import { DOCUMENTATION_OSO, DOCUMENTATION_SEGMENT, } from '~/core/constants/externalUrls' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { ADYEN_INTEGRATION_ROUTE, ANROK_INTEGRATION_ROUTE, @@ -88,11 +89,6 @@ import Segment from '~/public/images/segment.svg' import Stripe from '~/public/images/stripe.svg' import Xero from '~/public/images/xero.svg' -export enum IntegrationsTabsOptionsEnum { - Lago = 'lago', - Community = 'community', -} - gql` query integrationsSetting($limit: Int) { organization { diff --git a/src/pages/settings/LagoTaxManagementIntegration.tsx b/src/pages/settings/LagoTaxManagementIntegration.tsx index 9f356e542..e7f602fd1 100644 --- a/src/pages/settings/LagoTaxManagementIntegration.tsx +++ b/src/pages/settings/LagoTaxManagementIntegration.tsx @@ -17,6 +17,7 @@ import { import { WarningDialog } from '~/components/WarningDialog' import { addToast } from '~/core/apolloClient' import { CountryCodes } from '~/core/constants/countryCodes' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { intlFormatNumber } from '~/core/formats/intlFormatNumber' import { INTEGRATIONS_ROUTE, @@ -34,8 +35,6 @@ import { usePermissions } from '~/hooks/usePermissions' import LagoTaxManagement from '~/public/images/lago-tax-management.svg' import { HEADER_TABLE_HEIGHT, NAV_HEIGHT, PageHeader, theme } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - gql` query lagoTaxManagementIntegrationsSetting { organization { diff --git a/src/pages/settings/NetsuiteIntegrationDetails.tsx b/src/pages/settings/NetsuiteIntegrationDetails.tsx index e3514a44b..436826e4c 100644 --- a/src/pages/settings/NetsuiteIntegrationDetails.tsx +++ b/src/pages/settings/NetsuiteIntegrationDetails.tsx @@ -27,6 +27,7 @@ import { } from '~/components/settings/integrations/DeleteNetsuiteIntegrationDialog' import NetsuiteIntegrationItemsList from '~/components/settings/integrations/NetsuiteIntegrationItemsList' import NetsuiteIntegrationSettings from '~/components/settings/integrations/NetsuiteIntegrationSettings' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, NETSUITE_INTEGRATION_DETAILS_ROUTE, @@ -44,8 +45,6 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import Netsuite from '~/public/images/netsuite.svg' import { MenuPopper, PageHeader, theme } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - const PROVIDER_CONNECTION_LIMIT = 2 export enum NetsuiteIntegrationDetailsTabs { diff --git a/src/pages/settings/NetsuiteIntegrations.tsx b/src/pages/settings/NetsuiteIntegrations.tsx index b206e9598..dc2cc7503 100644 --- a/src/pages/settings/NetsuiteIntegrations.tsx +++ b/src/pages/settings/NetsuiteIntegrations.tsx @@ -23,6 +23,7 @@ import { DeleteNetsuiteIntegrationDialog, DeleteNetsuiteIntegrationDialogRef, } from '~/components/settings/integrations/DeleteNetsuiteIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, NETSUITE_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { DeleteNetsuiteIntegrationDialogFragmentDoc, @@ -43,7 +44,6 @@ import { theme, } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' import { NetsuiteIntegrationDetailsTabs } from './NetsuiteIntegrationDetails' gql` diff --git a/src/pages/settings/SalesforceIntegrationDetails.tsx b/src/pages/settings/SalesforceIntegrationDetails.tsx index a1d229a3f..cbe53985f 100644 --- a/src/pages/settings/SalesforceIntegrationDetails.tsx +++ b/src/pages/settings/SalesforceIntegrationDetails.tsx @@ -21,6 +21,7 @@ import { DeleteSalesforceIntegrationDialog, DeleteSalesforceIntegrationDialogRef, } from '~/components/settings/integrations/DeleteSalesforceIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, SALESFORCE_INTEGRATION_ROUTE } from '~/core/router' import { DeleteSalesforceIntegrationDialogFragmentDoc, @@ -33,8 +34,6 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import Salesforce from '~/public/images/salesforce.svg' import { MenuPopper, PageHeader } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - const PROVIDER_CONNECTION_LIMIT = 2 gql` diff --git a/src/pages/settings/SalesforceIntegrations.tsx b/src/pages/settings/SalesforceIntegrations.tsx index a155b9350..7f651950c 100644 --- a/src/pages/settings/SalesforceIntegrations.tsx +++ b/src/pages/settings/SalesforceIntegrations.tsx @@ -21,6 +21,7 @@ import { DeleteSalesforceIntegrationDialog, DeleteSalesforceIntegrationDialogRef, } from '~/components/settings/integrations/DeleteSalesforceIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, SALESFORCE_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { DeleteSalesforceIntegrationDialogFragmentDoc, @@ -33,8 +34,6 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import Salesforce from '~/public/images/salesforce.svg' import { ListItemLink, MenuPopper, PageHeader, PopperOpener } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - gql` fragment SalesforceIntegrations on SalesforceIntegration { id diff --git a/src/pages/settings/StripeIntegrationDetails.tsx b/src/pages/settings/StripeIntegrationDetails.tsx index e7874e8d2..b7a20e6cc 100644 --- a/src/pages/settings/StripeIntegrationDetails.tsx +++ b/src/pages/settings/StripeIntegrationDetails.tsx @@ -27,6 +27,7 @@ import { DeleteStripeIntegrationDialog, DeleteStripeIntegrationDialogRef, } from '~/components/settings/integrations/DeleteStripeIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, STRIPE_INTEGRATION_ROUTE } from '~/core/router' import { AddStripeProviderDialogFragmentDoc, @@ -41,8 +42,6 @@ import { usePermissions } from '~/hooks/usePermissions' import Stripe from '~/public/images/stripe.svg' import { MenuPopper, NAV_HEIGHT, PageHeader, PopperOpener, theme } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - const PROVIDER_CONNECTION_LIMIT = 2 gql` diff --git a/src/pages/settings/StripeIntegrations.tsx b/src/pages/settings/StripeIntegrations.tsx index 7d9d9c46b..001919d82 100644 --- a/src/pages/settings/StripeIntegrations.tsx +++ b/src/pages/settings/StripeIntegrations.tsx @@ -27,6 +27,7 @@ import { DeleteStripeIntegrationDialog, DeleteStripeIntegrationDialogRef, } from '~/components/settings/integrations/DeleteStripeIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, STRIPE_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { AddStripeProviderDialogFragmentDoc, @@ -49,8 +50,6 @@ import { theme, } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - gql` fragment StripeIntegrations on StripeProvider { id diff --git a/src/pages/settings/XeroIntegrationDetails.tsx b/src/pages/settings/XeroIntegrationDetails.tsx index 52e2b9a10..20b6345f5 100644 --- a/src/pages/settings/XeroIntegrationDetails.tsx +++ b/src/pages/settings/XeroIntegrationDetails.tsx @@ -24,6 +24,7 @@ import { } from '~/components/settings/integrations/DeleteXeroIntegrationDialog' import XeroIntegrationItemsList from '~/components/settings/integrations/XeroIntegrationItemsList' import XeroIntegrationSettings from '~/components/settings/integrations/XeroIntegrationSettings' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, XERO_INTEGRATION_DETAILS_ROUTE, @@ -41,8 +42,6 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import Xero from '~/public/images/xero.svg' import { MenuPopper, PageHeader, theme } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' - const PROVIDER_CONNECTION_LIMIT = 2 export enum XeroIntegrationDetailsTabs { diff --git a/src/pages/settings/XeroIntegrations.tsx b/src/pages/settings/XeroIntegrations.tsx index 66ec6172e..d19a758bc 100644 --- a/src/pages/settings/XeroIntegrations.tsx +++ b/src/pages/settings/XeroIntegrations.tsx @@ -20,6 +20,7 @@ import { DeleteXeroIntegrationDialog, DeleteXeroIntegrationDialogRef, } from '~/components/settings/integrations/DeleteXeroIntegrationDialog' +import { IntegrationsTabsOptionsEnum } from '~/core/constants/tabsOptions' import { INTEGRATIONS_ROUTE, XERO_INTEGRATION_DETAILS_ROUTE } from '~/core/router' import { DeleteXeroIntegrationDialogFragmentDoc, @@ -40,7 +41,6 @@ import { theme, } from '~/styles' -import { IntegrationsTabsOptionsEnum } from './Integrations' import { XeroIntegrationDetailsTabs } from './XeroIntegrationDetails' gql`