From c591f7f5079b0e2392699f704e37f6fd309cf969 Mon Sep 17 00:00:00 2001 From: Alexandre Monjol Date: Thu, 23 Nov 2023 18:04:26 +0100 Subject: [PATCH] chore(prettier) fix after v3 upgrade --- scripts/InspectTranslationKeys.js | 4 +- scripts/MergeTranslationFiles.js | 2 +- src/components/CodeSnippet.tsx | 10 +- src/components/DebugInfoDialog.tsx | 2 +- src/components/PremiumWarningDialog.tsx | 2 +- src/components/RouteWrapper.tsx | 2 +- src/components/TimezoneDate.tsx | 6 +- src/components/WarningDialog.tsx | 4 +- .../__tests__/WarningDialog.test.tsx | 4 +- src/components/addOns/AddOnItem.tsx | 2 +- .../BillableMetricCodeSnippet.tsx | 32 ++--- .../billableMetrics/BillableMetricItem.tsx | 2 +- .../DeleteBillableMetricDialog.tsx | 12 +- .../EditBillableMetricGroupDialog.tsx | 2 +- .../coupons/AddPlanToCouponDialog.tsx | 2 +- src/components/coupons/CouponCaption.tsx | 16 +-- src/components/coupons/CouponCodeSnippet.tsx | 24 ++-- .../creditNote/CreditNoteFormCalculation.tsx | 48 +++---- src/components/creditNote/utils.ts | 24 ++-- .../customerPortal/PortalInvoiceListItem.tsx | 2 +- .../customers/AddCouponToCustomerDialog.tsx | 6 +- .../customers/AddCustomerDrawer.tsx | 52 ++++---- .../customers/CustomerCreditNotesList.tsx | 4 +- .../customers/CustomerInvoicesList.tsx | 2 +- .../customers/CustomerMainInfos.tsx | 12 +- src/components/customers/CustomerSettings.tsx | 22 ++-- .../customers/DeleteCustomerDialog.tsx | 2 +- .../EditCustomerDocumentLocaleDialog.tsx | 4 +- .../customers/EditCustomerVatRateDialog.tsx | 4 +- .../EditCustomerVatRateDialog.test.tsx | 10 +- .../customers/creditNotes/CreditNotesList.tsx | 8 +- .../creditNotes/VoidCreditNoteDialog.tsx | 4 +- .../CustomerSubscriptionsList.tsx | 2 +- .../subscriptions/SubscriptionLine.tsx | 8 +- .../TerminateCustomerSubscriptionDialog.tsx | 2 +- ...riptionDatesOffsetHelperComponent.test.tsx | 6 +- .../customers/usage/CustomerUsage.tsx | 2 +- .../usage/CustomerUsageDetailDrawer.tsx | 4 +- src/components/customers/usage/UsageItem.tsx | 6 +- src/components/designSystem/Accordion.tsx | 6 +- src/components/designSystem/Button.tsx | 4 +- src/components/designSystem/ButtonLink.tsx | 4 +- src/components/designSystem/Chip.tsx | 10 +- src/components/designSystem/Dialog.tsx | 4 +- src/components/designSystem/Drawer.tsx | 4 +- .../designSystem/InfiniteScroll.tsx | 2 +- src/components/designSystem/NavigationTab.tsx | 26 ++-- src/components/designSystem/Popper.tsx | 6 +- src/components/designSystem/Selector.tsx | 4 +- src/components/designSystem/Toasts/Toast.tsx | 4 +- src/components/designSystem/Tooltip.tsx | 4 +- src/components/designSystem/Typography.tsx | 6 +- .../designSystem/__tests__/Button.test.tsx | 4 +- .../__tests__/ButtonLink.test.tsx | 12 +- .../designSystem/graphs/AreaChart.tsx | 2 +- .../developers/CreateWebhookDialog.tsx | 8 +- .../form/AmountInput/AmountInput.tsx | 6 +- .../form/AmountInput/AmountInputField.tsx | 8 +- .../ButtonSelector/ButtonSelectorField.tsx | 4 +- .../form/ButtonSelector/TabButton.tsx | 4 +- src/components/form/ComboBox/ComboBox.tsx | 4 +- .../form/ComboBox/ComboBoxField.tsx | 4 +- src/components/form/ComboBox/ComboBoxItem.tsx | 2 +- .../form/ComboBox/ComboBoxPopperFactory.tsx | 51 ++++---- .../form/ComboBox/ComboBoxVirtualizedList.tsx | 8 +- src/components/form/ComboBox/ComboboxList.tsx | 14 ++- src/components/form/DatePicker/DatePicker.tsx | 2 +- .../form/DatePicker/DatePickerField.tsx | 4 +- src/components/form/JsonEditor/JsonEditor.tsx | 18 ++- .../form/JsonEditor/JsonEditorField.tsx | 4 +- src/components/form/Radio/Radio.tsx | 2 +- src/components/form/Radio/RadioField.tsx | 6 +- src/components/form/Switch/Switch.tsx | 13 +- src/components/form/Switch/SwitchField.tsx | 4 +- src/components/form/TextInput/TextInput.tsx | 58 ++++----- .../form/TextInput/TextInputField.tsx | 8 +- src/components/graphs/Gross.tsx | 2 +- src/components/graphs/Invoices.tsx | 38 +++--- src/components/graphs/Mrr.tsx | 2 +- src/components/graphs/Usage.tsx | 4 +- src/components/graphs/__tests__/Gross.test.ts | 32 ++--- .../graphs/__tests__/Invoices.test.ts | 24 ++-- src/components/graphs/__tests__/Mrr.test.ts | 32 ++--- src/components/graphs/__tests__/Usage.test.ts | 20 +-- src/components/graphs/__tests__/utils.test.ts | 2 +- src/components/graphs/utils.ts | 10 +- src/components/invoices/AddMetadataDrawer.tsx | 18 +-- .../EditInvoiceItemDescriptionDialog.tsx | 2 +- .../invoices/EditInvoiceItemTaxDialog.tsx | 4 +- .../EditInvoicePaymentStatusDialog.tsx | 2 +- .../invoices/FinalizeInvoiceDialog.tsx | 2 +- .../invoices/InvoiceCreditNotesTable.tsx | 44 +++---- .../invoices/InvoiceCustomerInfos.tsx | 4 +- .../invoices/InvoiceDetailsTable.tsx | 118 +++++++++--------- .../invoices/InvoiceDetailsTableFeeItem.tsx | 4 +- .../invoices/InvoiceDetailsTableFooter.tsx | 22 ++-- .../invoices/InvoiceDetailsTableHeader.tsx | 2 +- src/components/invoices/InvoiceListItem.tsx | 6 +- src/components/invoices/Metadatas.tsx | 2 +- src/components/plans/ChargeAccordion.tsx | 40 +++--- .../plans/ChargeOptionsAccordion.tsx | 2 +- src/components/plans/ChargePercentage.tsx | 12 +- src/components/plans/ChargeWrapperSwitch.tsx | 4 +- src/components/plans/ChargesSection.tsx | 28 ++--- src/components/plans/DeletePlanDialog.tsx | 20 +-- src/components/plans/FixedFeeSection.tsx | 4 +- src/components/plans/GraduatedChargeTable.tsx | 4 +- .../plans/GraduatedPercentageChargeTable.tsx | 4 +- src/components/plans/PackageCharge.tsx | 4 +- src/components/plans/PlanSettingsSection.tsx | 6 +- src/components/plans/VolumeChargeTable.tsx | 2 +- .../plans/__tests__/ChargeAccordion.test.tsx | 4 +- .../details/PlanDetailsChargesSection.tsx | 10 +- .../PlanDetailsChargesSectionAccordion.tsx | 2 +- .../details/PlanDetailsFixedFeeAccordion.tsx | 2 +- .../DeleteOrganizationVatRateDialog.tsx | 2 +- .../settings/EditNetPaymentTermDialog.tsx | 16 +-- .../EditOrganizationDocumentLocaleDialog.tsx | 2 +- .../emails/UpdateOrganizationLogoDialog.tsx | 2 +- .../settings/integrations/AddAdyenDialog.tsx | 10 +- .../AddEditDeleteSuccessRedirectUrlDialog.tsx | 14 +-- .../settings/integrations/AddStripeDialog.tsx | 12 +- .../settings/members/InviteItem.tsx | 4 +- .../settings/members/MembershipItem.tsx | 2 +- src/components/taxes/DeleteTaxDialog.tsx | 2 +- src/components/taxes/TaxCodeSnippet.tsx | 8 +- .../wallets/AddWalletToCustomerDialog.tsx | 14 +-- src/components/wallets/TopupWalletDialog.tsx | 10 +- .../wallets/UpdateCustomerWalletDialog.tsx | 4 +- src/components/wallets/WalletAccordion.tsx | 6 +- .../wallets/WalletTransactionList.tsx | 8 +- .../apolloClient/__tests__/errorUtils.test.ts | 4 +- src/core/apolloClient/cacheUtils.ts | 2 +- src/core/apolloClient/errorUtils.ts | 2 +- src/core/apolloClient/init.ts | 4 +- .../reactiveVars/duplicatePlanVar.ts | 2 +- .../__tests__/intlFormatNumber.test.ts | 30 ++--- src/core/formats/formatCreditNotesItems.ts | 2 +- src/core/formats/formatInvoiceItemsMap.ts | 6 +- src/core/formats/intlFormatNumber.ts | 4 +- src/core/router/AuthRoutes.tsx | 6 +- src/core/router/CustomerPortalRoutes.tsx | 2 +- src/core/router/CustomerRoutes.tsx | 12 +- src/core/router/DevelopperRoutes.tsx | 10 +- src/core/router/ObjectsRoutes.tsx | 24 ++-- src/core/router/SettingRoutes.tsx | 18 +-- src/core/router/index.tsx | 4 +- src/core/router/utils.tsx | 2 +- .../serializeCreditNoteInput.test.ts | 4 +- src/core/serializers/serializeAmount.ts | 2 +- .../serializers/serializeCreditNoteInput.ts | 6 +- src/core/serializers/serializePlanInput.ts | 8 +- src/core/timezone/utils.ts | 2 +- src/core/translations/__tests__/utils.test.ts | 10 +- src/core/translations/utils.ts | 4 +- src/core/utils/BMGroupUtils.ts | 6 +- .../utils/__tests__/copyToClipboard.test.ts | 2 +- src/formValidation/chargeSchema.ts | 16 +-- src/formValidation/feesSchema.ts | 14 +-- src/formValidation/metadataSchema.ts | 4 +- .../useInternationalization.test.tsx | 2 +- .../core/__tests__/useLocationHistory.test.ts | 6 +- src/hooks/core/useContextualLocale.ts | 2 +- src/hooks/core/useInternationalization.ts | 2 +- src/hooks/core/useLocationHistory.ts | 2 +- src/hooks/customer/useAddSubscription.tsx | 14 ++- .../__tests__/useVolumeChargeForm.test.tsx | 8 +- src/hooks/plans/useGraduatedChargeForm.ts | 16 +-- .../plans/useGraduatedPercentageChargeForm.ts | 14 +-- src/hooks/plans/usePlanForm.tsx | 14 +-- src/hooks/plans/useVolumeChargeForm.ts | 10 +- .../__tests__/useListKeyNavigation.test.tsx | 12 +- src/hooks/ui/__tests__/useShortcuts.test.tsx | 8 +- src/hooks/ui/useListKeyNavigation.tsx | 2 +- src/hooks/ui/useShortcuts.tsx | 6 +- src/hooks/useCreateCreditNote.ts | 18 +-- src/hooks/useCreateEditAddOn.ts | 2 +- src/hooks/useCreateEditBillableMetric.ts | 2 +- src/hooks/useCreateEditCoupon.ts | 12 +- src/hooks/useCreateEditCustomer.ts | 2 +- src/hooks/useCreateEditTax.ts | 2 +- src/hooks/useDebouncedSearch.ts | 4 +- src/index.html | 2 +- src/layouts/CustomerInvoiceDetails.tsx | 10 +- src/pages/Analytics.tsx | 8 +- src/pages/CreateAddOn.tsx | 22 ++-- src/pages/CreateBillableMetric.tsx | 39 +++--- src/pages/CreateCoupon.tsx | 20 +-- src/pages/CreateCreditNote.tsx | 26 ++-- src/pages/CreateInvoice.tsx | 18 +-- src/pages/CreatePlan.tsx | 14 +-- src/pages/CreateSubscription.tsx | 20 +-- src/pages/CreateTax.tsx | 10 +- src/pages/CreditNoteDetails.tsx | 62 ++++----- src/pages/CustomerDetails.tsx | 4 +- src/pages/CustomerDraftInvoicesList.tsx | 2 +- src/pages/Invitation.tsx | 2 +- src/pages/InvoiceOverview.tsx | 4 +- src/pages/InvoicesList.tsx | 26 ++-- src/pages/PlanDetails.tsx | 2 +- src/pages/PlansList.tsx | 2 +- src/pages/SubscriptionDetails.tsx | 8 +- src/pages/__devOnly/DesignSystem.tsx | 8 +- src/pages/auth/ResetPassword.tsx | 2 +- src/pages/auth/SignUp.tsx | 2 +- src/pages/developers/Debugger.tsx | 2 +- src/pages/developers/WebhookLogs.tsx | 6 +- src/pages/settings/EmailScenarioConfig.tsx | 4 +- src/pages/settings/InvoiceSettings.tsx | 4 +- src/test-utils.tsx | 2 +- 210 files changed, 1044 insertions(+), 1015 deletions(-) diff --git a/scripts/InspectTranslationKeys.js b/scripts/InspectTranslationKeys.js index ed42bcbf8..6942c10f7 100644 --- a/scripts/InspectTranslationKeys.js +++ b/scripts/InspectTranslationKeys.js @@ -57,7 +57,7 @@ async function extract() { 31 + 'm' + `\n----- Keys used but not defined ----- ${keysNotInDitto.length}` + - '\u001b[0m' + '\u001b[0m', ) console.info(keysNotInDitto.join('\n')) } @@ -67,7 +67,7 @@ async function extract() { 31 + 'm' + `\n----- Keys defined but not used ----- ${dittoKeysNotUsed.length}` + - '\u001b[0m' + '\u001b[0m', ) console.info(dittoKeysNotUsed.join('\n')) } diff --git a/scripts/MergeTranslationFiles.js b/scripts/MergeTranslationFiles.js index a5f2499a0..51759b06d 100644 --- a/scripts/MergeTranslationFiles.js +++ b/scripts/MergeTranslationFiles.js @@ -18,7 +18,7 @@ async function extract(locale) { fs.writeFileSync( path.join(DITTO_DIR, `/${fileLocaleKey}.json`), - `${JSON.stringify(allKeys, null, 2)}\n` + `${JSON.stringify(allKeys, null, 2)}\n`, ) } diff --git a/src/components/CodeSnippet.tsx b/src/components/CodeSnippet.tsx index 2c6c4b5df..a11742ed8 100644 --- a/src/components/CodeSnippet.tsx +++ b/src/components/CodeSnippet.tsx @@ -78,7 +78,7 @@ export const CodeSnippet = memo( )} ) - } + }, ) CodeSnippet.displayName = 'CodeSnippet' @@ -183,7 +183,13 @@ const Content = styled.div` pre[class*='language-'] { color: #19212e; background: none; - font-family: IBM Plex Mono, Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-family: + IBM Plex Mono, + Consolas, + Monaco, + 'Andale Mono', + 'Ubuntu Mono', + monospace; text-align: left; white-space: pre; word-spacing: normal; diff --git a/src/components/DebugInfoDialog.tsx b/src/components/DebugInfoDialog.tsx index ca9d37a95..87e3db671 100644 --- a/src/components/DebugInfoDialog.tsx +++ b/src/components/DebugInfoDialog.tsx @@ -36,7 +36,7 @@ export const DebugInfoDialog = forwardRef(({}, ref) => { (!!currentUser?.id ? ` **User Id :** ${currentUser?.id}` - : '') + : ''), ) addToast({ diff --git a/src/components/PremiumWarningDialog.tsx b/src/components/PremiumWarningDialog.tsx index e9db7a151..d8e576a5f 100644 --- a/src/components/PremiumWarningDialog.tsx +++ b/src/components/PremiumWarningDialog.tsx @@ -21,7 +21,7 @@ export const PremiumWarningDialog = forwardRef(({}, ref) => { {translate('text_63b3155768489ee342482f55')} diff --git a/src/components/RouteWrapper.tsx b/src/components/RouteWrapper.tsx index 4d0c42569..4105cc0e5 100644 --- a/src/components/RouteWrapper.tsx +++ b/src/components/RouteWrapper.tsx @@ -27,7 +27,7 @@ const PageWrapper = ({ children, routeConfig }: PageWrapperProps) => { export const routesFormatter: ( routesToFormat: CustomRouteObject[], - loggedIn: boolean + loggedIn: boolean, ) => RouteObject[] = (routesToFormat, loggedIn) => { return routesToFormat.reduce((acc, route) => { const routeConfig = { diff --git a/src/components/TimezoneDate.tsx b/src/components/TimezoneDate.tsx index f653be120..c65860dce 100644 --- a/src/components/TimezoneDate.tsx +++ b/src/components/TimezoneDate.tsx @@ -77,9 +77,9 @@ export const TimezoneDate = ({ mainTimezone === MainTimezoneEnum.organization ? timezone : mainTimezone === MainTimezoneEnum.customer - ? customerTimezone - : TimezoneEnum.TzUtc, - mainDateFormat + ? customerTimezone + : TimezoneEnum.TzUtc, + mainDateFormat, )} diff --git a/src/components/WarningDialog.tsx b/src/components/WarningDialog.tsx index 45714a195..96ed5753e 100644 --- a/src/components/WarningDialog.tsx +++ b/src/components/WarningDialog.tsx @@ -26,7 +26,7 @@ export const WarningDialog = forwardRef( forceOpen = false, ...props }: WarningDialogProps, - ref + ref, ) => { const { translate } = useInternationalization() @@ -55,7 +55,7 @@ export const WarningDialog = forwardRef( data-test="warning-dialog" /> ) - } + }, ) WarningDialog.displayName = 'WarningDialog' diff --git a/src/components/__tests__/WarningDialog.test.tsx b/src/components/__tests__/WarningDialog.test.tsx index bbe37decb..87b48db3b 100644 --- a/src/components/__tests__/WarningDialog.test.tsx +++ b/src/components/__tests__/WarningDialog.test.tsx @@ -16,8 +16,8 @@ async function prepare() { description="description" continueText="continueText" onContinue={onContinueMock} - /> - ) + />, + ), ) } diff --git a/src/components/addOns/AddOnItem.tsx b/src/components/addOns/AddOnItem.tsx index 96d32b75c..386b6aeab 100644 --- a/src/components/addOns/AddOnItem.tsx +++ b/src/components/addOns/AddOnItem.tsx @@ -76,7 +76,7 @@ export const AddOnItem = ({ addOn, deleteDialogRef, navigationProps }: AddOnItem { currencyDisplay: 'symbol', currency: amountCurrency, - } + }, ), })} diff --git a/src/components/billableMetrics/BillableMetricCodeSnippet.tsx b/src/components/billableMetrics/BillableMetricCodeSnippet.tsx index d21c4a25e..f31fbbdae 100644 --- a/src/components/billableMetrics/BillableMetricCodeSnippet.tsx +++ b/src/components/billableMetrics/BillableMetricCodeSnippet.tsx @@ -54,11 +54,11 @@ const getSnippets = (billableMetric?: CreateBillableMetricInput) => { "timestamp": $(date +%s), "properties": { "${fieldName}": 12${ - groupDimension > 0 - ? `, + groupDimension > 0 + ? `, ${propertiesForGroup}` - : '' - } + : '' + } } } }' @@ -104,11 +104,11 @@ ${groupDimensionMessage} "timestamp": $(date +%s), "properties": { "${fieldName}": "data"${ - groupDimension > 0 - ? `, + groupDimension > 0 + ? `, ${propertiesForGroup}` - : '' - } + : '' + } } } }' @@ -130,11 +130,11 @@ ${groupDimensionMessage} "timestamp": $(date +%s), "properties": { "${fieldName}": 12${ - groupDimension > 0 - ? `, + groupDimension > 0 + ? `, ${propertiesForGroup}` - : '' - } + : '' + } } } }' @@ -156,11 +156,11 @@ ${groupDimensionMessage} "timestamp": $(date +%s), "properties": { "${fieldName}": 12${ - groupDimension > 0 - ? `, + groupDimension > 0 + ? `, ${propertiesForGroup}` - : '' - } + : '' + } } } }' diff --git a/src/components/billableMetrics/BillableMetricItem.tsx b/src/components/billableMetrics/BillableMetricItem.tsx index 2d5113d93..b69683991 100644 --- a/src/components/billableMetrics/BillableMetricItem.tsx +++ b/src/components/billableMetrics/BillableMetricItem.tsx @@ -124,7 +124,7 @@ export const BillableMetricItem = memo( ) - } + }, ) export const BillableMetricItemSkeleton = () => { diff --git a/src/components/billableMetrics/DeleteBillableMetricDialog.tsx b/src/components/billableMetrics/DeleteBillableMetricDialog.tsx index dc571ffea..9997bd660 100644 --- a/src/components/billableMetrics/DeleteBillableMetricDialog.tsx +++ b/src/components/billableMetrics/DeleteBillableMetricDialog.tsx @@ -31,7 +31,7 @@ export const DeleteBillableMetricDialog = forwardRef(null) const { translate } = useInternationalization() const [billableMetric, setBillableMetric] = useState( - undefined + undefined, ) const { @@ -86,12 +86,12 @@ export const DeleteBillableMetricDialog = forwardRef 0 && activeSubscriptionsCount > 0 ? 2 : 0 + draftInvoicesCount > 0 && activeSubscriptionsCount > 0 ? 2 : 0, ) ) : ( diff --git a/src/components/billableMetrics/EditBillableMetricGroupDialog.tsx b/src/components/billableMetrics/EditBillableMetricGroupDialog.tsx index 49b3b7396..93b5984a1 100644 --- a/src/components/billableMetrics/EditBillableMetricGroupDialog.tsx +++ b/src/components/billableMetrics/EditBillableMetricGroupDialog.tsx @@ -58,7 +58,7 @@ export const EditBillableMetricGroupDialog = forwardRef ) - } + }, ) EditBillableMetricGroupDialog.displayName = 'EditBillableMetricGroupDialog' diff --git a/src/components/coupons/AddPlanToCouponDialog.tsx b/src/components/coupons/AddPlanToCouponDialog.tsx index af11b49d2..077b9086a 100644 --- a/src/components/coupons/AddPlanToCouponDialog.tsx +++ b/src/components/coupons/AddPlanToCouponDialog.tsx @@ -123,7 +123,7 @@ export const AddPlanToCouponDialog = forwardRef ) - } + }, ) AddPlanToCouponDialog.displayName = 'AddPlanToCouponDialog' diff --git a/src/components/coupons/CouponCaption.tsx b/src/components/coupons/CouponCaption.tsx index 5453edbfe..2b63ab23b 100644 --- a/src/components/coupons/CouponCaption.tsx +++ b/src/components/coupons/CouponCaption.tsx @@ -68,14 +68,14 @@ export const CouponCaption = memo(({ coupon, variant = 'caption' }: CouponCaptio amount: intlFormatNumber( deserializeAmount( Number(amountCentsRemaining) || Number(amountCents), - amountCurrency || CurrencyEnum.Usd + amountCurrency || CurrencyEnum.Usd, ) || 0, { currencyDisplay: 'symbol', currency: amountCurrency || undefined, - } + }, ), - } + }, ) } else if (couponType === CouponTypeEnum.Percentage && frequency === CouponFrequency.Once) { return translate('text_632d68358f1fedc68eed3eb5', { @@ -94,16 +94,16 @@ export const CouponCaption = memo(({ coupon, variant = 'caption' }: CouponCaptio amount: intlFormatNumber( deserializeAmount( Number(amountCentsRemaining) || Number(amountCents), - amountCurrency || CurrencyEnum.Usd + amountCurrency || CurrencyEnum.Usd, ) || 0, { currencyDisplay: 'symbol', currency: amountCurrency || undefined, - } + }, ), duration: frequencyDurationRemaining || frequencyDuration, }, - frequencyDurationRemaining || frequencyDuration || 1 + frequencyDurationRemaining || frequencyDuration || 1, ) } else if ( couponType === CouponTypeEnum.Percentage && @@ -118,7 +118,7 @@ export const CouponCaption = memo(({ coupon, variant = 'caption' }: CouponCaptio }), duration: frequencyDurationRemaining || frequencyDuration, }, - frequencyDurationRemaining || frequencyDuration || 1 + frequencyDurationRemaining || frequencyDuration || 1, ) } else if (couponType === CouponTypeEnum.FixedAmount && frequency === CouponFrequency.Forever) { return translate('text_63c946e8bef768ead2fee35c', { @@ -127,7 +127,7 @@ export const CouponCaption = memo(({ coupon, variant = 'caption' }: CouponCaptio { currencyDisplay: 'symbol', currency: amountCurrency || undefined, - } + }, ), }) } else if (couponType === CouponTypeEnum.Percentage && frequency === CouponFrequency.Forever) { diff --git a/src/components/coupons/CouponCodeSnippet.tsx b/src/components/coupons/CouponCodeSnippet.tsx index 25a9451a6..772090b53 100644 --- a/src/components/coupons/CouponCodeSnippet.tsx +++ b/src/components/coupons/CouponCodeSnippet.tsx @@ -18,7 +18,7 @@ const getSnippets = ( hasBillableMetricLimit: boolean, limitPlansList?: PlansForCouponsFragment[], limitBillableMetricsList?: BillableMetricsForCouponsFragment[], - coupon?: CreateCouponInput + coupon?: CreateCouponInput, ) => { if (!coupon || !coupon.code) return '# Fill the form to generate the code snippet' const { @@ -61,20 +61,20 @@ curl --location --request POST "${apiUrl}/api/v1/applied_coupons" \\ "expiration_date": "${expirationAt ? expirationAt : '__MUST_BE_DEFINED__'}",` : `"expiration": "${expiration}",` }${ - !!hasPlanLimit && !!limitPlansList?.length - ? ` + !!hasPlanLimit && !!limitPlansList?.length + ? ` "applies_to": { "plan_codes": [${limitPlansList.map( - (p: PlansForCouponsFragment) => `"${p.code}"` + (p: PlansForCouponsFragment) => `"${p.code}"`, )}] },` - : '' - }${ - !!hasBillableMetricLimit && !!limitBillableMetricsList?.length - ? ` + : '' + }${ + !!hasBillableMetricLimit && !!limitBillableMetricsList?.length + ? ` "applies_to": { "billable_metrics_codes": [${limitBillableMetricsList.map( - (b: BillableMetricsForCouponsFragment) => `"${b.code}"` + (b: BillableMetricsForCouponsFragment) => `"${b.code}"`, )}] },` - : '' - } + : '' + } } }' @@ -107,7 +107,7 @@ export const CouponCodeSnippet = ({ hasBillableMetricLimit, limitPlansList, limitBillableMetricsList, - coupon + coupon, )} /> ) diff --git a/src/components/creditNote/CreditNoteFormCalculation.tsx b/src/components/creditNote/CreditNoteFormCalculation.tsx index ef86150da..9c7ac863f 100644 --- a/src/components/creditNote/CreditNoteFormCalculation.tsx +++ b/src/components/creditNote/CreditNoteFormCalculation.tsx @@ -116,7 +116,7 @@ export const CreditNoteFormCalculation = ({ }, }) }, DEBOUNCE_SEARCH_MS), - [invoice?.id, feeForEstimate, getEstimate] + [invoice?.id, feeForEstimate, getEstimate], ) useEffect(() => { @@ -147,25 +147,25 @@ export const CreditNoteFormCalculation = ({ totalTaxIncluded: isError ? 0 : canOnlyCredit - ? deserializeAmount( - estimationData?.creditNoteEstimate.maxCreditableAmountCents || 0, - currency - ) - : deserializeAmount( - estimationData?.creditNoteEstimate.maxRefundableAmountCents || 0, - currency - ), + ? deserializeAmount( + estimationData?.creditNoteEstimate.maxCreditableAmountCents || 0, + currency, + ) + : deserializeAmount( + estimationData?.creditNoteEstimate.maxRefundableAmountCents || 0, + currency, + ), proRatedCouponAmount: isError ? 0 : deserializeAmount( estimationData?.creditNoteEstimate?.couponsAdjustmentAmountCents || 0, - currency + currency, ), totalExcludedTax: isError ? 0 : deserializeAmount( estimationData?.creditNoteEstimate?.subTotalExcludingTaxesAmountCents || 0, - currency + currency, ), taxes: isError ? new Map() @@ -177,7 +177,7 @@ export const CreditNoteFormCalculation = ({ taxRate: tax.taxRate, amount: deserializeAmount(tax.amountCents || 0, currency), }, - ]) + ]), ), hasCreditOrCoupon: isError ? false @@ -201,7 +201,7 @@ export const CreditNoteFormCalculation = ({ } else if (payBack.length < 2) { formikProps.setFieldValue( 'payBack.0.value', - !totalTaxIncluded ? undefined : Number(totalTaxIncluded || 0)?.toFixed(currencyPrecision) + !totalTaxIncluded ? undefined : Number(totalTaxIncluded || 0)?.toFixed(currencyPrecision), ) } @@ -215,15 +215,15 @@ export const CreditNoteFormCalculation = ({ return type === CreditTypeEnum.refund ? number().max( deserializeAmount(maxRefundableAmountCents, currency) || 0, - PayBackErrorEnum.maxRefund + PayBackErrorEnum.maxRefund, ) : number().max( deserializeAmount(maxCreditableAmountCents, currency) || 0, - PayBackErrorEnum.maxRefund + PayBackErrorEnum.maxRefund, ) }), - }) - ) + }), + ), ) formikProps.setTouched({ payBack: true, @@ -311,7 +311,7 @@ export const CreditNoteFormCalculation = ({ ) : ( {`${translate( - 'text_636bedf292786b19d3398f06' + 'text_636bedf292786b19d3398f06', )} (0%)`} {estiationLoading ? ( @@ -379,7 +379,7 @@ export const CreditNoteFormCalculation = ({ value: Math.round( (totalTaxIncluded || 0) * 100 - - Number(invoice?.refundableAmountCents || 0) + Number(invoice?.refundableAmountCents || 0), ) / 100, }, ]) @@ -406,9 +406,9 @@ export const CreditNoteFormCalculation = ({ deserializeAmount(invoice?.refundableAmountCents || 0, currency), { currency, - } + }, ), - } + }, ), }, ]} @@ -513,9 +513,9 @@ export const CreditNoteFormCalculation = ({ deserializeAmount(invoice?.refundableAmountCents || 0, currency), { currency, - } + }, ), - } + }, ), }, ]} @@ -526,7 +526,7 @@ export const CreditNoteFormCalculation = ({ deserializeAmount(invoice?.refundableAmountCents || 0, currency), { currency, - } + }, ), })} placement="top-end" diff --git a/src/components/creditNote/utils.ts b/src/components/creditNote/utils.ts index 6e69e2b77..0644764a1 100644 --- a/src/components/creditNote/utils.ts +++ b/src/components/creditNote/utils.ts @@ -53,13 +53,13 @@ export const creditNoteFormCalculationCalculation = ({ return accFee }, - [] + [], ) accGroup = [...accGroup, ...groupedValues] return accGroup }, - [] + [], ) accSub = [...accSub, ...subValues] @@ -67,17 +67,17 @@ export const creditNoteFormCalculationCalculation = ({ return accSub }, []) : !!addonFees - ? addonFees?.reduce((acc, fee) => { - if (!!fee.checked) { - acc.push({ - feeId: fee.id, - amountCents: serializeAmount(fee.value, currency), - }) - } + ? addonFees?.reduce((acc, fee) => { + if (!!fee.checked) { + acc.push({ + feeId: fee.id, + amountCents: serializeAmount(fee.value, currency), + }) + } - return acc - }, []) - : undefined + return acc + }, []) + : undefined return { feeForEstimate, diff --git a/src/components/customerPortal/PortalInvoiceListItem.tsx b/src/components/customerPortal/PortalInvoiceListItem.tsx index 243cebf98..d4b7b5aa4 100644 --- a/src/components/customerPortal/PortalInvoiceListItem.tsx +++ b/src/components/customerPortal/PortalInvoiceListItem.tsx @@ -121,7 +121,7 @@ export const PortalInvoiceListItem = memo( ) - } + }, ) PortalInvoiceListItem.displayName = 'PortalInvoiceListItem' diff --git a/src/components/customers/AddCouponToCustomerDialog.tsx b/src/components/customers/AddCouponToCustomerDialog.tsx index dbc80fe3e..ff475ba90 100644 --- a/src/components/customers/AddCouponToCustomerDialog.tsx +++ b/src/components/customers/AddCouponToCustomerDialog.tsx @@ -210,7 +210,7 @@ export const AddCouponToCustomerDialog = forwardRef< enableReinitialize: true, onSubmit: async ( { amountCents, amountCurrency, percentageRate, frequencyDuration, ...values }, - formikBag + formikBag, ) => { const couponValues = { ...values, @@ -243,7 +243,7 @@ export const AddCouponToCustomerDialog = forwardRef< if (hasDefinedGQLError('CouponIsNotReusable', errors)) { formikBag.setFieldError( 'couponId', - translate('text_638f48274d41e3f1d01fc119', { customerFullName: customerName }) + translate('text_638f48274d41e3f1d01fc119', { customerFullName: customerName }), ) } else if (hasDefinedGQLError('CurrenciesDoesNotMatch', errors, 'currency')) { formikBag.setFieldError('amountCurrency', '') @@ -318,7 +318,7 @@ export const AddCouponToCustomerDialog = forwardRef< couponId: coupon.id, amountCents: deserializeAmount( coupon.amountCents || 0, - coupon.amountCurrency || CurrencyEnum.Usd + coupon.amountCurrency || CurrencyEnum.Usd, ), amountCurrency: coupon.amountCurrency, percentageRate: coupon.percentageRate, diff --git a/src/components/customers/AddCustomerDrawer.tsx b/src/components/customers/AddCustomerDrawer.tsx index c35e2d3f3..7dcb1cd64 100644 --- a/src/components/customers/AddCustomerDrawer.tsx +++ b/src/components/customers/AddCustomerDrawer.tsx @@ -59,7 +59,7 @@ interface LocalCustomerMetadata extends CustomerMetadataInput { } const providerData: { value: ProviderTypeEnum; label: string }[] = Object.keys( - ProviderTypeEnum + ProviderTypeEnum, ).map((provider) => ({ // @ts-ignore value: ProviderTypeEnum[provider], @@ -100,8 +100,8 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { providerPaymentMethods: customer?.providerCustomer?.providerPaymentMethods?.length ? customer?.providerCustomer?.providerPaymentMethods : customer?.currency !== CurrencyEnum.Eur - ? [ProviderPaymentMethodsEnum.Card] - : [ProviderPaymentMethodsEnum.Card, ProviderPaymentMethodsEnum.SepaDebit], + ? [ProviderPaymentMethodsEnum.Card] + : [ProviderPaymentMethodsEnum.Card, ProviderPaymentMethodsEnum.SepaDebit], }, paymentProvider: customer?.paymentProvider ?? undefined, metadata: customer?.metadata ?? undefined, @@ -119,7 +119,7 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { ...values, metadata: ((metadata as LocalCustomerMetadata[]) || []).map( // eslint-disable-next-line @typescript-eslint/no-unused-vars - ({ localId, ...rest }) => rest + ({ localId, ...rest }) => rest, ), }) @@ -144,7 +144,7 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { 'providerCustomer.providerPaymentMethods', formikProps.values.currency !== CurrencyEnum.Eur ? [ProviderPaymentMethodsEnum.Card] - : [ProviderPaymentMethodsEnum.Card, ProviderPaymentMethodsEnum.SepaDebit] + : [ProviderPaymentMethodsEnum.Card, ProviderPaymentMethodsEnum.SepaDebit], ) } // eslint-disable-next-line react-hooks/exhaustive-deps @@ -165,11 +165,11 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { isEdition ? 'text_632b4acf0c41206cbcb8c2f6' : customer?.name - ? 'text_632b49e2620ea4c6d96c9650' - : 'text_632b49e2620ea4c6d96c9652', + ? 'text_632b49e2620ea4c6d96c9650' + : 'text_632b49e2620ea4c6d96c9652', { customerName: customer?.name || '', - } + }, )} onClose={() => { formikProps.resetForm({ @@ -196,8 +196,8 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { providerPaymentMethods: customer?.providerCustomer?.providerPaymentMethods?.length ? customer?.providerCustomer?.providerPaymentMethods : customer?.currency !== CurrencyEnum.Eur - ? [ProviderPaymentMethodsEnum.Card] - : [ProviderPaymentMethodsEnum.Card, ProviderPaymentMethodsEnum.SepaDebit], + ? [ProviderPaymentMethodsEnum.Card] + : [ProviderPaymentMethodsEnum.Card, ProviderPaymentMethodsEnum.SepaDebit], }, paymentProvider: customer?.paymentProvider ?? undefined, metadata: customer?.metadata ?? undefined, @@ -210,12 +210,12 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { {translate( - isEdition ? 'text_632b4acf0c41206cbcb8c2f8' : 'text_632b49e2620ea4c6d96c9652' + isEdition ? 'text_632b4acf0c41206cbcb8c2f8' : 'text_632b49e2620ea4c6d96c9652', )} {translate( - isEdition ? 'text_632b4acf0c41206cbcb8c2fa' : 'text_632b49e2620ea4c6d96c9654' + isEdition ? 'text_632b4acf0c41206cbcb8c2fa' : 'text_632b49e2620ea4c6d96c9654', )} @@ -292,7 +292,7 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { infoText={translate( !customer?.canEditAttributes && isEdition ? 'text_632c6e59b73f9a54d4c7223d' - : 'text_632c6e59b73f9a54d4c7223f' + : 'text_632c6e59b73f9a54d4c7223f', )} name="currency" data={Object.values(CurrencyEnum).map((currencyType) => ({ @@ -422,8 +422,8 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { formikProps.values.paymentProvider === ProviderTypeEnum.Gocardless ? translate('text_635bdbda84c98758f9bba8aa') : formikProps.values.paymentProvider === ProviderTypeEnum.Adyen - ? translate('text_645d0728ea0a5a7bbf76d5c7') - : translate('text_635bdbda84c98758f9bba89e') + ? translate('text_645d0728ea0a5a7bbf76d5c7') + : translate('text_635bdbda84c98758f9bba89e') } onChange={(e, checked) => { setIsDisabled(checked) @@ -447,14 +447,14 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { name="providerCustomer.providerPaymentMethods.card" value={ !!formikProps.values.providerCustomer?.providerPaymentMethods?.includes( - ProviderPaymentMethodsEnum.Card + ProviderPaymentMethodsEnum.Card, ) } label={translate('text_64aeb7b998c4322918c84208')} disabled={ formikProps.values.providerCustomer?.providerPaymentMethods?.length === 1 && formikProps.values.providerCustomer?.providerPaymentMethods.includes( - ProviderPaymentMethodsEnum.Card + ProviderPaymentMethodsEnum.Card, ) } onChange={(e, checked) => { @@ -470,7 +470,7 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { formikProps.setFieldValue( 'providerCustomer.providerPaymentMethods', - newValue + newValue, ) }} /> @@ -478,7 +478,7 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { name="providerCustomer.providerPaymentMethods.sepa_debit" value={ !!formikProps.values.providerCustomer?.providerPaymentMethods?.includes( - ProviderPaymentMethodsEnum.SepaDebit + ProviderPaymentMethodsEnum.SepaDebit, ) } label={translate('text_64aeb7b998c4322918c8420c')} @@ -489,7 +489,7 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { disabled={ formikProps.values.providerCustomer?.providerPaymentMethods?.length === 1 && formikProps.values.providerCustomer?.providerPaymentMethods.includes( - ProviderPaymentMethodsEnum.SepaDebit + ProviderPaymentMethodsEnum.SepaDebit, ) } onChange={(e, checked) => { @@ -505,7 +505,7 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { formikProps.setFieldValue( 'providerCustomer.providerPaymentMethods', - newValue + newValue, ) }} /> @@ -561,10 +561,10 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { `${number}` > = _get(formikProps.errors, `metadata.${i}.value`) const hasCustomKeyError = Object.keys(MetadataErrorsEnum).includes( - metadataItemKeyError || '' + metadataItemKeyError || '', ) const hasCustomValueError = Object.keys(MetadataErrorsEnum).includes( - metadataItemValueError || '' + metadataItemValueError || '', ) return ( @@ -575,8 +575,8 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { metadataItemKeyError === MetadataErrorsEnum.uniqueness ? translate('text_63fcc3218d35b9377840f5dd') : metadataItemKeyError === MetadataErrorsEnum.maxLength - ? translate('text_63fcc3218d35b9377840f5d9') - : undefined + ? translate('text_63fcc3218d35b9377840f5d9') + : undefined } disableHoverListener={!hasCustomKeyError} > @@ -672,7 +672,7 @@ export const AddCustomerDrawer = forwardRef((_, ref) => { onClick={formikProps.submitForm} > {translate( - isEdition ? 'text_632b4acf0c41206cbcb8c30c' : 'text_632b49e2620ea4c6d96c9666' + isEdition ? 'text_632b4acf0c41206cbcb8c30c' : 'text_632b49e2620ea4c6d96c9666', )} diff --git a/src/components/customers/CustomerCreditNotesList.tsx b/src/components/customers/CustomerCreditNotesList.tsx index 110f8e943..0e3857df4 100644 --- a/src/components/customers/CustomerCreditNotesList.tsx +++ b/src/components/customers/CustomerCreditNotesList.tsx @@ -88,12 +88,12 @@ export const CustomerCreditNotesList = ({ {intlFormatNumber( deserializeAmount( creditNotesBalanceAmountCents || 0, - userCurrency || CurrencyEnum.Usd + userCurrency || CurrencyEnum.Usd, ) || 0, { currencyDisplay: 'symbol', currency: userCurrency, - } + }, )} diff --git a/src/components/customers/CustomerInvoicesList.tsx b/src/components/customers/CustomerInvoicesList.tsx index 1c8bd2ff8..21ebf1937 100644 --- a/src/components/customers/CustomerInvoicesList.tsx +++ b/src/components/customers/CustomerInvoicesList.tsx @@ -90,7 +90,7 @@ export const CustomerInvoicesList = ({ {translate( context === CustomerInvoiceListContextEnum.draft ? 'text_63ac86d797f728a87b2f9fa7' - : 'text_63b5d225b075850e0fe489f4' + : 'text_63b5d225b075850e0fe489f4', )} diff --git a/src/components/customers/CustomerMainInfos.tsx b/src/components/customers/CustomerMainInfos.tsx index 9f19f350f..70acab31a 100644 --- a/src/components/customers/CustomerMainInfos.tsx +++ b/src/components/customers/CustomerMainInfos.tsx @@ -200,10 +200,10 @@ export const CustomerMainInfos = ({ loading, customer, onEdit }: CustomerMainInf {paymentProvider === ProviderTypeEnum?.Stripe ? translate('text_62b5c912506c4905fa75524a') : paymentProvider === ProviderTypeEnum?.Gocardless - ? translate('text_634ea0ecc6147de10ddb6648') - : paymentProvider === ProviderTypeEnum?.Adyen - ? translate('text_645d071272418a14c1c76a6d') - : ''} + ? translate('text_634ea0ecc6147de10ddb6648') + : paymentProvider === ProviderTypeEnum?.Adyen + ? translate('text_645d071272418a14c1c76a6d') + : ''} )} @@ -221,8 +221,8 @@ export const CustomerMainInfos = ({ loading, customer, onEdit }: CustomerMainInf {providerCustomer?.providerPaymentMethods?.length === 2 ? translate('text_64aeb7b998c4322918c8423b') : providerCustomer?.providerPaymentMethods[0] === ProviderPaymentMethodsEnum?.Card - ? translate('text_64aeb7b998c4322918c84208') - : translate('text_64aeb7b998c4322918c8420c')} + ? translate('text_64aeb7b998c4322918c84208') + : translate('text_64aeb7b998c4322918c8420c')} )} diff --git a/src/components/customers/CustomerSettings.tsx b/src/components/customers/CustomerSettings.tsx index 695cf0116..b02f8308b 100644 --- a/src/components/customers/CustomerSettings.tsx +++ b/src/components/customers/CustomerSettings.tsx @@ -292,17 +292,17 @@ export const CustomerSettings = ({ customerId }: CustomerSettingsProps) => { { days: organization?.netPaymentTerm, }, - organization?.netPaymentTerm + organization?.netPaymentTerm, ) : customer?.netPaymentTerm === 0 - ? translate('text_64c7a89b6c67eb6c98898125') - : translate( - 'text_64c7a89b6c67eb6c9889815f', - { - days: customer?.netPaymentTerm, - }, - customer?.netPaymentTerm - )} + ? translate('text_64c7a89b6c67eb6c98898125') + : translate( + 'text_64c7a89b6c67eb6c9889815f', + { + days: customer?.netPaymentTerm, + }, + customer?.netPaymentTerm, + )} { { invoiceGracePeriod: customer?.invoiceGracePeriod, }, - customer?.invoiceGracePeriod + customer?.invoiceGracePeriod, ) : translate( 'text_63aa085d28b8510cd464440d', @@ -394,7 +394,7 @@ export const CustomerSettings = ({ customerId }: CustomerSettingsProps) => { invoiceGracePeriod: organization?.billingConfiguration?.invoiceGracePeriod || 0, }, - organization?.billingConfiguration?.invoiceGracePeriod || 0 + organization?.billingConfiguration?.invoiceGracePeriod || 0, )} ) - } + }, ) DeleteCustomerDialog.displayName = 'DeleteCustomerDialog' diff --git a/src/components/customers/EditCustomerDocumentLocaleDialog.tsx b/src/components/customers/EditCustomerDocumentLocaleDialog.tsx index 8dbbbae9f..7d71ba972 100644 --- a/src/components/customers/EditCustomerDocumentLocaleDialog.tsx +++ b/src/components/customers/EditCustomerDocumentLocaleDialog.tsx @@ -49,7 +49,7 @@ const documentLocalesData: { value: string; label: string }[] = Object.keys(Docu value: localeKey, label: DocumentLocales[localeKey], } - } + }, ) export const EditCustomerDocumentLocaleDialog = forwardRef< @@ -103,7 +103,7 @@ export const EditCustomerDocumentLocaleDialog = forwardRef< ( ( { appliedTaxRatesTaxesIds, customer, forceOpen = false }: EditCustomerVatRateDialogProps, - ref + ref, ) => { const { translate } = useInternationalization() const [localTax, setLocalTax] = useState('') @@ -175,7 +175,7 @@ export const EditCustomerVatRateDialog = forwardRef ) - } + }, ) const Content = styled.div` diff --git a/src/components/customers/__tests__/EditCustomerVatRateDialog.test.tsx b/src/components/customers/__tests__/EditCustomerVatRateDialog.test.tsx index ce326cb65..cea69e09a 100644 --- a/src/components/customers/__tests__/EditCustomerVatRateDialog.test.tsx +++ b/src/components/customers/__tests__/EditCustomerVatRateDialog.test.tsx @@ -41,7 +41,7 @@ async function prepare({ await act(() => render(, { mocks, - }) + }), ) } @@ -62,14 +62,14 @@ describe('EditCustomerVatRateDialog', () => { screen .queryByTestId('edit-customer-vat-rate-dialog') ?.querySelector( - `.${SEARCH_TAX_INPUT_FOR_CUSTOMER_CLASSNAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}` - ) as HTMLElement - ) + `.${SEARCH_TAX_INPUT_FOR_CUSTOMER_CLASSNAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}`, + ) as HTMLElement, + ), ) expect(screen.queryByTestId('combobox-item-Create a tax_rate')).toBeInTheDocument() expect( - screen.queryByTestId('combobox-item-Create a tax_rate')?.querySelector(`a`) + screen.queryByTestId('combobox-item-Create a tax_rate')?.querySelector(`a`), ).toHaveAttribute('href', CREATE_TAX_ROUTE) }) }) diff --git a/src/components/customers/creditNotes/CreditNotesList.tsx b/src/components/customers/creditNotes/CreditNotesList.tsx index db409eb0f..0174264b7 100644 --- a/src/components/customers/creditNotes/CreditNotesList.tsx +++ b/src/components/customers/creditNotes/CreditNotesList.tsx @@ -171,7 +171,7 @@ const CreditNotesList = memo( customerId, invoiceId: invoiceId, creditNoteId: creditNote.id, - }) + }), ) } > @@ -184,7 +184,7 @@ const CreditNotesList = memo( { currencyDisplay: 'symbol', currency: creditNote.currency, - } + }, )} @@ -202,7 +202,7 @@ const CreditNotesList = memo( title={translate( creditNote.canBeVoided ? 'text_63728c6434e1344aea76347d' - : 'text_63728c6434e1344aea76347f' + : 'text_63728c6434e1344aea76347f', )} > ) - } + }, ) ButtonLink.displayName = 'ButtonLink' diff --git a/src/components/designSystem/Chip.tsx b/src/components/designSystem/Chip.tsx index 3c87ff640..893b19a67 100644 --- a/src/components/designSystem/Chip.tsx +++ b/src/components/designSystem/Chip.tsx @@ -66,7 +66,7 @@ export const Chip = ({ @@ -93,15 +93,15 @@ export const Chip = ({ type === ChipTypeEnum.beta ? 'captionCode' : variant === ChipVariantEnum.secondary - ? 'body' - : 'captionHl' + ? 'body' + : 'captionHl' } color={ type === ChipTypeEnum.error ? 'danger600' : type === ChipTypeEnum.beta - ? 'info600' - : 'textSecondary' + ? 'info600' + : 'textSecondary' } > {label} diff --git a/src/components/designSystem/Dialog.tsx b/src/components/designSystem/Dialog.tsx index a68299354..e66abee13 100644 --- a/src/components/designSystem/Dialog.tsx +++ b/src/components/designSystem/Dialog.tsx @@ -25,7 +25,7 @@ export interface DialogRef { export const Dialog = forwardRef( ( { title, description, actions, children, onOpen, onClose, open = false, ...props }: DialogProps, - ref + ref, ) => { const [isOpen, setIsOpen] = useState(open) @@ -74,7 +74,7 @@ export const Dialog = forwardRef( ) - } + }, ) Dialog.displayName = 'Dialog' diff --git a/src/components/designSystem/Drawer.tsx b/src/components/designSystem/Drawer.tsx index fc1924236..c4dc09ef0 100644 --- a/src/components/designSystem/Drawer.tsx +++ b/src/components/designSystem/Drawer.tsx @@ -30,7 +30,7 @@ export interface DrawerRef { export const Drawer = forwardRef( ( { forceOpen = false, children, opener, anchor = 'right', title, onOpen, onClose }: DrawerProps, - ref + ref, ) => { const [isOpen, setIsOpen] = useState(forceOpen) @@ -81,7 +81,7 @@ export const Drawer = forwardRef( ) - } + }, ) Drawer.displayName = 'Drawer' diff --git a/src/components/designSystem/InfiniteScroll.tsx b/src/components/designSystem/InfiniteScroll.tsx index f4a4b474e..579572ce4 100644 --- a/src/components/designSystem/InfiniteScroll.tsx +++ b/src/components/designSystem/InfiniteScroll.tsx @@ -16,7 +16,7 @@ export const InfiniteScroll = ({ children, onBottom }: InfiniteScrollProps) => { onBottom && onBottom() } }, - { threshold: [0] } + { threshold: [0] }, ) let element: HTMLDivElement diff --git a/src/components/designSystem/NavigationTab.tsx b/src/components/designSystem/NavigationTab.tsx index ef147311d..9ba480f91 100644 --- a/src/components/designSystem/NavigationTab.tsx +++ b/src/components/designSystem/NavigationTab.tsx @@ -54,7 +54,7 @@ export const NavigationTab = ({ }: NavigationTabsProps) => { const { pathname } = useLocation() const activeTab = tabs.find( - (tab) => tab.link === pathname || !!tab.match?.find((path) => !!matchPath(path, pathname)) + (tab) => tab.link === pathname || !!tab.match?.find((path) => !!matchPath(path, pathname)), ) return ( @@ -133,18 +133,18 @@ const TabsBlock = styled.div<{ } ` : $align === NavigationTabAlignEnum.superLeft - ? css` - padding: ${theme.spacing(4)} 0; - - ${theme.breakpoints.down('sm')} { - padding: ${theme.spacing(4)}; - } - ` - : css` - > * { - flex: 1; - } - `} + ? css` + padding: ${theme.spacing(4)} 0; + + ${theme.breakpoints.down('sm')} { + padding: ${theme.spacing(4)}; + } + ` + : css` + > * { + flex: 1; + } + `} } &.navigation-tab--vertical { diff --git a/src/components/designSystem/Popper.tsx b/src/components/designSystem/Popper.tsx index f02b90a98..b2782c270 100644 --- a/src/components/designSystem/Popper.tsx +++ b/src/components/designSystem/Popper.tsx @@ -50,7 +50,7 @@ export const Popper = forwardRef( displayInDialog = false, onClickAway, }: PopperProps, - ref + ref, ) => { const [isOpen, setIsOpen] = useState(false) // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -61,7 +61,7 @@ export const Popper = forwardRef( (open: boolean) => { setIsOpen(open) }, - [setIsOpen] + [setIsOpen], ) const toggle = useCallback(() => { @@ -132,7 +132,7 @@ export const Popper = forwardRef( ) - } + }, ) Popper.displayName = 'Popper' diff --git a/src/components/designSystem/Selector.tsx b/src/components/designSystem/Selector.tsx index d0e378123..062fb5c81 100644 --- a/src/components/designSystem/Selector.tsx +++ b/src/components/designSystem/Selector.tsx @@ -132,8 +132,8 @@ const Container = styled.button<{ $selected ? theme.palette.primary[100] : $disabled - ? theme.palette.grey[100] - : theme.palette.background.default}; + ? theme.palette.grey[100] + : theme.palette.background.default}; border: 1px solid ${({ $selected }) => ($selected ? theme.palette.primary[600] : theme.palette.grey[400])}; cursor: ${({ $disabled }) => ($disabled ? 'not-allowed' : 'default')}; diff --git a/src/components/designSystem/Toasts/Toast.tsx b/src/components/designSystem/Toasts/Toast.tsx index 3c54a421f..edb195149 100644 --- a/src/components/designSystem/Toasts/Toast.tsx +++ b/src/components/designSystem/Toasts/Toast.tsx @@ -34,12 +34,12 @@ export const Toast = forwardRef(({ toast }: ToastProps, re setClosing(true) }, time) }, - [setClosing, autoDismiss] + [setClosing, autoDismiss], ) const stopTimeout = useCallback( () => autoDismiss && !!timeoutRef.current && clearTimeout(timeoutRef.current || undefined), - [autoDismiss] + [autoDismiss], ) useEffect(() => { diff --git a/src/components/designSystem/Tooltip.tsx b/src/components/designSystem/Tooltip.tsx index 0dd7d07ba..5e5cd6172 100644 --- a/src/components/designSystem/Tooltip.tsx +++ b/src/components/designSystem/Tooltip.tsx @@ -16,7 +16,7 @@ export const Tooltip = forwardRef( ( { children, disableHoverListener, className, maxWidth = '320px', ...props }: TooltipProps, // eslint-disable-next-line @typescript-eslint/no-explicit-any - ref: any + ref: any, ) => { const [isOpen, setIsOpen] = useState(false) @@ -39,7 +39,7 @@ export const Tooltip = forwardRef( ) - } + }, ) Tooltip.displayName = 'Tooltip' diff --git a/src/components/designSystem/Typography.tsx b/src/components/designSystem/Typography.tsx index 91e722618..e9d0c1cfe 100644 --- a/src/components/designSystem/Typography.tsx +++ b/src/components/designSystem/Typography.tsx @@ -114,12 +114,12 @@ export const Typography = memo( sanitizedWithInternalLinks.push( {internalLink['data-text']} - + , ) } sanitizedWithInternalLinks.push( - + , ) }) @@ -152,7 +152,7 @@ export const Typography = memo( }, // eslint-disable-next-line @typescript-eslint/no-unused-vars ({ component, ...prevProps }, { component: nextComponent, ...nextProps }) => - _isEqual(prevProps, nextProps) + _isEqual(prevProps, nextProps), ) Typography.displayName = 'Typography' diff --git a/src/components/designSystem/__tests__/Button.test.tsx b/src/components/designSystem/__tests__/Button.test.tsx index d40905bc8..aa2dce627 100644 --- a/src/components/designSystem/__tests__/Button.test.tsx +++ b/src/components/designSystem/__tests__/Button.test.tsx @@ -20,8 +20,8 @@ async function prepare({ onClick={props?.onClick} > {children} - - ) + , + ), ) } diff --git a/src/components/designSystem/__tests__/ButtonLink.test.tsx b/src/components/designSystem/__tests__/ButtonLink.test.tsx index 7be8be6f4..0b9f15e39 100644 --- a/src/components/designSystem/__tests__/ButtonLink.test.tsx +++ b/src/components/designSystem/__tests__/ButtonLink.test.tsx @@ -17,7 +17,7 @@ async function prepare( props?: Record type: ButtonLinkBaseProps['type'] to: string - } = { type: 'button', to: '/' } + } = { type: 'button', to: '/' }, ) { await act(() => render( @@ -30,8 +30,8 @@ async function prepare( buttonProps={props?.buttonProps} > {children} - - ) + , + ), ) } @@ -72,7 +72,7 @@ describe('ButtonLink', () => { expect(onContinueMock).not.toHaveBeenCalled() await waitFor(() => - userEvent.click(screen.queryByTestId('button-link-button') as HTMLElement) + userEvent.click(screen.queryByTestId('button-link-button') as HTMLElement), ) expect(onContinueMock).toHaveBeenCalled() @@ -90,7 +90,7 @@ describe('ButtonLink', () => { expect(onContinueMock).not.toHaveBeenCalled() expect(screen.queryByTestId('button-link-button')).toBeDisabled() expect(screen.queryByTestId('tab-internal-button-link-title')).toHaveClass( - 'button-link-disabled' + 'button-link-disabled', ) }) @@ -103,7 +103,7 @@ describe('ButtonLink', () => { expect(screen.queryByTestId('tab-internal-button-link-title')).toHaveAttribute( 'href', - '/this-is-my-route' + '/this-is-my-route', ) }) }) diff --git a/src/components/designSystem/graphs/AreaChart.tsx b/src/components/designSystem/graphs/AreaChart.tsx index 2a5153989..34a7d4ca2 100644 --- a/src/components/designSystem/graphs/AreaChart.tsx +++ b/src/components/designSystem/graphs/AreaChart.tsx @@ -161,7 +161,7 @@ const AreaChart = memo(({ blur, currency, data, hasOnlyZeroValues, loading }: Ar deserializeAmount(payload.value, currency), { currency, - } + }, )} diff --git a/src/components/developers/CreateWebhookDialog.tsx b/src/components/developers/CreateWebhookDialog.tsx index eae124e26..33b94c6d3 100644 --- a/src/components/developers/CreateWebhookDialog.tsx +++ b/src/components/developers/CreateWebhookDialog.tsx @@ -54,7 +54,7 @@ export const CreateWebhookDialog = forwardRef((_, ref) = const navigate = useNavigate() const [mutationError, setMutationError] = useState(undefined) const [localWebhook, setLocalWebhook] = useState( - undefined + undefined, ) const [isEdit, setIsEdit] = useState(false) const [createWebhook] = useCreateWebhookEndpointMutation({ @@ -107,7 +107,7 @@ export const CreateWebhookDialog = forwardRef((_, ref) = } else if (!errors) { addToast({ message: translate( - isEdit ? 'text_64d23b49d481ab00681c22ab' : 'text_6271200984178801ba8bdf7f' + isEdit ? 'text_64d23b49d481ab00681c22ab' : 'text_6271200984178801ba8bdf7f', ), severity: 'success', }) @@ -117,7 +117,7 @@ export const CreateWebhookDialog = forwardRef((_, ref) = generatePath(WEBHOOK_LOGS_ROUTE, { webhookId: (res?.data as CreateWebhookEndpointMutation)?.createWebhookEndpoint ?.id as string, - }) + }), ) } dialogRef.current?.closeDialog() @@ -140,7 +140,7 @@ export const CreateWebhookDialog = forwardRef((_, ref) = ref={dialogRef} title={translate(isEdit ? 'text_64d23a81a7d807f8aa570509' : 'text_6271200984178801ba8bdec0')} description={translate( - isEdit ? 'text_64d23a81a7d807f8aa57050b' : 'text_6271200984178801ba8bdee6' + isEdit ? 'text_64d23a81a7d807f8aa57050b' : 'text_6271200984178801ba8bdee6', )} onClose={() => { !!mutationError && setMutationError(undefined) diff --git a/src/components/form/AmountInput/AmountInput.tsx b/src/components/form/AmountInput/AmountInput.tsx index cb2f57944..e3ce392af 100644 --- a/src/components/form/AmountInput/AmountInput.tsx +++ b/src/components/form/AmountInput/AmountInput.tsx @@ -19,7 +19,7 @@ export interface AmountInputProps extends Omit { const newBeforeChangeFormatter: ValueFormatterType[] = [ beforeChangeFormatter @@ -67,7 +67,7 @@ export const AmountInput = forwardRef( displayErrorText = true, ...props }: AmountInputProps, - ref + ref, ) => { const { translate } = useInternationalization() const newBeforeChangeFormatter = defineNewBeforeChangeFormatter(beforeChangeFormatter, currency) @@ -82,7 +82,7 @@ export const AmountInput = forwardRef( {...props} /> ) - } + }, ) AmountInput.displayName = 'AmountInput' diff --git a/src/components/form/AmountInput/AmountInputField.tsx b/src/components/form/AmountInput/AmountInputField.tsx index e2a2f3796..5cb9302c2 100644 --- a/src/components/form/AmountInput/AmountInputField.tsx +++ b/src/components/form/AmountInput/AmountInputField.tsx @@ -28,7 +28,7 @@ export const AmountInputField = memo( displayErrorText = true, ...props }: AmountInputFieldProps, - ref + ref, ) => { const { values, errors, touched, handleBlur, setFieldValue } = formikProps @@ -53,11 +53,11 @@ export const AmountInputField = memo( {...props} /> ) - } + }, ), ( { formikProps: prevFormikProps, name: prevName, ...prev }, - { formikProps: nextformikProps, name: nextName, ...next } + { formikProps: nextformikProps, name: nextName, ...next }, ) => { return ( _isEqual(prev, next) && @@ -66,7 +66,7 @@ export const AmountInputField = memo( _get(prevFormikProps.errors, prevName) === _get(nextformikProps.errors, nextName) && _get(prevFormikProps.touched, prevName) === _get(nextformikProps.touched, nextName) ) - } + }, ) AmountInputField.displayName = 'AmountInputField' diff --git a/src/components/form/ButtonSelector/ButtonSelectorField.tsx b/src/components/form/ButtonSelector/ButtonSelectorField.tsx index 51944c130..999084eb5 100644 --- a/src/components/form/ButtonSelector/ButtonSelectorField.tsx +++ b/src/components/form/ButtonSelector/ButtonSelectorField.tsx @@ -25,7 +25,7 @@ export const ButtonSelectorField = memo( }, ( { formikProps: prevFormikProps, name: prevName, ...prev }, - { formikProps: nextformikProps, name: nextName, ...next } + { formikProps: nextformikProps, name: nextName, ...next }, ) => { return ( _isEqual(prev, next) && @@ -34,7 +34,7 @@ export const ButtonSelectorField = memo( prevFormikProps.errors[prevName] === nextformikProps.errors[nextName] && prevFormikProps.touched[prevName] === nextformikProps.touched[nextName] ) - } + }, ) ButtonSelectorField.displayName = 'ButtonSelectorField' diff --git a/src/components/form/ButtonSelector/TabButton.tsx b/src/components/form/ButtonSelector/TabButton.tsx index 575a1e70f..25c7dff20 100644 --- a/src/components/form/ButtonSelector/TabButton.tsx +++ b/src/components/form/ButtonSelector/TabButton.tsx @@ -19,7 +19,7 @@ export interface TabButtonProps { export const TabButton = forwardRef( ( { active = false, title, icon, className, disabled, onClick, ...props }: TabButtonProps, - ref + ref, ) => { const [isLoading, setIsLoading] = useState(false) const mountedRef = useRef(false) @@ -78,7 +78,7 @@ export const TabButton = forwardRef( )} ) - } + }, ) TabButton.displayName = 'TabButton' diff --git a/src/components/form/ComboBox/ComboBox.tsx b/src/components/form/ComboBox/ComboBox.tsx index fcb12c95a..dc95e62bf 100644 --- a/src/components/form/ComboBox/ComboBox.tsx +++ b/src/components/form/ComboBox/ComboBox.tsx @@ -64,7 +64,7 @@ export const ComboBox = ({ useEffect(() => { if (prevRawData && data) { const deletedOptions = prevRawData.filter( - ({ value: oldVal }) => !data.find(({ value: newVal }) => oldVal === newVal) + ({ value: oldVal }) => !data.find(({ value: newVal }) => oldVal === newVal), ) if (deletedOptions.find(({ value: deletedValue }) => value === deletedValue)) { @@ -160,7 +160,7 @@ export const ComboBox = ({ options, params.inputValue !== value ? params - : { getOptionLabel: params.getOptionLabel, inputValue: '' } + : { getOptionLabel: params.getOptionLabel, inputValue: '' }, ) // Suggest the creation of a new value diff --git a/src/components/form/ComboBox/ComboBoxField.tsx b/src/components/form/ComboBox/ComboBoxField.tsx index 6d5be58b1..be88fdaa3 100644 --- a/src/components/form/ComboBox/ComboBoxField.tsx +++ b/src/components/form/ComboBox/ComboBoxField.tsx @@ -47,7 +47,7 @@ export const ComboBoxField = memo( }, ( { formikProps: prevFormikProps, name: prevName, ...prev }, - { formikProps: nextformikProps, name: nextName, ...next } + { formikProps: nextformikProps, name: nextName, ...next }, ) => { return ( _isEqual(prev, next) && @@ -56,7 +56,7 @@ export const ComboBoxField = memo( _get(prevFormikProps.errors, prevName) === _get(nextformikProps.errors, nextName) && _get(prevFormikProps.touched, prevName) === _get(nextformikProps.touched, nextName) ) - } + }, ) ComboBoxField.displayName = 'ComboBoxField' diff --git a/src/components/form/ComboBox/ComboBoxItem.tsx b/src/components/form/ComboBox/ComboBoxItem.tsx index e0998137d..e29ef48bc 100644 --- a/src/components/form/ComboBox/ComboBoxItem.tsx +++ b/src/components/form/ComboBox/ComboBoxItem.tsx @@ -46,7 +46,7 @@ export const ComboBoxItem = ({ { 'combo-box-item--disabled': disabled, }, - className + className, )} data-test={value} key={value} diff --git a/src/components/form/ComboBox/ComboBoxPopperFactory.tsx b/src/components/form/ComboBox/ComboBoxPopperFactory.tsx index 7b4f9a87f..49e96c19f 100644 --- a/src/components/form/ComboBox/ComboBoxPopperFactory.tsx +++ b/src/components/form/ComboBox/ComboBoxPopperFactory.tsx @@ -23,34 +23,33 @@ export const ComboBoxPopperFactory = virtualized, }: ComboBoxPopperFactoryArgs = {}) => // eslint-disable-next-line react/display-name - (props: PopperProps) => - ( - ( + +
-
- {props?.children as ReactNode} -
- - ) + {props?.children as ReactNode} +
+
+ ) const StyledPopper = styled(Popper)<{ $minWidth?: number diff --git a/src/components/form/ComboBox/ComboBoxVirtualizedList.tsx b/src/components/form/ComboBox/ComboBoxVirtualizedList.tsx index 1762228ba..6c8a41c7f 100644 --- a/src/components/form/ComboBox/ComboBoxVirtualizedList.tsx +++ b/src/components/form/ComboBox/ComboBoxVirtualizedList.tsx @@ -44,7 +44,7 @@ export const ComboBoxVirtualizedList = (props: ComboBoxVirtualizedListProps) => () => { if (gridRef && value && gridRef.current) { const valueIndex = elements.findIndex( - (el) => el.props?.children?.props?.option?.value === value + (el) => el.props?.children?.props?.option?.value === value, ) if (valueIndex) { @@ -53,7 +53,7 @@ export const ComboBoxVirtualizedList = (props: ComboBoxVirtualizedListProps) => } }, // eslint-disable-next-line react-hooks/exhaustive-deps - [value] + [value], ) return ( @@ -67,8 +67,8 @@ export const ComboBoxVirtualizedList = (props: ComboBoxVirtualizedListProps) => return index === itemCount - 1 ? ITEM_HEIGHT : ((elements[index].key as string) || '').includes(GROUP_ITEM_KEY) - ? GROUP_HEADER_HEIGHT + (index === 0 ? 8 : 12) - : ITEM_HEIGHT + 4 + ? GROUP_HEADER_HEIGHT + (index === 0 ? 8 : 12) + : ITEM_HEIGHT + 4 }} overscanCount={5} itemCount={itemCount} diff --git a/src/components/form/ComboBox/ComboboxList.tsx b/src/components/form/ComboBox/ComboboxList.tsx index 6f55ac29c..23bfd32da 100644 --- a/src/components/form/ComboBox/ComboboxList.tsx +++ b/src/components/form/ComboBox/ComboboxList.tsx @@ -28,7 +28,7 @@ export const ComboboxList = forwardRef( renderGroupHeader, ...propsToForward }: ComboBoxVirtualizedListProps, - ref: ForwardedRef + ref: ForwardedRef, ) => { const isGrouped = !!(children as { props: { option: ComboBoxData } }[])[0]?.props?.option?.group @@ -39,7 +39,7 @@ export const ComboboxList = forwardRef( {item} - )) + )), ) } @@ -49,7 +49,7 @@ export const ComboboxList = forwardRef( */ const groupedBy = _groupBy( children as { props: { option: ComboBoxData } }[], - (child) => child.props.option.group + (child) => child.props.option.group, ) return Children.toArray( @@ -76,7 +76,7 @@ export const ComboboxList = forwardRef( )), ] - }, []) + }, []), ) }, [isGrouped, renderGroupHeader, children, propsToForward, virtualized]) @@ -89,7 +89,7 @@ export const ComboboxList = forwardRef( )} ) - } + }, ) ComboboxList.displayName = 'ComboboxList' @@ -121,7 +121,9 @@ const GroupHeader = styled.div<{ $isFirst?: boolean; $virtualized?: boolean }>` padding: 0 ${theme.spacing(6)}; background-color: ${theme.palette.grey[100]}; box-sizing: border-box; - box-shadow: ${theme.shadows[7]}, 0px -1px 0px 0px ${theme.palette.divider}; + box-shadow: + ${theme.shadows[7]}, + 0px -1px 0px 0px ${theme.palette.divider}; ${({ $virtualized, $isFirst }) => !$virtualized diff --git a/src/components/form/DatePicker/DatePicker.tsx b/src/components/form/DatePicker/DatePicker.tsx index 359272837..e5d6969a4 100644 --- a/src/components/form/DatePicker/DatePicker.tsx +++ b/src/components/form/DatePicker/DatePicker.tsx @@ -67,7 +67,7 @@ export const DatePicker = ({ * Date will be passed to the parent as ISO * So we need to make sure to re-transform to DateTime for the component to read it */ - !!value ? (typeof value === 'string' ? DateTime.fromISO(value) : value) : null + !!value ? (typeof value === 'string' ? DateTime.fromISO(value) : value) : null, ) const isInvalid = !!localDate && !localDate.isValid diff --git a/src/components/form/DatePicker/DatePickerField.tsx b/src/components/form/DatePicker/DatePickerField.tsx index 8a4707443..5ce7dabaf 100644 --- a/src/components/form/DatePicker/DatePickerField.tsx +++ b/src/components/form/DatePicker/DatePickerField.tsx @@ -31,7 +31,7 @@ export const DatePickerField = memo( }, ( { formikProps: prevFormikProps, name: prevName, ...prev }, - { formikProps: nextformikProps, name: nextName, ...next } + { formikProps: nextformikProps, name: nextName, ...next }, ) => { return ( _isEqual(prev, next) && @@ -40,7 +40,7 @@ export const DatePickerField = memo( prevFormikProps.errors[prevName] === nextformikProps.errors[nextName] && prevFormikProps.touched[prevName] === nextformikProps.touched[nextName] ) - } + }, ) DatePickerField.displayName = 'DatePickerField' diff --git a/src/components/form/JsonEditor/JsonEditor.tsx b/src/components/form/JsonEditor/JsonEditor.tsx index 8c6a4cccb..2377f9c88 100644 --- a/src/components/form/JsonEditor/JsonEditor.tsx +++ b/src/components/form/JsonEditor/JsonEditor.tsx @@ -122,7 +122,7 @@ export const JsonEditor = ({ {!!error ? translate( - error === JSON_EDITOR_ERROR_ENUM.invalid ? customInvalidError || error : error + error === JSON_EDITOR_ERROR_ENUM.invalid ? customInvalidError || error : error, ) : helperText} @@ -175,7 +175,13 @@ const Editor = styled(AceEditor)` && { width: 100%; min-height: 250px; - font-family: IBM Plex Mono, Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace; + font-family: + IBM Plex Mono, + Consolas, + Monaco, + Andale Mono, + Ubuntu Mono, + monospace; font-size: 14px; .ace_active-line { @@ -278,7 +284,13 @@ const Editor = styled(AceEditor)` .ace_placeholder { color: ${theme.palette.grey[500]}; - font-family: IBM Plex Mono, Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace; + font-family: + IBM Plex Mono, + Consolas, + Monaco, + Andale Mono, + Ubuntu Mono, + monospace; font-size: 14px; top: 10px; padding: 0 !important; diff --git a/src/components/form/JsonEditor/JsonEditorField.tsx b/src/components/form/JsonEditor/JsonEditorField.tsx index bc2637c0e..b30c8f36b 100644 --- a/src/components/form/JsonEditor/JsonEditorField.tsx +++ b/src/components/form/JsonEditor/JsonEditorField.tsx @@ -33,7 +33,7 @@ export const JsonEditorField = memo( }, ( { formikProps: prevFormikProps, name: prevName, ...prev }, - { formikProps: nextformikProps, name: nextName, ...next } + { formikProps: nextformikProps, name: nextName, ...next }, ) => { return ( _isEqual(prev, next) && @@ -42,7 +42,7 @@ export const JsonEditorField = memo( _get(prevFormikProps.errors, prevName) === _get(nextformikProps.errors, nextName) && _get(prevFormikProps.touched, prevName) === _get(nextformikProps.touched, nextName) ) - } + }, ) JsonEditorField.displayName = 'JsonEditorField' diff --git a/src/components/form/Radio/Radio.tsx b/src/components/form/Radio/Radio.tsx index 8830d9b44..0752ac980 100644 --- a/src/components/form/Radio/Radio.tsx +++ b/src/components/form/Radio/Radio.tsx @@ -69,7 +69,7 @@ export const Radio = forwardRef( ) - } + }, ) Radio.displayName = 'Radio' diff --git a/src/components/form/Radio/RadioField.tsx b/src/components/form/Radio/RadioField.tsx index a46c526c7..e8ddc8b2b 100644 --- a/src/components/form/Radio/RadioField.tsx +++ b/src/components/form/Radio/RadioField.tsx @@ -26,11 +26,11 @@ export const RadioField = memo( name={name} /> ) - } + }, ), ( { formikProps: prevFormikProps, name: prevName, ...prev }, - { formikProps: nextformikProps, name: nextName, ...next } + { formikProps: nextformikProps, name: nextName, ...next }, ) => { return ( _isEqual(prev, next) && @@ -39,7 +39,7 @@ export const RadioField = memo( prevFormikProps.errors[prevName] === nextformikProps.errors[nextName] && prevFormikProps.touched[prevName] === nextformikProps.touched[nextName] ) - } + }, ) RadioField.displayName = 'RadioField' diff --git a/src/components/form/Switch/Switch.tsx b/src/components/form/Switch/Switch.tsx index e27208aca..a41623249 100644 --- a/src/components/form/Switch/Switch.tsx +++ b/src/components/form/Switch/Switch.tsx @@ -110,8 +110,8 @@ export const Switch = ({ disabled ? theme.palette.grey[300] : checked - ? theme.palette.common.white - : theme.palette.grey[500] + ? theme.palette.common.white + : theme.palette.grey[500] } /> @@ -156,7 +156,8 @@ const Space = styled.div` const Loader = styled(Icon)` position: absolute; left: 20px; - transition: left 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, + transition: + left 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; opacity: 0; ` @@ -164,7 +165,8 @@ const Loader = styled(Icon)` const SwitchElement = styled.svg<{ $checked: boolean }>` position: absolute; left: ${(props) => (props.$checked ? theme.spacing(8) : theme.spacing(1))}; - transition: left 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, + transition: + left 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; opacity: 1; ` @@ -172,7 +174,8 @@ const SwitchElement = styled.svg<{ $checked: boolean }>` const StyledTypography = styled(Typography)` width: 24px; text-align: center; - transition: left 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, + transition: + left 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; opacity: 1; ` diff --git a/src/components/form/Switch/SwitchField.tsx b/src/components/form/Switch/SwitchField.tsx index 0fa46322a..1504e837c 100644 --- a/src/components/form/Switch/SwitchField.tsx +++ b/src/components/form/Switch/SwitchField.tsx @@ -24,7 +24,7 @@ export const SwitchField = memo( }, ( { formikProps: prevFormikProps, name: prevName, ...prev }, - { formikProps: nextformikProps, name: nextName, ...next } + { formikProps: nextformikProps, name: nextName, ...next }, ) => { return ( _isEqual(prev, next) && @@ -33,7 +33,7 @@ export const SwitchField = memo( prevFormikProps.errors[prevName] === nextformikProps.errors[nextName] && prevFormikProps.touched[prevName] === nextformikProps.touched[nextName] ) - } + }, ) SwitchField.displayName = 'SwitchField' diff --git a/src/components/form/TextInput/TextInput.tsx b/src/components/form/TextInput/TextInput.tsx index b1261cfde..f36c36d28 100644 --- a/src/components/form/TextInput/TextInput.tsx +++ b/src/components/form/TextInput/TextInput.tsx @@ -41,12 +41,12 @@ export interface TextInputProps } const numberFormatter = new RegExp( - `${ValueFormatter.int}|${ValueFormatter.decimal}|${ValueFormatter.triDecimal}|${ValueFormatter.quadDecimal}|${ValueFormatter.positiveNumber}` + `${ValueFormatter.int}|${ValueFormatter.decimal}|${ValueFormatter.triDecimal}|${ValueFormatter.quadDecimal}|${ValueFormatter.positiveNumber}`, ) export const formatValue = ( value: string | number | undefined, - formatterFunctions?: ValueFormatterType[] | ValueFormatterType + formatterFunctions?: ValueFormatterType[] | ValueFormatterType, ) => { let formattedValue = value @@ -54,7 +54,7 @@ export const formatValue = ( if (!formatterFunctions || !formatterFunctions.length) return value if ( numberFormatter.test( - typeof formatterFunctions === 'string' ? formatterFunctions : formatterFunctions.join('') + typeof formatterFunctions === 'string' ? formatterFunctions : formatterFunctions.join(''), ) ) { if ( @@ -128,7 +128,7 @@ export const TextInput = forwardRef( onChange, ...props }: TextInputProps, - ref + ref, ) => { const { translate } = useInternationalization() const [localValue, setLocalValue] = useState('') @@ -140,7 +140,7 @@ export const TextInput = forwardRef( const udpateValue = ( newValue: string | number, - event: ChangeEvent | null + event: ChangeEvent | null, ) => { const formattedValue = formatValue(newValue, beforeChangeFormatter) @@ -174,7 +174,7 @@ export const TextInput = forwardRef( udpateValue(event.currentTarget.value, event) }, // eslint-disable-next-line react-hooks/exhaustive-deps - [onChange, beforeChangeFormatter] + [onChange, beforeChangeFormatter], ) return ( @@ -224,28 +224,28 @@ export const TextInput = forwardRef( ), } : password && !!localValue - ? { - endAdornment: ( - - - ) - } + }, ) const MetadataGrid = styled.div<{ $isHeader?: boolean }>` diff --git a/src/components/invoices/EditInvoiceItemDescriptionDialog.tsx b/src/components/invoices/EditInvoiceItemDescriptionDialog.tsx index 3f3081688..e3cf59a92 100644 --- a/src/components/invoices/EditInvoiceItemDescriptionDialog.tsx +++ b/src/components/invoices/EditInvoiceItemDescriptionDialog.tsx @@ -102,7 +102,7 @@ export const EditInvoiceItemDescriptionDialog = forwardRef ) - } + }, ) EditInvoiceItemDescriptionDialog.displayName = 'forwardRef' diff --git a/src/components/invoices/EditInvoiceItemTaxDialog.tsx b/src/components/invoices/EditInvoiceItemTaxDialog.tsx index 5372b4bd1..e84ab98bf 100644 --- a/src/components/invoices/EditInvoiceItemTaxDialog.tsx +++ b/src/components/invoices/EditInvoiceItemTaxDialog.tsx @@ -74,7 +74,7 @@ export const EditInvoiceItemTaxDialog = forwardRef( taxes: array().of( object().shape({ id: string().required(''), - }) + }), ), }), validateOnMount: true, @@ -167,7 +167,7 @@ export const EditInvoiceItemTaxDialog = forwardRef( formikProps.values?.taxes?.map((t) => t?.id)?.includes(localTaxId) && localTaxId !== tax?.id, } - } + }, ), ]} value={tax?.id || ''} diff --git a/src/components/invoices/EditInvoicePaymentStatusDialog.tsx b/src/components/invoices/EditInvoicePaymentStatusDialog.tsx index 17e616ae3..cc41a887c 100644 --- a/src/components/invoices/EditInvoicePaymentStatusDialog.tsx +++ b/src/components/invoices/EditInvoicePaymentStatusDialog.tsx @@ -134,7 +134,7 @@ export const UpdateInvoicePaymentStatusDialog = forwardRef ) - } + }, ) UpdateInvoicePaymentStatusDialog.displayName = 'forwardRef' diff --git a/src/components/invoices/FinalizeInvoiceDialog.tsx b/src/components/invoices/FinalizeInvoiceDialog.tsx index 23ab761e0..be1871e75 100644 --- a/src/components/invoices/FinalizeInvoiceDialog.tsx +++ b/src/components/invoices/FinalizeInvoiceDialog.tsx @@ -69,7 +69,7 @@ export const FinalizeInvoiceDialog = forwardRef((_, re issuingDate: formatDateToTZ( invoice?.issuingDate, invoice?.customer?.applicableTimezone, - "LLL. dd, yyyy U'T'CZ" + "LLL. dd, yyyy U'T'CZ", ), })} actions={({ closeDialog }) => ( diff --git a/src/components/invoices/InvoiceCreditNotesTable.tsx b/src/components/invoices/InvoiceCreditNotesTable.tsx index 24d1d19d1..d4d7bb5a2 100644 --- a/src/components/invoices/InvoiceCreditNotesTable.tsx +++ b/src/components/invoices/InvoiceCreditNotesTable.tsx @@ -179,7 +179,7 @@ export const InvoiceCreditNotesTable = memo( }${ item?.fee?.trueUpParentFee?.id ? ` - ${translate( - 'text_64463aaa34904c00a23be4f7' + 'text_64463aaa34904c00a23be4f7', )}` : '' }`} @@ -195,10 +195,10 @@ export const InvoiceCreditNotesTable = memo( item.fee.groupName ? ` • ${item.fee.groupName}` : item.fee.group?.key - ? `${` • ${item.fee.group?.key} • `}${ - item.fee.group.value - }` - : '' + ? `${` • ${item.fee.group?.key} • `}${ + item.fee.group.value + }` + : '' }` : `${ item.fee.invoiceName || @@ -207,14 +207,14 @@ export const InvoiceCreditNotesTable = memo( item.fee.groupName ? ` • ${item.fee.groupName}` : item.fee.group?.value - ? ` • ${item.fee.group?.value}` - : '' + ? ` • ${item.fee.group?.value}` + : '' }`} {item?.fee?.trueUpParentFee?.id ? ` - ${translate( - 'text_64463aaa34904c00a23be4f7' + 'text_64463aaa34904c00a23be4f7', )}` : ''} @@ -236,7 +236,7 @@ export const InvoiceCreditNotesTable = memo( { maximumFractionDigits: 2, style: 'percent', - } + }, )}
)) @@ -249,12 +249,12 @@ export const InvoiceCreditNotesTable = memo( {intlFormatNumber( deserializeAmount( item.amountCents, - item.amountCurrency + item.amountCurrency, ) || 0, { currencyDisplay: 'symbol', currency: item.amountCurrency, - } + }, )} @@ -286,12 +286,12 @@ export const InvoiceCreditNotesTable = memo( {intlFormatNumber( deserializeAmount( creditNote?.couponsAdjustmentAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -310,12 +310,12 @@ export const InvoiceCreditNotesTable = memo( {intlFormatNumber( deserializeAmount( creditNote?.subTotalExcludingTaxesAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -336,12 +336,12 @@ export const InvoiceCreditNotesTable = memo( amount: intlFormatNumber( deserializeAmount( appliedTax.baseAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, ), })} @@ -352,12 +352,12 @@ export const InvoiceCreditNotesTable = memo( {intlFormatNumber( deserializeAmount( appliedTax.amountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -396,12 +396,12 @@ export const InvoiceCreditNotesTable = memo( {intlFormatNumber( deserializeAmount( creditNote?.totalAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -413,7 +413,7 @@ export const InvoiceCreditNotesTable = memo( })} ) - } + }, ) InvoiceCreditNotesTable.displayName = 'InvoiceCreditNotesTable' diff --git a/src/components/invoices/InvoiceCustomerInfos.tsx b/src/components/invoices/InvoiceCustomerInfos.tsx index e2eecf1bb..e56a51f2f 100644 --- a/src/components/invoices/InvoiceCustomerInfos.tsx +++ b/src/components/invoices/InvoiceCustomerInfos.tsx @@ -207,7 +207,7 @@ export const InvoiceCustomerInfos = memo(({ invoice }: InvoiceCustomerInfosProps {formatDateToTZ( invoice?.issuingDate, customer?.applicableTimezone, - "LLL. dd, yyyy U'T'CZ" + "LLL. dd, yyyy U'T'CZ", )} @@ -221,7 +221,7 @@ export const InvoiceCustomerInfos = memo(({ invoice }: InvoiceCustomerInfosProps {formatDateToTZ( invoice?.paymentDueDate, customer?.applicableTimezone, - "LLL. dd, yyyy U'T'CZ" + "LLL. dd, yyyy U'T'CZ", )} diff --git a/src/components/invoices/InvoiceDetailsTable.tsx b/src/components/invoices/InvoiceDetailsTable.tsx index 1d9bf1979..1495f8daa 100644 --- a/src/components/invoices/InvoiceDetailsTable.tsx +++ b/src/components/invoices/InvoiceDetailsTable.tsx @@ -160,7 +160,7 @@ export const InvoiceDetailsTable = memo( if ( [InvoiceTypeEnum.AddOn, InvoiceTypeEnum.Credit, InvoiceTypeEnum.OneOff].includes( - invoice.invoiceType + invoice.invoiceType, ) ) { return ( @@ -176,8 +176,8 @@ export const InvoiceDetailsTable = memo( {invoice.invoiceType === InvoiceTypeEnum.AddOn ? translate('text_6388baa2e514213fed583611', { name: fee.itemName }) : invoice.invoiceType === InvoiceTypeEnum.OneOff - ? fee.invoiceDisplayName || fee.itemName - : translate('text_637ccf8133d2c9a7d11ce6e1')} + ? fee.invoiceDisplayName || fee.itemName + : translate('text_637ccf8133d2c9a7d11ce6e1')} @@ -223,7 +223,7 @@ export const InvoiceDetailsTable = memo( } const formattedInvoiceItemsMap = formatInvoiceItemsMap( - invoice?.invoiceSubscriptions as InvoiceSubscription[] + invoice?.invoiceSubscriptions as InvoiceSubscription[], ) return ( @@ -238,10 +238,10 @@ export const InvoiceDetailsTable = memo( feesInArrears, feesInAdvance, }, - i + i, ) => { const hasAnySubscriptionFeeUnits = subscriptionFees?.some( - (fee) => Number(fee.units) > 0 + (fee) => Number(fee.units) > 0, ) const hasAnyArrearsFeeUnits = feesInArrears?.some((fee) => Number(fee.units) > 0) const hasAnyAdvanceFeeUnits = feesInAdvance?.some((fee) => Number(fee.units) > 0) @@ -261,57 +261,57 @@ export const InvoiceDetailsTable = memo( from: formatDateToTZ( invoiceSubscription?.fromDatetime, customer?.applicableTimezone, - 'LLL. dd, yyyy' + 'LLL. dd, yyyy', ), to: formatDateToTZ( invoiceSubscription?.toDatetime, customer?.applicableTimezone, - 'LLL. dd, yyyy' + 'LLL. dd, yyyy', ), }) : !hasAnySubscriptionFeeUnits && - hasAnyArrearsFeeUnits && - feesInArrears.some((r) => r.units === 0) && - !hasAnyAdvanceFeeUnits - ? invoiceSubscription?.chargesFromDatetime && - invoiceSubscription?.chargesToDatetime - ? translate('text_6499a4e4db5730004703f36b', { - from: formatDateToTZ( - invoiceSubscription?.chargesFromDatetime, - customer?.applicableTimezone, - 'LLL. dd, yyyy' - ), - to: formatDateToTZ( - invoiceSubscription?.chargesToDatetime, - customer?.applicableTimezone, - 'LLL. dd, yyyy' - ), - }) - : translate('text_6499a6209ae0d900826053a7', { - date: formatDateToTZ( - invoice.issuingDate, - customer?.applicableTimezone, - 'LLL. dd, yyyy' - ), - }) - : !hasAnySubscriptionFeeUnits && - !hasAnyArrearsFeeUnits && - !hasAnyAdvanceFeeUnits && - !!invoiceSubscription?.fromDatetime && - !!invoiceSubscription?.toDatetime - ? translate('text_6499a4e4db5730004703f36b', { - from: formatDateToTZ( - invoiceSubscription?.fromDatetime, - customer?.applicableTimezone, - 'LLL. dd, yyyy' - ), - to: formatDateToTZ( - invoiceSubscription?.toDatetime, - customer?.applicableTimezone, - 'LLL. dd, yyyy' - ), - }) - : undefined + hasAnyArrearsFeeUnits && + feesInArrears.some((r) => r.units === 0) && + !hasAnyAdvanceFeeUnits + ? invoiceSubscription?.chargesFromDatetime && + invoiceSubscription?.chargesToDatetime + ? translate('text_6499a4e4db5730004703f36b', { + from: formatDateToTZ( + invoiceSubscription?.chargesFromDatetime, + customer?.applicableTimezone, + 'LLL. dd, yyyy', + ), + to: formatDateToTZ( + invoiceSubscription?.chargesToDatetime, + customer?.applicableTimezone, + 'LLL. dd, yyyy', + ), + }) + : translate('text_6499a6209ae0d900826053a7', { + date: formatDateToTZ( + invoice.issuingDate, + customer?.applicableTimezone, + 'LLL. dd, yyyy', + ), + }) + : !hasAnySubscriptionFeeUnits && + !hasAnyArrearsFeeUnits && + !hasAnyAdvanceFeeUnits && + !!invoiceSubscription?.fromDatetime && + !!invoiceSubscription?.toDatetime + ? translate('text_6499a4e4db5730004703f36b', { + from: formatDateToTZ( + invoiceSubscription?.fromDatetime, + customer?.applicableTimezone, + 'LLL. dd, yyyy', + ), + to: formatDateToTZ( + invoiceSubscription?.toDatetime, + customer?.applicableTimezone, + 'LLL. dd, yyyy', + ), + }) + : undefined } /> @@ -321,7 +321,7 @@ export const InvoiceDetailsTable = memo( !hasAnyArrearsFeeUnits && // Same condition as bellow to show/hide fees in advance !feesInAdvance?.some( - (fee) => !(Number(fee?.units) === 0 && !!fee?.isGroupChildFee) + (fee) => !(Number(fee?.units) === 0 && !!fee?.isGroupChildFee), ) && ( @@ -408,19 +408,19 @@ export const InvoiceDetailsTable = memo( from: formatDateToTZ( invoiceSubscription?.chargesFromDatetime, customer?.applicableTimezone, - 'LLL. dd, yyyy' + 'LLL. dd, yyyy', ), to: formatDateToTZ( invoiceSubscription?.chargesToDatetime, customer?.applicableTimezone, - 'LLL. dd, yyyy' + 'LLL. dd, yyyy', ), }) : translate('text_6499a6209ae0d900826053a7', { date: formatDateToTZ( invoice.issuingDate, customer?.applicableTimezone, - 'LLL. dd, yyyy' + 'LLL. dd, yyyy', ), })} @@ -472,19 +472,19 @@ export const InvoiceDetailsTable = memo( from: formatDateToTZ( invoiceSubscription?.inAdvanceChargesFromDatetime, customer?.applicableTimezone, - 'LLL. dd, yyyy' + 'LLL. dd, yyyy', ), to: formatDateToTZ( invoiceSubscription?.inAdvanceChargesToDatetime, customer?.applicableTimezone, - 'LLL. dd, yyyy' + 'LLL. dd, yyyy', ), }) : translate('text_6499a6209ae0d900826053a7', { date: formatDateToTZ( invoice.issuingDate, customer?.applicableTimezone, - 'LLL. dd, yyyy' + 'LLL. dd, yyyy', ), })} @@ -504,14 +504,14 @@ export const InvoiceDetailsTable = memo( })} ) - } + }, )}
) - } + }, ) InvoiceDetailsTable.displayName = 'InvoiceDetailsTable' diff --git a/src/components/invoices/InvoiceDetailsTableFeeItem.tsx b/src/components/invoices/InvoiceDetailsTableFeeItem.tsx index 93bbb98f5..7b21b8371 100644 --- a/src/components/invoices/InvoiceDetailsTableFeeItem.tsx +++ b/src/components/invoices/InvoiceDetailsTableFeeItem.tsx @@ -164,7 +164,7 @@ export const InvoiceDetailsTableFeeItem = memo( { currencyDisplay: 'symbol', currency: customer?.currency || CurrencyEnum.Usd, - } + }, )} } @@ -173,7 +173,7 @@ export const InvoiceDetailsTableFeeItem = memo( ) - } + }, ) InvoiceDetailsTableFeeItem.displayName = 'InvoiceDetailsTableFeeItem' diff --git a/src/components/invoices/InvoiceDetailsTableFooter.tsx b/src/components/invoices/InvoiceDetailsTableFooter.tsx index 239832782..655cbed2b 100644 --- a/src/components/invoices/InvoiceDetailsTableFooter.tsx +++ b/src/components/invoices/InvoiceDetailsTableFooter.tsx @@ -78,7 +78,7 @@ export const InvoiceDetailsTableFooter = memo( { currencyDisplay: 'symbol', currency, - } + }, )} @@ -100,12 +100,12 @@ export const InvoiceDetailsTableFooter = memo( {intlFormatNumber( deserializeAmount( invoice?.subTotalExcludingTaxesAmountCents || 0, - currency + currency, ), { currencyDisplay: 'symbol', currency, - } + }, )} @@ -132,7 +132,7 @@ export const InvoiceDetailsTableFooter = memo( { currencyDisplay: 'symbol', currency, - } + }, ), })} @@ -148,7 +148,7 @@ export const InvoiceDetailsTableFooter = memo( { currencyDisplay: 'symbol', currency, - } + }, )} @@ -189,12 +189,12 @@ export const InvoiceDetailsTableFooter = memo( {intlFormatNumber( deserializeAmount( invoice?.subTotalIncludingTaxesAmountCents || 0, - currency + currency, ), { currencyDisplay: 'symbol', currency, - } + }, )} @@ -217,7 +217,7 @@ export const InvoiceDetailsTableFooter = memo( { currencyDisplay: 'symbol', currency, - } + }, )} @@ -241,7 +241,7 @@ export const InvoiceDetailsTableFooter = memo( { currencyDisplay: 'symbol', currency, - } + }, )} @@ -264,7 +264,7 @@ export const InvoiceDetailsTableFooter = memo( { currencyDisplay: 'symbol', currency, - } + }, )} @@ -304,7 +304,7 @@ export const InvoiceDetailsTableFooter = memo( )} ) - } + }, ) const RightSkeleton = styled(Skeleton)` diff --git a/src/components/invoices/InvoiceDetailsTableHeader.tsx b/src/components/invoices/InvoiceDetailsTableHeader.tsx index d5206f231..50f3341d6 100644 --- a/src/components/invoices/InvoiceDetailsTableHeader.tsx +++ b/src/components/invoices/InvoiceDetailsTableHeader.tsx @@ -45,7 +45,7 @@ export const InvoiceDetailsTableHeader = memo( ) - } + }, ) InvoiceDetailsTableHeader.displayName = 'InvoiceDetailsTableHeader' diff --git a/src/components/invoices/InvoiceListItem.tsx b/src/components/invoices/InvoiceListItem.tsx index 1bfad898f..22756e624 100644 --- a/src/components/invoices/InvoiceListItem.tsx +++ b/src/components/invoices/InvoiceListItem.tsx @@ -92,7 +92,7 @@ interface InvoiceListItemProps { const mapStatusConfig = ( status: InvoiceStatusTypeEnum, - paymentStatus: InvoicePaymentStatusTypeEnum + paymentStatus: InvoicePaymentStatusTypeEnum, ) => { if (status === InvoiceStatusTypeEnum.Draft) { return { label: 'text_63ac8850ff7117ad55777d31', type: StatusEnum.draft } @@ -246,7 +246,7 @@ export const InvoiceListItem = ({ )} {status === InvoiceStatusTypeEnum.Finalized && [InvoicePaymentStatusTypeEnum.Failed, InvoicePaymentStatusTypeEnum.Pending].includes( - paymentStatus + paymentStatus, ) && ( diff --git a/src/components/plans/ChargeAccordion.tsx b/src/components/plans/ChargeAccordion.tsx index d6617ca9b..4ecbed5ba 100644 --- a/src/components/plans/ChargeAccordion.tsx +++ b/src/components/plans/ChargeAccordion.tsx @@ -193,7 +193,7 @@ export const ChargeAccordion = memo( localCharge?.groupProperties?.map((g) => g.groupId) || [] const [showSpendingMinimum, setShowSpendingMinimum] = useState( - !!initialLocalCharge?.minAmountCents && Number(initialLocalCharge?.minAmountCents) > 0 + !!initialLocalCharge?.minAmountCents && Number(initialLocalCharge?.minAmountCents) > 0, ) const [showAddGroup, setShowAddGroup] = useState(false) const [shouldDisplayTaxesInput, setShouldDisplayTaxesInput] = useState(false) @@ -204,7 +204,7 @@ export const ChargeAccordion = memo( useEffect(() => { setShowSpendingMinimum( - !!initialLocalCharge?.minAmountCents && Number(initialLocalCharge?.minAmountCents) > 0 + !!initialLocalCharge?.minAmountCents && Number(initialLocalCharge?.minAmountCents) > 0, ) }, [initialLocalCharge?.minAmountCents]) @@ -269,7 +269,7 @@ export const ChargeAccordion = memo( localCharge.payInAdvance, localCharge.chargeModel, premiumWarningDialogRef, - ] + ], ) const taxValueForBadgeDisplay = useMemo((): string | undefined => { @@ -379,7 +379,7 @@ export const ChargeAccordion = memo( callback: (invoiceDisplayName: string) => { formikProps.setFieldValue( `charges.${index}.invoiceDisplayName`, - invoiceDisplayName + invoiceDisplayName, ) }, }) @@ -420,8 +420,8 @@ export const ChargeAccordion = memo( formikProps.values.interval, (formikProps.values.interval === PlanInterval.Yearly && !!formikProps.values.billChargesMonthly) || - false - ) + false, + ), )} /> {!isInSubscriptionForm && ( @@ -532,14 +532,14 @@ export const ChargeAccordion = memo( localCharge.chargeModel === ChargeModelEnum.Percentage ? 'text_62ff5d01a306e274d4ffcc06' : localCharge.chargeModel === ChargeModelEnum.Graduated - ? 'text_62793bbb599f1c01522e91a1' - : localCharge.chargeModel === ChargeModelEnum.GraduatedPercentage - ? 'text_64de472463e2da6b31737db8' - : localCharge.chargeModel === ChargeModelEnum.Package - ? 'text_6282085b4f283b010265586c' - : localCharge.chargeModel === ChargeModelEnum.Volume - ? 'text_6304e74aab6dbc18d615f38a' - : 'text_624d9adba93343010cd14ca7' + ? 'text_62793bbb599f1c01522e91a1' + : localCharge.chargeModel === ChargeModelEnum.GraduatedPercentage + ? 'text_64de472463e2da6b31737db8' + : localCharge.chargeModel === ChargeModelEnum.Package + ? 'text_6282085b4f283b010265586c' + : localCharge.chargeModel === ChargeModelEnum.Volume + ? 'text_6304e74aab6dbc18d615f38a' + : 'text_624d9adba93343010cd14ca7', )} onChange={(value) => handleUpdate('chargeModel', value)} /> @@ -623,7 +623,7 @@ export const ChargeAccordion = memo( {/* Group properties */} {localCharge?.groupProperties?.map((group, groupPropertyIndex) => { const associatedFlagGroup = localCharge?.billableMetric?.flatGroups?.find( - (flatGroup) => flatGroup.id === group.groupId + (flatGroup) => flatGroup.id === group.groupId, ) const groupKey = associatedFlagGroup?.key @@ -672,7 +672,7 @@ export const ChargeAccordion = memo( callback: (invoiceDisplayName: string) => { formikProps.setFieldValue( `charges.${index}.groupProperties.${groupPropertyIndex}.invoiceDisplayName`, - invoiceDisplayName + invoiceDisplayName, ) }, }) @@ -800,7 +800,7 @@ export const ChargeAccordion = memo( setTimeout(() => { ;( document.querySelector( - `.${SEARCH_CHARGE_GROUP_INPUT_CLASSNAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}` + `.${SEARCH_CHARGE_GROUP_INPUT_CLASSNAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}`, ) as HTMLElement )?.click() }, 0) @@ -983,7 +983,7 @@ export const ChargeAccordion = memo( onChange={(newTaxId) => { const previousTaxes = [...(localCharge?.taxes || [])] const newTaxObject = taxesData?.taxes.collection.find( - (t) => t.id === newTaxId + (t) => t.id === newTaxId, ) as TaxForPlanChargeAccordionFragment handleUpdate('taxes', [...previousTaxes, newTaxObject]) @@ -1035,7 +1035,7 @@ export const ChargeAccordion = memo( setTimeout(() => { const element = document.querySelector( - `.${SEARCH_TAX_INPUT_FOR_CHARGE_CLASSNAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}` + `.${SEARCH_TAX_INPUT_FOR_CHARGE_CLASSNAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}`, ) as HTMLElement if (!element) return @@ -1054,7 +1054,7 @@ export const ChargeAccordion = memo( ) - } + }, ) ChargeAccordion.displayName = 'ChargeAccordion' diff --git a/src/components/plans/ChargeOptionsAccordion.tsx b/src/components/plans/ChargeOptionsAccordion.tsx index 6d859d52a..04720f40d 100644 --- a/src/components/plans/ChargeOptionsAccordion.tsx +++ b/src/components/plans/ChargeOptionsAccordion.tsx @@ -95,7 +95,7 @@ export const ChargeOptionsAccordion = ({ @@ -141,7 +141,7 @@ export const AddAdyenDialog = forwardRef( ) - } + }, ) const Content = styled.div` diff --git a/src/components/settings/integrations/AddEditDeleteSuccessRedirectUrlDialog.tsx b/src/components/settings/integrations/AddEditDeleteSuccessRedirectUrlDialog.tsx index 7eb350bf7..9677413dc 100644 --- a/src/components/settings/integrations/AddEditDeleteSuccessRedirectUrlDialog.tsx +++ b/src/components/settings/integrations/AddEditDeleteSuccessRedirectUrlDialog.tsx @@ -96,8 +96,8 @@ export const AddEditDeleteSuccessRedirectUrlDialog = localData?.mode === AddEditDeleteSuccessRedirectUrlDialogMode.Delete ? 'text_65367cb78324b77fcb6af2c1' : localData?.mode === AddEditDeleteSuccessRedirectUrlDialogMode.Add - ? 'text_65367cb78324b77fcb6af261' - : 'text_65367cb78324b77fcb6af28f' + ? 'text_65367cb78324b77fcb6af261' + : 'text_65367cb78324b77fcb6af28f', ) const [updateAdyenProvider] = useUpdateAdyenPaymentProviderMutation({ onCompleted(data) { @@ -242,8 +242,8 @@ export const AddEditDeleteSuccessRedirectUrlDialog = localData?.mode === AddEditDeleteSuccessRedirectUrlDialogMode.Delete ? 'text_65367cb78324b77fcb6af200' : localData?.mode === AddEditDeleteSuccessRedirectUrlDialogMode.Edit - ? 'text_65367cb78324b77fcb6af216' - : 'text_65367cb78324b77fcb6af1b4' + ? 'text_65367cb78324b77fcb6af216' + : 'text_65367cb78324b77fcb6af1b4', )} description={translate( localData?.mode === AddEditDeleteSuccessRedirectUrlDialogMode.Delete @@ -251,7 +251,7 @@ export const AddEditDeleteSuccessRedirectUrlDialog = : 'text_65367cb78324b77fcb6af224', { connectionName: localData?.type, - } + }, )} onClose={() => { setLocalData(undefined) @@ -277,8 +277,8 @@ export const AddEditDeleteSuccessRedirectUrlDialog = localData?.mode === AddEditDeleteSuccessRedirectUrlDialogMode.Delete ? 'text_65367cb78324b77fcb6af255' : localData?.mode === AddEditDeleteSuccessRedirectUrlDialogMode.Edit - ? 'text_65367cb78324b77fcb6af249' - : 'text_65367cb78324b77fcb6af1ec' + ? 'text_65367cb78324b77fcb6af249' + : 'text_65367cb78324b77fcb6af1ec', )} diff --git a/src/components/settings/integrations/AddStripeDialog.tsx b/src/components/settings/integrations/AddStripeDialog.tsx index 8f0973eec..8678ca588 100644 --- a/src/components/settings/integrations/AddStripeDialog.tsx +++ b/src/components/settings/integrations/AddStripeDialog.tsx @@ -42,7 +42,7 @@ export const AddStripeDialog = forwardRef( setStripeApiKey('') addToast({ message: translate( - isEdition ? 'text_62b1edddbf5f461ab97126f6' : 'text_62b1edddbf5f461ab9712743' + isEdition ? 'text_62b1edddbf5f461ab97126f6' : 'text_62b1edddbf5f461ab9712743', ), severity: 'success', }) @@ -54,10 +54,10 @@ export const AddStripeDialog = forwardRef( { setStripeApiKey('') @@ -86,7 +86,7 @@ export const AddStripeDialog = forwardRef( }} > {translate( - isEdition ? 'text_62b1edddbf5f461ab9712769' : 'text_62b1edddbf5f461ab9712773' + isEdition ? 'text_62b1edddbf5f461ab9712769' : 'text_62b1edddbf5f461ab9712773', )} @@ -96,7 +96,7 @@ export const AddStripeDialog = forwardRef( ( ) - } + }, ) const Content = styled.div` diff --git a/src/components/settings/members/InviteItem.tsx b/src/components/settings/members/InviteItem.tsx index e58ce53c2..eaa4c46c9 100644 --- a/src/components/settings/members/InviteItem.tsx +++ b/src/components/settings/members/InviteItem.tsx @@ -52,7 +52,7 @@ export const InviteItem = forwardRef( copyToClipboard( `${window.location.origin}${generatePath(INVITATION_ROUTE, { token, - })}` + })}`, ) addToast({ severity: 'info', @@ -78,7 +78,7 @@ export const InviteItem = forwardRef( ) - } + }, ) InviteItem.displayName = 'InviteItem' diff --git a/src/components/settings/members/MembershipItem.tsx b/src/components/settings/members/MembershipItem.tsx index a3d2d1e1b..8347e9b88 100644 --- a/src/components/settings/members/MembershipItem.tsx +++ b/src/components/settings/members/MembershipItem.tsx @@ -59,7 +59,7 @@ export const MembershipItem = forwardRef ) - } + }, ) MembershipItem.displayName = 'MembershipItem' diff --git a/src/components/taxes/DeleteTaxDialog.tsx b/src/components/taxes/DeleteTaxDialog.tsx index d88dddb10..3d41a503a 100644 --- a/src/components/taxes/DeleteTaxDialog.tsx +++ b/src/components/taxes/DeleteTaxDialog.tsx @@ -72,7 +72,7 @@ export const DeleteTaxDialog = forwardRef((_, ref) => { ? translate( 'text_645bb193927b375079d28b0c', { count: tax?.customersCount }, - tax?.customersCount + tax?.customersCount, ) : translate('text_645cb766cca2dd00e2956271')} diff --git a/src/components/taxes/TaxCodeSnippet.tsx b/src/components/taxes/TaxCodeSnippet.tsx index de13325a2..cbb1d79e5 100644 --- a/src/components/taxes/TaxCodeSnippet.tsx +++ b/src/components/taxes/TaxCodeSnippet.tsx @@ -18,11 +18,11 @@ curl --location --request ${isEdition ? 'PUT' : 'POST'} "${apiUrl}/api/v1/taxes$ "taxes": { "name": "${tax.name || '__NAME_OF_TAX__'}", "code": "${tax.code || '__CODE_OF_TAX__'}",${ - !!tax.description - ? ` + !!tax.description + ? ` "description": "${tax.description}",` - : '' - } + : '' + } "rate": "${tax.rate || '_VALUE_OF_TAX__'}", } }' diff --git a/src/components/wallets/AddWalletToCustomerDialog.tsx b/src/components/wallets/AddWalletToCustomerDialog.tsx index ab5d54e79..103baaaf0 100644 --- a/src/components/wallets/AddWalletToCustomerDialog.tsx +++ b/src/components/wallets/AddWalletToCustomerDialog.tsx @@ -60,7 +60,7 @@ export const AddWalletToCustomerDialog = forwardRef @@ -246,7 +246,7 @@ export const AddWalletToCustomerDialog = forwardRef @@ -317,7 +317,7 @@ export const AddWalletToCustomerDialog = forwardRef ) - } + }, ) const Content = styled.div` diff --git a/src/components/wallets/TopupWalletDialog.tsx b/src/components/wallets/TopupWalletDialog.tsx index eb47937d0..2d26af9ff 100644 --- a/src/components/wallets/TopupWalletDialog.tsx +++ b/src/components/wallets/TopupWalletDialog.tsx @@ -115,7 +115,7 @@ export const TopupWalletDialog = forwardRef( 'text_62e79671d23ae6ff149de96c', undefined, Number(formikProps.values.paidCredits || 0) + - Number(formikProps.values.grantedCredits || 0) + Number(formikProps.values.grantedCredits || 0), )} @@ -156,7 +156,7 @@ export const TopupWalletDialog = forwardRef( { currencyDisplay: 'symbol', currency: wallet.currency, - } + }, ), })} InputProps={{ @@ -183,7 +183,7 @@ export const TopupWalletDialog = forwardRef( { currencyDisplay: 'symbol', currency: wallet.currency, - } + }, ), })} InputProps={{ @@ -201,7 +201,7 @@ export const TopupWalletDialog = forwardRef( totalCreditCount: Math.round( Number(formikProps.values.paidCredits || 0) * 100 + - Number(formikProps.values.grantedCredits || 0) * 100 + Number(formikProps.values.grantedCredits || 0) * 100, ) / 100, })} @@ -209,7 +209,7 @@ export const TopupWalletDialog = forwardRef( ) - } + }, ) const Content = styled.div` diff --git a/src/components/wallets/UpdateCustomerWalletDialog.tsx b/src/components/wallets/UpdateCustomerWalletDialog.tsx index dc5dd4a58..e775a434f 100644 --- a/src/components/wallets/UpdateCustomerWalletDialog.tsx +++ b/src/components/wallets/UpdateCustomerWalletDialog.tsx @@ -66,7 +66,7 @@ export const UpdateCustomerWalletDialog = forwardRef { @@ -127,7 +127,7 @@ export const UpdateCustomerWalletDialog = forwardRef ) - } + }, ) const Content = styled.div` diff --git a/src/components/wallets/WalletAccordion.tsx b/src/components/wallets/WalletAccordion.tsx index c3dd0c15f..599f16b8c 100644 --- a/src/components/wallets/WalletAccordion.tsx +++ b/src/components/wallets/WalletAccordion.tsx @@ -158,7 +158,7 @@ export const WalletAccordion = forwardRef @@ -204,7 +204,7 @@ export const WalletAccordion = forwardRef @@ -258,7 +258,7 @@ export const WalletAccordion = forwardRef ) - } + }, ) export const WalletAccordionSkeleton = () => { diff --git a/src/components/wallets/WalletTransactionList.tsx b/src/components/wallets/WalletTransactionList.tsx index 380a655a4..8f2e82115 100644 --- a/src/components/wallets/WalletTransactionList.tsx +++ b/src/components/wallets/WalletTransactionList.tsx @@ -151,12 +151,12 @@ export const WalletTransactionList = forwardRef @@ -183,7 +183,7 @@ export const WalletTransactionList = forwardRef @@ -218,7 +218,7 @@ export const WalletTransactionList = forwardRef ) - } + }, ) const TransactionListHeader = styled.div` diff --git a/src/core/apolloClient/__tests__/errorUtils.test.ts b/src/core/apolloClient/__tests__/errorUtils.test.ts index 026e0fbee..9f5ab2835 100644 --- a/src/core/apolloClient/__tests__/errorUtils.test.ts +++ b/src/core/apolloClient/__tests__/errorUtils.test.ts @@ -22,10 +22,10 @@ const createApolloError: (details: Record) => ApolloE }, }, ], - } as unknown as ApolloError) + }) as unknown as ApolloError const createGraphQLError: (details: Record) => GraphQLError[] = ( - details + details, ) => [ { diff --git a/src/core/apolloClient/cacheUtils.ts b/src/core/apolloClient/cacheUtils.ts index 4bbeb2620..2858ae029 100644 --- a/src/core/apolloClient/cacheUtils.ts +++ b/src/core/apolloClient/cacheUtils.ts @@ -67,7 +67,7 @@ export const onLogIn = (token: string, user: CurrentUserFragment) => { export const switchCurrentOrganization = async ( client: ApolloClient, - organizationId: string + organizationId: string, ) => { setItemFromLS(ORGANIZATION_LS_KEY_ID, organizationId) diff --git a/src/core/apolloClient/errorUtils.ts b/src/core/apolloClient/errorUtils.ts index 437dad5c5..10db15ec7 100644 --- a/src/core/apolloClient/errorUtils.ts +++ b/src/core/apolloClient/errorUtils.ts @@ -14,7 +14,7 @@ export interface LagoGQLError extends GraphQLError { export const hasDefinedGQLError = ( errorCode: keyof typeof LagoApiError, errorObject?: ApolloError | readonly GraphQLError[], - key?: string + key?: string, ) => { if (!errorObject) return false diff --git a/src/core/apolloClient/init.ts b/src/core/apolloClient/init.ts index 9f3bc0f89..53df4e4be 100644 --- a/src/core/apolloClient/init.ts +++ b/src/core/apolloClient/init.ts @@ -83,8 +83,8 @@ export const initializeApolloClient = async () => { // eslint-disable-next-line no-console console.warn( `[GraphQL error]: Message: ${message}, Path: ${path}, Location: ${JSON.stringify( - locations - )}` + locations, + )}`, ) }) } diff --git a/src/core/apolloClient/reactiveVars/duplicatePlanVar.ts b/src/core/apolloClient/reactiveVars/duplicatePlanVar.ts index 04fe730b4..37ad1cb5c 100644 --- a/src/core/apolloClient/reactiveVars/duplicatePlanVar.ts +++ b/src/core/apolloClient/reactiveVars/duplicatePlanVar.ts @@ -31,7 +31,7 @@ const initial = { } export const duplicatePlanVar = makeVar( - getItemFromLS(DUPLICATE_PLAN_LS_KEY) || initial + getItemFromLS(DUPLICATE_PLAN_LS_KEY) || initial, ) export const updateDuplicatePlanVar = (input: DuplicatePlanVar) => { diff --git a/src/core/formats/__tests__/intlFormatNumber.test.ts b/src/core/formats/__tests__/intlFormatNumber.test.ts index 4f794378d..15d1ec1d6 100644 --- a/src/core/formats/__tests__/intlFormatNumber.test.ts +++ b/src/core/formats/__tests__/intlFormatNumber.test.ts @@ -105,49 +105,49 @@ describe('Currency tools', () => { expect(bigNumberShortenNotationFormater(1_111, { currency: CurrencyEnum.Eur })).toBe('€1.1k') expect(bigNumberShortenNotationFormater(10_000, { currency: CurrencyEnum.Eur })).toBe('€10k') expect(bigNumberShortenNotationFormater(100_000, { currency: CurrencyEnum.Eur })).toBe( - '€100k' + '€100k', ) expect(bigNumberShortenNotationFormater(1_000_000, { currency: CurrencyEnum.Eur })).toBe( - '€1M' + '€1M', ) expect(bigNumberShortenNotationFormater(10_000_000, { currency: CurrencyEnum.Eur })).toBe( - '€10M' + '€10M', ) expect(bigNumberShortenNotationFormater(100_000_000, { currency: CurrencyEnum.Eur })).toBe( - '€100M' + '€100M', ) expect(bigNumberShortenNotationFormater(1_000_000_000, { currency: CurrencyEnum.Eur })).toBe( - '€1B' + '€1B', ) expect(bigNumberShortenNotationFormater(10_000_000_000, { currency: CurrencyEnum.Eur })).toBe( - '€10B' + '€10B', ) expect( - bigNumberShortenNotationFormater(100_000_000_000, { currency: CurrencyEnum.Eur }) + bigNumberShortenNotationFormater(100_000_000_000, { currency: CurrencyEnum.Eur }), ).toBe('€100B') expect( - bigNumberShortenNotationFormater(1_000_000_000_000, { currency: CurrencyEnum.Eur }) + bigNumberShortenNotationFormater(1_000_000_000_000, { currency: CurrencyEnum.Eur }), ).toBe('€1T') expect( - bigNumberShortenNotationFormater(10_000_000_000_000, { currency: CurrencyEnum.Eur }) + bigNumberShortenNotationFormater(10_000_000_000_000, { currency: CurrencyEnum.Eur }), ).toBe('€10T') expect( - bigNumberShortenNotationFormater(100_000_000_000_000, { currency: CurrencyEnum.Eur }) + bigNumberShortenNotationFormater(100_000_000_000_000, { currency: CurrencyEnum.Eur }), ).toBe('€100T') expect( - bigNumberShortenNotationFormater(1_000_000_000_000_000, { currency: CurrencyEnum.Eur }) + bigNumberShortenNotationFormater(1_000_000_000_000_000, { currency: CurrencyEnum.Eur }), ).toBe('€1Q') expect( bigNumberShortenNotationFormater( deserializeAmount(100_000_000_000_000_000, CurrencyEnum.Eur), - { currency: CurrencyEnum.Eur } - ) + { currency: CurrencyEnum.Eur }, + ), ).toBe('€1Q') expect( - bigNumberShortenNotationFormater(10_000_000_000_000_000, { currency: CurrencyEnum.Eur }) + bigNumberShortenNotationFormater(10_000_000_000_000_000, { currency: CurrencyEnum.Eur }), ).toBe('€10Q') expect( - bigNumberShortenNotationFormater(100_000_000_000_000_000, { currency: CurrencyEnum.Eur }) + bigNumberShortenNotationFormater(100_000_000_000_000_000, { currency: CurrencyEnum.Eur }), ).toBe('€100Q') expect(bigNumberShortenNotationFormater(100_000_000_000_000_000)).toBe('$100Q') }) diff --git a/src/core/formats/formatCreditNotesItems.ts b/src/core/formats/formatCreditNotesItems.ts index 8291bce0a..e64158d63 100644 --- a/src/core/formats/formatCreditNotesItems.ts +++ b/src/core/formats/formatCreditNotesItems.ts @@ -7,7 +7,7 @@ const formatCreditNotesItems = (items: CreditNoteItem[] | null | undefined) => { _.chain(items) .groupBy((item) => item?.fee?.subscription?.id) .map((item) => Object.values(_.groupBy(item, (element) => element?.fee?.charge?.id))) - .value() + .value(), ) } diff --git a/src/core/formats/formatInvoiceItemsMap.ts b/src/core/formats/formatInvoiceItemsMap.ts index 1c746a5f7..1d2ab91af 100644 --- a/src/core/formats/formatInvoiceItemsMap.ts +++ b/src/core/formats/formatInvoiceItemsMap.ts @@ -65,12 +65,12 @@ const formatInvoiceItemsMap = (data: InvoiceSubscription[]) => { // Format fees if (formattedData?.feesInArrears?.length) { formattedData.feesInArrears = _deepFormatFees( - formattedData.feesInArrears as unknown as BaseFormattedInvoiceSubscription['feesInArrears'] + formattedData.feesInArrears as unknown as BaseFormattedInvoiceSubscription['feesInArrears'], ) } if (formattedData?.feesInAdvance?.length) { formattedData.feesInAdvance = _deepFormatFees( - formattedData.feesInAdvance as unknown as BaseFormattedInvoiceSubscription['feesInAdvance'] + formattedData.feesInAdvance as unknown as BaseFormattedInvoiceSubscription['feesInAdvance'], ) } return formattedData @@ -80,7 +80,7 @@ const formatInvoiceItemsMap = (data: InvoiceSubscription[]) => { const _deepFormatFees = ( feesToFormat: | BaseFormattedInvoiceSubscription['feesInArrears'] - | BaseFormattedInvoiceSubscription['feesInAdvance'] + | BaseFormattedInvoiceSubscription['feesInAdvance'], ) => { return Object.values(_groupBy(feesToFormat, (fee) => fee?.charge?.id)) .map((fees) => { diff --git a/src/core/formats/intlFormatNumber.ts b/src/core/formats/intlFormatNumber.ts index f209f7ec1..973858d40 100644 --- a/src/core/formats/intlFormatNumber.ts +++ b/src/core/formats/intlFormatNumber.ts @@ -21,7 +21,7 @@ type FormatterOptions = { export const intlFormatNumber: (amount: number, options?: FormatterOptions) => string = ( amount, - options + options, ) => { let formattedToUnit = amount @@ -53,7 +53,7 @@ export const getCurrencySymbol = (currencyCode: CurrencyEnum) => { // Current limitation: does not add the space between amount and currency symbol if the locale notation has one export const bigNumberShortenNotationFormater = ( amount: number, - options?: Omit + options?: Omit, ) => { const { style = AmountStyle.currency, diff --git a/src/core/router/AuthRoutes.tsx b/src/core/router/AuthRoutes.tsx index 997f796e6..400cf211d 100644 --- a/src/core/router/AuthRoutes.tsx +++ b/src/core/router/AuthRoutes.tsx @@ -9,15 +9,15 @@ const { disableSignUp } = envGlobalVar() const Login = lazyLoad(() => import(/* webpackChunkName: 'login' */ '~/pages/auth/Login')) const SignUp = lazyLoad(() => import(/* webpackChunkName: 'sign-up' */ '~/pages/auth/SignUp')) const ForgotPassword = lazyLoad( - () => import(/* webpackChunkName: 'forgot-password' */ '~/pages/auth/ForgotPassword') + () => import(/* webpackChunkName: 'forgot-password' */ '~/pages/auth/ForgotPassword'), ) const ResetPassword = lazyLoad( - () => import(/* webpackChunkName: 'reset-password' */ '~/pages/auth/ResetPassword') + () => import(/* webpackChunkName: 'reset-password' */ '~/pages/auth/ResetPassword'), ) const Invitation = lazyLoad(() => import(/* webpackChunkName: 'invitation' */ '~/pages/Invitation')) const InvitationInit = lazyLoad( - () => import(/* webpackChunkName: 'invitation-init' */ '~/pages/InvitationInit') + () => import(/* webpackChunkName: 'invitation-init' */ '~/pages/InvitationInit'), ) // ----------- Routes ----------- diff --git a/src/core/router/CustomerPortalRoutes.tsx b/src/core/router/CustomerPortalRoutes.tsx index bec6a9a99..426964248 100644 --- a/src/core/router/CustomerPortalRoutes.tsx +++ b/src/core/router/CustomerPortalRoutes.tsx @@ -3,7 +3,7 @@ import { lazyLoad } from './utils' // ----------- Pages ----------- const PortalInit = lazyLoad( - () => import(/* webpackChunkName: 'customer-portal-init' */ '~/pages/auth/PortalInit') + () => import(/* webpackChunkName: 'customer-portal-init' */ '~/pages/auth/PortalInit'), ) // ----------- Routes ----------- diff --git a/src/core/router/CustomerRoutes.tsx b/src/core/router/CustomerRoutes.tsx index 1dc42aaf0..0d8d6c231 100644 --- a/src/core/router/CustomerRoutes.tsx +++ b/src/core/router/CustomerRoutes.tsx @@ -3,28 +3,28 @@ import { lazyLoad } from './utils' // ----------- Pages ----------- const CustomersList = lazyLoad( - () => import(/* webpackChunkName: 'customers-list' */ '~/pages/CustomersList') + () => import(/* webpackChunkName: 'customers-list' */ '~/pages/CustomersList'), ) const CustomerDetails = lazyLoad( - () => import(/* webpackChunkName: 'customer-details' */ '~/pages/CustomerDetails') + () => import(/* webpackChunkName: 'customer-details' */ '~/pages/CustomerDetails'), ) const CustomerDraftInvoicesList = lazyLoad( () => import( /* webpackChunkName: 'customer-draft-invoice-list' */ '~/pages/CustomerDraftInvoicesList' - ) + ), ) const CustomerInvoiceDetails = lazyLoad( () => - import(/* webpackChunkName: 'customer-invoice-details' */ '~/layouts/CustomerInvoiceDetails') + import(/* webpackChunkName: 'customer-invoice-details' */ '~/layouts/CustomerInvoiceDetails'), ) // Credit note related const CreateCreditNote = lazyLoad( - () => import(/* webpackChunkName: 'create-credit-note' */ '~/pages/CreateCreditNote') + () => import(/* webpackChunkName: 'create-credit-note' */ '~/pages/CreateCreditNote'), ) const CreditNoteDetails = lazyLoad( - () => import(/* webpackChunkName: 'credit-note-details' */ '~/pages/CreditNoteDetails') + () => import(/* webpackChunkName: 'credit-note-details' */ '~/pages/CreditNoteDetails'), ) // ----------- Routes ----------- diff --git a/src/core/router/DevelopperRoutes.tsx b/src/core/router/DevelopperRoutes.tsx index 32a409e3b..b7134c129 100644 --- a/src/core/router/DevelopperRoutes.tsx +++ b/src/core/router/DevelopperRoutes.tsx @@ -3,21 +3,21 @@ import { lazyLoad } from './utils' // ----------- Layouts ----------- const Developers = lazyLoad( - () => import(/* webpackChunkName: 'developers-layout' */ '~/layouts/Developers') + () => import(/* webpackChunkName: 'developers-layout' */ '~/layouts/Developers'), ) // ----------- Pages ----------- const ApiKeys = lazyLoad( - () => import(/* webpackChunkName: 'api-keys' */ '~/pages/developers/ApiKeys') + () => import(/* webpackChunkName: 'api-keys' */ '~/pages/developers/ApiKeys'), ) const Webhooks = lazyLoad( - () => import(/* webpackChunkName: 'webhook' */ '~/pages/developers/Webhooks') + () => import(/* webpackChunkName: 'webhook' */ '~/pages/developers/Webhooks'), ) const WebhookLogs = lazyLoad( - () => import(/* webpackChunkName: 'webhook-logs' */ '~/pages/developers/WebhookLogs') + () => import(/* webpackChunkName: 'webhook-logs' */ '~/pages/developers/WebhookLogs'), ) const Debugger = lazyLoad( - () => import(/* webpackChunkName: 'debugger' */ '~/pages/developers/Debugger') + () => import(/* webpackChunkName: 'debugger' */ '~/pages/developers/Debugger'), ) // ----------- Routes ----------- diff --git a/src/core/router/ObjectsRoutes.tsx b/src/core/router/ObjectsRoutes.tsx index 4cdd01b03..93997eba9 100644 --- a/src/core/router/ObjectsRoutes.tsx +++ b/src/core/router/ObjectsRoutes.tsx @@ -4,46 +4,46 @@ import { lazyLoad } from './utils' // ----------- Pages ----------- // Lists const BillableMetricsList = lazyLoad( - () => import(/* webpackChunkName: 'billable-metrics' */ '~/pages/BillableMetricsList') + () => import(/* webpackChunkName: 'billable-metrics' */ '~/pages/BillableMetricsList'), ) const PlansList = lazyLoad(() => import(/* webpackChunkName: 'plans-list' */ '~/pages/PlansList')) const CouponsList = lazyLoad( - () => import(/* webpackChunkName: 'coupons-list' */ '~/pages/CouponsList') + () => import(/* webpackChunkName: 'coupons-list' */ '~/pages/CouponsList'), ) const AddOnsList = lazyLoad( - () => import(/* webpackChunkName: 'add-ons-list' */ '~/pages/AddOnsList') + () => import(/* webpackChunkName: 'add-ons-list' */ '~/pages/AddOnsList'), ) const InvoicesList = lazyLoad( - () => import(/* webpackChunkName: 'invoices-list' */ '~/pages/InvoicesList') + () => import(/* webpackChunkName: 'invoices-list' */ '~/pages/InvoicesList'), ) // Creation const CreateBillableMetric = lazyLoad( - () => import(/* webpackChunkName: 'create-billable-metrics' */ '~/pages/CreateBillableMetric') + () => import(/* webpackChunkName: 'create-billable-metrics' */ '~/pages/CreateBillableMetric'), ) const CreatePlan = lazyLoad( - () => import(/* webpackChunkName: 'create-plan' */ '~/pages/CreatePlan') + () => import(/* webpackChunkName: 'create-plan' */ '~/pages/CreatePlan'), ) const CreateTax = lazyLoad(() => import(/* webpackChunkName: 'create-tax' */ '~/pages/CreateTax')) const CreateInvoice = lazyLoad( - () => import(/* webpackChunkName: 'create-plan' */ '~/pages/CreateInvoice') + () => import(/* webpackChunkName: 'create-plan' */ '~/pages/CreateInvoice'), ) const CreateCoupon = lazyLoad( - () => import(/* webpackChunkName: 'create-coupon' */ '~/pages/CreateCoupon') + () => import(/* webpackChunkName: 'create-coupon' */ '~/pages/CreateCoupon'), ) const CreateAddOn = lazyLoad( - () => import(/* webpackChunkName: 'create-add-on' */ '~/pages/CreateAddOn') + () => import(/* webpackChunkName: 'create-add-on' */ '~/pages/CreateAddOn'), ) const CreateSubscription = lazyLoad( - () => import(/* webpackChunkName: 'create-subscription' */ '~/pages/CreateSubscription') + () => import(/* webpackChunkName: 'create-subscription' */ '~/pages/CreateSubscription'), ) // Details const SubscriptionDetails = lazyLoad( - () => import(/* webpackChunkName: 'subscription-details' */ '~/pages/SubscriptionDetails') + () => import(/* webpackChunkName: 'subscription-details' */ '~/pages/SubscriptionDetails'), ) const PlanDetails = lazyLoad( - () => import(/* webpackChunkName: 'plan-details' */ '~/pages/PlanDetails') + () => import(/* webpackChunkName: 'plan-details' */ '~/pages/PlanDetails'), ) // ----------- Routes ----------- diff --git a/src/core/router/SettingRoutes.tsx b/src/core/router/SettingRoutes.tsx index b51892fae..e6b7a44af 100644 --- a/src/core/router/SettingRoutes.tsx +++ b/src/core/router/SettingRoutes.tsx @@ -9,36 +9,36 @@ const OrganizationInformations = lazyLoad( () => import( /* webpackChunkName: 'organization-informations' */ '~/pages/settings/OrganizationInformations' - ) + ), ) const InvoiceSettings = lazyLoad( - () => import(/* webpackChunkName: 'invoice-settings' */ '~/pages/settings/InvoiceSettings') + () => import(/* webpackChunkName: 'invoice-settings' */ '~/pages/settings/InvoiceSettings'), ) const TaxesSettings = lazyLoad( - () => import(/* webpackChunkName: 'tax-settings' */ '~/pages/settings/TaxesSettings') + () => import(/* webpackChunkName: 'tax-settings' */ '~/pages/settings/TaxesSettings'), ) const Members = lazyLoad(() => import(/* webpackChunkName: 'members' */ '~/pages/settings/Members')) const Integrations = lazyLoad( - () => import(/* webpackChunkName: 'integrations' */ '~/pages/settings/Integrations') + () => import(/* webpackChunkName: 'integrations' */ '~/pages/settings/Integrations'), ) const AdyenIntegration = lazyLoad( - () => import(/* webpackChunkName: 'adyen-integration' */ '~/pages/settings/AdyenIntegration') + () => import(/* webpackChunkName: 'adyen-integration' */ '~/pages/settings/AdyenIntegration'), ) const StripeIntegration = lazyLoad( - () => import(/* webpackChunkName: 'stripe-integration' */ '~/pages/settings/StripeIntegration') + () => import(/* webpackChunkName: 'stripe-integration' */ '~/pages/settings/StripeIntegration'), ) const GocardlessIntegration = lazyLoad( () => import( /* webpackChunkName: 'gocardless-integration' */ '~/pages/settings/GocardlessIntegration' - ) + ), ) const EmailSettings = lazyLoad( - () => import(/* webpackChunkName: 'email-settings' */ '~/pages/settings/EmailSettings') + () => import(/* webpackChunkName: 'email-settings' */ '~/pages/settings/EmailSettings'), ) const EmailScenarioConfig = lazyLoad( () => - import(/* webpackChunkName: 'email-scenario-config' */ '~/pages/settings/EmailScenarioConfig') + import(/* webpackChunkName: 'email-scenario-config' */ '~/pages/settings/EmailScenarioConfig'), ) // ----------- Routes ----------- diff --git a/src/core/router/index.tsx b/src/core/router/index.tsx index 4f38853dd..105c81a86 100644 --- a/src/core/router/index.tsx +++ b/src/core/router/index.tsx @@ -21,7 +21,7 @@ const { appEnv } = envGlobalVar() // ----------- Layouts ----------- const SideNavLayout = lazyLoad( - () => import(/* webpackChunkName: 'side-nav-layout' */ '~/layouts/SideNavLayout') + () => import(/* webpackChunkName: 'side-nav-layout' */ '~/layouts/SideNavLayout'), ) // ----------- Pages ----------- @@ -30,7 +30,7 @@ const Analytic = lazyLoad(() => import(/* webpackChunkName: 'analytics' */ '~/pa // Route Available only on dev mode const DesignSystem = lazyLoad( - () => import(/* webpackChunkName: 'design-system' */ '~/pages/__devOnly/DesignSystem') + () => import(/* webpackChunkName: 'design-system' */ '~/pages/__devOnly/DesignSystem'), ) export const HOME_ROUTE = '/' diff --git a/src/core/router/utils.tsx b/src/core/router/utils.tsx index 15bca4a6d..d07278142 100644 --- a/src/core/router/utils.tsx +++ b/src/core/router/utils.tsx @@ -3,7 +3,7 @@ import { ComponentType, lazy } from 'react' const retry = ( fn: Function, retriesLeft: number = 2, - interval: number = 1000 + interval: number = 1000, ): Promise<{ default: ComponentType }> => { return new Promise((resolve) => { fn() diff --git a/src/core/serializers/__tests__/serializeCreditNoteInput.test.ts b/src/core/serializers/__tests__/serializeCreditNoteInput.test.ts index 8d2be6413..d8607fb84 100644 --- a/src/core/serializers/__tests__/serializeCreditNoteInput.test.ts +++ b/src/core/serializers/__tests__/serializeCreditNoteInput.test.ts @@ -44,7 +44,7 @@ describe('serializeCreditNoteInput()', () => { }, ], }, - CurrencyEnum.Eur + CurrencyEnum.Eur, ) expect(plan).toStrictEqual({ @@ -198,7 +198,7 @@ describe('serializeCreditNoteInput()', () => { }, ], }, - CurrencyEnum.Eur + CurrencyEnum.Eur, ) expect(plan).toStrictEqual({ diff --git a/src/core/serializers/serializeAmount.ts b/src/core/serializers/serializeAmount.ts index 9d7c35c0c..910a90ca9 100644 --- a/src/core/serializers/serializeAmount.ts +++ b/src/core/serializers/serializeAmount.ts @@ -33,7 +33,7 @@ export const serializeAmount = (value: string | number, currency: CurrencyEnum) return Number((String(Math.round(Number(value) * 1000)).match(/^-?\d+(?:\.\d{0,3})?/) || [])[0]) } else if (precision === 4) { return Number( - (String(Math.round(Number(value) * 10000)).match(/^-?\d+(?:\.\d{0,4})?/) || [])[0] + (String(Math.round(Number(value) * 10000)).match(/^-?\d+(?:\.\d{0,4})?/) || [])[0], ) } diff --git a/src/core/serializers/serializeCreditNoteInput.ts b/src/core/serializers/serializeCreditNoteInput.ts index fb1e273bb..5d8b3b143 100644 --- a/src/core/serializers/serializeCreditNoteInput.ts +++ b/src/core/serializers/serializeCreditNoteInput.ts @@ -16,7 +16,7 @@ import { export const serializeCreditNoteInput: ( invoiceId: string, formValues: CreditNoteForm, - currency: CurrencyEnum + currency: CurrencyEnum, ) => CreateCreditNoteInput = (invoiceId, formValues, currency) => { const { reason, description, payBack, fees = [], addOnFee } = formValues @@ -28,13 +28,13 @@ export const serializeCreditNoteInput: ( ? 0 : serializeAmount( payBack.find((p) => p.type === CreditTypeEnum.credit)?.value || 0, - currency + currency, ), refundAmountCents: !payBack ? 0 : serializeAmount( payBack.find((p) => p.type === CreditTypeEnum.refund)?.value || 0, - currency + currency, ) || 0, items: [ ...(addOnFee?.reduce((acc, fee) => { diff --git a/src/core/serializers/serializePlanInput.ts b/src/core/serializers/serializePlanInput.ts index eeee0b381..1d824c8bf 100644 --- a/src/core/serializers/serializePlanInput.ts +++ b/src/core/serializers/serializePlanInput.ts @@ -26,7 +26,7 @@ const serializeProperties = (properties: Properties, chargeModel: ChargeModelEnu fromValue: fromValue || 0, perUnitAmount: serializeScientificNotation(perUnitAmount), ...range, - }) + }), ) : undefined, } @@ -40,7 +40,7 @@ const serializeProperties = (properties: Properties, chargeModel: ChargeModelEnu fromValue: fromValue || 0, rate: serializeScientificNotation(rate), ...range, - }) + }), ) : undefined, } @@ -55,7 +55,7 @@ const serializeProperties = (properties: Properties, chargeModel: ChargeModelEnu fromValue: fromValue || 0, perUnitAmount: serializeScientificNotation(perUnitAmount), ...range, - }) + }), ) : undefined, } @@ -121,7 +121,7 @@ export const serializePlanInput = (values: PlanFormInput) => { : [], ...charge, } - } + }, ), ...otherValues, } diff --git a/src/core/timezone/utils.ts b/src/core/timezone/utils.ts index c65b10009..71927ef45 100644 --- a/src/core/timezone/utils.ts +++ b/src/core/timezone/utils.ts @@ -11,7 +11,7 @@ export const getTimezoneConfig = (timezone: TimezoneEnum | null | undefined) => export const formatDateToTZ = ( date: string, timezone: TimezoneEnum | null | undefined, - format?: string + format?: string, ) => { return DateTime.fromISO(date, { zone: getTimezoneConfig(timezone).name, diff --git a/src/core/translations/__tests__/utils.test.ts b/src/core/translations/__tests__/utils.test.ts index a22392968..2f61ea41b 100644 --- a/src/core/translations/__tests__/utils.test.ts +++ b/src/core/translations/__tests__/utils.test.ts @@ -14,7 +14,7 @@ describe('utils', () => { }) it('returns plural for more than 2', () => { expect( - getPluralTranslation('singular|plural', Math.round(Math.random() * 100) + 2) + getPluralTranslation('singular|plural', Math.round(Math.random() * 100) + 2), ).toEqual('plural') }) }) @@ -31,7 +31,7 @@ describe('utils', () => { }) it('returns plural for more than 2', () => { expect( - getPluralTranslation('none|singular|plural', Math.round(Math.random() * 100) + 2) + getPluralTranslation('none|singular|plural', Math.round(Math.random() * 100) + 2), ).toEqual('plural') }) }) @@ -43,12 +43,12 @@ describe('utils', () => { }) it('replaces the dynamic variable multiple times', () => { expect(replaceDynamicVarInString('Hello {{name}}, {{name}}', { name: 'World' })).toEqual( - 'Hello World, World' + 'Hello World, World', ) }) it('replaces the dynamic variabled with multiple words', () => { expect(replaceDynamicVarInString('Hello {{name}}', { name: 'World Peace' })).toEqual( - 'Hello World Peace' + 'Hello World Peace', ) }) it('replaces the dynamic variable with numbers', () => { @@ -59,7 +59,7 @@ describe('utils', () => { replaceDynamicVarInString('Hello {{firstName}} {{lastName}}', { firstName: 'John', lastName: 'Doe', - }) + }), ).toEqual('Hello John Doe') }) }) diff --git a/src/core/translations/utils.ts b/src/core/translations/utils.ts index f320e7ff3..fbd19227c 100644 --- a/src/core/translations/utils.ts +++ b/src/core/translations/utils.ts @@ -3,7 +3,7 @@ import { AppEnvEnum } from '~/core/constants/globalTypes' import { DittoTranslation, Locale, TranslateData, Translations } from './types' export const getTranslations: (locale: Locale) => Promise> = async ( - locale + locale, ) => { let loadedDittoTranslation: DittoTranslation @@ -45,7 +45,7 @@ export const translateKey: ( }, key: string, data?: TranslateData, - plural?: number + plural?: number, ) => string = ({ translations, locale, appEnv }, key, data, plural = 0) => { if (!translations || Object.keys(translations).length === 0) { return '' diff --git a/src/core/utils/BMGroupUtils.ts b/src/core/utils/BMGroupUtils.ts index cf39fe029..72e742114 100644 --- a/src/core/utils/BMGroupUtils.ts +++ b/src/core/utils/BMGroupUtils.ts @@ -64,21 +64,21 @@ export const isGroupValid = (object: groupType) => const areGroupsOneDimension = ( group1: oneDimensionGroupType, - group2: oneDimensionGroupType + group2: oneDimensionGroupType, ): boolean => { return isOneDimension(group1) && isOneDimension(group2) } const areGroupsTwoDimension = ( group1: twoDimensionGroupType, - group2: twoDimensionGroupType + group2: twoDimensionGroupType, ): boolean => { return isTwoDimension(group1) && isTwoDimension(group2) } export const determineGroupDiffLevel: ( group1: groupType | string, - group2: groupType | string + group2: groupType | string, ) => determineGroupDiffLevelReturnType = (group1 = {}, group2 = {}) => { // Groups can be empty, replace them with empty object if (!group1 || group1 === '') group1 = '{}' diff --git a/src/core/utils/__tests__/copyToClipboard.test.ts b/src/core/utils/__tests__/copyToClipboard.test.ts index 98c8a86d0..f1c4864bf 100644 --- a/src/core/utils/__tests__/copyToClipboard.test.ts +++ b/src/core/utils/__tests__/copyToClipboard.test.ts @@ -11,7 +11,7 @@ describe('copyToClipboard', () => { copyToClipboard('the text that needs to be copied') expect(window.navigator.clipboard.writeText).toHaveBeenCalledWith( - 'the text that needs to be copied' + 'the text that needs to be copied', ) }) }) diff --git a/src/formValidation/chargeSchema.ts b/src/formValidation/chargeSchema.ts index 306d942f7..f0883d85c 100644 --- a/src/formValidation/chargeSchema.ts +++ b/src/formValidation/chargeSchema.ts @@ -23,7 +23,7 @@ const percentageShape = { MIN_AMOUNT_SHOULD_BE_LOWER_THAN_MAX_ERROR, MIN_AMOUNT_SHOULD_BE_LOWER_THAN_MAX_ERROR, (value, ctx) => - !value || !ctx.parent.perTransactionMaxAmount || value <= ctx.parent.perTransactionMaxAmount + !value || !ctx.parent.perTransactionMaxAmount || value <= ctx.parent.perTransactionMaxAmount, ), perTransactionMaxAmount: number(), } @@ -186,7 +186,7 @@ export const chargeSchema = array().of( schema.of( object().shape({ values: object().shape(standardShape), - }) + }), ), }) .when(['chargeModel', 'billableMetric'], { @@ -199,7 +199,7 @@ export const chargeSchema = array().of( schema.of( object().shape({ values: object().shape(packageShape), - }) + }), ), }) .when(['chargeModel', 'billableMetric'], { @@ -212,7 +212,7 @@ export const chargeSchema = array().of( schema.of( object().shape({ values: object().shape(percentageShape), - }) + }), ), }) .when(['chargeModel', 'billableMetric'], { @@ -225,7 +225,7 @@ export const chargeSchema = array().of( schema.of( object().shape({ values: object().shape(graduatedShape), - }) + }), ), }) .when(['chargeModel', 'billableMetric'], { @@ -238,7 +238,7 @@ export const chargeSchema = array().of( schema.of( object().shape({ values: object().shape(graduatedPercentageShape), - }) + }), ), }) .when(['chargeModel', 'billableMetric'], { @@ -251,8 +251,8 @@ export const chargeSchema = array().of( schema.of( object().shape({ values: object().shape(volumeShape), - }) + }), ), }), - }) + }), ) diff --git a/src/formValidation/feesSchema.ts b/src/formValidation/feesSchema.ts index cddcc20da..d442fc598 100644 --- a/src/formValidation/feesSchema.ts +++ b/src/formValidation/feesSchema.ts @@ -43,9 +43,9 @@ export const generateFeesSchema = (formikInitialFees: FeesPerInvoice, currency: [feeGroupKey]: simpleFeeSchema( _get( formikInitialFees || {}, - `${subKey}.fees.${feeGroupKey}.maxAmount` + `${subKey}.fees.${feeGroupKey}.maxAmount`, ) as unknown as number, - currency + currency, ), } } @@ -61,21 +61,21 @@ export const generateFeesSchema = (formikInitialFees: FeesPerInvoice, currency: [feeKey]: simpleFeeSchema( _get( formikInitialFees || {}, - `${subKey}.fees.${feeGroupKey}.grouped.${feeKey}.maxAmount` + `${subKey}.fees.${feeGroupKey}.grouped.${feeKey}.maxAmount`, ) as unknown as number, - currency + currency, ), } - }, {}) + }, {}), ), }), } - }, {}) + }, {}), ), }), } return accSub - }, {}) + }, {}), ) export const generateAddOnFeesSchema = (formikInitialFees: FromFee[], currency: CurrencyEnum) => { diff --git a/src/formValidation/metadataSchema.ts b/src/formValidation/metadataSchema.ts index 7dede04c8..0c4a0f4e3 100644 --- a/src/formValidation/metadataSchema.ts +++ b/src/formValidation/metadataSchema.ts @@ -19,7 +19,7 @@ export const metadataSchema = ({ valueMaxLength = METADATA_VALUE_MAX_LENGTH_DEFA if (arguments[1].from[1]?.value?.metadata.length > 1) { const keysList = arguments[1].from[1]?.value?.metadata?.map( - (m: { key: string }) => m.key + (m: { key: string }) => m.key, ) // Check key unicity @@ -54,5 +54,5 @@ export const metadataSchema = ({ valueMaxLength = METADATA_VALUE_MAX_LENGTH_DEFA return true }, }), - }) + }), ) diff --git a/src/hooks/core/__tests__/useInternationalization.test.tsx b/src/hooks/core/__tests__/useInternationalization.test.tsx index ed9bc8c9c..0f7ce8caa 100644 --- a/src/hooks/core/__tests__/useInternationalization.test.tsx +++ b/src/hooks/core/__tests__/useInternationalization.test.tsx @@ -21,7 +21,7 @@ describe('useLocationHistory()', () => { it('returns interpolate variable in strings', () => { expect( - replaceDynamicVarInString("What' your real name {{fakeName}}?", { fakeName: 'Mr Brown' }) + replaceDynamicVarInString("What' your real name {{fakeName}}?", { fakeName: 'Mr Brown' }), ).toBe("What' your real name Mr Brown?") }) }) diff --git a/src/hooks/core/__tests__/useLocationHistory.test.ts b/src/hooks/core/__tests__/useLocationHistory.test.ts index c17fe82e2..194c26da3 100644 --- a/src/hooks/core/__tests__/useLocationHistory.test.ts +++ b/src/hooks/core/__tests__/useLocationHistory.test.ts @@ -129,7 +129,7 @@ describe('useLocationHistory()', () => { act(() => result.current.goBack(FALLBACK_URL, { exclude: [MOCK_HISTORY_VAR[1].pathname, MOCK_HISTORY_VAR[2].pathname], - }) + }), ) expect(mockNavigate).toHaveBeenCalledWith(MOCK_HISTORY_VAR[3]) @@ -146,7 +146,7 @@ describe('useLocationHistory()', () => { MOCK_HISTORY_VAR[2].pathname, MOCK_HISTORY_VAR[3].pathname, ], - }) + }), ) expect(mockNavigate).toHaveBeenCalledWith(FALLBACK_URL) @@ -159,7 +159,7 @@ describe('useLocationHistory()', () => { act(() => result.current.goBack(FALLBACK_URL, { previousCount: -5, - }) + }), ) expect(mockNavigate).toHaveBeenCalledWith(FALLBACK_URL) diff --git a/src/hooks/core/useContextualLocale.ts b/src/hooks/core/useContextualLocale.ts index 00bff32a6..021baf505 100644 --- a/src/hooks/core/useContextualLocale.ts +++ b/src/hooks/core/useContextualLocale.ts @@ -33,7 +33,7 @@ export const useContextualLocale: UseContextualLocale = (locale) => { (key, data, plural = 0) => { return translateKey({ translations, locale, appEnv }, key, data, plural) }, - [translations, locale] + [translations, locale], ), } } diff --git a/src/hooks/core/useInternationalization.ts b/src/hooks/core/useInternationalization.ts index 173012187..072f6d239 100644 --- a/src/hooks/core/useInternationalization.ts +++ b/src/hooks/core/useInternationalization.ts @@ -23,7 +23,7 @@ export const useInternationalization: UseInternationalization = () => { (key, data, plural = 0) => { return translateKey({ translations, locale, appEnv }, key, data, plural) }, - [translations, locale] + [translations, locale], ), updateLocale: updateIntlLocale, } diff --git a/src/hooks/core/useLocationHistory.ts b/src/hooks/core/useLocationHistory.ts index 1d5738840..50ddc7c62 100644 --- a/src/hooks/core/useLocationHistory.ts +++ b/src/hooks/core/useLocationHistory.ts @@ -9,7 +9,7 @@ type GoBack = ( // Previous count represents how many location from now you want to go back to previousCount?: number exclude?: string | string[] - } + }, ) => void type UseLocationHistoryReturn = () => { diff --git a/src/hooks/customer/useAddSubscription.tsx b/src/hooks/customer/useAddSubscription.tsx index 034fe6949..4bdbbf18b 100644 --- a/src/hooks/customer/useAddSubscription.tsx +++ b/src/hooks/customer/useAddSubscription.tsx @@ -55,7 +55,7 @@ type UseAddSubscriptionReturn = { customerId: string, values: Omit, planValues: PlanFormInput, - hasPlanBeingChangedFromInitial: boolean + hasPlanBeingChangedFromInitial: boolean, ) => Promise } @@ -115,7 +115,7 @@ export const useAddSubscription: UseAddSubscription = ({ navigate( generatePath(CUSTOMER_DETAILS_ROUTE, { customerId: res.createSubscription.customer.id as string, - }) + }), ) } }, @@ -153,7 +153,7 @@ export const useAddSubscription: UseAddSubscription = ({ message: translate( formType === FORM_TYPE_ENUM.upgradeDowngrade ? 'text_65118a52df984447c18695f9' - : 'text_65118a52df984447c186962e' + : 'text_65118a52df984447c186962e', ), severity: 'success', }) @@ -162,7 +162,7 @@ export const useAddSubscription: UseAddSubscription = ({ navigate( generatePath(CUSTOMER_DETAILS_ROUTE, { customerId: res?.updateSubscription?.customer.id as string, - }) + }), ) }, refetchQueries: ['getCustomerSubscriptionForList'], @@ -187,7 +187,7 @@ export const useAddSubscription: UseAddSubscription = ({ ...values }, { ...planValues }, - hasPlanBeingChangedFromInitial + hasPlanBeingChangedFromInitial, ) => { const serializedPlanValues = serializePlanInput(planValues) const { errors } = @@ -229,7 +229,9 @@ export const useAddSubscription: UseAddSubscription = ({ ...values, id: existingSubscription?.id as string, subscriptionAt: !!existingSubscription?.startedAt - ? DateTime.fromISO(existingSubscription?.startedAt).toUTC().toISO() + ? DateTime.fromISO(existingSubscription?.startedAt) + .toUTC() + .toISO() : undefined, endingAt: !!subEndDate ? DateTime.fromISO(subEndDate).toUTC().toISO() : null, name: name || undefined, diff --git a/src/hooks/plans/__tests__/useVolumeChargeForm.test.tsx b/src/hooks/plans/__tests__/useVolumeChargeForm.test.tsx index bbf6f9de4..f4aeca37b 100644 --- a/src/hooks/plans/__tests__/useVolumeChargeForm.test.tsx +++ b/src/hooks/plans/__tests__/useVolumeChargeForm.test.tsx @@ -127,7 +127,7 @@ describe('useVolumeChargeForm()', () => { volumeRanges.map((row, i) => ({ ...row, disabledDelete: [0].includes(i), - })) + })), ) }) @@ -162,7 +162,7 @@ describe('useVolumeChargeForm()', () => { volumeRanges.map((row) => ({ ...row, disabledDelete: true, - })) + })), ) }) }) @@ -403,7 +403,7 @@ describe('useVolumeChargeForm()', () => { volumeRanges.map((row, i) => ({ ...row, disabledDelete: [0].includes(i), - })) + })), ) }) @@ -438,7 +438,7 @@ describe('useVolumeChargeForm()', () => { volumeRanges.map((row) => ({ ...row, disabledDelete: true, - })) + })), ) }) }) diff --git a/src/hooks/plans/useGraduatedChargeForm.ts b/src/hooks/plans/useGraduatedChargeForm.ts index bc884ad42..d7cc255b0 100644 --- a/src/hooks/plans/useGraduatedChargeForm.ts +++ b/src/hooks/plans/useGraduatedChargeForm.ts @@ -77,7 +77,7 @@ export const useGraduatedChargeForm: UseGraduatedChargeForm = ({ disabledDelete: [0].includes(i) || !!disabled, } }), - [graduatedRanges, disabled] + [graduatedRanges, disabled], ), infosCalculation: useMemo( () => @@ -122,7 +122,7 @@ export const useGraduatedChargeForm: UseGraduatedChargeForm = ({ return acc }, []), - [graduatedRanges] + [graduatedRanges], ), addRange: () => { const addIndex = graduatedRanges?.length - 1 // Add before the last range @@ -151,19 +151,19 @@ export const useGraduatedChargeForm: UseGraduatedChargeForm = ({ return acc }, - [] + [], ) formikProps.setFieldValue( `charges.${chargeIndex}.${propertyCursor}.graduatedRanges`, - newGraduatedRanges + newGraduatedRanges, ) }, handleUpdate: (rangeIndex, fieldName, value) => { if (fieldName !== 'toValue') { formikProps.setFieldValue( `${formikIdentifier}.${rangeIndex}.${fieldName}`, - value !== '' ? Number(value) : value + value !== '' ? Number(value) : value, ) } else { const newGraduatedRanges = graduatedRanges.reduce( @@ -182,8 +182,8 @@ export const useGraduatedChargeForm: UseGraduatedChargeForm = ({ range.toValue === null ? null : Number(range.toValue || 0) <= Number(fromValue) - ? String(Number(fromValue) + 1) - : String(range.toValue || 0), + ? String(Number(fromValue) + 1) + : String(range.toValue || 0), }) } else { acc.push(range) @@ -191,7 +191,7 @@ export const useGraduatedChargeForm: UseGraduatedChargeForm = ({ return acc }, - [] + [], ) formikProps.setFieldValue(formikIdentifier, newGraduatedRanges) diff --git a/src/hooks/plans/useGraduatedPercentageChargeForm.ts b/src/hooks/plans/useGraduatedPercentageChargeForm.ts index 265eb6482..08bdf2b4e 100644 --- a/src/hooks/plans/useGraduatedPercentageChargeForm.ts +++ b/src/hooks/plans/useGraduatedPercentageChargeForm.ts @@ -56,7 +56,7 @@ export const useGraduatedPercentageChargeForm: useGraduatedPercentageChargeForm const formikIdentifier = `charges.${chargeIndex}.${propertyCursor}.graduatedPercentageRanges` const graduatedPercentageRanges = useMemo( () => valuePointer?.graduatedPercentageRanges || [], - [valuePointer] + [valuePointer], ) useEffect(() => { @@ -77,7 +77,7 @@ export const useGraduatedPercentageChargeForm: useGraduatedPercentageChargeForm disabledDelete: [0].includes(i) || !!disabled, } }), - [graduatedPercentageRanges, disabled] + [graduatedPercentageRanges, disabled], ), infosCalculation: useMemo( () => @@ -97,7 +97,7 @@ export const useGraduatedPercentageChargeForm: useGraduatedPercentageChargeForm return acc }, []), - [graduatedPercentageRanges] + [graduatedPercentageRanges], ), addRange: () => { const addIndex = graduatedPercentageRanges?.length - 1 // Add before the last range @@ -132,14 +132,14 @@ export const useGraduatedPercentageChargeForm: useGraduatedPercentageChargeForm formikProps.setFieldValue( `charges.${chargeIndex}.${propertyCursor}.graduatedPercentageRanges`, - newgraduatedPercentageRanges + newgraduatedPercentageRanges, ) }, handleUpdate: (rangeIndex, fieldName, value) => { if (fieldName !== 'toValue') { formikProps.setFieldValue( `${formikIdentifier}.${rangeIndex}.${fieldName}`, - value !== '' ? Number(value) : value + value !== '' ? Number(value) : value, ) } else { const newgraduatedPercentageRanges = graduatedPercentageRanges.reduce< @@ -159,8 +159,8 @@ export const useGraduatedPercentageChargeForm: useGraduatedPercentageChargeForm range.toValue === null ? null : Number(range.toValue || 0) <= Number(fromValue) - ? String(Number(fromValue) + 1) - : String(range.toValue || 0), + ? String(Number(fromValue) + 1) + : String(range.toValue || 0), }) } else { acc.push(range) diff --git a/src/hooks/plans/usePlanForm.tsx b/src/hooks/plans/usePlanForm.tsx index d8df92d3b..3ddcf4eec 100644 --- a/src/hooks/plans/usePlanForm.tsx +++ b/src/hooks/plans/usePlanForm.tsx @@ -89,8 +89,8 @@ export const usePlanForm: ({ const type = !!id ? FORM_TYPE_ENUM.edition : isDuplicate - ? FORM_TYPE_ENUM.duplicate - : FORM_TYPE_ENUM.creation + ? FORM_TYPE_ENUM.duplicate + : FORM_TYPE_ENUM.creation const isEdition = type === FORM_TYPE_ENUM.edition const plan = data?.plan @@ -154,7 +154,7 @@ export const usePlanForm: ({ minAmountCents: isNaN(minAmountCents) ? undefined : String( - deserializeAmount(minAmountCents || 0, plan.amountCurrency || CurrencyEnum.Usd) + deserializeAmount(minAmountCents || 0, plan.amountCurrency || CurrencyEnum.Usd), ), payInAdvance: payInAdvance || false, properties: properties ? getPropertyShape(properties) : undefined, @@ -168,7 +168,7 @@ export const usePlanForm: ({ }) : [], ...charge, - }) + }), ) : ([] as LocalChargeInput[]), }, @@ -206,7 +206,7 @@ export const usePlanForm: ({ generatePath(PLAN_DETAILS_ROUTE, { planId: createPlan.id, tab: PlanDetailsTabsOptionsEnum.overview, - }) + }), ) } }, @@ -223,7 +223,7 @@ export const usePlanForm: ({ generatePath(PLAN_DETAILS_ROUTE, { planId: updatePlan.id, tab: PlanDetailsTabsOptionsEnum.overview, - }) + }), ) } }, @@ -290,6 +290,6 @@ export const usePlanForm: ({ type, plan, }), - [errorCode, formikProps, isEdition, loading, type, plan] + [errorCode, formikProps, isEdition, loading, type, plan], ) } diff --git a/src/hooks/plans/useVolumeChargeForm.ts b/src/hooks/plans/useVolumeChargeForm.ts index ab3a41a75..eaf5fb44e 100644 --- a/src/hooks/plans/useVolumeChargeForm.ts +++ b/src/hooks/plans/useVolumeChargeForm.ts @@ -76,7 +76,7 @@ export const useVolumeChargeForm: UseVolumeChargeForm = ({ disabledDelete: [0].includes(i) || !!disabled, } }), - [volumeRanges, disabled] + [volumeRanges, disabled], ), infosCalculation: useMemo(() => { const lastRow = volumeRanges[volumeRanges.length - 1] @@ -118,14 +118,14 @@ export const useVolumeChargeForm: UseVolumeChargeForm = ({ formikProps.setFieldValue( `charges.${chargeIndex}.${propertyCursor}.volumeRanges`, - newVolumeRanges + newVolumeRanges, ) }, handleUpdate: (rangeIndex, fieldName, value) => { if (fieldName !== 'toValue') { formikProps.setFieldValue( `${formikIdentifier}.${rangeIndex}.${fieldName}`, - value !== '' ? Number(value) : value + value !== '' ? Number(value) : value, ) } else { const newVolumeRanges = volumeRanges.reduce((acc, range, i) => { @@ -143,8 +143,8 @@ export const useVolumeChargeForm: UseVolumeChargeForm = ({ range.toValue === null ? null : Number(range.toValue || 0) <= Number(fromValue) - ? String(Number(fromValue) + 1) - : String(range.toValue || 0), + ? String(Number(fromValue) + 1) + : String(range.toValue || 0), }) } else { acc.push(range) diff --git a/src/hooks/ui/__tests__/useListKeyNavigation.test.tsx b/src/hooks/ui/__tests__/useListKeyNavigation.test.tsx index d34159851..8b44b2361 100644 --- a/src/hooks/ui/__tests__/useListKeyNavigation.test.tsx +++ b/src/hooks/ui/__tests__/useListKeyNavigation.test.tsx @@ -34,7 +34,7 @@ describe('useListKeyNavigation()', () => { Active element Next element {/* eslint-enable jsx-a11y/anchor-is-valid*/} - + , ) await userEvent.keyboard('{ArrowDown}') @@ -72,7 +72,7 @@ describe('useListKeyNavigation()', () => { {/* eslint-enable jsx-a11y/anchor-is-valid, jsx-a11y/no-noninteractive-tabindex*/} - + , ) document?.getElementById('item-0')?.focus() @@ -101,7 +101,7 @@ describe('useListKeyNavigation()', () => { First {/* eslint-enable jsx-a11y/anchor-is-valid, jsx-a11y/no-noninteractive-tabindex*/} - + , ) document?.getElementById('item-0')?.focus() @@ -140,7 +140,7 @@ describe('useListKeyNavigation()', () => { {/* eslint-enable jsx-a11y/anchor-is-valid, jsx-a11y/no-noninteractive-tabindex*/} - + , ) document?.getElementById('item-2')?.focus() @@ -169,7 +169,7 @@ describe('useListKeyNavigation()', () => { First {/* eslint-enable jsx-a11y/anchor-is-valid, jsx-a11y/no-noninteractive-tabindex*/} - + , ) document?.getElementById('item-0')?.focus() @@ -205,7 +205,7 @@ describe('useListKeyNavigation()', () => { {/* eslint-enable jsx-a11y/anchor-is-valid, jsx-a11y/no-noninteractive-tabindex*/} - + , ) document?.getElementById('item-0')?.focus() diff --git a/src/hooks/ui/__tests__/useShortcuts.test.tsx b/src/hooks/ui/__tests__/useShortcuts.test.tsx index ada1347e9..beb65edf9 100644 --- a/src/hooks/ui/__tests__/useShortcuts.test.tsx +++ b/src/hooks/ui/__tests__/useShortcuts.test.tsx @@ -24,7 +24,7 @@ describe('useShortcuts()', () => { render(
-
+ , ) // cf: https://testing-library.com/docs/ecosystem-user-event#keyboardtext-options @@ -48,7 +48,7 @@ describe('useShortcuts()', () => { render(
-
+ , ) await userEvent.keyboard('{Meta>}D') @@ -71,7 +71,7 @@ describe('useShortcuts()', () => { render(
-
+ , ) await userEvent.keyboard('{Meta>}[Enter]') @@ -94,7 +94,7 @@ describe('useShortcuts()', () => { render(
-
+ , ) // cf: https://testing-library.com/docs/ecosystem-user-event#keyboardtext-options diff --git a/src/hooks/ui/useListKeyNavigation.tsx b/src/hooks/ui/useListKeyNavigation.tsx index 7a2369903..342d85511 100644 --- a/src/hooks/ui/useListKeyNavigation.tsx +++ b/src/hooks/ui/useListKeyNavigation.tsx @@ -58,7 +58,7 @@ export const useListKeysNavigation: UseKeyNavigation = ({ elementToFocus && elementToFocus.focus() }, - [disabled, getElmId, navigate] + [disabled, getElmId, navigate], ), } } diff --git a/src/hooks/ui/useShortcuts.tsx b/src/hooks/ui/useShortcuts.tsx index 59b29e982..af1e9b5e0 100644 --- a/src/hooks/ui/useShortcuts.tsx +++ b/src/hooks/ui/useShortcuts.tsx @@ -77,7 +77,7 @@ export const useShortcuts: UseShortcutReturn = (shortcuts) => { return acc }, {}), - [shortcuts, isMac] + [shortcuts, isMac], ) const onKeyDown: (e: Event) => void = useCallback( @@ -87,7 +87,7 @@ export const useShortcuts: UseShortcutReturn = (shortcuts) => { keyPressedRef.current[cleanKey] = true const pressKeysID = getShortcutId( - Object.keys(keyPressedRef.current).filter((key) => !!keyPressedRef.current[key]) + Object.keys(keyPressedRef.current).filter((key) => !!keyPressedRef.current[key]), ) if (!!usableShortcuts[pressKeysID]) { @@ -97,7 +97,7 @@ export const useShortcuts: UseShortcutReturn = (shortcuts) => { keyPressedRef.current = {} } }, - [usableShortcuts] + [usableShortcuts], ) const onKeyUp: (e: Event) => void = useCallback((e) => { diff --git a/src/hooks/useCreateCreditNote.ts b/src/hooks/useCreateCreditNote.ts index 15116aa62..07171b3d5 100644 --- a/src/hooks/useCreateCreditNote.ts +++ b/src/hooks/useCreateCreditNote.ts @@ -116,7 +116,7 @@ type UseCreateCreditNoteReturn = { feesPerInvoice?: FeesPerInvoice feeForAddOn?: FromFee[] onCreate: ( - value: CreditNoteForm + value: CreditNoteForm, ) => Promise<{ data?: { createCreditNote?: { id?: string } }; errors?: ApolloError }> } @@ -147,7 +147,7 @@ export const useCreateCreditNote: () => UseCreateCreditNoteReturn = () => { customerId: customerId as string, invoiceId: invoiceId as string, tab: CustomerInvoiceDetailsTabsOptionsEnum.overview, - }) + }), ) } }, @@ -201,7 +201,7 @@ export const useCreateCreditNote: () => UseCreateCreditNoteReturn = () => { if (!unorderedData.length || trueUpFeeIds?.length === 0) return unorderedData const feesWithoutTrueUpOnes = invoiceSubscription?.fees?.filter( - (fee) => !trueUpFeeIds?.includes(fee?.id) + (fee) => !trueUpFeeIds?.includes(fee?.id), ) const newFees = [] @@ -212,7 +212,7 @@ export const useCreateCreditNote: () => UseCreateCreditNoteReturn = () => { newFees.push(currentFee) } else { const relatedTrueUpFee = unorderedData.find( - (fee) => fee.id === currentFee.trueUpFee?.id + (fee) => fee.id === currentFee.trueUpFee?.id, ) newFees.push(currentFee) @@ -304,13 +304,13 @@ export const useCreateCreditNote: () => UseCreateCreditNoteReturn = () => { checked: true, value: deserializeAmount( feeGrouped?.creditableAmountCents, - feeGrouped.amountCurrency + feeGrouped.amountCurrency, ), name: !!feeGrouped?.groupName ? feeGrouped?.groupName : feeGrouped?.group?.key - ? `${feeGrouped?.group?.key} • ${feeGrouped?.group?.value}` - : (feeGrouped?.group?.value as string), + ? `${feeGrouped?.group?.key} • ${feeGrouped?.group?.value}` + : (feeGrouped?.group?.value as string), maxAmount: feeGrouped?.creditableAmountCents, appliedTaxes: feeGrouped?.appliedTaxes || [], }, @@ -338,7 +338,7 @@ export const useCreateCreditNote: () => UseCreateCreditNoteReturn = () => { } : subAcc }, - {} + {}, ) }, [data?.invoice]) @@ -353,7 +353,7 @@ export const useCreateCreditNote: () => UseCreateCreditNoteReturn = () => { input: serializeCreditNoteInput( invoiceId as string, values, - data?.invoice?.currency || CurrencyEnum.Usd + data?.invoice?.currency || CurrencyEnum.Usd, ), }, }) diff --git a/src/hooks/useCreateEditAddOn.ts b/src/hooks/useCreateEditAddOn.ts index 5d1ea9434..ec356d970 100644 --- a/src/hooks/useCreateEditAddOn.ts +++ b/src/hooks/useCreateEditAddOn.ts @@ -153,6 +153,6 @@ export const useCreateEditAddOn: () => UseCreateEditAddOnReturn = () => { }) }, }), - [loading, addOnId, errorCode, data?.addOn, update, create] + [loading, addOnId, errorCode, data?.addOn, update, create], ) } diff --git a/src/hooks/useCreateEditBillableMetric.ts b/src/hooks/useCreateEditBillableMetric.ts index 392d4dfff..13b704890 100644 --- a/src/hooks/useCreateEditBillableMetric.ts +++ b/src/hooks/useCreateEditBillableMetric.ts @@ -142,6 +142,6 @@ export const useCreateEditBillableMetric: () => UseCreateEditBillableMetricRetur }) }, }), - [loading, billableMetricId, errorCode, data?.billableMetric, update, create] + [loading, billableMetricId, errorCode, data?.billableMetric, update, create], ) } diff --git a/src/hooks/useCreateEditCoupon.ts b/src/hooks/useCreateEditCoupon.ts index 6659767f3..3c1e57247 100644 --- a/src/hooks/useCreateEditCoupon.ts +++ b/src/hooks/useCreateEditCoupon.ts @@ -95,7 +95,7 @@ const formatCouponInput = ( hasPlanLimit: boolean, limitPlansList: PlansForCouponsFragment[], hasBillableMetricLimit: boolean, - limitBillableMetricsList: BillableMetricsForCouponsFragment[] + limitBillableMetricsList: BillableMetricsForCouponsFragment[], ) => { const { amountCents, @@ -144,10 +144,10 @@ export const useCreateEditCoupon: () => UseCreateEditCouponReturn = () => { }) const [hasPlanLimit, setHasPlanLimit] = useState(!!data?.coupon?.limitedPlans) const [limitPlansList, setLimitPlansList] = useState( - data?.coupon?.plans || [] + data?.coupon?.plans || [], ) const [hasBillableMetricLimit, setHasBillableMetricLimit] = useState( - !!data?.coupon?.limitedBillableMetrics + !!data?.coupon?.limitedBillableMetrics, ) const [limitBillableMetricsList, setLimitBillableMetricsList] = useState< BillableMetricsForCouponsFragment[] @@ -232,7 +232,7 @@ export const useCreateEditCoupon: () => UseCreateEditCouponReturn = () => { hasPlanLimit, limitPlansList, hasBillableMetricLimit, - limitBillableMetricsList + limitBillableMetricsList, ), }, }, @@ -246,7 +246,7 @@ export const useCreateEditCoupon: () => UseCreateEditCouponReturn = () => { hasPlanLimit, limitPlansList, hasBillableMetricLimit, - limitBillableMetricsList + limitBillableMetricsList, ), }, }) @@ -263,6 +263,6 @@ export const useCreateEditCoupon: () => UseCreateEditCouponReturn = () => { data?.coupon, update, create, - ] + ], ) } diff --git a/src/hooks/useCreateEditCustomer.ts b/src/hooks/useCreateEditCustomer.ts index e5f8e2f08..771d25741 100644 --- a/src/hooks/useCreateEditCustomer.ts +++ b/src/hooks/useCreateEditCustomer.ts @@ -75,7 +75,7 @@ gql` type UseCreateEditCustomer = (props: { customer?: AddCustomerDrawerFragment | null }) => { isEdition: boolean onSave: ( - values: CreateCustomerInput | UpdateCustomerInput + values: CreateCustomerInput | UpdateCustomerInput, ) => Promise< | FetchResult, Record> | FetchResult, Record> diff --git a/src/hooks/useCreateEditTax.ts b/src/hooks/useCreateEditTax.ts index 3c0d007f3..b36d8385a 100644 --- a/src/hooks/useCreateEditTax.ts +++ b/src/hooks/useCreateEditTax.ts @@ -142,6 +142,6 @@ export const useCreateEditTax: () => useCreateEditTaxReturn = () => { }) }, }), - [loading, errorCode, taxId, data?.tax, navigate, update, create] + [loading, errorCode, taxId, data?.tax, navigate, update, create], ) } diff --git a/src/hooks/useDebouncedSearch.ts b/src/hooks/useDebouncedSearch.ts index e80bb34ad..f6c3694d4 100644 --- a/src/hooks/useDebouncedSearch.ts +++ b/src/hooks/useDebouncedSearch.ts @@ -12,7 +12,7 @@ export type UseDebouncedSearch = ( // eslint-disable-next-line @typescript-eslint/no-explicit-any any >, - loading?: boolean + loading?: boolean, ) => { debouncedSearch?: DebouncedFunc<(value: unknown) => void> isLoading: boolean @@ -31,7 +31,7 @@ export const useDebouncedSearch: UseDebouncedSearch = (searchQuery, loading) => variables: { searchTerm: value }, }) }, DEBOUNCE_SEARCH_MS), - [] + [], ) useEffect(() => { diff --git a/src/index.html b/src/index.html index a518a9a31..9ed7a82b5 100644 --- a/src/index.html +++ b/src/index.html @@ -1,4 +1,4 @@ - + diff --git a/src/layouts/CustomerInvoiceDetails.tsx b/src/layouts/CustomerInvoiceDetails.tsx index cf428c504..3f2390ac9 100644 --- a/src/layouts/CustomerInvoiceDetails.tsx +++ b/src/layouts/CustomerInvoiceDetails.tsx @@ -135,7 +135,7 @@ export enum CustomerInvoiceDetailsTabsOptionsEnum { const mapStatus = ( status: InvoiceStatusTypeEnum, - paymentStatus?: InvoicePaymentStatusTypeEnum | undefined + paymentStatus?: InvoicePaymentStatusTypeEnum | undefined, ) => { if (status === InvoiceStatusTypeEnum.Draft) { return { label: 'text_63ac8850ff7117ad55777d31', type: StatusEnum.draft } @@ -297,7 +297,7 @@ const CustomerInvoiceDetails = () => { CUSTOMER_CREDIT_NOTE_DETAILS_ROUTE, CUSTOMER_INVOICE_CREDIT_NOTE_DETAILS_ROUTE, ], - } + }, ) } /> @@ -325,7 +325,7 @@ const CustomerInvoiceDetails = () => { align="left" onClick={async () => { finalizeInvoiceRef.current?.openDialog( - data?.invoice as InvoiceForFinalizeInvoiceFragment + data?.invoice as InvoiceForFinalizeInvoiceFragment, ) closePopper() }} @@ -373,7 +373,7 @@ const CustomerInvoiceDetails = () => { generatePath(CUSTOMER_INVOICE_CREATE_CREDIT_NOTE_ROUTE, { customerId: customerId as string, invoiceId: invoiceId as string, - }) + }), ) }} > @@ -507,7 +507,7 @@ const CustomerInvoiceDetails = () => { { currencyDisplay: 'symbol', currency: currency || CurrencyEnum.Usd, - } + }, ), })} diff --git a/src/pages/Analytics.tsx b/src/pages/Analytics.tsx index 3fbbf08b8..813139bf1 100644 --- a/src/pages/Analytics.tsx +++ b/src/pages/Analytics.tsx @@ -25,11 +25,11 @@ const Analytics = () => { const premiumWarningDialogRef = useRef(null) const [periodScope, setPeriodScope] = useState( - AnalyticsPeriodScopeEnum.Year + AnalyticsPeriodScopeEnum.Year, ) const [currencySearch, setCurrencySearch] = useState('') const [selectedCurrency, setSelectedCurrency] = useState( - organization?.defaultCurrency || CurrencyEnum.Usd + organization?.defaultCurrency || CurrencyEnum.Usd, ) useEffect(() => { @@ -40,7 +40,7 @@ const Analytics = () => { const currenciesToDisplay = useMemo(() => { return Object.values(CurrencyEnum).filter((c) => - c.toLowerCase().includes(currencySearch.toLowerCase()) + c.toLowerCase().includes(currencySearch.toLowerCase()), ) }, [currencySearch]) @@ -62,7 +62,7 @@ const Analytics = () => { } else { setTimeout(() => { const currencyButton = document.querySelector( - `[data-analytics-currency="${selectedCurrency}"]` + `[data-analytics-currency="${selectedCurrency}"]`, ) if (currencyButton) { diff --git a/src/pages/CreateAddOn.tsx b/src/pages/CreateAddOn.tsx index e704bba87..37b3d9eb8 100644 --- a/src/pages/CreateAddOn.tsx +++ b/src/pages/CreateAddOn.tsx @@ -81,8 +81,8 @@ const CreateAddOn = () => { ? String( deserializeAmount( addOn?.amountCents, - addOn?.amountCurrency || organization?.defaultCurrency - ) + addOn?.amountCurrency || organization?.defaultCurrency, + ), ) : addOn?.amountCents || undefined, amountCurrency: addOn?.amountCurrency || organization?.defaultCurrency || CurrencyEnum.Usd, @@ -131,7 +131,7 @@ const CreateAddOn = () => { const [shouldDisplayTaxesInput, setShouldDisplayTaxesInput] = useState(false) const [shouldDisplayDescription, setShouldDisplayDescription] = useState( - !!formikProps.initialValues.description + !!formikProps.initialValues.description, ) useEffect(() => { @@ -208,12 +208,12 @@ const CreateAddOn = () => {
{translate( - isEdition ? 'text_629728388c4d2300e2d38041' : 'text_629728388c4d2300e2d3803d' + isEdition ? 'text_629728388c4d2300e2d38041' : 'text_629728388c4d2300e2d3803d', )} {translate( - isEdition ? 'text_629728388c4d2300e2d38065' : 'text_629728388c4d2300e2d38061' + isEdition ? 'text_629728388c4d2300e2d38065' : 'text_629728388c4d2300e2d38061', )}
@@ -344,7 +344,7 @@ const CreateAddOn = () => { onChange={(newTaxId) => { const previousTaxes = [...(formikProps?.values?.taxes || [])] const newTaxObject = taxesData?.taxes?.collection?.find( - (t) => t.id === newTaxId + (t) => t.id === newTaxId, ) formikProps.setFieldValue('taxes', [...previousTaxes, newTaxObject]) @@ -375,7 +375,7 @@ const CreateAddOn = () => { setTimeout(() => { const element = document.querySelector( - `.${SEARCH_TAX_INPUT_FOR_ADD_ON_CLASSNAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}` + `.${SEARCH_TAX_INPUT_FOR_ADD_ON_CLASSNAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}`, ) as HTMLElement if (!element) return @@ -400,7 +400,7 @@ const CreateAddOn = () => { data-test="submit" > {translate( - isEdition ? 'text_629728388c4d2300e2d38170' : 'text_629728388c4d2300e2d38179' + isEdition ? 'text_629728388c4d2300e2d38170' : 'text_629728388c4d2300e2d38179', )} @@ -416,13 +416,13 @@ const CreateAddOn = () => { navigate(ADD_ONS_ROUTE)} /> diff --git a/src/pages/CreateBillableMetric.tsx b/src/pages/CreateBillableMetric.tsx index 39c685787..b59c14430 100644 --- a/src/pages/CreateBillableMetric.tsx +++ b/src/pages/CreateBillableMetric.tsx @@ -118,7 +118,7 @@ const CreateBillableMetric = () => { formikProps.setFieldValue(name, value) }, - [formikProps] + [formikProps], ) return ( @@ -182,12 +182,12 @@ const CreateBillableMetric = () => {
{translate( - isEdition ? 'text_62582fb4675ece01137a7e46' : 'text_623b42ff8ee4e000ba87d0b0' + isEdition ? 'text_62582fb4675ece01137a7e46' : 'text_623b42ff8ee4e000ba87d0b0', )} {translate( - isEdition ? 'text_62582fb4675ece01137a7e48' : 'text_623b42ff8ee4e000ba87d0b4' + isEdition ? 'text_62582fb4675ece01137a7e48' : 'text_623b42ff8ee4e000ba87d0b4', )}
@@ -235,7 +235,7 @@ const CreateBillableMetric = () => { helperText={translate( formikProps.values.recurring ? 'text_64d27292062d9600b089aacb' - : 'text_64d272b4df12dc008076e232' + : 'text_64d272b4df12dc008076e232', )} options={[ { @@ -318,16 +318,17 @@ const CreateBillableMetric = () => { formikProps.values?.aggregationType === AggregationTypeEnum.CountAgg ? translate('text_6241cc759211e600ea57f4f1') : formikProps.values?.aggregationType === AggregationTypeEnum.UniqueCountAgg - ? translate('text_62694d9181be8d00a33f20f6') - : formikProps.values?.aggregationType === AggregationTypeEnum.LatestAgg - ? translate('text_64f8823d75521b6faaee854b') - : formikProps.values?.aggregationType === AggregationTypeEnum.MaxAgg - ? translate('text_62694d9181be8d00a33f20f2') - : formikProps.values?.aggregationType === AggregationTypeEnum.SumAgg - ? translate('text_62694d9181be8d00a33f20ec') - : formikProps.values?.aggregationType === AggregationTypeEnum.WeightedSumAgg - ? translate('text_650062226a33c46e82050488') - : undefined + ? translate('text_62694d9181be8d00a33f20f6') + : formikProps.values?.aggregationType === AggregationTypeEnum.LatestAgg + ? translate('text_64f8823d75521b6faaee854b') + : formikProps.values?.aggregationType === AggregationTypeEnum.MaxAgg + ? translate('text_62694d9181be8d00a33f20f2') + : formikProps.values?.aggregationType === AggregationTypeEnum.SumAgg + ? translate('text_62694d9181be8d00a33f20ec') + : formikProps.values?.aggregationType === + AggregationTypeEnum.WeightedSumAgg + ? translate('text_650062226a33c46e82050488') + : undefined } /> @@ -394,7 +395,7 @@ const CreateBillableMetric = () => { ) { const groupChangeLevel = determineGroupDiffLevel( billableMetric?.group, - formikProps?.values?.group + formikProps?.values?.group, ) if (groupChangeLevel === GroupLevelEnum.StructuralChange) { @@ -423,7 +424,7 @@ const CreateBillableMetric = () => { }} > {translate( - isEdition ? 'text_62582fb4675ece01137a7e6c' : 'text_623b42ff8ee4e000ba87d0d4' + isEdition ? 'text_62582fb4675ece01137a7e6c' : 'text_623b42ff8ee4e000ba87d0d4', )} @@ -439,13 +440,13 @@ const CreateBillableMetric = () => { navigate(BILLABLE_METRICS_ROUTE)} /> diff --git a/src/pages/CreateCoupon.tsx b/src/pages/CreateCoupon.tsx index 76f76c638..c0d082e4c 100644 --- a/src/pages/CreateCoupon.tsx +++ b/src/pages/CreateCoupon.tsx @@ -143,7 +143,7 @@ const CreateCoupon = () => { DateTime.now().plus({ days: -1 }), translate('text_632d68358f1fedc68eed3ef2', { date: DateTime.now().plus({ days: -1 }).toFormat('LLL. dd, yyyy').toLocaleString(), - }) + }), ) .required(''), }), @@ -153,7 +153,7 @@ const CreateCoupon = () => { onSubmit: onSave, }) const [shouldDisplayDescription, setShouldDisplayDescription] = useState( - !!formikProps.initialValues.description + !!formikProps.initialValues.description, ) const attachPlanToCoupon = (plan: PlansForCouponsFragment) => { @@ -265,12 +265,12 @@ const CreateCoupon = () => {
{translate( - isEdition ? 'text_6287a9bdac160c00b2e0fc05' : 'text_62876e85e32e0300e1803106' + isEdition ? 'text_6287a9bdac160c00b2e0fc05' : 'text_62876e85e32e0300e1803106', )} {translate( - isEdition ? 'text_6287a9bdac160c00b2e0fc0b' : 'text_62876e85e32e0300e180310f' + isEdition ? 'text_6287a9bdac160c00b2e0fc0b' : 'text_62876e85e32e0300e180310f', )}
@@ -466,7 +466,7 @@ const CreateCoupon = () => { onChange={(_, checked) => { formikProps.setFieldValue( 'expiration', - checked ? CouponExpiration.TimeLimit : CouponExpiration.NoExpiration + checked ? CouponExpiration.TimeLimit : CouponExpiration.NoExpiration, ) }} /> @@ -578,7 +578,7 @@ const CreateCoupon = () => { setLimitBillableMetricsList( (oldArray: BillableMetricsForCouponsFragment[]) => [ ...oldArray.filter((b) => b.id !== billableMetric.id), - ] + ], ) } data-test={`delete-limited-billable-metric-${i}`} @@ -633,7 +633,7 @@ const CreateCoupon = () => { data-test="submit" > {translate( - isEdition ? 'text_6287a9bdac160c00b2e0fc6b' : 'text_62876e85e32e0300e180317d' + isEdition ? 'text_6287a9bdac160c00b2e0fc6b' : 'text_62876e85e32e0300e180317d', )} @@ -656,13 +656,13 @@ const CreateCoupon = () => { navigate(COUPONS_ROUTE)} /> diff --git a/src/pages/CreateCreditNote.tsx b/src/pages/CreateCreditNote.tsx index 54daef28a..a12dc8043 100644 --- a/src/pages/CreateCreditNote.tsx +++ b/src/pages/CreateCreditNote.tsx @@ -57,7 +57,7 @@ gql` const determineCheckboxValue = ( initialValue: boolean | undefined | null, - additionnalValue: boolean | undefined + additionnalValue: boolean | undefined, ) => { if (initialValue === undefined || additionnalValue === undefined) return undefined if (initialValue === null) { @@ -122,12 +122,12 @@ const CreateCreditNote = () => { const addOnFeesValidation = useMemo( () => generateAddOnFeesSchema(feeForAddOn || [], currency), - [feeForAddOn, currency] + [feeForAddOn, currency], ) const feesValidation = useMemo( () => generateFeesSchema(feesPerInvoice || {}, currency), - [feesPerInvoice, currency] + [feesPerInvoice, currency], ) const [payBackValidation, setPayBackValidation] = useState(array()) @@ -206,7 +206,7 @@ const CreateCreditNote = () => { [childKey]: groupValue, value: determineCheckboxValue( subscriptionGroupValues.value, - groupValue as unknown as boolean | undefined + groupValue as unknown as boolean | undefined, ), } } @@ -225,7 +225,7 @@ const CreateCreditNote = () => { fees: formikProps.values.fees, addonFees: formikProps.values.addOnFee, }), - [currency, formikProps.values.addOnFee, formikProps.values.fees, hasError] + [currency, formikProps.values.addOnFee, formikProps.values.fees, hasError], ) return ( @@ -253,7 +253,7 @@ const CreateCreditNote = () => { customerId: customerId as string, invoiceId: invoiceId as string, tab: CustomerInvoiceDetailsTabsOptionsEnum.overview, - }) + }), ) } /> @@ -302,11 +302,11 @@ const CreateCreditNote = () => { subtotal: intlFormatNumber( deserializeAmount( invoice?.subTotalIncludingTaxesAmountCents || 0, - currency + currency, ), { currency, - } + }, ), })} @@ -379,7 +379,7 @@ const CreateCreditNote = () => { deserializeAmount(invoice?.creditableAmountCents || 0, currency), { currency, - } + }, ), })} @@ -415,7 +415,7 @@ const CreateCreditNote = () => { onChange={(_, value) => { const childValues = _get( formikProps.values.fees, - `${subKey}.fees` + `${subKey}.fees`, ) as unknown as { [feeGroupId: string]: FromFee | GroupedFee } formikProps.setFieldValue( @@ -441,13 +441,13 @@ const CreateCreditNote = () => { [groupKey]: { ...fee, checked: value }, } }, - {} + {}, ), }, } } return acc - }, {}) + }, {}), ) }} /> @@ -543,7 +543,7 @@ const CreateCreditNote = () => { customerId: customerId as string, invoiceId: invoiceId as string, tab: CustomerInvoiceDetailsTabsOptionsEnum.overview, - }) + }), ) } /> diff --git a/src/pages/CreateInvoice.tsx b/src/pages/CreateInvoice.tsx index 4a0b9569f..2093e7bed 100644 --- a/src/pages/CreateInvoice.tsx +++ b/src/pages/CreateInvoice.tsx @@ -201,7 +201,7 @@ const CreateInvoice = () => { addOnId: string().required(''), description: string(), units: number().min(1, 'text_645381a65b99559adf6401f0').required(''), - }) + }), ) .required(''), }), @@ -259,7 +259,7 @@ const CreateInvoice = () => { currentTaxesMap: TaxMapType, feeAmount?: number, feeUnits?: number, - feeAppliedTaxes?: TaxInfosForCreateInvoiceFragment[] + feeAppliedTaxes?: TaxInfosForCreateInvoiceFragment[], ) => { if (!feeAppliedTaxes?.length) return currentTaxesMap if (!currentTaxesMap) currentTaxesMap = new Map() @@ -289,12 +289,12 @@ const CreateInvoice = () => { acc.taxesToDisplay, fee.unitAmountCents, fee.units || 0, - fee?.taxes || undefined + fee?.taxes || undefined, ), } return acc }, - { subTotal: 0, taxesToDisplay: new Map() } + { subTotal: 0, taxesToDisplay: new Map() }, ) const vatTotalAmount = totalsReduced?.taxesToDisplay?.size @@ -567,7 +567,7 @@ const CreateInvoice = () => { callback: (invoiceDisplayName: string) => { formikProps.setFieldValue( `fees.${i}.invoiceDisplayName`, - invoiceDisplayName + invoiceDisplayName, ) }, }) @@ -657,7 +657,7 @@ const CreateInvoice = () => { callback: (newDescription?: string) => { formikProps.setFieldValue( `fees.${i}.description`, - newDescription + newDescription, ) }, }) @@ -676,7 +676,7 @@ const CreateInvoice = () => { callback: (newTaxesArray?: LocalFeeInput['taxes']) => { formikProps.setFieldValue( `fees.${i}.taxes`, - newTaxesArray + newTaxesArray, ) }, }) @@ -718,7 +718,7 @@ const CreateInvoice = () => { placeholder={translate('text_6453819268763979024ad0ad')} onChange={(value) => { const addOn = addOnData?.addOns?.collection.find( - (c) => c.id === value + (c) => c.id === value, ) const addonApplicableTaxes = addOn?.taxes?.length ? addOn?.taxes @@ -763,7 +763,7 @@ const CreateInvoice = () => { setTimeout(() => { ;( document.querySelector( - `.${ADD_ITEM_FOR_INVOICE_INPUT_NAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}` + `.${ADD_ITEM_FOR_INVOICE_INPUT_NAME} .${MUI_INPUT_BASE_ROOT_CLASSNAME}`, ) as HTMLElement ).click() }, 0) diff --git a/src/pages/CreatePlan.tsx b/src/pages/CreatePlan.tsx index 2f18e3709..5df5c8660 100644 --- a/src/pages/CreatePlan.tsx +++ b/src/pages/CreatePlan.tsx @@ -116,7 +116,7 @@ const CreatePlan = () => { generatePath(PLAN_DETAILS_ROUTE, { planId: plan.id, tab: PlanDetailsTabsOptionsEnum.overview, - }) + }), ) } else { navigate(PLANS_ROUTE) @@ -183,14 +183,14 @@ const CreatePlan = () => {
{translate( - isEdition ? 'text_625fd165963a7b00c8f59771' : 'text_624453d52e945301380e498a' + isEdition ? 'text_625fd165963a7b00c8f59771' : 'text_624453d52e945301380e498a', )} {translate( type === FORM_TYPE_ENUM.edition ? 'text_625fd165963a7b00c8f5977b' - : 'text_642d5eb2783a2ad10d670318' + : 'text_642d5eb2783a2ad10d670318', )}
@@ -229,7 +229,7 @@ const CreatePlan = () => { {translate( type === FORM_TYPE_ENUM.edition ? 'text_625fd165963a7b00c8f598aa' - : 'text_62ff5d01a306e274d4ffcc75' + : 'text_62ff5d01a306e274d4ffcc75', )} @@ -245,13 +245,13 @@ const CreatePlan = () => { planCloseRedirection()} /> diff --git a/src/pages/CreateSubscription.tsx b/src/pages/CreateSubscription.tsx index 667055e6f..b4c7ea59b 100644 --- a/src/pages/CreateSubscription.tsx +++ b/src/pages/CreateSubscription.tsx @@ -202,7 +202,7 @@ const CreateSubscription = () => { customerId as string, localValues, planFormikProps.values, - planFormikProps.dirty + planFormikProps.dirty, ) if (errorsString === 'CurrenciesDoesNotMatch') { @@ -225,7 +225,7 @@ const CreateSubscription = () => { const [shouldDisplaySubscriptionExternalId, setShouldDisplaySubscriptionExternalId] = useState(!!subscriptionFormikProps.initialValues.externalId) const [shouldDisplaySubscriptionName, setShouldDisplaySubscriptionName] = useState( - !!subscriptionFormikProps.initialValues.name + !!subscriptionFormikProps.initialValues.name, ) useEffect(() => { @@ -316,8 +316,8 @@ const CreateSubscription = () => { return billingTime === BillingTimeEnum.Calendar ? translate('text_62ea7cd44cd4b14bb9ac1d92') : formattedCurrentDate === february29 - ? translate('text_62ea7cd44cd4b14bb9ac1d9a') - : translate('text_62ea7cd44cd4b14bb9ac1d96', { date: currentDate.toFormat('LLL. dd') }) + ? translate('text_62ea7cd44cd4b14bb9ac1d9a') + : translate('text_62ea7cd44cd4b14bb9ac1d96', { date: currentDate.toFormat('LLL. dd') }) case PlanInterval.Quarterly: if (billingTime === BillingTimeEnum.Calendar) @@ -365,8 +365,8 @@ const CreateSubscription = () => { {formType === FORM_TYPE_ENUM.creation ? translate('text_65118a52df984447c1869463') : formType === FORM_TYPE_ENUM.edition - ? translate('text_62d7f6178ec94cd09370e63c') - : translate('text_65118a52df984447c18694c6')} + ? translate('text_62d7f6178ec94cd09370e63c') + : translate('text_65118a52df984447c18694c6')} ) @@ -616,10 +616,10 @@ const CreateSubscription = () => { selectedPlan?.interval === PlanInterval.Yearly ? translate('text_62ebd597d5d5130a03ced107') : selectedPlan?.interval === PlanInterval.Weekly - ? translate('text_62ebd597d5d5130a03ced101') - : selectedPlan?.interval === PlanInterval.Quarterly - ? translate('text_64d6357b00dea100ad1cba27') - : translate('text_62ea7cd44cd4b14bb9ac1db9'), + ? translate('text_62ebd597d5d5130a03ced101') + : selectedPlan?.interval === PlanInterval.Quarterly + ? translate('text_64d6357b00dea100ad1cba27') + : translate('text_62ea7cd44cd4b14bb9ac1db9'), value: BillingTimeEnum.Calendar, }, { diff --git a/src/pages/CreateTax.tsx b/src/pages/CreateTax.tsx index d6ad1edc4..1c6f5f8d3 100644 --- a/src/pages/CreateTax.tsx +++ b/src/pages/CreateTax.tsx @@ -50,7 +50,7 @@ const CreateTaxRate = () => { }) const [shouldDisplayDescription, setShouldDisplayDescription] = useState( - !!formikProps.initialValues.description + !!formikProps.initialValues.description, ) useEffect(() => { @@ -129,12 +129,12 @@ const CreateTaxRate = () => {
{translate( - isEdition ? 'text_645bb193927b375079d28a0d' : 'text_645bb193927b375079d28a51' + isEdition ? 'text_645bb193927b375079d28a0d' : 'text_645bb193927b375079d28a51', )} {translate( - isEdition ? 'text_645bb193927b375079d28a17' : 'text_645bb193927b375079d28a71' + isEdition ? 'text_645bb193927b375079d28a17' : 'text_645bb193927b375079d28a71', )}
@@ -229,7 +229,7 @@ const CreateTaxRate = () => { data-test="submit" > {translate( - isEdition ? 'text_645bb193927b375079d28ab7' : 'text_645bb193927b375079d28b8e' + isEdition ? 'text_645bb193927b375079d28ab7' : 'text_645bb193927b375079d28b8e', )} @@ -260,7 +260,7 @@ const CreateTaxRate = () => { { customersCount: tax?.customersCount, }, - tax?.customersCount + tax?.customersCount, )} continueText={translate('text_6464a12047f2dd00affa9252')} onContinue={formikProps.submitForm} diff --git a/src/pages/CreditNoteDetails.tsx b/src/pages/CreditNoteDetails.tsx index dcbbf2b2f..24a70370a 100644 --- a/src/pages/CreditNoteDetails.tsx +++ b/src/pages/CreditNoteDetails.tsx @@ -239,7 +239,7 @@ const CreditNoteDetails = () => { : generatePath(CUSTOMER_DETAILS_TAB_ROUTE, { customerId: customerId as string, tab: CustomerDetailsTabsOptions.creditNotes, - }) + }), ) } /> @@ -343,7 +343,7 @@ const CreditNoteDetails = () => { label={translate(status.label, { date: formatDateToTZ( creditNote?.refundedAt, - creditNote?.customer.applicableTimezone + creditNote?.customer.applicableTimezone, ), })} /> @@ -355,12 +355,12 @@ const CreditNoteDetails = () => { amount: intlFormatNumber( deserializeAmount( creditNote?.totalAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, ), })} @@ -455,7 +455,7 @@ const CreditNoteDetails = () => { {formatDateToTZ( creditNote?.createdAt, - creditNote?.customer.applicableTimezone + creditNote?.customer.applicableTimezone, )} @@ -471,12 +471,12 @@ const CreditNoteDetails = () => { {intlFormatNumber( deserializeAmount( creditNote?.balanceAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -493,7 +493,7 @@ const CreditNoteDetails = () => { label={translate(status.label, { date: formatDateToTZ( creditNote?.refundedAt, - creditNote?.customer.applicableTimezone + creditNote?.customer.applicableTimezone, ), })} /> @@ -564,7 +564,7 @@ const CreditNoteDetails = () => { }${ item?.fee?.trueUpParentFee?.id ? ` - ${translate( - 'text_64463aaa34904c00a23be4f7' + 'text_64463aaa34904c00a23be4f7', )}` : '' }`} @@ -580,10 +580,10 @@ const CreditNoteDetails = () => { item.fee.groupName ? ` • ${item.fee.groupName}` : item.fee.group?.key - ? `${` • ${item.fee.group?.key} • `}${ - item.fee.group.value - }` - : '' + ? `${` • ${item.fee.group?.key} • `}${ + item.fee.group.value + }` + : '' }` : `${ item.fee.invoiceName || @@ -592,8 +592,8 @@ const CreditNoteDetails = () => { item.fee.groupName ? ` • ${item.fee.groupName}` : item.fee.group?.value - ? ` • ${item.fee.group?.value}` - : '' + ? ` • ${item.fee.group?.value}` + : '' }`} @@ -630,12 +630,12 @@ const CreditNoteDetails = () => { {intlFormatNumber( deserializeAmount( item.amountCents || 0, - item.amountCurrency + item.amountCurrency, ), { currencyDisplay: 'symbol', currency: item.amountCurrency, - } + }, )} @@ -665,12 +665,12 @@ const CreditNoteDetails = () => { {intlFormatNumber( deserializeAmount( creditNote?.couponsAdjustmentAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -689,12 +689,12 @@ const CreditNoteDetails = () => { {intlFormatNumber( deserializeAmount( creditNote?.subTotalExcludingTaxesAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -715,12 +715,12 @@ const CreditNoteDetails = () => { amount: intlFormatNumber( deserializeAmount( appliedTax.baseAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, ), })} @@ -731,12 +731,12 @@ const CreditNoteDetails = () => { {intlFormatNumber( deserializeAmount( appliedTax.amountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -777,12 +777,12 @@ const CreditNoteDetails = () => { {intlFormatNumber( deserializeAmount( creditNote?.creditAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -802,12 +802,12 @@ const CreditNoteDetails = () => { {intlFormatNumber( deserializeAmount( creditNote?.refundAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} @@ -826,12 +826,12 @@ const CreditNoteDetails = () => { {intlFormatNumber( deserializeAmount( creditNote?.totalAmountCents || 0, - creditNote?.currency || CurrencyEnum.Usd + creditNote?.currency || CurrencyEnum.Usd, ), { currencyDisplay: 'symbol', currency: creditNote?.currency || CurrencyEnum.Usd, - } + }, )} diff --git a/src/pages/CustomerDetails.tsx b/src/pages/CustomerDetails.tsx index 0ebad673d..3cdd1d913 100644 --- a/src/pages/CustomerDetails.tsx +++ b/src/pages/CustomerDetails.tsx @@ -188,7 +188,7 @@ const CustomerDetails = () => { navigate( generatePath(CREATE_SUBSCRIPTION, { customerId: customerId as string, - }) + }), ) closePopper() }} @@ -200,7 +200,7 @@ const CustomerDetails = () => { align="left" onClick={() => { navigate( - generatePath(CREATE_INVOICE_ROUTE, { customerId: customerId as string }) + generatePath(CREATE_INVOICE_ROUTE, { customerId: customerId as string }), ) closePopper() diff --git a/src/pages/CustomerDraftInvoicesList.tsx b/src/pages/CustomerDraftInvoicesList.tsx index 43e6e42b2..419f4e2bf 100644 --- a/src/pages/CustomerDraftInvoicesList.tsx +++ b/src/pages/CustomerDraftInvoicesList.tsx @@ -87,7 +87,7 @@ const CustomerDraftInvoicesList = () => { generatePath(CUSTOMER_DETAILS_TAB_ROUTE, { customerId, tab: CustomerDetailsTabsOptions.invoices, - }) + }), ) } /> diff --git a/src/pages/Invitation.tsx b/src/pages/Invitation.tsx index 0323e9cbd..e352a371e 100644 --- a/src/pages/Invitation.tsx +++ b/src/pages/Invitation.tsx @@ -96,7 +96,7 @@ const Invitation = () => { .matches(RegExp('(.*\\d.*)'), FORM_ERRORS.NUMBER) .matches(RegExp('[/_!@#$%^&*(),.?":{}|<>/-]'), FORM_ERRORS.SPECIAL), }), - [] + [], ) const onInvitation = async () => { const { password } = formFields diff --git a/src/pages/InvoiceOverview.tsx b/src/pages/InvoiceOverview.tsx index fa6daaeb1..bcaddf0fd 100644 --- a/src/pages/InvoiceOverview.tsx +++ b/src/pages/InvoiceOverview.tsx @@ -150,7 +150,7 @@ export const InvoiceOverview = memo( issuingDate: formatDateToTZ( invoice.issuingDate, customer?.applicableTimezone, - "LLL. dd, yyyy U'T'CZ" + "LLL. dd, yyyy U'T'CZ", ), })} @@ -181,7 +181,7 @@ export const InvoiceOverview = memo( ) - } + }, ) InvoiceOverview.displayName = 'InvoiceOverview' diff --git a/src/pages/InvoicesList.tsx b/src/pages/InvoicesList.tsx index 473c6208e..3d8aaf1e1 100644 --- a/src/pages/InvoicesList.tsx +++ b/src/pages/InvoicesList.tsx @@ -141,7 +141,7 @@ const InvoicesList = () => { customerId: splitted[0], invoiceId: splitted[1], tab: CustomerInvoiceDetailsTabsOptionsEnum.overview, - }) + }), ) }, }) @@ -267,12 +267,12 @@ const InvoicesList = () => { tab === InvoiceListTabEnum.succeeded ? 'text_63c67d2913c20b8d7d05c44c' : tab === InvoiceListTabEnum.draft - ? 'text_63c67d2913c20b8d7d05c442' - : tab === InvoiceListTabEnum.pendingFailed - ? 'text_63c67d8796db41749ada51ca' - : tab === InvoiceListTabEnum.voided - ? 'text_65269cd46e7ec037a6823fd8' - : 'text_63c67d2913c20b8d7d05c43e' + ? 'text_63c67d2913c20b8d7d05c442' + : tab === InvoiceListTabEnum.pendingFailed + ? 'text_63c67d8796db41749ada51ca' + : tab === InvoiceListTabEnum.voided + ? 'text_65269cd46e7ec037a6823fd8' + : 'text_63c67d2913c20b8d7d05c43e', )} subtitle={translate('text_63c67d2913c20b8d7d05c446')} image={} @@ -283,12 +283,12 @@ const InvoicesList = () => { tab === InvoiceListTabEnum.succeeded ? 'text_63b578e959c1366df5d14559' : tab === InvoiceListTabEnum.draft - ? 'text_63b578e959c1366df5d1455b' - : tab === InvoiceListTabEnum.pendingFailed - ? 'text_63b578e959c1366df5d1456e' - : tab === InvoiceListTabEnum.voided - ? 'text_65269cd46e7ec037a6823fd6' - : 'text_63b578e959c1366df5d14569' + ? 'text_63b578e959c1366df5d1455b' + : tab === InvoiceListTabEnum.pendingFailed + ? 'text_63b578e959c1366df5d1456e' + : tab === InvoiceListTabEnum.voided + ? 'text_65269cd46e7ec037a6823fd6' + : 'text_63b578e959c1366df5d14569', )} subtitle={ tab === InvoiceListTabEnum.succeeded ? ( diff --git a/src/pages/PlanDetails.tsx b/src/pages/PlanDetails.tsx index 27ed4547b..7d8b9c6dc 100644 --- a/src/pages/PlanDetails.tsx +++ b/src/pages/PlanDetails.tsx @@ -75,7 +75,7 @@ const PlanDetails = () => { customerId: customerId as string, subscriptionId: subscriptionId as string, tab: PlanDetailsTabsOptionsEnum.overview, - }) + }), ) } else { navigate(PLANS_ROUTE) diff --git a/src/pages/PlansList.tsx b/src/pages/PlansList.tsx index a5b25d51d..007e3f987 100644 --- a/src/pages/PlansList.tsx +++ b/src/pages/PlansList.tsx @@ -54,7 +54,7 @@ const PlansList = () => { generatePath(PLAN_DETAILS_ROUTE, { planId: String(id), tab: PlanDetailsTabsOptionsEnum.overview, - }) + }), ), }) let index = -1 diff --git a/src/pages/SubscriptionDetails.tsx b/src/pages/SubscriptionDetails.tsx index 386edf459..ba2e26f58 100644 --- a/src/pages/SubscriptionDetails.tsx +++ b/src/pages/SubscriptionDetails.tsx @@ -84,7 +84,7 @@ const SubscriptionDetails = () => { generatePath(PLAN_DETAILS_ROUTE, { planId: planId, tab: PlanDetailsTabsOptionsEnum.subscriptions, - }) + }), ) } }} @@ -116,7 +116,7 @@ const SubscriptionDetails = () => { generatePath(UPDATE_SUBSCRIPTION, { customerId: subscription?.customer?.id as string, subscriptionId: subscriptionId as string, - }) + }), ) closePopper() }} @@ -131,7 +131,7 @@ const SubscriptionDetails = () => { generatePath(UPGRADE_DOWNGRADE_SUBSCRIPTION, { customerId: subscription?.customer?.id as string, subscriptionId: subscriptionId as string, - }) + }), ) closePopper() }} @@ -165,7 +165,7 @@ const SubscriptionDetails = () => { navigate( generatePath(CUSTOMER_DETAILS_ROUTE, { customerId: subscription?.customer?.id as string, - }) + }), ) }, }) diff --git a/src/pages/__devOnly/DesignSystem.tsx b/src/pages/__devOnly/DesignSystem.tsx index b58c645f7..7ee5c1ea5 100644 --- a/src/pages/__devOnly/DesignSystem.tsx +++ b/src/pages/__devOnly/DesignSystem.tsx @@ -732,8 +732,8 @@ const DesignSystem = () => { formikProps.values.checkboxCond1 && formikProps.values.checkboxCond2 ? true : !formikProps.values.checkboxCond1 && !formikProps.values.checkboxCond2 - ? false - : undefined + ? false + : undefined } onChange={(e, value) => { if (value) { @@ -759,8 +759,8 @@ const DesignSystem = () => { formikProps.values.checkboxCond1 && formikProps.values.checkboxCond2 ? true : !formikProps.values.checkboxCond1 && !formikProps.values.checkboxCond2 - ? false - : undefined + ? false + : undefined } onChange={(e, value) => { if (value) { diff --git a/src/pages/auth/ResetPassword.tsx b/src/pages/auth/ResetPassword.tsx index d21abf3ce..d5e4fe2c4 100644 --- a/src/pages/auth/ResetPassword.tsx +++ b/src/pages/auth/ResetPassword.tsx @@ -100,7 +100,7 @@ const ResetPassword = () => { .matches(RegExp('(.*\\d.*)'), FORM_ERRORS.NUMBER) .matches(RegExp('[/_!@#$%^&*(),.?":{}|<>/-]'), FORM_ERRORS.SPECIAL), }), - [] + [], ) const onResetPassword = async () => { const { password } = formFields diff --git a/src/pages/auth/SignUp.tsx b/src/pages/auth/SignUp.tsx index b579ae151..d8c948c15 100644 --- a/src/pages/auth/SignUp.tsx +++ b/src/pages/auth/SignUp.tsx @@ -77,7 +77,7 @@ const SignUp = () => { .matches(RegExp('(.*\\d.*)'), FORM_ERRORS.NUMBER) .matches(RegExp('[/_!@#$%^&*(),.?":{}|<>/-]'), FORM_ERRORS.SPECIAL), }), - [] + [], ) const onSignUp = async () => { await signUp({ diff --git a/src/pages/developers/Debugger.tsx b/src/pages/developers/Debugger.tsx index 35ab3c2ae..4f41693f4 100644 --- a/src/pages/developers/Debugger.tsx +++ b/src/pages/developers/Debugger.tsx @@ -83,7 +83,7 @@ const Debugger = () => { return acc }, {}), - [data?.events?.collection, formatTimeOrgaTZ] + [data?.events?.collection, formatTimeOrgaTZ], ) useEffect(() => { diff --git a/src/pages/developers/WebhookLogs.tsx b/src/pages/developers/WebhookLogs.tsx index c41f51894..ef8b08980 100644 --- a/src/pages/developers/WebhookLogs.tsx +++ b/src/pages/developers/WebhookLogs.tsx @@ -112,9 +112,9 @@ const WebhookLogs = () => { return acc }, - {} + {}, ), - [data?.webhooks?.collection, formatTimeOrgaTZ] + [data?.webhooks?.collection, formatTimeOrgaTZ], ) const { onKeyDown } = useListKeysNavigation({ getElmId: (i) => `${WEBHOOK_ITEM_NAV_KEY}${i}`, @@ -219,7 +219,7 @@ const WebhookLogs = () => { title={translate( !!variables?.searchTerm ? 'text_63ebafd12755e50052a86e13' - : 'text_63ebaf555f88d954d73beb7e' + : 'text_63ebaf555f88d954d73beb7e', )} subtitle={ !variables?.searchTerm ? ( diff --git a/src/pages/settings/EmailScenarioConfig.tsx b/src/pages/settings/EmailScenarioConfig.tsx index d229cdb73..8bb6b5443 100644 --- a/src/pages/settings/EmailScenarioConfig.tsx +++ b/src/pages/settings/EmailScenarioConfig.tsx @@ -391,12 +391,12 @@ const EmailScenarioConfig = () => { {translateWithContextualLocal( - translationsKey.credit_note_number as string + translationsKey.credit_note_number as string, )} {translateWithContextualLocal( - translationsKey.credit_note_number_value as string + translationsKey.credit_note_number_value as string, )} diff --git a/src/pages/settings/InvoiceSettings.tsx b/src/pages/settings/InvoiceSettings.tsx index 226007f5d..7960a7505 100644 --- a/src/pages/settings/InvoiceSettings.tsx +++ b/src/pages/settings/InvoiceSettings.tsx @@ -233,7 +233,7 @@ const InvoiceSettings = () => { { days: organization?.netPaymentTerm, }, - organization?.netPaymentTerm + organization?.netPaymentTerm, )} @@ -273,7 +273,7 @@ const InvoiceSettings = () => { {translate( 'text_638dc196fb209d551f3d81a2', { gracePeriod: invoiceGracePeriod }, - invoiceGracePeriod + invoiceGracePeriod, )} diff --git a/src/test-utils.tsx b/src/test-utils.tsx index 3d5aa8308..a6025e79c 100644 --- a/src/test-utils.tsx +++ b/src/test-utils.tsx @@ -56,7 +56,7 @@ export const AllTheProviders = ({ const customRender = ( ui: ReactElement, - options?: Omit & { mocks?: TestMocksType } + options?: Omit & { mocks?: TestMocksType }, ) => render(ui, { wrapper: (props) => ,