@etsoo/smarterp-core 1.0.64 → 1.0.65
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/org/OrgSwitchPopover.d.ts +1 -0
- package/lib/cjs/components/org/OrgSwitchPopover.js +2 -2
- package/lib/cjs/i18n/en.json +1 -0
- package/lib/cjs/i18n/zh-Hans.json +1 -0
- package/lib/cjs/i18n/zh-Hant.json +1 -0
- package/lib/cjs/rq/org/OrgGetMyRQ.d.ts +5 -0
- package/lib/mjs/components/org/OrgSwitchPopover.d.ts +1 -0
- package/lib/mjs/components/org/OrgSwitchPopover.js +2 -2
- package/lib/mjs/i18n/en.json +1 -0
- package/lib/mjs/i18n/zh-Hans.json +1 -0
- package/lib/mjs/i18n/zh-Hant.json +1 -0
- package/lib/mjs/rq/org/OrgGetMyRQ.d.ts +5 -0
- package/package.json +1 -1
- package/src/components/org/OrgSwitchPopover.tsx +3 -2
- package/src/i18n/en.json +1 -0
- package/src/i18n/zh-Hans.json +1 -0
- package/src/i18n/zh-Hant.json +1 -0
- package/src/rq/org/OrgGetMyRQ.ts +6 -0
|
@@ -15,7 +15,7 @@ const Button_1 = __importDefault(require("@mui/material/Button"));
|
|
|
15
15
|
const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
16
16
|
function OrgSwitchPopover(props) {
|
|
17
17
|
// Destruct
|
|
18
|
-
const { organizationName } = props;
|
|
18
|
+
const { appId, organizationName } = props;
|
|
19
19
|
// Route
|
|
20
20
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
21
21
|
// App
|
|
@@ -29,7 +29,7 @@ function OrgSwitchPopover(props) {
|
|
|
29
29
|
// Current organization
|
|
30
30
|
const currentOrg = app.userData?.organization;
|
|
31
31
|
// 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)(AccountTree_1.default, {}) })] }) })), loadData: () => app.core.orgApi.getMy({ maxItems }, { showLoading: false }), children: (data) => {
|
|
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)(AccountTree_1.default, {}) })] }) })), loadData: () => app.core.orgApi.getMy({ appId, maxItems }, { showLoading: false }), children: (data) => {
|
|
33
33
|
if (data == null)
|
|
34
34
|
return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, {});
|
|
35
35
|
// Remove the current organization
|
package/lib/cjs/i18n/en.json
CHANGED
|
@@ -9,7 +9,7 @@ import Button from "@mui/material/Button";
|
|
|
9
9
|
import Stack from "@mui/material/Stack";
|
|
10
10
|
export function OrgSwitchPopover(props) {
|
|
11
11
|
// Destruct
|
|
12
|
-
const { organizationName } = props;
|
|
12
|
+
const { appId, organizationName } = props;
|
|
13
13
|
// Route
|
|
14
14
|
const navigate = useNavigate();
|
|
15
15
|
// App
|
|
@@ -23,7 +23,7 @@ export function OrgSwitchPopover(props) {
|
|
|
23
23
|
// Current organization
|
|
24
24
|
const currentOrg = app.userData?.organization;
|
|
25
25
|
// Layout
|
|
26
|
-
return (_jsx(ButtonPopover, { button: (callback) => (_jsx(React.Fragment, { children: _jsxs(ButtonGroup, { variant: "text", children: [_jsx(Button, { sx: { display: { xs: "none", md: "block" } }, title: labels.currentOrg, onClick: () => callback(anchorRef.current), children: organizationName ?? labels.switchOrg }), _jsx(Button, { title: labels.switchOrg, onClick: (e) => callback(e.currentTarget), ref: anchorRef, children: _jsx(AccountTreeIcon, {}) })] }) })), loadData: () => app.core.orgApi.getMy({ maxItems }, { showLoading: false }), children: (data) => {
|
|
26
|
+
return (_jsx(ButtonPopover, { button: (callback) => (_jsx(React.Fragment, { children: _jsxs(ButtonGroup, { variant: "text", children: [_jsx(Button, { sx: { display: { xs: "none", md: "block" } }, title: labels.currentOrg, onClick: () => callback(anchorRef.current), children: organizationName ?? labels.switchOrg }), _jsx(Button, { title: labels.switchOrg, onClick: (e) => callback(e.currentTarget), ref: anchorRef, children: _jsx(AccountTreeIcon, {}) })] }) })), loadData: () => app.core.orgApi.getMy({ appId, maxItems }, { showLoading: false }), children: (data) => {
|
|
27
27
|
if (data == null)
|
|
28
28
|
return _jsx(React.Fragment, {});
|
|
29
29
|
// Remove the current organization
|
package/lib/mjs/i18n/en.json
CHANGED
package/package.json
CHANGED
|
@@ -9,12 +9,13 @@ import Button from "@mui/material/Button";
|
|
|
9
9
|
import Stack from "@mui/material/Stack";
|
|
10
10
|
|
|
11
11
|
export type OrgSwitchPopoverProps = {
|
|
12
|
+
appId?: number;
|
|
12
13
|
organizationName?: string;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export function OrgSwitchPopover(props: OrgSwitchPopoverProps) {
|
|
16
17
|
// Destruct
|
|
17
|
-
const { organizationName } = props;
|
|
18
|
+
const { appId, organizationName } = props;
|
|
18
19
|
|
|
19
20
|
// Route
|
|
20
21
|
const navigate = useNavigate();
|
|
@@ -58,7 +59,7 @@ export function OrgSwitchPopover(props: OrgSwitchPopoverProps) {
|
|
|
58
59
|
</React.Fragment>
|
|
59
60
|
)}
|
|
60
61
|
loadData={() =>
|
|
61
|
-
app.core.orgApi.getMy({ maxItems }, { showLoading: false })
|
|
62
|
+
app.core.orgApi.getMy({ appId, maxItems }, { showLoading: false })
|
|
62
63
|
}
|
|
63
64
|
>
|
|
64
65
|
{(data) => {
|
package/src/i18n/en.json
CHANGED
package/src/i18n/zh-Hans.json
CHANGED
package/src/i18n/zh-Hant.json
CHANGED