@vtex/faststore-plugin-buyer-portal 1.1.106 → 1.1.108
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/package.json +1 -1
- package/src/features/custom-fields/layouts/CustomFieldsLayout/CustomFieldsLayout.tsx +1 -0
- package/src/features/shared/clients/Auth.ts +25 -0
- package/src/features/shared/clients/Client.ts +11 -1
- package/src/features/shared/components/withErrorBoundary/withErrorBoundary.tsx +7 -6
- package/src/features/shared/services/index.ts +4 -0
- package/src/features/shared/services/validate-access.service.ts +11 -0
- package/src/features/shared/types/AuthRouteProps.ts +5 -0
- package/src/features/shared/types/index.ts +1 -0
- package/src/features/shared/utils/constants.ts +4 -4
- package/src/features/shared/utils/index.ts +5 -0
- package/src/features/shared/utils/withAuth.tsx +31 -0
- package/src/features/shared/utils/withAuthLoader.ts +47 -0
- package/src/features/shared/utils/withAuthProvider.tsx +38 -0
- package/src/features/shared/utils/withBuyerPortal.tsx +24 -0
- package/src/features/shared/utils/withLoaderErrorBoundary.ts +79 -71
- package/src/features/shared/utils/withProviders.tsx +35 -0
- package/src/pages/address-details.tsx +95 -91
- package/src/pages/addresses.tsx +63 -63
- package/src/pages/budgets-details.tsx +44 -43
- package/src/pages/budgets.tsx +58 -56
- package/src/pages/buying-policies.tsx +84 -78
- package/src/pages/buying-policy-details.tsx +43 -44
- package/src/pages/collections.tsx +59 -60
- package/src/pages/cost-centers.tsx +48 -51
- package/src/pages/credit-cards.tsx +44 -49
- package/src/pages/home.tsx +28 -23
- package/src/pages/org-unit-details.tsx +39 -36
- package/src/pages/org-units.tsx +86 -90
- package/src/pages/payment-methods.tsx +41 -42
- package/src/pages/po-numbers.tsx +43 -46
- package/src/pages/profile.tsx +54 -52
- package/src/pages/releases.tsx +43 -41
- package/src/pages/role-details.tsx +57 -60
- package/src/pages/roles.tsx +42 -39
- package/src/pages/user-details.tsx +58 -58
- package/src/pages/users.tsx +83 -80
|
@@ -4,10 +4,7 @@ import { getAddressLocationService } from "../features/addresses/services/locati
|
|
|
4
4
|
import { getAddressRecipientsService } from "../features/addresses/services/recipients/get-address-recipients.service";
|
|
5
5
|
import { getContractDetailsService } from "../features/contracts/services";
|
|
6
6
|
import { getOrgUnitBasicDataService } from "../features/org-units/services";
|
|
7
|
-
import {
|
|
8
|
-
BuyerPortalProvider,
|
|
9
|
-
withErrorBoundary,
|
|
10
|
-
} from "../features/shared/components";
|
|
7
|
+
import { withErrorBoundary } from "../features/shared/components";
|
|
11
8
|
import { ErrorBoundaryProps } from "../features/shared/components/ErrorBoundary/types";
|
|
12
9
|
import {
|
|
13
10
|
PAGE_PARAMS,
|
|
@@ -16,9 +13,10 @@ import {
|
|
|
16
13
|
import { ErrorTabsLayout } from "../features/shared/layouts/ErrorTabsLayout/ErrorTabsLayout";
|
|
17
14
|
import {
|
|
18
15
|
type ClientContext,
|
|
19
|
-
getClientContext,
|
|
20
16
|
getValidPage,
|
|
21
17
|
withLoaderErrorBoundary,
|
|
18
|
+
withAuthLoader,
|
|
19
|
+
withProviders,
|
|
22
20
|
} from "../features/shared/utils";
|
|
23
21
|
import { getUserByIdService } from "../features/users/services";
|
|
24
22
|
|
|
@@ -29,7 +27,7 @@ import type {
|
|
|
29
27
|
} from "../features/addresses/types/AddressData";
|
|
30
28
|
import type { ContractData } from "../features/contracts/types";
|
|
31
29
|
import type { OrgUnitBasicData } from "../features/org-units/types";
|
|
32
|
-
import type { LoaderData } from "../features/shared/types";
|
|
30
|
+
import type { AuthRouteProps, LoaderData } from "../features/shared/types";
|
|
33
31
|
import type { UserData } from "../features/users/types";
|
|
34
32
|
|
|
35
33
|
const DEFAULT_ADDRESS_PAGINATED_DATA = {
|
|
@@ -69,7 +67,7 @@ export type AddressDetailsPageData = {
|
|
|
69
67
|
|
|
70
68
|
const loaderFunction = async (
|
|
71
69
|
data: LoaderData<AddressDetailsPageQuery>
|
|
72
|
-
): Promise<AddressDetailsPageData
|
|
70
|
+
): Promise<AuthRouteProps<AddressDetailsPageData>> => {
|
|
73
71
|
const {
|
|
74
72
|
contractId,
|
|
75
73
|
orgUnitId,
|
|
@@ -82,83 +80,88 @@ const loaderFunction = async (
|
|
|
82
80
|
const pageRecipients = getValidPage(pageRecipientsString);
|
|
83
81
|
const pageLocation = getValidPage(pageLocationString);
|
|
84
82
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const contract = await getContractDetailsService({
|
|
107
|
-
contractId,
|
|
108
|
-
cookie,
|
|
109
|
-
unitId: orgUnitId,
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
const user = await getUserByIdService({ orgUnitId, userId, cookie });
|
|
113
|
-
|
|
114
|
-
const { data: recipients = [], total = 0 } =
|
|
115
|
-
await getAddressRecipientsService({
|
|
116
|
-
unitId: orgUnitId,
|
|
117
|
-
customerId: contractId,
|
|
118
|
-
addressId,
|
|
119
|
-
cookie,
|
|
120
|
-
search: searchRecipients,
|
|
121
|
-
page: pageRecipients,
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
const { data: locations, total: totalLocations } =
|
|
125
|
-
await getAddressLocationService({
|
|
126
|
-
contractId,
|
|
127
|
-
addressId,
|
|
128
|
-
cookie,
|
|
129
|
-
unitId: orgUnitId,
|
|
130
|
-
search: searchLocations,
|
|
131
|
-
page: pageLocation,
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
return {
|
|
135
|
-
data: {
|
|
136
|
-
addressDetails: await getAddressDetailsService(
|
|
137
|
-
addressId,
|
|
83
|
+
return withAuthLoader(
|
|
84
|
+
data,
|
|
85
|
+
async ({ customerId, cookie, userId, ...clientContext }) => {
|
|
86
|
+
if (!contractId || !orgUnitId) {
|
|
87
|
+
return {
|
|
88
|
+
data: {
|
|
89
|
+
addressDetails: null,
|
|
90
|
+
recipientsData: null,
|
|
91
|
+
locationsData: null,
|
|
92
|
+
},
|
|
93
|
+
context: {
|
|
94
|
+
clientContext: { customerId, cookie, userId, ...clientContext },
|
|
95
|
+
currentOrgUnit: null,
|
|
96
|
+
currentContract: null,
|
|
97
|
+
currentUser: null,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const orgUnit = await getOrgUnitBasicDataService({
|
|
138
103
|
cookie,
|
|
104
|
+
id: orgUnitId,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const contract = await getContractDetailsService({
|
|
139
108
|
contractId,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
109
|
+
cookie,
|
|
110
|
+
unitId: orgUnitId,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const user = await getUserByIdService({ orgUnitId, userId, cookie });
|
|
114
|
+
|
|
115
|
+
const { data: recipients = [], total = 0 } =
|
|
116
|
+
await getAddressRecipientsService({
|
|
117
|
+
unitId: orgUnitId,
|
|
118
|
+
customerId: contractId,
|
|
119
|
+
addressId,
|
|
120
|
+
cookie,
|
|
121
|
+
search: searchRecipients,
|
|
122
|
+
page: pageRecipients,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const { data: locations, total: totalLocations } =
|
|
126
|
+
await getAddressLocationService({
|
|
127
|
+
contractId,
|
|
128
|
+
addressId,
|
|
129
|
+
cookie,
|
|
130
|
+
unitId: orgUnitId,
|
|
131
|
+
search: searchLocations,
|
|
132
|
+
page: pageLocation,
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
data: {
|
|
137
|
+
addressDetails: await getAddressDetailsService(
|
|
138
|
+
addressId,
|
|
139
|
+
cookie,
|
|
140
|
+
contractId,
|
|
141
|
+
orgUnitId
|
|
142
|
+
),
|
|
143
|
+
recipientsData: {
|
|
144
|
+
data: recipients,
|
|
145
|
+
total,
|
|
146
|
+
search: searchRecipients ?? "",
|
|
147
|
+
page: pageRecipients ?? 1,
|
|
148
|
+
},
|
|
149
|
+
locationsData: {
|
|
150
|
+
data: locations,
|
|
151
|
+
total: totalLocations,
|
|
152
|
+
search: searchLocations ?? "",
|
|
153
|
+
page: pageLocation ?? 1,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
context: {
|
|
157
|
+
clientContext: { customerId, cookie, userId, ...clientContext },
|
|
158
|
+
currentOrgUnit: orgUnit,
|
|
159
|
+
currentContract: contract,
|
|
160
|
+
currentUser: user,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
);
|
|
162
165
|
};
|
|
163
166
|
|
|
164
167
|
export const loader = withLoaderErrorBoundary(loaderFunction, {
|
|
@@ -168,11 +171,10 @@ export const loader = withLoaderErrorBoundary(loaderFunction, {
|
|
|
168
171
|
|
|
169
172
|
const AddressDetailsPage = ({
|
|
170
173
|
data,
|
|
171
|
-
context,
|
|
172
174
|
hasError,
|
|
173
175
|
error,
|
|
174
176
|
}: AddressDetailsPageData) => (
|
|
175
|
-
|
|
177
|
+
<>
|
|
176
178
|
{hasError ? (
|
|
177
179
|
<ErrorTabsLayout error={error} />
|
|
178
180
|
) : (
|
|
@@ -182,12 +184,14 @@ const AddressDetailsPage = ({
|
|
|
182
184
|
locationsData={data.locationsData ?? DEFAULT_ADDRESS_PAGINATED_DATA}
|
|
183
185
|
/>
|
|
184
186
|
)}
|
|
185
|
-
|
|
187
|
+
</>
|
|
186
188
|
);
|
|
187
189
|
|
|
188
|
-
export default
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
190
|
+
export default withProviders(
|
|
191
|
+
withErrorBoundary(AddressDetailsPage, {
|
|
192
|
+
tags: {
|
|
193
|
+
component: "AddressDetailsPage",
|
|
194
|
+
errorType: "address_details_error",
|
|
195
|
+
},
|
|
196
|
+
})
|
|
197
|
+
);
|
package/src/pages/addresses.tsx
CHANGED
|
@@ -5,24 +5,22 @@ import {
|
|
|
5
5
|
} from "../features/addresses/services";
|
|
6
6
|
import { getContractDetailsService } from "../features/contracts/services";
|
|
7
7
|
import { getOrgUnitBasicDataService } from "../features/org-units/services";
|
|
8
|
-
import {
|
|
9
|
-
BuyerPortalProvider,
|
|
10
|
-
withErrorBoundary,
|
|
11
|
-
} from "../features/shared/components";
|
|
8
|
+
import { withErrorBoundary } from "../features/shared/components";
|
|
12
9
|
import { ErrorBoundaryProps } from "../features/shared/components/ErrorBoundary/types";
|
|
13
10
|
import { ErrorTabsLayout } from "../features/shared/layouts/ErrorTabsLayout/ErrorTabsLayout";
|
|
14
11
|
import {
|
|
15
12
|
type ClientContext,
|
|
16
|
-
getClientContext,
|
|
17
13
|
getValidPage,
|
|
18
14
|
withLoaderErrorBoundary,
|
|
15
|
+
withAuthLoader,
|
|
16
|
+
withProviders,
|
|
19
17
|
} from "../features/shared/utils";
|
|
20
18
|
import { getUserByIdService } from "../features/users/services";
|
|
21
19
|
|
|
22
20
|
import type { AddressData } from "../features/addresses/types";
|
|
23
21
|
import type { ContractData } from "../features/contracts/types";
|
|
24
22
|
import type { OrgUnitBasicData } from "../features/org-units/types";
|
|
25
|
-
import type { LoaderData } from "../features/shared/types";
|
|
23
|
+
import type { AuthRouteProps, LoaderData } from "../features/shared/types";
|
|
26
24
|
import type { UserData } from "../features/users/types";
|
|
27
25
|
|
|
28
26
|
export type AddressesPageData = {
|
|
@@ -48,62 +46,63 @@ export type AddressesPageQuery = GetAddressesServiceProps & {
|
|
|
48
46
|
|
|
49
47
|
const loaderFunction = async (
|
|
50
48
|
data: LoaderData<AddressesPageQuery>
|
|
51
|
-
): Promise<AddressesPageData
|
|
49
|
+
): Promise<AuthRouteProps<AddressesPageData>> => {
|
|
52
50
|
const { contractId, orgUnitId, search, page: pageString } = data.query;
|
|
53
51
|
|
|
54
52
|
const page = getValidPage(pageString);
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
return withAuthLoader(
|
|
55
|
+
data,
|
|
56
|
+
async ({ cookie, userId, customerId, ...clientContext }) => {
|
|
57
|
+
if (!contractId || !orgUnitId) {
|
|
58
|
+
return {
|
|
59
|
+
data: [],
|
|
60
|
+
search: search ?? "",
|
|
61
|
+
total: 0,
|
|
62
|
+
page: page ?? 1,
|
|
63
|
+
context: {
|
|
64
|
+
clientContext: { customerId, cookie, userId, ...clientContext },
|
|
65
|
+
currentOrgUnit: null,
|
|
66
|
+
currentContract: null,
|
|
67
|
+
currentUser: null,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
58
71
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
const [currentOrgUnit, user, contract, addressesResponse] =
|
|
73
|
+
await Promise.all([
|
|
74
|
+
getOrgUnitBasicDataService({
|
|
75
|
+
id: orgUnitId,
|
|
76
|
+
cookie,
|
|
77
|
+
}),
|
|
78
|
+
getUserByIdService({ orgUnitId, userId, cookie }),
|
|
79
|
+
getContractDetailsService({
|
|
80
|
+
contractId,
|
|
81
|
+
cookie,
|
|
82
|
+
unitId: orgUnitId,
|
|
83
|
+
}),
|
|
84
|
+
getAddressesByUnitIdService({
|
|
85
|
+
orgUnitId,
|
|
86
|
+
search,
|
|
87
|
+
page,
|
|
88
|
+
cookie,
|
|
89
|
+
}),
|
|
90
|
+
]);
|
|
73
91
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
id: orgUnitId,
|
|
78
|
-
cookie,
|
|
79
|
-
}),
|
|
80
|
-
getUserByIdService({ orgUnitId, userId, cookie }),
|
|
81
|
-
getContractDetailsService({
|
|
82
|
-
contractId,
|
|
83
|
-
cookie,
|
|
84
|
-
unitId: orgUnitId,
|
|
85
|
-
}),
|
|
86
|
-
getAddressesByUnitIdService({
|
|
87
|
-
orgUnitId,
|
|
88
|
-
search,
|
|
92
|
+
return {
|
|
93
|
+
data: addressesResponse.data,
|
|
94
|
+
total: addressesResponse.total,
|
|
89
95
|
page,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
search: search ?? "",
|
|
97
|
+
context: {
|
|
98
|
+
clientContext: { cookie, userId, customerId, ...clientContext },
|
|
99
|
+
currentOrgUnit,
|
|
100
|
+
currentUser: user,
|
|
101
|
+
currentContract: contract,
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
93
105
|
);
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
data: addressesResponse.data,
|
|
97
|
-
total: addressesResponse.total,
|
|
98
|
-
page,
|
|
99
|
-
search: search ?? "",
|
|
100
|
-
context: {
|
|
101
|
-
clientContext: { cookie, userId, customerId, ...clientContext },
|
|
102
|
-
currentOrgUnit,
|
|
103
|
-
currentUser: user,
|
|
104
|
-
currentContract: contract,
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
106
|
};
|
|
108
107
|
|
|
109
108
|
export const loader = withLoaderErrorBoundary(loaderFunction, {
|
|
@@ -116,11 +115,10 @@ const AddressPage = ({
|
|
|
116
115
|
search,
|
|
117
116
|
page,
|
|
118
117
|
total,
|
|
119
|
-
context,
|
|
120
118
|
hasError,
|
|
121
119
|
error,
|
|
122
120
|
}: AddressesPageData) => (
|
|
123
|
-
|
|
121
|
+
<>
|
|
124
122
|
{hasError ? (
|
|
125
123
|
<ErrorTabsLayout error={error} />
|
|
126
124
|
) : (
|
|
@@ -131,12 +129,14 @@ const AddressPage = ({
|
|
|
131
129
|
total={total}
|
|
132
130
|
/>
|
|
133
131
|
)}
|
|
134
|
-
|
|
132
|
+
</>
|
|
135
133
|
);
|
|
136
134
|
|
|
137
|
-
export default
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
135
|
+
export default withProviders(
|
|
136
|
+
withErrorBoundary(AddressPage, {
|
|
137
|
+
tags: {
|
|
138
|
+
component: "AddressesPage",
|
|
139
|
+
errorType: "addresses_error",
|
|
140
|
+
},
|
|
141
|
+
})
|
|
142
|
+
);
|
|
@@ -3,22 +3,20 @@ import { getBudgetByIdService } from "../features/budgets/services";
|
|
|
3
3
|
import { Budget } from "../features/budgets/types";
|
|
4
4
|
import { getContractDetailsService } from "../features/contracts/services";
|
|
5
5
|
import { getOrgUnitBasicDataService } from "../features/org-units/services";
|
|
6
|
-
import {
|
|
7
|
-
BuyerPortalProvider,
|
|
8
|
-
withErrorBoundary,
|
|
9
|
-
} from "../features/shared/components";
|
|
6
|
+
import { withErrorBoundary } from "../features/shared/components";
|
|
10
7
|
import { ErrorBoundaryProps } from "../features/shared/components/ErrorBoundary/types";
|
|
11
8
|
import { ErrorTabsLayout } from "../features/shared/layouts/ErrorTabsLayout/ErrorTabsLayout";
|
|
12
9
|
import {
|
|
13
10
|
type ClientContext,
|
|
14
|
-
getClientContext,
|
|
15
11
|
withLoaderErrorBoundary,
|
|
12
|
+
withAuthLoader,
|
|
13
|
+
withProviders,
|
|
16
14
|
} from "../features/shared/utils";
|
|
17
15
|
import { getUserByIdService } from "../features/users/services";
|
|
18
16
|
|
|
19
17
|
import type { ContractData } from "../features/contracts/types";
|
|
20
18
|
import type { OrgUnitBasicData } from "../features/org-units/types";
|
|
21
|
-
import type { LoaderData } from "../features/shared/types";
|
|
19
|
+
import type { AuthRouteProps, LoaderData } from "../features/shared/types";
|
|
22
20
|
import type { UserData } from "../features/users/types";
|
|
23
21
|
|
|
24
22
|
export type BudgetsDetailsData = {
|
|
@@ -41,37 +39,39 @@ export type BudgetsDetailsQuery = {
|
|
|
41
39
|
|
|
42
40
|
const loaderFunction = async (
|
|
43
41
|
data: LoaderData<BudgetsDetailsQuery>
|
|
44
|
-
): Promise<BudgetsDetailsData
|
|
45
|
-
const { customerId, cookie, userId, ...clientContext } =
|
|
46
|
-
await getClientContext(data);
|
|
47
|
-
|
|
42
|
+
): Promise<AuthRouteProps<BudgetsDetailsData>> => {
|
|
48
43
|
const { contractId, orgUnitId, budgetId } = data.query;
|
|
49
44
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
return withAuthLoader(
|
|
46
|
+
data,
|
|
47
|
+
async ({ customerId, cookie, userId, ...clientContext }) => {
|
|
48
|
+
const [orgUnit, contract, user, budgetsData] = await Promise.all([
|
|
49
|
+
getOrgUnitBasicDataService({ cookie, id: orgUnitId }),
|
|
50
|
+
getContractDetailsService({
|
|
51
|
+
contractId,
|
|
52
|
+
cookie,
|
|
53
|
+
unitId: orgUnitId,
|
|
54
|
+
}),
|
|
55
|
+
getUserByIdService({ orgUnitId, userId, cookie }),
|
|
56
|
+
getBudgetByIdService({
|
|
57
|
+
budgetId,
|
|
58
|
+
customerId,
|
|
59
|
+
unitId: orgUnitId,
|
|
60
|
+
cookie,
|
|
61
|
+
}),
|
|
62
|
+
]);
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
return {
|
|
65
|
+
budget: budgetsData,
|
|
66
|
+
context: {
|
|
67
|
+
clientContext: { customerId, cookie, userId, ...clientContext },
|
|
68
|
+
currentOrgUnit: orgUnit,
|
|
69
|
+
currentContract: contract,
|
|
70
|
+
currentUser: user,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
export const loader = withLoaderErrorBoundary(loaderFunction, {
|
|
@@ -81,22 +81,23 @@ export const loader = withLoaderErrorBoundary(loaderFunction, {
|
|
|
81
81
|
|
|
82
82
|
const BudgetsDetailsPage = ({
|
|
83
83
|
budget,
|
|
84
|
-
context,
|
|
85
84
|
hasError,
|
|
86
85
|
error,
|
|
87
86
|
}: BudgetsDetailsData) => (
|
|
88
|
-
|
|
87
|
+
<>
|
|
89
88
|
{hasError ? (
|
|
90
89
|
<ErrorTabsLayout error={error} />
|
|
91
90
|
) : (
|
|
92
91
|
<BudgetsDetailsLayout budget={budget} />
|
|
93
92
|
)}
|
|
94
|
-
|
|
93
|
+
</>
|
|
95
94
|
);
|
|
96
95
|
|
|
97
|
-
export default
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
96
|
+
export default withProviders(
|
|
97
|
+
withErrorBoundary(BudgetsDetailsPage, {
|
|
98
|
+
tags: {
|
|
99
|
+
component: "BudgetsDetailsPage",
|
|
100
|
+
errorType: "budgets_details_error",
|
|
101
|
+
},
|
|
102
|
+
})
|
|
103
|
+
);
|