diff --git a/src/App.tsx b/src/App.tsx index a580222b8..3bbff60df 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,33 +1,23 @@ import { ApolloClient, ApolloProvider, NormalizedCacheObject } from '@apollo/client' import { loadDevMessages, loadErrorMessages } from '@apollo/client/dev' import { StyledEngineProvider, ThemeProvider } from '@mui/material' -import { useEffect, useRef, useState } from 'react' +import { useEffect, useState } from 'react' import { BrowserRouter } from 'react-router-dom' -import { DebugInfoDialog, DebugInfoDialogRef } from '~/components/DebugInfoDialog' import { ToastContainer } from '~/components/designSystem/Toasts' import { ErrorBoundary } from '~/components/ErrorBoundary' import { RouteWrapper } from '~/components/RouteWrapper' import { UserIdentifier } from '~/components/UserIdentifier' import { envGlobalVar, initializeApolloClient, initializeTranslations } from '~/core/apolloClient' import { initializeYup } from '~/formValidation/initializeYup' -import { useShortcuts } from '~/hooks/ui/useShortcuts' import { theme } from '~/styles' import { AppEnvEnum } from './core/constants/globalTypes' const App = () => { const [client, setClient] = useState | null>(null) - const debugInfoDialogRef = useRef(null) const { appEnv } = envGlobalVar() - useShortcuts([ - { - keys: ['Ctrl', 'KeyI'], - action: () => debugInfoDialogRef.current?.openDialog(), - }, - ]) - useEffect(() => { async function initApolloClient() { const apolloClient = await initializeApolloClient() @@ -58,7 +48,6 @@ const App = () => { - diff --git a/src/components/DebugInfoDialog.tsx b/src/components/DebugInfoDialog.tsx deleted file mode 100644 index af5f0f8a3..000000000 --- a/src/components/DebugInfoDialog.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import { forwardRef } from 'react' -import styled from 'styled-components' - -import { Button, Dialog, DialogRef, Typography } from '~/components/designSystem' -import { addToast, envGlobalVar } from '~/core/apolloClient' -import { copyToClipboard } from '~/core/utils/copyToClipboard' -import { useInternationalization } from '~/hooks/core/useInternationalization' -import { useCurrentUser } from '~/hooks/useCurrentUser' -import { theme } from '~/styles' - -const { appEnv, apiUrl, appVersion } = envGlobalVar() - -export type DebugInfoDialogRef = DialogRef - -export const DebugInfoDialog = forwardRef((_props, ref) => { - const { translate } = useInternationalization() - const { currentUser } = useCurrentUser() - - return ( - } - actions={({ closeDialog }) => ( - <> - - - - )} - > - - - {translate('text_62f50d26c989ab031968849e')} - {appEnv} - - - {translate('text_62f50d26c989ab03196884a2')} - {apiUrl} - - - {translate('text_62f50d26c989ab03196884aa')} - {appVersion} - - {currentUser?.id && ( - - {translate('text_62f50d26c989ab03196884a6')} - {currentUser?.id} - - )} - - - ) -}) - -const Content = styled.div` - > *:not(:last-child) { - margin-bottom: ${theme.spacing(3)}; - } - > *:last-child { - margin-bottom: ${theme.spacing(8)}; - } -` - -const Line = styled.div` - display: flex; - align-items: baseline; - - > *:first-child { - width: 140px; - min-width: 140px; - margin-right: ${theme.spacing(3)}; - } -` - -DebugInfoDialog.displayName = 'DebugInfoDialog' diff --git a/src/generated/graphql.tsx b/src/generated/graphql.tsx index c9df6cd77..f345e849f 100644 --- a/src/generated/graphql.tsx +++ b/src/generated/graphql.tsx @@ -1207,13 +1207,22 @@ export type CreateCustomerWalletTransactionInput = { walletId: Scalars['ID']['input']; }; +/** Autogenerated input type of CreateCreditNotesDataExport */ +export type CreateDataExportsCreditNotesInput = { + /** A unique identifier for the client performing the mutation. */ + clientMutationId?: InputMaybe; + filters: DataExportCreditNoteFiltersInput; + format: DataExportFormatTypeEnum; + resourceType: CreditNoteExportTypeEnum; +}; + /** Autogenerated input type of CreateInvoicesDataExport */ export type CreateDataExportsInvoicesInput = { /** A unique identifier for the client performing the mutation. */ clientMutationId?: InputMaybe; filters: DataExportInvoiceFiltersInput; format: DataExportFormatTypeEnum; - resourceType: ExportTypeEnum; + resourceType: InvoiceExportTypeEnum; }; /** Autogenerated input type of CreateDunningCampaign */ @@ -1492,6 +1501,11 @@ export type CreditNoteEstimate = { taxesRate: Scalars['Float']['output']; }; +export enum CreditNoteExportTypeEnum { + CreditNoteItems = 'credit_note_items', + CreditNotes = 'credit_notes' +} + export type CreditNoteItem = { __typename?: 'CreditNoteItem'; amountCents: Scalars['BigInt']['output']; @@ -2112,6 +2126,23 @@ export type DataExport = { status: DataExportStatusEnum; }; +/** Export credit notes search query and filters input argument */ +export type DataExportCreditNoteFiltersInput = { + amountFrom?: InputMaybe; + amountTo?: InputMaybe; + creditStatus?: InputMaybe>; + currency?: InputMaybe; + customerExternalId?: InputMaybe; + /** Uniq ID of the customer */ + customerId?: InputMaybe; + invoiceNumber?: InputMaybe; + issuingDateFrom?: InputMaybe; + issuingDateTo?: InputMaybe; + reason?: InputMaybe>; + refundStatus?: InputMaybe>; + searchTerm?: InputMaybe; +}; + export enum DataExportFormatTypeEnum { Csv = 'csv' } @@ -2468,11 +2499,6 @@ export type EventCollection = { metadata: CollectionMetadata; }; -export enum ExportTypeEnum { - InvoiceFees = 'invoice_fees', - Invoices = 'invoices' -} - export type Fee = InvoiceItem & { __typename?: 'Fee'; adjustedFee: Scalars['Boolean']['output']; @@ -2975,6 +3001,11 @@ export type InvoiceCustomSectionCollection = { metadata: CollectionMetadata; }; +export enum InvoiceExportTypeEnum { + InvoiceFees = 'invoice_fees', + Invoices = 'invoices' +} + /** Invoice Item */ export type InvoiceItem = { amountCents: Scalars['BigInt']['output']; @@ -3256,6 +3287,8 @@ export type Mutation = { createCoupon?: Maybe; /** Creates a new Credit Note */ createCreditNote?: Maybe; + /** Request data export of credit notes */ + createCreditNotesDataExport?: Maybe; /** Creates a new customer */ createCustomer?: Maybe; /** Creates a new Customer Wallet Transaction from Customer Portal */ @@ -3530,6 +3563,11 @@ export type MutationCreateCreditNoteArgs = { }; +export type MutationCreateCreditNotesDataExportArgs = { + input: CreateDataExportsCreditNotesInput; +}; + + export type MutationCreateCustomerArgs = { input: CreateCustomerInput; }; @@ -4233,6 +4271,7 @@ export type Permissions = { couponsUpdate: Scalars['Boolean']['output']; couponsView: Scalars['Boolean']['output']; creditNotesCreate: Scalars['Boolean']['output']; + creditNotesExport: Scalars['Boolean']['output']; creditNotesUpdate: Scalars['Boolean']['output']; creditNotesView: Scalars['Boolean']['output']; creditNotesVoid: Scalars['Boolean']['output']; @@ -4458,6 +4497,8 @@ export type Query = { currentVersion: CurrentVersion; /** Query a single customer of an organization */ customer?: Maybe; + /** Query selected invoice_custom_sections of a customer */ + customerInvoiceCustomSections?: Maybe; /** Query invoices of a customer */ customerInvoices: InvoiceCollection; /** Query the usage of the customer on the current billing period */ @@ -4631,9 +4672,19 @@ export type QueryCreditNoteEstimateArgs = { export type QueryCreditNotesArgs = { + amountFrom?: InputMaybe; + amountTo?: InputMaybe; + creditStatus?: InputMaybe>; + currency?: InputMaybe; + customerExternalId?: InputMaybe; customerId?: InputMaybe; + invoiceNumber?: InputMaybe; + issuingDateFrom?: InputMaybe; + issuingDateTo?: InputMaybe; limit?: InputMaybe; page?: InputMaybe; + reason?: InputMaybe>; + refundStatus?: InputMaybe>; searchTerm?: InputMaybe; }; @@ -4643,6 +4694,13 @@ export type QueryCustomerArgs = { }; +export type QueryCustomerInvoiceCustomSectionsArgs = { + customerId: Scalars['ID']['input']; + limit?: InputMaybe; + page?: InputMaybe; +}; + + export type QueryCustomerInvoicesArgs = { customerId: Scalars['ID']['input']; limit?: InputMaybe; diff --git a/translations/base.json b/translations/base.json index 423a9a9f7..950f195fe 100644 --- a/translations/base.json +++ b/translations/base.json @@ -460,14 +460,6 @@ "text_6684044e95fa220048a145a7": "Netsuite credit note url", "text_6650b36fc702a4014c8788fd": "Sync invoice to NetSuite", "text_665d742ee9853200e3a6be7f": "Sync credit note to NetSuite", - "text_62f50d3cc15266f3bd1d83ce": "Infos copied to clipboard", - "text_62f50d26c989ab0319688498": "Environment information", - "text_62f50d26c989ab031968849a": "Use and share this information if you’re reporting a bug to Lago", - "text_62f50d26c989ab031968849e": "App environment ", - "text_62f50d26c989ab03196884a2": "API URL", - "text_62f50d26c989ab03196884a6": "User ID", - "text_62f50d26c989ab03196884aa": "Front version", - "text_62f50d26c989ab03196884ac": "Copy all info", "text_62f50d26c989ab03196884ae": "Close", "text_62ea7cd44cd4b14bb9ac1db7": "Billing time", "text_62ea7cd44cd4b14bb9ac1db9": "Beginning of month", @@ -2725,4 +2717,4 @@ "text_1734452833961ix7z38723pg": "A customer represents your client and can be associated with subscriptions, invoices, and other objects.", "text_1734452833961s338w0x3b4s": "Create a customer", "text_1734452833961chacuky8218": "Active sub." -} \ No newline at end of file +}