diff --git a/packages/server/newrelic_agent.log b/packages/server/newrelic_agent.log new file mode 100644 index 000000000..fd6d80162 --- /dev/null +++ b/packages/server/newrelic_agent.log @@ -0,0 +1,12 @@ +{"v":0,"level":30,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":5186,"time":"2024-11-18T22:14:20.534Z","msg":"Unable to find configuration file. If a configuration file is desired (common for non-containerized environments), a base configuration file can be copied from /Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/newrelic.js and renamed to \"newrelic.js\" in the directory from which you will start your application. Attempting to start agent using environment variables."} +{"v":0,"level":30,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":5186,"time":"2024-11-18T22:14:20.542Z","msg":"Using New Relic for Node.js. Agent version: 11.17.0; Node version: v18.18.2."} +{"v":0,"level":30,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":5186,"time":"2024-11-18T22:14:20.878Z","msg":"Using AsyncLocalContextManager"} +{"v":0,"level":50,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":5186,"time":"2024-11-18T22:14:20.881Z","msg":"New Relic for Node.js was unable to bootstrap itself due to an error:","stack":"Error: New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!\n at createAgent (/Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:160:11)\n at initialize (/Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:105:15)\n at Object. (/Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:39:3)\n at Module._compile (node:internal/modules/cjs/loader:1256:14)\n at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n at Module.load (node:internal/modules/cjs/loader:1119:32)\n at Module._load (node:internal/modules/cjs/loader:960:12)\n at Module.require (node:internal/modules/cjs/loader:1143:19)\n at require (node:internal/modules/cjs/helpers:119:18)\n at Object.newrelic (/Users/ahmedbouhuolia/repos/bigcapital/packages/server/build/index.js:49240:18)","message":"New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!"} +{"v":0,"level":30,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":36447,"time":"2024-11-19T14:46:43.059Z","msg":"Unable to find configuration file. If a configuration file is desired (common for non-containerized environments), a base configuration file can be copied from /Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/newrelic.js and renamed to \"newrelic.js\" in the directory from which you will start your application. Attempting to start agent using environment variables."} +{"v":0,"level":30,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":36447,"time":"2024-11-19T14:46:43.068Z","msg":"Using New Relic for Node.js. Agent version: 11.17.0; Node version: v18.18.2."} +{"v":0,"level":30,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":36447,"time":"2024-11-19T14:46:43.304Z","msg":"Using AsyncLocalContextManager"} +{"v":0,"level":50,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":36447,"time":"2024-11-19T14:46:43.306Z","msg":"New Relic for Node.js was unable to bootstrap itself due to an error:","stack":"Error: New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!\n at createAgent (/Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:160:11)\n at initialize (/Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:105:15)\n at Object. (/Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:39:3)\n at Module._compile (node:internal/modules/cjs/loader:1256:14)\n at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n at Module.load (node:internal/modules/cjs/loader:1119:32)\n at Module._load (node:internal/modules/cjs/loader:960:12)\n at Module.require (node:internal/modules/cjs/loader:1143:19)\n at require (node:internal/modules/cjs/helpers:119:18)\n at Object.newrelic (/Users/ahmedbouhuolia/repos/bigcapital/packages/server/build/index.js:49240:18)","message":"New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!"} +{"v":0,"level":30,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":60390,"time":"2024-11-19T19:55:31.373Z","msg":"Unable to find configuration file. If a configuration file is desired (common for non-containerized environments), a base configuration file can be copied from /Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/newrelic.js and renamed to \"newrelic.js\" in the directory from which you will start your application. Attempting to start agent using environment variables."} +{"v":0,"level":30,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":60390,"time":"2024-11-19T19:55:31.382Z","msg":"Using New Relic for Node.js. Agent version: 11.17.0; Node version: v18.18.2."} +{"v":0,"level":30,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":60390,"time":"2024-11-19T19:55:31.682Z","msg":"Using AsyncLocalContextManager"} +{"v":0,"level":50,"name":"newrelic","hostname":"Ahmeds-MacBook-Air.local","pid":60390,"time":"2024-11-19T19:55:31.683Z","msg":"New Relic for Node.js was unable to bootstrap itself due to an error:","stack":"Error: New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!\n at createAgent (/Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:160:11)\n at initialize (/Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:105:15)\n at Object. (/Users/ahmedbouhuolia/repos/bigcapital/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:39:3)\n at Module._compile (node:internal/modules/cjs/loader:1256:14)\n at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n at Module.load (node:internal/modules/cjs/loader:1119:32)\n at Module._load (node:internal/modules/cjs/loader:960:12)\n at Module.require (node:internal/modules/cjs/loader:1143:19)\n at require (node:internal/modules/cjs/helpers:119:18)\n at Object.newrelic (/Users/ahmedbouhuolia/repos/bigcapital/packages/server/build/index.js:49240:18)","message":"New Relic requires that you name this application!\nSet app_name in your newrelic.js or newrelic.cjs file or set environment variable\nNEW_RELIC_APP_NAME. Not starting!"} diff --git a/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendMailPreview.tsx b/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendMailPreview.tsx index 642cba320..8f687f9e8 100644 --- a/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendMailPreview.tsx +++ b/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendMailPreview.tsx @@ -2,6 +2,7 @@ import { Suspense } from 'react'; import { SendMailViewPreviewTabs } from '../SendMailViewDrawer/SendMailViewPreviewTabs'; import { Tab } from '@blueprintjs/core'; import { EstimateSendPdfPreviewConnected } from './EstimateSendPdfPreviewConnected'; +import { EstimateSendMailReceiptPreview } from './EstimateSendMailReceiptPreview'; export function EstimateSendMailPreviewTabs() { return ( @@ -10,7 +11,9 @@ export function EstimateSendMailPreviewTabs() { id={'payment-page'} title={'Payment page'} panel={ - {/* */} + + + } /> ; + + // # Subtotal + subtotalLabel?: string; + subtotal: string; + + // # View estimate button + showViewEstimateButton?: boolean; + viewEstimateButtonLabel?: string; + viewEstimateButtonOnClick?: () => void; +} + +export function EstimateSendMailReceipt({ + // # Company name. + companyLogoUri, + companyName, + + // # Estimate number. + estimateNumberLabel = 'Estimate #', + estimateNumber, + + // # Total. + total, + totalLabel = 'Total', + + // # Expiration date. + expirationDateLabel = 'Expiration Date', + expirationDate, + + // # Message + message, + + // # Items + items, + + // # Subtotal + subtotal, + subtotalLabel = 'Subtotal', + + // # View estimate button + showViewEstimateButton = true, + viewEstimateButtonLabel = 'View Estimate', + viewEstimateButtonOnClick, + + ...props +}: EstimateSendMailReceiptProps) { + return ( + + + {companyLogoUri && } + + + + {companyName} + + + + {total} + + + + {estimateNumberLabel} {estimateNumber} + + + + {expirationDateLabel} {expirationDate} + + + + + + {message} + + + {showViewEstimateButton && ( + + {viewEstimateButtonLabel} + + )} + + + {items?.map((item, key) => ( + + {item.label} + + {item.quantity} x {item.total} + + + ))} + + + {subtotalLabel} + + {subtotal} + + + + + {totalLabel} + + {total} + + + + + ); +} diff --git a/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendMailReceiptPreview.tsx b/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendMailReceiptPreview.tsx new file mode 100644 index 000000000..e33ad7aad --- /dev/null +++ b/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendMailReceiptPreview.tsx @@ -0,0 +1,50 @@ +import { css } from '@emotion/css'; +import { EstimateSendMailReceipt } from './EstimateSendMailReceipt'; +import { EstimateSendMailPreviewHeader } from './EstimateSendMailPreviewHeader'; +import { Stack } from '@/components'; + +export const EstimateSendMailReceiptPreview = () => { + const props = { + companyName: 'Bigcapital Technology, Inc.', + companyLogoUri: ' ', + + message: '', + total: '$1,000.00', + subtotal: '$1,000.00', + estimateNumber: 'INV-0001', + expirationDate: '2 Oct 2024', + dueAmount: '$1,000.00', + items: [{ label: 'Web development', total: '$1000.00', quantity: 1 }], + message: `Hi Ahmed Bouhuolia, + +Here's invoice # INV-00002 for $738.30 + +The amount outstanding of $737.30 is due on 01 Feb 2023. + +From your online payment page you can print a PDF or view your outstanding bills. + +If you have any questions, please let us know. + +Thanks, +Bigcapital`, + }; + + return ( + + + + + + + + ); +}; diff --git a/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendPdfPreviewConnected.tsx b/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendPdfPreviewConnected.tsx index d62b1abc3..eb57273a0 100644 --- a/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendPdfPreviewConnected.tsx +++ b/packages/webapp/src/containers/Sales/Estimates/EstimateSendMailDrawer/EstimateSendPdfPreviewConnected.tsx @@ -24,7 +24,6 @@ function EstimateSendPdfPreviewIframe() { if (isLoading && data) { return ; } - const iframeSrcDoc = data?.htmlContent; return ; diff --git a/packages/webapp/src/containers/Sales/Estimates/SendMailViewDrawer/SendMailViewReceiptPreview.tsx b/packages/webapp/src/containers/Sales/Estimates/SendMailViewDrawer/SendMailViewReceiptPreview.tsx index b6157c16e..1bc73278d 100644 --- a/packages/webapp/src/containers/Sales/Estimates/SendMailViewDrawer/SendMailViewReceiptPreview.tsx +++ b/packages/webapp/src/containers/Sales/Estimates/SendMailViewDrawer/SendMailViewReceiptPreview.tsx @@ -1,12 +1,12 @@ +import { Button, ButtonProps, Intent } from '@blueprintjs/core'; +import { css } from '@emotion/css'; +import { lighten } from 'polished'; import { x } from '@xstyled/emotion'; import { Stack, StackProps } from '@/components'; -interface SendMailReceiptProps extends StackProps { - children: React.ReactNode; -} +export type SendMailReceiptProps = StackProps; export function SendMailReceipt({ - children, ...restProps }: SendMailReceiptProps) { return ( @@ -19,7 +19,7 @@ export function SendMailReceipt({ boxShadow={'0 10px 15px rgba(0, 0, 0, 0.05)'} color={'black'} {...restProps} - > + /> ); } @@ -46,4 +46,36 @@ function SendMailReceiptCompanyLogo({ ); } +interface SendMailReceiptTitleProps extends ButtonProps { + primaryColor?: string; + children: React.ReactNode; +} + +function SendMailReceiptPrimaryButton({ + primaryColor, + ...props +}: SendMailReceiptTitleProps) { + return ( +