@etsoo/smarterp-core 1.1.31 → 1.1.33
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/lib/cjs/components/app/AppSwitchPopover.js +1 -1
- package/lib/cjs/components/org/OrgSwitchPopover.js +2 -3
- package/lib/mjs/components/app/AppSwitchPopover.js +1 -1
- package/lib/mjs/components/org/OrgSwitchPopover.js +2 -3
- package/package.json +7 -7
- package/src/components/app/AppSwitchPopover.tsx +1 -1
- package/src/components/org/OrgSwitchPopover.tsx +2 -3
|
@@ -40,7 +40,7 @@ function AppSwitchPopover(props) {
|
|
|
40
40
|
const index = data.findIndex((a) => a.id === currentApp);
|
|
41
41
|
if (index >= 0)
|
|
42
42
|
data.splice(index, 1);
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "column", margin: 2, children: [data.map((appData) => ((0, jsx_runtime_1.jsx)(Button_1.default, { onClick: async () => {
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "column", sx: { margin: 2 }, children: [data.map((appData) => ((0, jsx_runtime_1.jsx)(Button_1.default, { onClick: async () => {
|
|
44
44
|
/*
|
|
45
45
|
// Method 1, get the login URL and redirect
|
|
46
46
|
const tasks = appData.urls.map((u) =>
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.OrgSwitchPopover = OrgSwitchPopover;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const AccountTree_1 = __importDefault(require("@mui/icons-material/AccountTree"));
|
|
10
9
|
const react_router_dom_1 = require("react-router-dom");
|
|
11
10
|
const materialui_1 = require("@etsoo/materialui");
|
|
12
11
|
const ICoreServiceApp_1 = require("../../ICoreServiceApp");
|
|
@@ -29,7 +28,7 @@ function OrgSwitchPopover(props) {
|
|
|
29
28
|
// Current organization
|
|
30
29
|
const currentOrg = app.userData?.organization;
|
|
31
30
|
// Layout
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopover, { button: (callback) => ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(ButtonGroup_1.default, { variant: "text", children: [(0, jsx_runtime_1.jsx)(Button_1.default, { sx: { display: { xs: "none", md: "block" } }, title: labels.currentOrg, onClick: () => callback(anchorRef.current), children: organizationName ?? labels.switchOrg }), (0, jsx_runtime_1.jsx)(Button_1.default, { title: labels.switchOrg, onClick: (e) => callback(e.currentTarget), ref: anchorRef, children: (0, jsx_runtime_1.jsx)(
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopover, { button: (callback) => ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(ButtonGroup_1.default, { variant: "text", children: [(0, jsx_runtime_1.jsx)(Button_1.default, { sx: { display: { xs: "none", md: "block" } }, title: labels.currentOrg, onClick: () => callback(anchorRef.current), children: organizationName ?? labels.switchOrg }), (0, jsx_runtime_1.jsx)(Button_1.default, { title: labels.switchOrg, onClick: (e) => callback(e.currentTarget), ref: anchorRef, children: (0, jsx_runtime_1.jsx)(materialui_1.AccountTreeIcon, {}) })] }) })), loadData: () => app.core.orgApi.getMy({ appId, maxItems }, { showLoading: false }), children: (data) => {
|
|
33
32
|
if (data == null)
|
|
34
33
|
return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, {});
|
|
35
34
|
// Remove the current organization
|
|
@@ -38,7 +37,7 @@ function OrgSwitchPopover(props) {
|
|
|
38
37
|
if (index >= 0)
|
|
39
38
|
data.splice(index, 1);
|
|
40
39
|
}
|
|
41
|
-
return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "column", margin: 2, children: [data.map((org) => ((0, jsx_runtime_1.jsx)(Button_1.default, { onClick: async () => {
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "column", sx: { margin: 2 }, children: [data.map((org) => ((0, jsx_runtime_1.jsx)(Button_1.default, { onClick: async () => {
|
|
42
41
|
const result = await app.switchOrg(org.id);
|
|
43
42
|
if (result == null)
|
|
44
43
|
return;
|
|
@@ -34,7 +34,7 @@ export function AppSwitchPopover(props) {
|
|
|
34
34
|
const index = data.findIndex((a) => a.id === currentApp);
|
|
35
35
|
if (index >= 0)
|
|
36
36
|
data.splice(index, 1);
|
|
37
|
-
return (_jsxs(Stack, { direction: "column", margin: 2, children: [data.map((appData) => (_jsx(Button, { onClick: async () => {
|
|
37
|
+
return (_jsxs(Stack, { direction: "column", sx: { margin: 2 }, children: [data.map((appData) => (_jsx(Button, { onClick: async () => {
|
|
38
38
|
/*
|
|
39
39
|
// Method 1, get the login URL and redirect
|
|
40
40
|
const tasks = appData.urls.map((u) =>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import AccountTreeIcon from "@mui/icons-material/AccountTree";
|
|
4
3
|
import { useNavigate } from "react-router-dom";
|
|
5
|
-
import { ButtonPopover } from "@etsoo/materialui";
|
|
4
|
+
import { AccountTreeIcon, ButtonPopover } from "@etsoo/materialui";
|
|
6
5
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
7
6
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
8
7
|
import Button from "@mui/material/Button";
|
|
@@ -32,7 +31,7 @@ export function OrgSwitchPopover(props) {
|
|
|
32
31
|
if (index >= 0)
|
|
33
32
|
data.splice(index, 1);
|
|
34
33
|
}
|
|
35
|
-
return (_jsxs(Stack, { direction: "column", margin: 2, children: [data.map((org) => (_jsx(Button, { onClick: async () => {
|
|
34
|
+
return (_jsxs(Stack, { direction: "column", sx: { margin: 2 }, children: [data.map((org) => (_jsx(Button, { onClick: async () => {
|
|
36
35
|
const result = await app.switchOrg(org.id);
|
|
37
36
|
if (result == null)
|
|
38
37
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/smarterp-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.33",
|
|
4
4
|
"description": "TypeScript APIs for SmartERP Core",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@vitejs/plugin-react": "^6.0.1",
|
|
50
50
|
"jsdom": "^29.0.2",
|
|
51
51
|
"typescript": "^6.0.2",
|
|
52
|
-
"vitest": "^4.1.
|
|
52
|
+
"vitest": "^4.1.4"
|
|
53
53
|
},
|
|
54
54
|
"overrides": {
|
|
55
55
|
"react": "$react",
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@etsoo/appscript": "^1.6.60",
|
|
60
|
-
"@etsoo/materialui": "^1.6.
|
|
60
|
+
"@etsoo/materialui": "^1.6.43",
|
|
61
61
|
"@etsoo/react": "^1.8.84",
|
|
62
62
|
"@etsoo/shared": "^1.2.82",
|
|
63
|
-
"@etsoo/toolpad": "^1.0.
|
|
64
|
-
"@mui/material": "^
|
|
63
|
+
"@etsoo/toolpad": "^1.0.48",
|
|
64
|
+
"@mui/material": "^9.0.0",
|
|
65
65
|
"ajv": "^8.18.0",
|
|
66
66
|
"ajv-formats": "^3.0.1",
|
|
67
|
-
"react": "^19.2.
|
|
68
|
-
"react-dom": "^19.2.
|
|
67
|
+
"react": "^19.2.5",
|
|
68
|
+
"react-dom": "^19.2.5"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -66,7 +66,7 @@ export function AppSwitchPopover(props: AppSwitchPopoverProps) {
|
|
|
66
66
|
if (index >= 0) data.splice(index, 1);
|
|
67
67
|
|
|
68
68
|
return (
|
|
69
|
-
<Stack direction="column"
|
|
69
|
+
<Stack direction="column" sx={{ margin: 2 }}>
|
|
70
70
|
{data.map((appData) => (
|
|
71
71
|
<Button
|
|
72
72
|
key={appData.id}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import AccountTreeIcon from "@mui/icons-material/AccountTree";
|
|
3
2
|
import { useNavigate } from "react-router-dom";
|
|
4
|
-
import { ButtonPopover } from "@etsoo/materialui";
|
|
3
|
+
import { AccountTreeIcon, ButtonPopover } from "@etsoo/materialui";
|
|
5
4
|
import { OrgGetMyData } from "../../dto/org/OrgGetMyData";
|
|
6
5
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
7
6
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
@@ -72,7 +71,7 @@ export function OrgSwitchPopover(props: OrgSwitchPopoverProps) {
|
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
return (
|
|
75
|
-
<Stack direction="column"
|
|
74
|
+
<Stack direction="column" sx={{ margin: 2 }}>
|
|
76
75
|
{data.map((org) => (
|
|
77
76
|
<Button
|
|
78
77
|
key={org.id}
|