@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.
@@ -1,4 +1,5 @@
1
1
  export type OrgSwitchPopoverProps = {
2
+ appId?: number;
2
3
  organizationName?: string;
3
4
  };
4
5
  export declare function OrgSwitchPopover(props: OrgSwitchPopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -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
@@ -32,6 +32,7 @@
32
32
  "fullName": "Full name",
33
33
  "idContact": "Contact",
34
34
  "idCustomer": "Customer",
35
+ "idDept": "Department",
35
36
  "idOrg": "Organization",
36
37
  "idSupplier": "Supplier",
37
38
  "idUser": "User",
@@ -32,6 +32,7 @@
32
32
  "fullName": "全称",
33
33
  "idContact": "联系人",
34
34
  "idCustomer": "客户",
35
+ "idDept": "部门",
35
36
  "idOrg": "机构",
36
37
  "idSupplier": "供应商",
37
38
  "idUser": "用户",
@@ -35,6 +35,7 @@
35
35
  "lightMode": "淺色模式",
36
36
  "idContact": "聯絡人",
37
37
  "idCustomer": "客戶",
38
+ "idDept": "部門",
38
39
  "idOrg": "機構",
39
40
  "idSupplier": "供應商",
40
41
  "idUser": "用户",
@@ -3,6 +3,11 @@
3
3
  * 获取用户最近访问的机构请求数据
4
4
  */
5
5
  export type OrgGetMyRQ = {
6
+ /**
7
+ * Check if owns the application
8
+ * 是否拥有应用
9
+ */
10
+ appId?: number;
6
11
  /**
7
12
  * Max items
8
13
  * 最大项数
@@ -1,4 +1,5 @@
1
1
  export type OrgSwitchPopoverProps = {
2
+ appId?: number;
2
3
  organizationName?: string;
3
4
  };
4
5
  export declare function OrgSwitchPopover(props: OrgSwitchPopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -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
@@ -32,6 +32,7 @@
32
32
  "fullName": "Full name",
33
33
  "idContact": "Contact",
34
34
  "idCustomer": "Customer",
35
+ "idDept": "Department",
35
36
  "idOrg": "Organization",
36
37
  "idSupplier": "Supplier",
37
38
  "idUser": "User",
@@ -32,6 +32,7 @@
32
32
  "fullName": "全称",
33
33
  "idContact": "联系人",
34
34
  "idCustomer": "客户",
35
+ "idDept": "部门",
35
36
  "idOrg": "机构",
36
37
  "idSupplier": "供应商",
37
38
  "idUser": "用户",
@@ -35,6 +35,7 @@
35
35
  "lightMode": "淺色模式",
36
36
  "idContact": "聯絡人",
37
37
  "idCustomer": "客戶",
38
+ "idDept": "部門",
38
39
  "idOrg": "機構",
39
40
  "idSupplier": "供應商",
40
41
  "idUser": "用户",
@@ -3,6 +3,11 @@
3
3
  * 获取用户最近访问的机构请求数据
4
4
  */
5
5
  export type OrgGetMyRQ = {
6
+ /**
7
+ * Check if owns the application
8
+ * 是否拥有应用
9
+ */
10
+ appId?: number;
6
11
  /**
7
12
  * Max items
8
13
  * 最大项数
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.0.64",
3
+ "version": "1.0.65",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -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
@@ -32,6 +32,7 @@
32
32
  "fullName": "Full name",
33
33
  "idContact": "Contact",
34
34
  "idCustomer": "Customer",
35
+ "idDept": "Department",
35
36
  "idOrg": "Organization",
36
37
  "idSupplier": "Supplier",
37
38
  "idUser": "User",
@@ -32,6 +32,7 @@
32
32
  "fullName": "全称",
33
33
  "idContact": "联系人",
34
34
  "idCustomer": "客户",
35
+ "idDept": "部门",
35
36
  "idOrg": "机构",
36
37
  "idSupplier": "供应商",
37
38
  "idUser": "用户",
@@ -35,6 +35,7 @@
35
35
  "lightMode": "淺色模式",
36
36
  "idContact": "聯絡人",
37
37
  "idCustomer": "客戶",
38
+ "idDept": "部門",
38
39
  "idOrg": "機構",
39
40
  "idSupplier": "供應商",
40
41
  "idUser": "用户",
@@ -3,6 +3,12 @@
3
3
  * 获取用户最近访问的机构请求数据
4
4
  */
5
5
  export type OrgGetMyRQ = {
6
+ /**
7
+ * Check if owns the application
8
+ * 是否拥有应用
9
+ */
10
+ appId?: number;
11
+
6
12
  /**
7
13
  * Max items
8
14
  * 最大项数