@layerfi/components 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/layer-react.iml +9 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/dist/esm/index.js +112 -69
- package/dist/esm/index.js.map +3 -3
- package/dist/index.d.ts +28 -4
- package/dist/index.js +112 -69
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -161,6 +161,12 @@ declare module '@layerfi/components/api/layer/linked_accounts' {
|
|
|
161
161
|
} | undefined;
|
|
162
162
|
body?: Record<string, unknown> | undefined;
|
|
163
163
|
} | undefined) => Promise<Record<string, unknown>>;
|
|
164
|
+
export const updateConnectionStatus: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
165
|
+
params?: {
|
|
166
|
+
businessId: string;
|
|
167
|
+
} | undefined;
|
|
168
|
+
body?: Record<string, unknown> | undefined;
|
|
169
|
+
} | undefined) => Promise<Record<string, unknown>>;
|
|
164
170
|
export const getLinkedAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
165
171
|
params?: {
|
|
166
172
|
businessId: string;
|
|
@@ -467,6 +473,12 @@ declare module '@layerfi/components/api/layer' {
|
|
|
467
473
|
} | undefined;
|
|
468
474
|
body?: Record<string, unknown> | undefined;
|
|
469
475
|
} | undefined) => Promise<Record<string, unknown>>;
|
|
476
|
+
updateConnectionStatus: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
477
|
+
params?: {
|
|
478
|
+
businessId: string;
|
|
479
|
+
} | undefined;
|
|
480
|
+
body?: Record<string, unknown> | undefined;
|
|
481
|
+
} | undefined) => Promise<Record<string, unknown>>;
|
|
470
482
|
};
|
|
471
483
|
|
|
472
484
|
}
|
|
@@ -593,10 +605,12 @@ declare module '@layerfi/components/components/BankTransactionListItem/BankTrans
|
|
|
593
605
|
dateFormat: string;
|
|
594
606
|
bankTransaction: BankTransaction;
|
|
595
607
|
editable: boolean;
|
|
608
|
+
showDescriptions: boolean;
|
|
609
|
+
showReceiptUploads: boolean;
|
|
596
610
|
removeTransaction: (id: string) => void;
|
|
597
611
|
containerWidth?: number;
|
|
598
612
|
};
|
|
599
|
-
export const BankTransactionListItem: ({ index, dateFormat, bankTransaction, editable, containerWidth, }: Props) => React.JSX.Element | null;
|
|
613
|
+
export const BankTransactionListItem: ({ index, dateFormat, bankTransaction, editable, showDescriptions, showReceiptUploads, containerWidth, }: Props) => React.JSX.Element | null;
|
|
600
614
|
export {};
|
|
601
615
|
|
|
602
616
|
}
|
|
@@ -615,11 +629,13 @@ declare module '@layerfi/components/components/BankTransactionRow/BankTransactio
|
|
|
615
629
|
removeTransaction: (id: string) => void;
|
|
616
630
|
containerWidth?: number;
|
|
617
631
|
initialLoad?: boolean;
|
|
632
|
+
showDescriptions: boolean;
|
|
633
|
+
showReceiptUploads: boolean;
|
|
618
634
|
};
|
|
619
635
|
export type LastSubmittedForm = 'simple' | 'match' | 'split' | undefined;
|
|
620
636
|
export const extractDescriptionForSplit: (category: Category) => string;
|
|
621
637
|
export const getDefaultSelectedCategory: (bankTransaction: BankTransaction) => import("@layerfi/components/components/CategorySelect/CategorySelect").CategoryOption | undefined;
|
|
622
|
-
export const BankTransactionRow: ({ index, dateFormat, bankTransaction, editable, removeTransaction, containerWidth, initialLoad, }: Props) => React.JSX.Element | null;
|
|
638
|
+
export const BankTransactionRow: ({ index, dateFormat, bankTransaction, editable, removeTransaction, containerWidth, initialLoad, showDescriptions, showReceiptUploads, }: Props) => React.JSX.Element | null;
|
|
623
639
|
export {};
|
|
624
640
|
|
|
625
641
|
}
|
|
@@ -659,9 +675,11 @@ declare module '@layerfi/components/components/BankTransactions/BankTransactions
|
|
|
659
675
|
asWidget?: boolean;
|
|
660
676
|
pageSize?: number;
|
|
661
677
|
categorizedOnly?: boolean;
|
|
678
|
+
showDescriptions?: boolean;
|
|
679
|
+
showReceiptUploads?: boolean;
|
|
662
680
|
}
|
|
663
681
|
export const filterVisibility: (display: DisplayState, bankTransaction: BankTransaction) => boolean;
|
|
664
|
-
export const BankTransactions: ({ asWidget, pageSize, categorizedOnly, }: BankTransactionsProps) => React.JSX.Element;
|
|
682
|
+
export const BankTransactions: ({ asWidget, pageSize, categorizedOnly, showDescriptions, showReceiptUploads, }: BankTransactionsProps) => React.JSX.Element;
|
|
665
683
|
|
|
666
684
|
}
|
|
667
685
|
declare module '@layerfi/components/components/BankTransactions/index' {
|
|
@@ -1058,6 +1076,8 @@ declare module '@layerfi/components/components/ExpandedBankTransactionRow/Expand
|
|
|
1058
1076
|
submitBtnText?: string;
|
|
1059
1077
|
containerWidth?: number;
|
|
1060
1078
|
editable?: boolean;
|
|
1079
|
+
showDescriptions: boolean;
|
|
1080
|
+
showReceiptUploads: boolean;
|
|
1061
1081
|
};
|
|
1062
1082
|
export type SaveHandle = {
|
|
1063
1083
|
save: () => void;
|
|
@@ -2298,6 +2318,7 @@ declare module '@layerfi/components/contexts/LinkedAccountsContext/LinkedAccount
|
|
|
2298
2318
|
addConnection: (source: import("@layerfi/components/types/linked_accounts").Source) => void;
|
|
2299
2319
|
removeConnection: (source: import("@layerfi/components/types/linked_accounts").Source, sourceId: string) => void;
|
|
2300
2320
|
repairConnection: (source: import("@layerfi/components/types/linked_accounts").Source, sourceId: string) => void;
|
|
2321
|
+
updateConnectionStatus: () => void;
|
|
2301
2322
|
refetchAccounts: () => void;
|
|
2302
2323
|
syncAccounts: () => void;
|
|
2303
2324
|
unlinkAccount: (source: import("@layerfi/components/types/linked_accounts").Source, accountId: string) => void;
|
|
@@ -2535,6 +2556,7 @@ declare module '@layerfi/components/hooks/useLinkedAccounts/useLinkedAccounts' {
|
|
|
2535
2556
|
addConnection: (source: Source) => void;
|
|
2536
2557
|
removeConnection: (source: Source, sourceId: string) => void;
|
|
2537
2558
|
repairConnection: (source: Source, sourceId: string) => void;
|
|
2559
|
+
updateConnectionStatus: () => void;
|
|
2538
2560
|
refetchAccounts: () => void;
|
|
2539
2561
|
syncAccounts: () => void;
|
|
2540
2562
|
unlinkAccount: (source: Source, accountId: string) => void;
|
|
@@ -3729,8 +3751,10 @@ declare module '@layerfi/components/views/BankTransactionsWithLinkedAccounts/Ban
|
|
|
3729
3751
|
title?: string;
|
|
3730
3752
|
elevatedLinkedAccounts?: boolean;
|
|
3731
3753
|
showLedgerBalance?: boolean;
|
|
3754
|
+
showDescriptions?: boolean;
|
|
3755
|
+
showReceiptUploads?: boolean;
|
|
3732
3756
|
}
|
|
3733
|
-
export const BankTransactionsWithLinkedAccounts: ({ title, elevatedLinkedAccounts, showLedgerBalance, }: BankTransactionsWithLinkedAccountsProps) => React.JSX.Element;
|
|
3757
|
+
export const BankTransactionsWithLinkedAccounts: ({ title, elevatedLinkedAccounts, showLedgerBalance, showDescriptions, showReceiptUploads, }: BankTransactionsWithLinkedAccountsProps) => React.JSX.Element;
|
|
3734
3758
|
|
|
3735
3759
|
}
|
|
3736
3760
|
declare module '@layerfi/components/views/BankTransactionsWithLinkedAccounts/index' {
|
package/dist/index.js
CHANGED
|
@@ -346,6 +346,9 @@ var createJournalEntries = post(
|
|
|
346
346
|
|
|
347
347
|
// src/api/layer/linked_accounts.ts
|
|
348
348
|
var syncConnection = post(({ businessId }) => `/v1/businesses/${businessId}/sync`);
|
|
349
|
+
var updateConnectionStatus = post(
|
|
350
|
+
({ businessId }) => `/v1/businesses/${businessId}/external-accounts/update-connection-status`
|
|
351
|
+
);
|
|
349
352
|
var getLinkedAccounts = get(({ businessId }) => `/v1/businesses/${businessId}/external-accounts`);
|
|
350
353
|
var confirmConnection = post(
|
|
351
354
|
({ businessId, accountId }) => `/v1/businesses/${businessId}/external-accounts/${accountId}/confirm`
|
|
@@ -427,7 +430,8 @@ var Layer = {
|
|
|
427
430
|
getTasks,
|
|
428
431
|
submitResponseToTask,
|
|
429
432
|
breakPlaidItemConnection,
|
|
430
|
-
syncConnection
|
|
433
|
+
syncConnection,
|
|
434
|
+
updateConnectionStatus
|
|
431
435
|
};
|
|
432
436
|
|
|
433
437
|
// src/hooks/useLayerContext/useLayerContext.tsx
|
|
@@ -888,7 +892,7 @@ function hasSuggestions(categorization) {
|
|
|
888
892
|
|
|
889
893
|
// src/utils/helpers.ts
|
|
890
894
|
var range = (start, end) => {
|
|
891
|
-
|
|
895
|
+
const length = end - start + 1;
|
|
892
896
|
return Array.from({ length }, (_, idx) => idx + start);
|
|
893
897
|
};
|
|
894
898
|
var debounce = (fnc, timeout = 300) => {
|
|
@@ -2627,7 +2631,7 @@ var Toggle = ({
|
|
|
2627
2631
|
updateThumbPosition(selectedIndex);
|
|
2628
2632
|
}, [currentWidth]);
|
|
2629
2633
|
const getSelectedIndex = () => {
|
|
2630
|
-
|
|
2634
|
+
const selectedIndex = options.findIndex(
|
|
2631
2635
|
(option) => option.value === selectedValue
|
|
2632
2636
|
);
|
|
2633
2637
|
if (selectedIndex === -1) {
|
|
@@ -2663,7 +2667,7 @@ var ToggleOption = ({
|
|
|
2663
2667
|
index
|
|
2664
2668
|
}) => {
|
|
2665
2669
|
if (disabled) {
|
|
2666
|
-
return /* @__PURE__ */ import_react33.default.createElement(Tooltip, null, /* @__PURE__ */ import_react33.default.createElement(TooltipTrigger, null, /* @__PURE__ */ import_react33.default.createElement("label", { className:
|
|
2670
|
+
return /* @__PURE__ */ import_react33.default.createElement(Tooltip, null, /* @__PURE__ */ import_react33.default.createElement(TooltipTrigger, null, /* @__PURE__ */ import_react33.default.createElement("label", { className: "Layer__toggle-option", "data-checked": checked }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2667
2671
|
"input",
|
|
2668
2672
|
{
|
|
2669
2673
|
type: "radio",
|
|
@@ -2676,7 +2680,7 @@ var ToggleOption = ({
|
|
|
2676
2680
|
}
|
|
2677
2681
|
), /* @__PURE__ */ import_react33.default.createElement("span", { className: "Layer__toggle-option-content" }, leftIcon && /* @__PURE__ */ import_react33.default.createElement("span", { className: "Layer__toggle-option__icon" }, leftIcon), /* @__PURE__ */ import_react33.default.createElement("span", null, label)))), /* @__PURE__ */ import_react33.default.createElement(TooltipContent, { className: "Layer__tooltip" }, disabledMessage));
|
|
2678
2682
|
}
|
|
2679
|
-
return /* @__PURE__ */ import_react33.default.createElement("label", { className:
|
|
2683
|
+
return /* @__PURE__ */ import_react33.default.createElement("label", { className: "Layer__toggle-option", "data-checked": checked }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2680
2684
|
"input",
|
|
2681
2685
|
{
|
|
2682
2686
|
type: "radio",
|
|
@@ -2872,7 +2876,9 @@ var ExpandedBankTransactionRow = (0, import_react35.forwardRef)(
|
|
|
2872
2876
|
editable,
|
|
2873
2877
|
asListItem = false,
|
|
2874
2878
|
submitBtnText = "Save",
|
|
2875
|
-
containerWidth
|
|
2879
|
+
containerWidth,
|
|
2880
|
+
showDescriptions,
|
|
2881
|
+
showReceiptUploads
|
|
2876
2882
|
}, ref) => {
|
|
2877
2883
|
const {
|
|
2878
2884
|
categorize: categorizeBankTransaction2,
|
|
@@ -3195,7 +3201,7 @@ var ExpandedBankTransactionRow = (0, import_react35.forwardRef)(
|
|
|
3195
3201
|
"Split"
|
|
3196
3202
|
))))
|
|
3197
3203
|
)),
|
|
3198
|
-
/* @__PURE__ */ import_react35.default.createElement(
|
|
3204
|
+
showDescriptions && /* @__PURE__ */ import_react35.default.createElement(
|
|
3199
3205
|
InputGroup,
|
|
3200
3206
|
{
|
|
3201
3207
|
className: `${className}__description`,
|
|
@@ -3203,7 +3209,7 @@ var ExpandedBankTransactionRow = (0, import_react35.forwardRef)(
|
|
|
3203
3209
|
},
|
|
3204
3210
|
/* @__PURE__ */ import_react35.default.createElement(Textarea, { name: "description", placeholder: "Add description" })
|
|
3205
3211
|
),
|
|
3206
|
-
/* @__PURE__ */ import_react35.default.createElement("div", { className: `${className}__file-upload` }, /* @__PURE__ */ import_react35.default.createElement(FileInput, { text: "Upload receipt" })),
|
|
3212
|
+
showReceiptUploads && /* @__PURE__ */ import_react35.default.createElement("div", { className: `${className}__file-upload` }, /* @__PURE__ */ import_react35.default.createElement(FileInput, { text: "Upload receipt" })),
|
|
3207
3213
|
asListItem ? /* @__PURE__ */ import_react35.default.createElement("div", { className: `${className}__submit-btn` }, bankTransaction.error ? /* @__PURE__ */ import_react35.default.createElement(
|
|
3208
3214
|
Text,
|
|
3209
3215
|
{
|
|
@@ -3280,7 +3286,9 @@ var BankTransactionRow = ({
|
|
|
3280
3286
|
editable,
|
|
3281
3287
|
removeTransaction,
|
|
3282
3288
|
containerWidth,
|
|
3283
|
-
initialLoad
|
|
3289
|
+
initialLoad,
|
|
3290
|
+
showDescriptions,
|
|
3291
|
+
showReceiptUploads
|
|
3284
3292
|
}) => {
|
|
3285
3293
|
const expandedRowRef = (0, import_react37.useRef)(null);
|
|
3286
3294
|
const [showRetry, setShowRetry] = (0, import_react37.useState)(false);
|
|
@@ -3537,7 +3545,9 @@ var BankTransactionRow = ({
|
|
|
3537
3545
|
isOpen: open,
|
|
3538
3546
|
close: () => setOpen(false),
|
|
3539
3547
|
containerWidth,
|
|
3540
|
-
editable
|
|
3548
|
+
editable,
|
|
3549
|
+
showDescriptions,
|
|
3550
|
+
showReceiptUploads
|
|
3541
3551
|
}
|
|
3542
3552
|
))));
|
|
3543
3553
|
};
|
|
@@ -3588,6 +3598,8 @@ var BankTransactionListItem = ({
|
|
|
3588
3598
|
dateFormat,
|
|
3589
3599
|
bankTransaction,
|
|
3590
3600
|
editable,
|
|
3601
|
+
showDescriptions,
|
|
3602
|
+
showReceiptUploads,
|
|
3591
3603
|
containerWidth
|
|
3592
3604
|
}) => {
|
|
3593
3605
|
const expandedRowRef = (0, import_react39.useRef)(null);
|
|
@@ -3674,7 +3686,9 @@ var BankTransactionListItem = ({
|
|
|
3674
3686
|
editable,
|
|
3675
3687
|
asListItem: true,
|
|
3676
3688
|
submitBtnText: editable ? "Approve" : "Update",
|
|
3677
|
-
containerWidth
|
|
3689
|
+
containerWidth,
|
|
3690
|
+
showDescriptions,
|
|
3691
|
+
showReceiptUploads
|
|
3678
3692
|
}
|
|
3679
3693
|
)), /* @__PURE__ */ import_react39.default.createElement("span", { className: `${className}__base-row` }, editable ? /* @__PURE__ */ import_react39.default.createElement(
|
|
3680
3694
|
CategorySelect,
|
|
@@ -3916,8 +3930,8 @@ var hueToRgb = (p, q, t) => {
|
|
|
3916
3930
|
};
|
|
3917
3931
|
var hslToRgb = (hsl) => {
|
|
3918
3932
|
let r, g, b;
|
|
3919
|
-
|
|
3920
|
-
|
|
3933
|
+
const l = hsl.l / 100;
|
|
3934
|
+
const s = hsl.s / 100;
|
|
3921
3935
|
if (hsl.s === 0) {
|
|
3922
3936
|
r = g = b = l;
|
|
3923
3937
|
} else {
|
|
@@ -4061,20 +4075,20 @@ var usePagination = ({
|
|
|
4061
4075
|
const firstPageIndex = 1;
|
|
4062
4076
|
const lastPageIndex = totalPageCount;
|
|
4063
4077
|
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
4064
|
-
|
|
4065
|
-
|
|
4078
|
+
const leftItemCount = 3 + 2 * siblingCount;
|
|
4079
|
+
const leftRange = range(1, leftItemCount);
|
|
4066
4080
|
return [...leftRange, DOTS, totalPageCount];
|
|
4067
4081
|
}
|
|
4068
4082
|
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
4069
|
-
|
|
4070
|
-
|
|
4083
|
+
const rightItemCount = 3 + 2 * siblingCount;
|
|
4084
|
+
const rightRange = range(
|
|
4071
4085
|
totalPageCount - rightItemCount + 1,
|
|
4072
4086
|
totalPageCount
|
|
4073
4087
|
);
|
|
4074
4088
|
return [firstPageIndex, DOTS, ...rightRange];
|
|
4075
4089
|
}
|
|
4076
4090
|
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
4077
|
-
|
|
4091
|
+
const middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
4078
4092
|
return [firstPageIndex, DOTS, ...middleRange, DOTS, lastPageIndex];
|
|
4079
4093
|
}
|
|
4080
4094
|
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
@@ -4150,11 +4164,11 @@ var Pagination = ({
|
|
|
4150
4164
|
if (currentPage === 0 || paginationRange.length < 2) {
|
|
4151
4165
|
return;
|
|
4152
4166
|
}
|
|
4153
|
-
|
|
4167
|
+
const lastPage = paginationRange[paginationRange.length - 1];
|
|
4154
4168
|
return /* @__PURE__ */ import_react45.default.createElement("ul", { className: "Layer__pagination" }, /* @__PURE__ */ import_react45.default.createElement(
|
|
4155
4169
|
"li",
|
|
4156
4170
|
{
|
|
4157
|
-
key:
|
|
4171
|
+
key: "page-prev",
|
|
4158
4172
|
className: (0, import_classnames26.default)(
|
|
4159
4173
|
"Layer__pagination-item Layer__pagination-arrow Layer__pagination-arrow--previous",
|
|
4160
4174
|
{
|
|
@@ -4193,7 +4207,7 @@ var Pagination = ({
|
|
|
4193
4207
|
}), /* @__PURE__ */ import_react45.default.createElement(
|
|
4194
4208
|
"li",
|
|
4195
4209
|
{
|
|
4196
|
-
key:
|
|
4210
|
+
key: "page-last",
|
|
4197
4211
|
className: (0, import_classnames26.default)(
|
|
4198
4212
|
"Layer__pagination-item Layer__pagination-arrow Layer__pagination-arrow--next",
|
|
4199
4213
|
{
|
|
@@ -4228,7 +4242,9 @@ var filterVisibility = (display, bankTransaction) => {
|
|
|
4228
4242
|
var BankTransactions = ({
|
|
4229
4243
|
asWidget = false,
|
|
4230
4244
|
pageSize = 15,
|
|
4231
|
-
categorizedOnly = false
|
|
4245
|
+
categorizedOnly = false,
|
|
4246
|
+
showDescriptions = false,
|
|
4247
|
+
showReceiptUploads = false
|
|
4232
4248
|
}) => {
|
|
4233
4249
|
const [display, setDisplay] = (0, import_react46.useState)(
|
|
4234
4250
|
categorizedOnly ? "categorized" /* categorized */ : "review" /* review */
|
|
@@ -4339,7 +4355,9 @@ var BankTransactions = ({
|
|
|
4339
4355
|
bankTransaction,
|
|
4340
4356
|
editable,
|
|
4341
4357
|
removeTransaction,
|
|
4342
|
-
containerWidth
|
|
4358
|
+
containerWidth,
|
|
4359
|
+
showDescriptions,
|
|
4360
|
+
showReceiptUploads
|
|
4343
4361
|
}
|
|
4344
4362
|
)
|
|
4345
4363
|
))
|
|
@@ -4355,7 +4373,9 @@ var BankTransactions = ({
|
|
|
4355
4373
|
bankTransaction,
|
|
4356
4374
|
editable,
|
|
4357
4375
|
removeTransaction,
|
|
4358
|
-
containerWidth
|
|
4376
|
+
containerWidth,
|
|
4377
|
+
showDescriptions,
|
|
4378
|
+
showReceiptUploads
|
|
4359
4379
|
}
|
|
4360
4380
|
)
|
|
4361
4381
|
)) : null,
|
|
@@ -4415,6 +4435,8 @@ var LinkedAccountsContext = (0, import_react48.createContext)({
|
|
|
4415
4435
|
loadingStatus: "initial",
|
|
4416
4436
|
isValidating: false,
|
|
4417
4437
|
error: void 0,
|
|
4438
|
+
updateConnectionStatus: () => {
|
|
4439
|
+
},
|
|
4418
4440
|
addConnection: () => {
|
|
4419
4441
|
},
|
|
4420
4442
|
removeConnection: () => {
|
|
@@ -4607,7 +4629,7 @@ var useLinkedAccounts = () => {
|
|
|
4607
4629
|
if (linkMode == "add") {
|
|
4608
4630
|
exchangePlaidPublicToken2(publicToken, metadata);
|
|
4609
4631
|
} else {
|
|
4610
|
-
await
|
|
4632
|
+
await updateConnectionStatus2();
|
|
4611
4633
|
refetchAccounts();
|
|
4612
4634
|
setLinkMode("add");
|
|
4613
4635
|
}
|
|
@@ -4675,7 +4697,6 @@ var useLinkedAccounts = () => {
|
|
|
4675
4697
|
accountId
|
|
4676
4698
|
}
|
|
4677
4699
|
});
|
|
4678
|
-
syncAccounts();
|
|
4679
4700
|
await refetchAccounts();
|
|
4680
4701
|
} else {
|
|
4681
4702
|
console.error(
|
|
@@ -4725,6 +4746,12 @@ var useLinkedAccounts = () => {
|
|
|
4725
4746
|
params: { businessId }
|
|
4726
4747
|
});
|
|
4727
4748
|
};
|
|
4749
|
+
const updateConnectionStatus2 = async () => {
|
|
4750
|
+
DEBUG && console.log("updating connection status...");
|
|
4751
|
+
await Layer.updateConnectionStatus(apiUrl, auth?.access_token, {
|
|
4752
|
+
params: { businessId }
|
|
4753
|
+
});
|
|
4754
|
+
};
|
|
4728
4755
|
const unlinkPlaidItem2 = async (plaidItemPlaidId) => {
|
|
4729
4756
|
DEBUG && console.log("unlinking plaid item");
|
|
4730
4757
|
await Layer.unlinkPlaidItem(apiUrl, auth?.access_token, {
|
|
@@ -4746,7 +4773,8 @@ var useLinkedAccounts = () => {
|
|
|
4746
4773
|
confirmAccount,
|
|
4747
4774
|
denyAccount,
|
|
4748
4775
|
breakConnection,
|
|
4749
|
-
syncAccounts
|
|
4776
|
+
syncAccounts,
|
|
4777
|
+
updateConnectionStatus: updateConnectionStatus2
|
|
4750
4778
|
};
|
|
4751
4779
|
};
|
|
4752
4780
|
|
|
@@ -4920,7 +4948,7 @@ var LinkedAccountOptions = ({
|
|
|
4920
4948
|
"Layer__linked-accounts__options",
|
|
4921
4949
|
showLedgerBalance == false && "--hide-ledger-balance"
|
|
4922
4950
|
);
|
|
4923
|
-
return /* @__PURE__ */ import_react53.default.createElement("div", { className: linkedAccountOptionsClassName }, /* @__PURE__ */ import_react53.default.createElement("div", { className: "Layer__linked-accounts__options-overlay" }, /* @__PURE__ */ import_react53.default.createElement("div", { className: "Layer__linked-accounts__options-overlay-button" }, /* @__PURE__ */ import_react53.default.createElement(HoverMenu, { config }, /* @__PURE__ */ import_react53.default.createElement(MoreVertical_default, { size: 16 })))), children);
|
|
4951
|
+
return /* @__PURE__ */ import_react53.default.createElement("div", { className: linkedAccountOptionsClassName }, /* @__PURE__ */ import_react53.default.createElement("div", { className: "Layer__linked-accounts__options-overlay" }, config.length ? /* @__PURE__ */ import_react53.default.createElement("div", { className: "Layer__linked-accounts__options-overlay-button" }, /* @__PURE__ */ import_react53.default.createElement(HoverMenu, { config }, /* @__PURE__ */ import_react53.default.createElement(MoreVertical_default, { size: 16 }))) : null), children);
|
|
4924
4952
|
};
|
|
4925
4953
|
|
|
4926
4954
|
// src/components/LinkedAccountThumb/LinkedAccountThumb.tsx
|
|
@@ -5356,36 +5384,38 @@ var LinkedAccountsContent = ({
|
|
|
5356
5384
|
{
|
|
5357
5385
|
key: `linked-acc-${index}`,
|
|
5358
5386
|
config: [
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5387
|
+
...account.external_account_source === "PLAID" ? [
|
|
5388
|
+
{
|
|
5389
|
+
name: "Unlink account",
|
|
5390
|
+
action: async () => {
|
|
5391
|
+
if (!confirm(
|
|
5392
|
+
"Please confirm you wish to remove this financial account"
|
|
5393
|
+
)) {
|
|
5394
|
+
return;
|
|
5395
|
+
}
|
|
5396
|
+
await unlinkAccount2(
|
|
5397
|
+
account.external_account_source,
|
|
5398
|
+
account.id
|
|
5399
|
+
);
|
|
5366
5400
|
}
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
)
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5401
|
+
},
|
|
5402
|
+
{
|
|
5403
|
+
name: `Unlink all accounts under this ${account.institution?.name} connection`,
|
|
5404
|
+
action: async () => {
|
|
5405
|
+
if (!account.connection_external_id || !confirm(
|
|
5406
|
+
`Please confirm you wish to remove all accounts belonging to ${account.institution?.name || "this institution"}`
|
|
5407
|
+
)) {
|
|
5408
|
+
return;
|
|
5409
|
+
}
|
|
5410
|
+
await removeConnection(
|
|
5411
|
+
account.external_account_source,
|
|
5412
|
+
account.connection_external_id
|
|
5413
|
+
);
|
|
5380
5414
|
}
|
|
5381
|
-
await removeConnection(
|
|
5382
|
-
account.external_account_source,
|
|
5383
|
-
account.connection_external_id
|
|
5384
|
-
);
|
|
5385
5415
|
}
|
|
5386
|
-
|
|
5416
|
+
] : [],
|
|
5387
5417
|
...pillConfig ? pillConfig.config : [],
|
|
5388
|
-
...environment === "staging" && !account.connection_needs_repair_as_of ? [
|
|
5418
|
+
...environment === "staging" && !account.connection_needs_repair_as_of && account.external_account_source === "PLAID" ? [
|
|
5389
5419
|
{
|
|
5390
5420
|
name: "Break connection (test utility)",
|
|
5391
5421
|
action: async () => {
|
|
@@ -5875,7 +5905,7 @@ var humanizeEnum = (text) => {
|
|
|
5875
5905
|
var convertNumberToCurrency = (amount) => {
|
|
5876
5906
|
if (!amount)
|
|
5877
5907
|
return "";
|
|
5878
|
-
|
|
5908
|
+
const formattedValue = amount.toLocaleString("en-US");
|
|
5879
5909
|
return formattedValue.length > 0 ? `$${formattedValue}` : "";
|
|
5880
5910
|
};
|
|
5881
5911
|
var convertCurrencyToNumber = (amount) => {
|
|
@@ -6235,7 +6265,7 @@ var ProfitAndLossChart = () => {
|
|
|
6235
6265
|
patternUnits: "userSpaceOnUse"
|
|
6236
6266
|
},
|
|
6237
6267
|
/* @__PURE__ */ import_react62.default.createElement("rect", { width: "4", height: "4", opacity: 0.16 }),
|
|
6238
|
-
/* @__PURE__ */ import_react62.default.createElement("line", { x1: "0", y: "0", x2: "0", y2: "4",
|
|
6268
|
+
/* @__PURE__ */ import_react62.default.createElement("line", { x1: "0", y: "0", x2: "0", y2: "4", strokeWidth: "2" })
|
|
6239
6269
|
), /* @__PURE__ */ import_react62.default.createElement(
|
|
6240
6270
|
"pattern",
|
|
6241
6271
|
{
|
|
@@ -6248,7 +6278,7 @@ var ProfitAndLossChart = () => {
|
|
|
6248
6278
|
patternUnits: "userSpaceOnUse"
|
|
6249
6279
|
},
|
|
6250
6280
|
/* @__PURE__ */ import_react62.default.createElement("rect", { width: "4", height: "4", opacity: 0.16 }),
|
|
6251
|
-
/* @__PURE__ */ import_react62.default.createElement("line", { x1: "0", y: "0", x2: "0", y2: "4",
|
|
6281
|
+
/* @__PURE__ */ import_react62.default.createElement("line", { x1: "0", y: "0", x2: "0", y2: "4", strokeWidth: "2" })
|
|
6252
6282
|
)),
|
|
6253
6283
|
/* @__PURE__ */ import_react62.default.createElement(
|
|
6254
6284
|
import_recharts.Tooltip,
|
|
@@ -7259,7 +7289,7 @@ var MiniChart = ({ data }) => {
|
|
|
7259
7289
|
import_recharts3.Cell,
|
|
7260
7290
|
{
|
|
7261
7291
|
key: `cell-${index}`,
|
|
7262
|
-
className:
|
|
7292
|
+
className: "Layer__profit-and-loss-detailed-charts__pie",
|
|
7263
7293
|
fill: entry.name === "placeholder" ? "#e6e6e6" : colorConfig.color,
|
|
7264
7294
|
opacity: colorConfig.opacity
|
|
7265
7295
|
}
|
|
@@ -9326,7 +9356,7 @@ var LedgerAccount = ({
|
|
|
9326
9356
|
onRefresh: () => refetch(),
|
|
9327
9357
|
isLoading: isValidating || isLoading
|
|
9328
9358
|
}
|
|
9329
|
-
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */ import_react93.default.createElement("div", { className:
|
|
9359
|
+
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */ import_react93.default.createElement("div", { className: "Layer__ledger-account__loader-container" }, /* @__PURE__ */ import_react93.default.createElement(Loader2, null)) : null, !isLoading && !error && data?.length === 0 ? /* @__PURE__ */ import_react93.default.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ import_react93.default.createElement(
|
|
9330
9360
|
DataState,
|
|
9331
9361
|
{
|
|
9332
9362
|
status: "info" /* info */,
|
|
@@ -9476,8 +9506,10 @@ var LayerProvider = ({
|
|
|
9476
9506
|
}
|
|
9477
9507
|
}, [businessAccessToken, auth?.access_token]);
|
|
9478
9508
|
(0, import_swr9.default)(
|
|
9479
|
-
businessId && auth?.access_token && `categories-${businessId}`,
|
|
9480
|
-
Layer.getCategories(apiUrl, auth?.access_token, {
|
|
9509
|
+
businessId && state.auth?.access_token && `categories-${businessId}`,
|
|
9510
|
+
Layer.getCategories(apiUrl, state.auth?.access_token, {
|
|
9511
|
+
params: { businessId }
|
|
9512
|
+
}),
|
|
9481
9513
|
{
|
|
9482
9514
|
...defaultSWRConfig,
|
|
9483
9515
|
onSuccess: (response) => {
|
|
@@ -9491,8 +9523,10 @@ var LayerProvider = ({
|
|
|
9491
9523
|
}
|
|
9492
9524
|
);
|
|
9493
9525
|
(0, import_swr9.default)(
|
|
9494
|
-
businessId && auth?.access_token && `business-${businessId}`,
|
|
9495
|
-
Layer.getBusiness(apiUrl, auth?.access_token, {
|
|
9526
|
+
businessId && state?.auth?.access_token && `business-${businessId}`,
|
|
9527
|
+
Layer.getBusiness(apiUrl, state?.auth?.access_token, {
|
|
9528
|
+
params: { businessId }
|
|
9529
|
+
}),
|
|
9496
9530
|
{
|
|
9497
9531
|
...defaultSWRConfig,
|
|
9498
9532
|
onSuccess: (response) => {
|
|
@@ -9691,7 +9725,7 @@ var useJournal = () => {
|
|
|
9691
9725
|
(x) => x.id === value.value
|
|
9692
9726
|
);
|
|
9693
9727
|
if (foundParent) {
|
|
9694
|
-
|
|
9728
|
+
const newLineItem = {
|
|
9695
9729
|
...lineItem,
|
|
9696
9730
|
account_identifier: {
|
|
9697
9731
|
id: foundParent.id,
|
|
@@ -9707,7 +9741,7 @@ var useJournal = () => {
|
|
|
9707
9741
|
lineItems[lineItemIndex] = newLineItem;
|
|
9708
9742
|
}
|
|
9709
9743
|
} else {
|
|
9710
|
-
|
|
9744
|
+
const newLineItem = {
|
|
9711
9745
|
...lineItem,
|
|
9712
9746
|
[fieldName]: value
|
|
9713
9747
|
};
|
|
@@ -11098,7 +11132,7 @@ var TasksPending = () => {
|
|
|
11098
11132
|
import_recharts4.Cell,
|
|
11099
11133
|
{
|
|
11100
11134
|
key: `cell-${index}`,
|
|
11101
|
-
className:
|
|
11135
|
+
className: "Layer__profit-and-loss-detailed-charts__pie",
|
|
11102
11136
|
fill: TASKS_CHARTS_COLORS[task.name]
|
|
11103
11137
|
}
|
|
11104
11138
|
);
|
|
@@ -11113,7 +11147,7 @@ var Tasks = () => {
|
|
|
11113
11147
|
};
|
|
11114
11148
|
var TasksComponent = () => {
|
|
11115
11149
|
const { isLoading, data } = (0, import_react114.useContext)(TasksContext);
|
|
11116
|
-
return /* @__PURE__ */ import_react114.default.createElement(Container, { name: "tasks-component" }, /* @__PURE__ */ import_react114.default.createElement(TasksHeader, null), isLoading || !data ? /* @__PURE__ */ import_react114.default.createElement("div", { className:
|
|
11150
|
+
return /* @__PURE__ */ import_react114.default.createElement(Container, { name: "tasks-component" }, /* @__PURE__ */ import_react114.default.createElement(TasksHeader, null), isLoading || !data ? /* @__PURE__ */ import_react114.default.createElement("div", { className: "Layer__tasks__loader-container" }, /* @__PURE__ */ import_react114.default.createElement(Loader2, null)) : /* @__PURE__ */ import_react114.default.createElement(import_react114.default.Fragment, null, data.length > 0 && /* @__PURE__ */ import_react114.default.createElement(TasksPending, null), /* @__PURE__ */ import_react114.default.createElement(TasksList, null)));
|
|
11117
11151
|
};
|
|
11118
11152
|
|
|
11119
11153
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
@@ -11324,7 +11358,9 @@ var import_react121 = __toESM(require("react"));
|
|
|
11324
11358
|
var BankTransactionsWithLinkedAccounts = ({
|
|
11325
11359
|
title = "Bank transactions",
|
|
11326
11360
|
elevatedLinkedAccounts = true,
|
|
11327
|
-
showLedgerBalance = true
|
|
11361
|
+
showLedgerBalance = true,
|
|
11362
|
+
showDescriptions,
|
|
11363
|
+
showReceiptUploads
|
|
11328
11364
|
}) => {
|
|
11329
11365
|
return /* @__PURE__ */ import_react121.default.createElement(View3, { title }, /* @__PURE__ */ import_react121.default.createElement(
|
|
11330
11366
|
LinkedAccounts,
|
|
@@ -11332,7 +11368,14 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
11332
11368
|
elevated: elevatedLinkedAccounts,
|
|
11333
11369
|
showLedgerBalance
|
|
11334
11370
|
}
|
|
11335
|
-
), /* @__PURE__ */ import_react121.default.createElement(
|
|
11371
|
+
), /* @__PURE__ */ import_react121.default.createElement(
|
|
11372
|
+
BankTransactions,
|
|
11373
|
+
{
|
|
11374
|
+
asWidget: true,
|
|
11375
|
+
showDescriptions,
|
|
11376
|
+
showReceiptUploads
|
|
11377
|
+
}
|
|
11378
|
+
));
|
|
11336
11379
|
};
|
|
11337
11380
|
|
|
11338
11381
|
// src/views/Reports/Reports.tsx
|