ptechcore_ui 1.0.65 → 1.0.67
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/dist/index.cjs +32 -68
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +32 -68
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1410,7 +1410,7 @@ var ToastProvider = ({ children }) => {
|
|
|
1410
1410
|
const typeStyles = confirmState.options ? getConfirmTypeStyles(confirmState.options.type) : getConfirmTypeStyles();
|
|
1411
1411
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ToastContext.Provider, { value, children: [
|
|
1412
1412
|
children,
|
|
1413
|
-
confirmState.isOpen && confirmState.options && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "fixed inset-0 z-[
|
|
1413
|
+
confirmState.isOpen && confirmState.options && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "fixed inset-0 z-[11000] flex items-center justify-center", children: [
|
|
1414
1414
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1415
1415
|
"div",
|
|
1416
1416
|
{
|
|
@@ -1448,7 +1448,7 @@ var ToastProvider = ({ children }) => {
|
|
|
1448
1448
|
{
|
|
1449
1449
|
variant: "full",
|
|
1450
1450
|
onClick: () => handleConfirm(true),
|
|
1451
|
-
|
|
1451
|
+
classname: typeStyles.confirmBtnClass,
|
|
1452
1452
|
children: confirmState.options.confirmText || "Confirmer"
|
|
1453
1453
|
}
|
|
1454
1454
|
)
|
|
@@ -1956,6 +1956,29 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1956
1956
|
};
|
|
1957
1957
|
var ApprovalPreviewAnswer_default = ApprovalPreviewAnswer;
|
|
1958
1958
|
|
|
1959
|
+
// src/hooks/usePermissions.ts
|
|
1960
|
+
var usePermissions = () => {
|
|
1961
|
+
const { loggedUser, activeBusinessEntity } = useSession();
|
|
1962
|
+
const hasPermission = (permissionCode) => {
|
|
1963
|
+
if (loggedUser?.is_superuser) return true;
|
|
1964
|
+
const entityPermissions = activeBusinessEntity?.user_permissions || [];
|
|
1965
|
+
return entityPermissions.includes(permissionCode);
|
|
1966
|
+
};
|
|
1967
|
+
const hasAnyPermission = (permissionCodes) => {
|
|
1968
|
+
return permissionCodes.some((code) => hasPermission(code));
|
|
1969
|
+
};
|
|
1970
|
+
const hasAllPermissions = (permissionCodes) => {
|
|
1971
|
+
return permissionCodes.every((code) => hasPermission(code));
|
|
1972
|
+
};
|
|
1973
|
+
return {
|
|
1974
|
+
hasPermission,
|
|
1975
|
+
hasAnyPermission,
|
|
1976
|
+
hasAllPermissions,
|
|
1977
|
+
isSuperuser: loggedUser?.is_superuser || false,
|
|
1978
|
+
permissions: activeBusinessEntity?.user_permissions || []
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
|
|
1959
1982
|
// src/components/layout/ModernDoubleSidebarLayout.tsx
|
|
1960
1983
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1961
1984
|
var MODULE_URLS = {
|
|
@@ -2023,6 +2046,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
2023
2046
|
const navigate = (0, import_react_router_dom3.useNavigate)();
|
|
2024
2047
|
const { theme, themeType, setTheme } = useTheme();
|
|
2025
2048
|
const { loggedUser, token, activeBusinessEntity, setActiveBusinessEntity } = useSession();
|
|
2049
|
+
const { hasPermission } = usePermissions();
|
|
2026
2050
|
const moduleUrls = getModuleUrls(token || void 0);
|
|
2027
2051
|
const getOrganizationModules = () => {
|
|
2028
2052
|
if (!activeBusinessEntity) return [];
|
|
@@ -2369,7 +2393,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
2369
2393
|
className: "flex-1 py-4 overflow-y-auto",
|
|
2370
2394
|
role: "menubar",
|
|
2371
2395
|
"aria-label": "Modules principaux",
|
|
2372
|
-
children: primaryMenuItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2396
|
+
children: primaryMenuItems.map((item) => item.permission && !hasPermission(item.permission) ? null : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2373
2397
|
"button",
|
|
2374
2398
|
{
|
|
2375
2399
|
onClick: () => {
|
|
@@ -2465,7 +2489,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
2465
2489
|
className: "flex-1 py-4 overflow-y-auto",
|
|
2466
2490
|
role: "menu",
|
|
2467
2491
|
"aria-label": "Sous-navigation",
|
|
2468
|
-
children: secondaryMenuItems[selectedModule]?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2492
|
+
children: secondaryMenuItems[selectedModule]?.map((item) => item.permission && !hasPermission(item.permission) ? null : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2469
2493
|
"button",
|
|
2470
2494
|
{
|
|
2471
2495
|
onClick: () => item.path && navigate(item.path),
|
|
@@ -3644,7 +3668,7 @@ var ToastItem = ({ toast }) => {
|
|
|
3644
3668
|
};
|
|
3645
3669
|
var ToastContainer = () => {
|
|
3646
3670
|
const { toasts } = useToast();
|
|
3647
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "fixed top-4 right-4 z-
|
|
3671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "fixed top-4 right-4 z-[10000] space-y-3", children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastItem, { toast }, toast.id)) });
|
|
3648
3672
|
};
|
|
3649
3673
|
var Toast_default = ToastContainer;
|
|
3650
3674
|
|
|
@@ -3849,31 +3873,6 @@ var Badge = ({
|
|
|
3849
3873
|
// src/components/common/FDrawer.tsx
|
|
3850
3874
|
var import_react8 = __toESM(require("react"), 1);
|
|
3851
3875
|
var import_react_router_dom4 = require("react-router-dom");
|
|
3852
|
-
|
|
3853
|
-
// src/hooks/usePermissions.ts
|
|
3854
|
-
var usePermissions = () => {
|
|
3855
|
-
const { loggedUser, activeBusinessEntity } = useSession();
|
|
3856
|
-
const hasPermission = (permissionCode) => {
|
|
3857
|
-
if (loggedUser?.is_superuser) return true;
|
|
3858
|
-
const entityPermissions = activeBusinessEntity?.user_permissions || [];
|
|
3859
|
-
return entityPermissions.includes(permissionCode);
|
|
3860
|
-
};
|
|
3861
|
-
const hasAnyPermission = (permissionCodes) => {
|
|
3862
|
-
return permissionCodes.some((code) => hasPermission(code));
|
|
3863
|
-
};
|
|
3864
|
-
const hasAllPermissions = (permissionCodes) => {
|
|
3865
|
-
return permissionCodes.every((code) => hasPermission(code));
|
|
3866
|
-
};
|
|
3867
|
-
return {
|
|
3868
|
-
hasPermission,
|
|
3869
|
-
hasAnyPermission,
|
|
3870
|
-
hasAllPermissions,
|
|
3871
|
-
isSuperuser: loggedUser?.is_superuser || false,
|
|
3872
|
-
permissions: activeBusinessEntity?.user_permissions || []
|
|
3873
|
-
};
|
|
3874
|
-
};
|
|
3875
|
-
|
|
3876
|
-
// src/components/common/FDrawer.tsx
|
|
3877
3876
|
var import_lucide_react6 = require("lucide-react");
|
|
3878
3877
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3879
3878
|
var ExcelImportModal = ({
|
|
@@ -5348,23 +5347,7 @@ var SelectVendor = ({
|
|
|
5348
5347
|
label = "Ajouter un fournisseur"
|
|
5349
5348
|
}) => {
|
|
5350
5349
|
const [showModal, setShowModal] = (0, import_react10.useState)(false);
|
|
5351
|
-
const
|
|
5352
|
-
const { token, activeBusinessEntity } = useSession();
|
|
5353
|
-
const [vendors, setVendors] = (0, import_react10.useState)(() => {
|
|
5354
|
-
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
5355
|
-
const cached = sessionStorage.getItem(cacheKey);
|
|
5356
|
-
return cached ? JSON.parse(cached) : [];
|
|
5357
|
-
});
|
|
5358
|
-
const [loadingVendors, setLoadingVendors] = (0, import_react10.useState)(false);
|
|
5359
|
-
(0, import_react10.useEffect)(() => {
|
|
5360
|
-
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
5361
|
-
const cached = sessionStorage.getItem(cacheKey);
|
|
5362
|
-
if (!cached) {
|
|
5363
|
-
loadVendors();
|
|
5364
|
-
} else {
|
|
5365
|
-
setVendors(JSON.parse(cached));
|
|
5366
|
-
}
|
|
5367
|
-
}, [activeBusinessEntity?.id]);
|
|
5350
|
+
const { vendors, loadingVendors, loadVendors } = useSession();
|
|
5368
5351
|
const getVendorOptions = () => {
|
|
5369
5352
|
return vendors.filter((vendor) => vendor.id !== void 0).map((vendor) => ({
|
|
5370
5353
|
value: vendor.id,
|
|
@@ -5372,26 +5355,7 @@ var SelectVendor = ({
|
|
|
5372
5355
|
object: vendor
|
|
5373
5356
|
}));
|
|
5374
5357
|
};
|
|
5375
|
-
const loadVendors = async () => {
|
|
5376
|
-
if (!token) {
|
|
5377
|
-
console.error("Vous devez etre connect\xE9 pour voir les organisations");
|
|
5378
|
-
return;
|
|
5379
|
-
}
|
|
5380
|
-
try {
|
|
5381
|
-
setLoadingVendors(true);
|
|
5382
|
-
const result = await VendorServices.list({ business_entity_id: activeBusinessEntity?.id });
|
|
5383
|
-
setVendors(result.data);
|
|
5384
|
-
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
5385
|
-
sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
|
|
5386
|
-
} catch (error) {
|
|
5387
|
-
console.error(error);
|
|
5388
|
-
} finally {
|
|
5389
|
-
setLoadingVendors(false);
|
|
5390
|
-
}
|
|
5391
|
-
};
|
|
5392
5358
|
const handleRefresh = () => {
|
|
5393
|
-
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
5394
|
-
sessionStorage.removeItem(cacheKey);
|
|
5395
5359
|
loadVendors();
|
|
5396
5360
|
};
|
|
5397
5361
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
@@ -5418,12 +5382,12 @@ var SelectVendor = ({
|
|
|
5418
5382
|
showModal && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5419
5383
|
MinimalVendorForm,
|
|
5420
5384
|
{
|
|
5421
|
-
object:
|
|
5385
|
+
object: null,
|
|
5422
5386
|
isOpen: showModal,
|
|
5423
5387
|
onClose: () => setShowModal(false),
|
|
5424
5388
|
refresh: handleRefresh
|
|
5425
5389
|
},
|
|
5426
|
-
`entity-modal
|
|
5390
|
+
`entity-modal-new`
|
|
5427
5391
|
)
|
|
5428
5392
|
] });
|
|
5429
5393
|
};
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1240,7 +1240,7 @@ var ToastProvider = ({ children }) => {
|
|
|
1240
1240
|
const typeStyles = confirmState.options ? getConfirmTypeStyles(confirmState.options.type) : getConfirmTypeStyles();
|
|
1241
1241
|
return /* @__PURE__ */ jsxs3(ToastContext.Provider, { value, children: [
|
|
1242
1242
|
children,
|
|
1243
|
-
confirmState.isOpen && confirmState.options && /* @__PURE__ */ jsxs3("div", { className: "fixed inset-0 z-[
|
|
1243
|
+
confirmState.isOpen && confirmState.options && /* @__PURE__ */ jsxs3("div", { className: "fixed inset-0 z-[11000] flex items-center justify-center", children: [
|
|
1244
1244
|
/* @__PURE__ */ jsx6(
|
|
1245
1245
|
"div",
|
|
1246
1246
|
{
|
|
@@ -1278,7 +1278,7 @@ var ToastProvider = ({ children }) => {
|
|
|
1278
1278
|
{
|
|
1279
1279
|
variant: "full",
|
|
1280
1280
|
onClick: () => handleConfirm(true),
|
|
1281
|
-
|
|
1281
|
+
classname: typeStyles.confirmBtnClass,
|
|
1282
1282
|
children: confirmState.options.confirmText || "Confirmer"
|
|
1283
1283
|
}
|
|
1284
1284
|
)
|
|
@@ -1786,6 +1786,29 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1786
1786
|
};
|
|
1787
1787
|
var ApprovalPreviewAnswer_default = ApprovalPreviewAnswer;
|
|
1788
1788
|
|
|
1789
|
+
// src/hooks/usePermissions.ts
|
|
1790
|
+
var usePermissions = () => {
|
|
1791
|
+
const { loggedUser, activeBusinessEntity } = useSession();
|
|
1792
|
+
const hasPermission = (permissionCode) => {
|
|
1793
|
+
if (loggedUser?.is_superuser) return true;
|
|
1794
|
+
const entityPermissions = activeBusinessEntity?.user_permissions || [];
|
|
1795
|
+
return entityPermissions.includes(permissionCode);
|
|
1796
|
+
};
|
|
1797
|
+
const hasAnyPermission = (permissionCodes) => {
|
|
1798
|
+
return permissionCodes.some((code) => hasPermission(code));
|
|
1799
|
+
};
|
|
1800
|
+
const hasAllPermissions = (permissionCodes) => {
|
|
1801
|
+
return permissionCodes.every((code) => hasPermission(code));
|
|
1802
|
+
};
|
|
1803
|
+
return {
|
|
1804
|
+
hasPermission,
|
|
1805
|
+
hasAnyPermission,
|
|
1806
|
+
hasAllPermissions,
|
|
1807
|
+
isSuperuser: loggedUser?.is_superuser || false,
|
|
1808
|
+
permissions: activeBusinessEntity?.user_permissions || []
|
|
1809
|
+
};
|
|
1810
|
+
};
|
|
1811
|
+
|
|
1789
1812
|
// src/components/layout/ModernDoubleSidebarLayout.tsx
|
|
1790
1813
|
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1791
1814
|
var MODULE_URLS = {
|
|
@@ -1853,6 +1876,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
1853
1876
|
const navigate = useNavigate();
|
|
1854
1877
|
const { theme, themeType, setTheme } = useTheme();
|
|
1855
1878
|
const { loggedUser, token, activeBusinessEntity, setActiveBusinessEntity } = useSession();
|
|
1879
|
+
const { hasPermission } = usePermissions();
|
|
1856
1880
|
const moduleUrls = getModuleUrls(token || void 0);
|
|
1857
1881
|
const getOrganizationModules = () => {
|
|
1858
1882
|
if (!activeBusinessEntity) return [];
|
|
@@ -2199,7 +2223,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
2199
2223
|
className: "flex-1 py-4 overflow-y-auto",
|
|
2200
2224
|
role: "menubar",
|
|
2201
2225
|
"aria-label": "Modules principaux",
|
|
2202
|
-
children: primaryMenuItems.map((item) => /* @__PURE__ */ jsxs6(
|
|
2226
|
+
children: primaryMenuItems.map((item) => item.permission && !hasPermission(item.permission) ? null : /* @__PURE__ */ jsxs6(
|
|
2203
2227
|
"button",
|
|
2204
2228
|
{
|
|
2205
2229
|
onClick: () => {
|
|
@@ -2295,7 +2319,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
2295
2319
|
className: "flex-1 py-4 overflow-y-auto",
|
|
2296
2320
|
role: "menu",
|
|
2297
2321
|
"aria-label": "Sous-navigation",
|
|
2298
|
-
children: secondaryMenuItems[selectedModule]?.map((item) => /* @__PURE__ */ jsxs6(
|
|
2322
|
+
children: secondaryMenuItems[selectedModule]?.map((item) => item.permission && !hasPermission(item.permission) ? null : /* @__PURE__ */ jsxs6(
|
|
2299
2323
|
"button",
|
|
2300
2324
|
{
|
|
2301
2325
|
onClick: () => item.path && navigate(item.path),
|
|
@@ -3474,7 +3498,7 @@ var ToastItem = ({ toast }) => {
|
|
|
3474
3498
|
};
|
|
3475
3499
|
var ToastContainer = () => {
|
|
3476
3500
|
const { toasts } = useToast();
|
|
3477
|
-
return /* @__PURE__ */ jsx10("div", { className: "fixed top-4 right-4 z-
|
|
3501
|
+
return /* @__PURE__ */ jsx10("div", { className: "fixed top-4 right-4 z-[10000] space-y-3", children: toasts.map((toast) => /* @__PURE__ */ jsx10(ToastItem, { toast }, toast.id)) });
|
|
3478
3502
|
};
|
|
3479
3503
|
var Toast_default = ToastContainer;
|
|
3480
3504
|
|
|
@@ -3679,31 +3703,6 @@ var Badge = ({
|
|
|
3679
3703
|
// src/components/common/FDrawer.tsx
|
|
3680
3704
|
import React7, { useEffect as useEffect6, useState as useState8, useRef } from "react";
|
|
3681
3705
|
import { useLocation as useLocation2, useNavigate as useNavigate2, useSearchParams as useSearchParams2, Link as Link3 } from "react-router-dom";
|
|
3682
|
-
|
|
3683
|
-
// src/hooks/usePermissions.ts
|
|
3684
|
-
var usePermissions = () => {
|
|
3685
|
-
const { loggedUser, activeBusinessEntity } = useSession();
|
|
3686
|
-
const hasPermission = (permissionCode) => {
|
|
3687
|
-
if (loggedUser?.is_superuser) return true;
|
|
3688
|
-
const entityPermissions = activeBusinessEntity?.user_permissions || [];
|
|
3689
|
-
return entityPermissions.includes(permissionCode);
|
|
3690
|
-
};
|
|
3691
|
-
const hasAnyPermission = (permissionCodes) => {
|
|
3692
|
-
return permissionCodes.some((code) => hasPermission(code));
|
|
3693
|
-
};
|
|
3694
|
-
const hasAllPermissions = (permissionCodes) => {
|
|
3695
|
-
return permissionCodes.every((code) => hasPermission(code));
|
|
3696
|
-
};
|
|
3697
|
-
return {
|
|
3698
|
-
hasPermission,
|
|
3699
|
-
hasAnyPermission,
|
|
3700
|
-
hasAllPermissions,
|
|
3701
|
-
isSuperuser: loggedUser?.is_superuser || false,
|
|
3702
|
-
permissions: activeBusinessEntity?.user_permissions || []
|
|
3703
|
-
};
|
|
3704
|
-
};
|
|
3705
|
-
|
|
3706
|
-
// src/components/common/FDrawer.tsx
|
|
3707
3706
|
import { ArrowDownAZ, ArrowDownUp, ArrowUpAZ, AlertCircle as AlertCircle3, CheckCircle2 as CheckCircle22, ChevronDown, Columns3, Copy, Download as Download2, FileSpreadsheet, Filter, LayoutGrid as LayoutGrid2, LayoutList, Maximize2, Minimize2, MoreVertical, Plus, Printer, RefreshCw, Settings2 as Settings22, Trash2 as Trash22, Upload, X as X5, Search as Search2, SquareIcon } from "lucide-react";
|
|
3708
3707
|
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3709
3708
|
var ExcelImportModal = ({
|
|
@@ -5178,23 +5177,7 @@ var SelectVendor = ({
|
|
|
5178
5177
|
label = "Ajouter un fournisseur"
|
|
5179
5178
|
}) => {
|
|
5180
5179
|
const [showModal, setShowModal] = useState10(false);
|
|
5181
|
-
const
|
|
5182
|
-
const { token, activeBusinessEntity } = useSession();
|
|
5183
|
-
const [vendors, setVendors] = useState10(() => {
|
|
5184
|
-
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
5185
|
-
const cached = sessionStorage.getItem(cacheKey);
|
|
5186
|
-
return cached ? JSON.parse(cached) : [];
|
|
5187
|
-
});
|
|
5188
|
-
const [loadingVendors, setLoadingVendors] = useState10(false);
|
|
5189
|
-
useEffect8(() => {
|
|
5190
|
-
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
5191
|
-
const cached = sessionStorage.getItem(cacheKey);
|
|
5192
|
-
if (!cached) {
|
|
5193
|
-
loadVendors();
|
|
5194
|
-
} else {
|
|
5195
|
-
setVendors(JSON.parse(cached));
|
|
5196
|
-
}
|
|
5197
|
-
}, [activeBusinessEntity?.id]);
|
|
5180
|
+
const { vendors, loadingVendors, loadVendors } = useSession();
|
|
5198
5181
|
const getVendorOptions = () => {
|
|
5199
5182
|
return vendors.filter((vendor) => vendor.id !== void 0).map((vendor) => ({
|
|
5200
5183
|
value: vendor.id,
|
|
@@ -5202,26 +5185,7 @@ var SelectVendor = ({
|
|
|
5202
5185
|
object: vendor
|
|
5203
5186
|
}));
|
|
5204
5187
|
};
|
|
5205
|
-
const loadVendors = async () => {
|
|
5206
|
-
if (!token) {
|
|
5207
|
-
console.error("Vous devez etre connect\xE9 pour voir les organisations");
|
|
5208
|
-
return;
|
|
5209
|
-
}
|
|
5210
|
-
try {
|
|
5211
|
-
setLoadingVendors(true);
|
|
5212
|
-
const result = await VendorServices.list({ business_entity_id: activeBusinessEntity?.id });
|
|
5213
|
-
setVendors(result.data);
|
|
5214
|
-
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
5215
|
-
sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
|
|
5216
|
-
} catch (error) {
|
|
5217
|
-
console.error(error);
|
|
5218
|
-
} finally {
|
|
5219
|
-
setLoadingVendors(false);
|
|
5220
|
-
}
|
|
5221
|
-
};
|
|
5222
5188
|
const handleRefresh = () => {
|
|
5223
|
-
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
5224
|
-
sessionStorage.removeItem(cacheKey);
|
|
5225
5189
|
loadVendors();
|
|
5226
5190
|
};
|
|
5227
5191
|
return /* @__PURE__ */ jsxs12("div", { children: [
|
|
@@ -5248,12 +5212,12 @@ var SelectVendor = ({
|
|
|
5248
5212
|
showModal && /* @__PURE__ */ jsx16(
|
|
5249
5213
|
MinimalVendorForm,
|
|
5250
5214
|
{
|
|
5251
|
-
object:
|
|
5215
|
+
object: null,
|
|
5252
5216
|
isOpen: showModal,
|
|
5253
5217
|
onClose: () => setShowModal(false),
|
|
5254
5218
|
refresh: handleRefresh
|
|
5255
5219
|
},
|
|
5256
|
-
`entity-modal
|
|
5220
|
+
`entity-modal-new`
|
|
5257
5221
|
)
|
|
5258
5222
|
] });
|
|
5259
5223
|
};
|