@nocobase/client 0.8.1-alpha.4 → 0.9.0-alpha.2
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/es/acl/ACLProvider.d.ts +16 -2
- package/es/acl/ACLProvider.js +271 -100
- package/es/acl/Configuration/ConfigureCenter.d.ts +2 -0
- package/es/acl/Configuration/ConfigureCenter.js +254 -0
- package/es/acl/Configuration/MenuConfigure.js +2 -2
- package/es/acl/Configuration/PermisionProvider.d.ts +4 -0
- package/es/acl/Configuration/PermisionProvider.js +132 -0
- package/es/acl/Configuration/RoleConfigure.js +98 -23
- package/es/acl/Configuration/RoleTable.d.ts +1 -1
- package/es/acl/Configuration/RoleTable.js +6 -3
- package/es/acl/Configuration/RolesResourcesActions.js +2 -2
- package/es/acl/Configuration/index.d.ts +1 -0
- package/es/acl/Configuration/index.js +2 -1
- package/es/acl/Configuration/schemas/roleCollections.js +41 -13
- package/es/acl/Configuration/schemas/roles.js +42 -2
- package/es/acl/Configuration/schemas/scopes.js +2 -0
- package/es/acl/index.d.ts +1 -0
- package/es/acl/index.js +2 -1
- package/es/acl/style.less +10 -0
- package/es/antd-config-provider/index.d.ts +3 -1
- package/es/antd-config-provider/index.js +25 -6
- package/es/antd-config-provider/loadConstrueLocale.d.ts +1 -0
- package/es/antd-config-provider/loadConstrueLocale.js +293 -0
- package/es/api-client/APIClient.js +5 -0
- package/es/block-provider/FormBlockProvider.js +5 -2
- package/es/block-provider/KanbanBlockProvider.js +3 -3
- package/es/block-provider/SharedFilterProvider.d.ts +1 -0
- package/es/block-provider/SharedFilterProvider.js +22 -6
- package/es/collection-manager/CollectionHistoryProvider.js +14 -2
- package/es/collection-manager/hooks/useCollection.d.ts +1 -0
- package/es/collection-manager/hooks/useCollection.js +10 -0
- package/es/collection-manager/interfaces/index.d.ts +0 -1
- package/es/collection-manager/interfaces/index.js +0 -1
- package/es/collection-manager/interfaces/o2m.js +1 -0
- package/es/collection-manager/interfaces/properties/operators.js +7 -0
- package/es/collection-manager/interfaces/subTable.js +1 -0
- package/es/collection-manager/templates/calendar.js +5 -0
- package/es/formula/Expression.d.ts +2 -0
- package/es/formula/Expression.js +296 -0
- package/es/formula/Result.d.ts +2 -0
- package/es/formula/Result.js +91 -0
- package/es/formula/index.d.ts +6 -0
- package/es/formula/index.js +8 -0
- package/es/i18n/i18n.js +7 -12
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -2
- package/es/locale/en_US.d.ts +108 -28
- package/es/locale/en_US.js +108 -28
- package/es/locale/index.d.ts +201 -4
- package/es/locale/index.js +191 -58
- package/es/locale/ja_JP.d.ts +4 -0
- package/es/locale/ja_JP.js +4 -0
- package/es/locale/zh_CN.d.ts +11 -1
- package/es/locale/zh_CN.js +12 -2
- package/es/plugin-manager/PluginManager.js +19 -13
- package/es/pm/PluginManagerLink.js +38 -43
- package/es/pm/index.d.ts +1 -0
- package/es/pm/index.js +84 -35
- package/es/record-provider/index.d.ts +1 -0
- package/es/record-provider/index.js +7 -4
- package/es/route-switch/antd/admin-layout/index.d.ts +1 -0
- package/es/route-switch/antd/admin-layout/index.js +4 -6
- package/es/schema-component/antd/action/Action.js +19 -16
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +24 -23
- package/es/schema-component/antd/cron/Cron.d.ts +0 -1
- package/es/schema-component/antd/cron/Cron.js +16 -19
- package/es/schema-component/antd/cron/locale/index.d.ts +37 -0
- package/es/schema-component/antd/cron/locale/index.js +6 -0
- package/es/schema-component/antd/filter/useFilterActionProps.js +17 -23
- package/es/schema-component/antd/form-item/FormItem.js +5 -4
- package/es/schema-component/antd/index.d.ts +1 -2
- package/es/schema-component/antd/index.js +1 -2
- package/es/schema-component/antd/page/FixedBlock.d.ts +1 -1
- package/es/schema-component/antd/page/FixedBlock.js +70 -21
- package/es/schema-component/antd/page/Page.js +15 -10
- package/es/schema-component/antd/remote-select/RemoteSelect.js +12 -2
- package/es/schema-component/antd/table/Table.Array.js +1 -1
- package/es/schema-component/antd/table-v2/Table.js +13 -6
- package/es/schema-component/antd/table-v2/TableBlockDesigner.js +24 -8
- package/es/schema-component/hooks/useDesignable.d.ts +1 -1
- package/es/schema-component/hooks/useDesignable.js +45 -16
- package/es/schema-component/hooks/useFieldTitle.js +3 -1
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +3 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -0
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -0
- package/es/schema-initializer/utils.js +6 -9
- package/es/schema-templates/BlockTemplate.js +2 -2
- package/es/schema-templates/SchemaTemplateManagerProvider.js +1 -1
- package/es/system-settings/SystemSettingsShortcut.js +1 -1
- package/lib/acl/ACLProvider.d.ts +16 -2
- package/lib/acl/ACLProvider.js +283 -102
- package/lib/acl/Configuration/ConfigureCenter.d.ts +2 -0
- package/lib/acl/Configuration/ConfigureCenter.js +278 -0
- package/lib/acl/Configuration/MenuConfigure.js +3 -3
- package/lib/acl/Configuration/PermisionProvider.d.ts +4 -0
- package/lib/acl/Configuration/PermisionProvider.js +156 -0
- package/lib/acl/Configuration/RoleConfigure.js +107 -23
- package/lib/acl/Configuration/RoleTable.d.ts +1 -1
- package/lib/acl/Configuration/RoleTable.js +8 -4
- package/lib/acl/Configuration/RolesResourcesActions.js +2 -2
- package/lib/acl/Configuration/index.d.ts +1 -0
- package/lib/acl/Configuration/index.js +15 -1
- package/lib/acl/Configuration/schemas/roleCollections.js +41 -13
- package/lib/acl/Configuration/schemas/roles.js +47 -2
- package/lib/acl/Configuration/schemas/scopes.js +2 -0
- package/lib/acl/index.d.ts +1 -0
- package/lib/acl/index.js +3 -1
- package/lib/acl/style.less +10 -0
- package/lib/antd-config-provider/index.d.ts +3 -1
- package/lib/antd-config-provider/index.js +40 -6
- package/lib/antd-config-provider/loadConstrueLocale.d.ts +1 -0
- package/lib/antd-config-provider/loadConstrueLocale.js +304 -0
- package/lib/api-client/APIClient.js +5 -0
- package/lib/block-provider/FormBlockProvider.js +9 -3
- package/lib/block-provider/KanbanBlockProvider.js +3 -3
- package/lib/block-provider/SharedFilterProvider.d.ts +1 -0
- package/lib/block-provider/SharedFilterProvider.js +26 -7
- package/lib/collection-manager/CollectionHistoryProvider.js +14 -1
- package/lib/collection-manager/hooks/useCollection.d.ts +1 -0
- package/lib/collection-manager/hooks/useCollection.js +10 -0
- package/lib/collection-manager/interfaces/index.d.ts +0 -1
- package/lib/collection-manager/interfaces/index.js +0 -13
- package/lib/collection-manager/interfaces/o2m.js +1 -0
- package/lib/collection-manager/interfaces/properties/operators.js +7 -0
- package/lib/collection-manager/interfaces/subTable.js +1 -0
- package/lib/collection-manager/templates/calendar.js +5 -0
- package/lib/formula/Expression.d.ts +2 -0
- package/lib/formula/Expression.js +319 -0
- package/lib/formula/Result.d.ts +2 -0
- package/lib/formula/Result.js +114 -0
- package/lib/formula/index.d.ts +6 -0
- package/lib/formula/index.js +22 -0
- package/lib/i18n/i18n.js +7 -14
- package/lib/index.d.ts +2 -1
- package/lib/index.js +26 -13
- package/lib/locale/en_US.d.ts +108 -28
- package/lib/locale/en_US.js +108 -28
- package/lib/locale/index.d.ts +201 -4
- package/lib/locale/index.js +197 -67
- package/lib/locale/ja_JP.d.ts +4 -0
- package/lib/locale/ja_JP.js +4 -0
- package/lib/locale/zh_CN.d.ts +11 -1
- package/lib/locale/zh_CN.js +12 -2
- package/lib/plugin-manager/PluginManager.js +20 -13
- package/lib/pm/PluginManagerLink.js +37 -43
- package/lib/pm/index.d.ts +1 -0
- package/lib/pm/index.js +90 -35
- package/lib/record-provider/index.d.ts +1 -0
- package/lib/record-provider/index.js +7 -4
- package/lib/route-switch/antd/admin-layout/index.d.ts +1 -0
- package/lib/route-switch/antd/admin-layout/index.js +5 -4
- package/lib/schema-component/antd/action/Action.js +19 -16
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +22 -21
- package/lib/schema-component/antd/cron/Cron.d.ts +0 -1
- package/lib/schema-component/antd/cron/Cron.js +19 -24
- package/lib/schema-component/antd/cron/locale/index.d.ts +37 -0
- package/lib/schema-component/antd/cron/locale/index.js +18 -0
- package/lib/schema-component/antd/filter/useFilterActionProps.js +16 -23
- package/lib/schema-component/antd/form-item/FormItem.js +6 -4
- package/lib/schema-component/antd/index.d.ts +1 -2
- package/lib/schema-component/antd/index.js +8 -21
- package/lib/schema-component/antd/page/FixedBlock.d.ts +1 -1
- package/lib/schema-component/antd/page/FixedBlock.js +71 -21
- package/lib/schema-component/antd/page/Page.js +14 -9
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +18 -3
- package/lib/schema-component/antd/table/Table.Array.js +1 -1
- package/lib/schema-component/antd/table-v2/Table.js +14 -6
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +25 -8
- package/lib/schema-component/hooks/useDesignable.d.ts +1 -1
- package/lib/schema-component/hooks/useDesignable.js +47 -18
- package/lib/schema-component/hooks/useFieldTitle.js +4 -1
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +3 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -0
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -0
- package/lib/schema-initializer/utils.js +6 -9
- package/lib/schema-templates/BlockTemplate.js +2 -2
- package/lib/schema-templates/SchemaTemplateManagerProvider.js +1 -1
- package/lib/system-settings/SystemSettingsShortcut.js +1 -1
- package/package.json +6 -11
- package/es/collection-manager/interfaces/formula.d.ts +0 -2
- package/es/collection-manager/interfaces/formula.js +0 -74
- package/es/schema-component/antd/formula-input/Compute.d.ts +0 -3
- package/es/schema-component/antd/formula-input/Compute.js +0 -55
- package/es/schema-component/antd/formula-input/FormulaInput.d.ts +0 -3
- package/es/schema-component/antd/formula-input/FormulaInput.js +0 -167
- package/es/schema-component/antd/formula-input/index.d.ts +0 -1
- package/es/schema-component/antd/formula-input/index.js +0 -7
- package/lib/collection-manager/interfaces/formula.d.ts +0 -2
- package/lib/collection-manager/interfaces/formula.js +0 -83
- package/lib/schema-component/antd/formula-input/Compute.d.ts +0 -3
- package/lib/schema-component/antd/formula-input/Compute.js +0 -79
- package/lib/schema-component/antd/formula-input/FormulaInput.d.ts +0 -3
- package/lib/schema-component/antd/formula-input/FormulaInput.js +0 -191
- package/lib/schema-component/antd/formula-input/index.d.ts +0 -1
- package/lib/schema-component/antd/formula-input/index.js +0 -18
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
8
|
|
|
3
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -10,29 +16,15 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
10
16
|
|
|
11
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
18
|
|
|
13
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
-
|
|
15
19
|
import { AppstoreAddOutlined, SettingOutlined } from '@ant-design/icons';
|
|
16
|
-
import { uid } from '@formily/shared';
|
|
17
20
|
import { Dropdown, Menu } from 'antd';
|
|
18
|
-
import React, { useState } from 'react';
|
|
21
|
+
import React, { useContext, useState } from 'react';
|
|
19
22
|
import { useTranslation } from 'react-i18next';
|
|
20
23
|
import { useHistory } from 'react-router-dom';
|
|
24
|
+
import { useACLRoleContext } from '../acl/ACLProvider';
|
|
21
25
|
import { PluginManager } from '../plugin-manager';
|
|
22
|
-
import { ActionContext } from '../schema-component';
|
|
23
|
-
|
|
24
|
-
type: 'object',
|
|
25
|
-
properties: _defineProperty({}, uid(), {
|
|
26
|
-
'x-component': 'Action.Drawer',
|
|
27
|
-
type: 'void',
|
|
28
|
-
title: '{{t("Collections & Fields")}}',
|
|
29
|
-
properties: {
|
|
30
|
-
configuration: {
|
|
31
|
-
'x-component': 'ConfigurationTable'
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
};
|
|
26
|
+
import { ActionContext, useCompile } from '../schema-component';
|
|
27
|
+
import { getPluginsTabs, SettingsCenterContext } from './index';
|
|
36
28
|
export var PluginManagerLink = function PluginManagerLink() {
|
|
37
29
|
var _useState = useState(false),
|
|
38
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -56,7 +48,25 @@ export var PluginManagerLink = function PluginManagerLink() {
|
|
|
56
48
|
}
|
|
57
49
|
}));
|
|
58
50
|
};
|
|
51
|
+
|
|
52
|
+
var getBookmarkTabs = function getBookmarkTabs(data) {
|
|
53
|
+
var bookmarkTabs = [];
|
|
54
|
+
data.forEach(function (plugin) {
|
|
55
|
+
var tabs = plugin.tabs;
|
|
56
|
+
tabs.forEach(function (tab) {
|
|
57
|
+
tab.isBookmark && tab.isAllow && bookmarkTabs.push(_objectSpread(_objectSpread({}, tab), {}, {
|
|
58
|
+
path: "".concat(plugin.key, "/").concat(tab.key)
|
|
59
|
+
}));
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
return bookmarkTabs;
|
|
63
|
+
};
|
|
64
|
+
|
|
59
65
|
export var SettingsCenterDropdown = function SettingsCenterDropdown() {
|
|
66
|
+
var _useACLRoleContext = useACLRoleContext(),
|
|
67
|
+
_useACLRoleContext$sn = _useACLRoleContext.snippets,
|
|
68
|
+
snippets = _useACLRoleContext$sn === void 0 ? [] : _useACLRoleContext$sn;
|
|
69
|
+
|
|
60
70
|
var _useState3 = useState(false),
|
|
61
71
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
72
|
visible = _useState4[0],
|
|
@@ -65,48 +75,33 @@ export var SettingsCenterDropdown = function SettingsCenterDropdown() {
|
|
|
65
75
|
var _useTranslation2 = useTranslation(),
|
|
66
76
|
t = _useTranslation2.t;
|
|
67
77
|
|
|
78
|
+
var compile = useCompile();
|
|
68
79
|
var history = useHistory();
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, {
|
|
73
|
-
title: t('Roles & Permissions'),
|
|
74
|
-
path: 'acl/roles'
|
|
75
|
-
}, {
|
|
76
|
-
title: t('File storages'),
|
|
77
|
-
path: 'file-manager/storages'
|
|
78
|
-
}, {
|
|
79
|
-
title: t('System settings'),
|
|
80
|
-
path: 'system-settings/system-settings'
|
|
81
|
-
}, {
|
|
82
|
-
title: t('workflow:Workflow'),
|
|
83
|
-
path: 'workflow/workflows'
|
|
84
|
-
} // {
|
|
85
|
-
// title: t('Graph Collections'),
|
|
86
|
-
// path: 'graph/collections',
|
|
87
|
-
// },
|
|
88
|
-
];
|
|
80
|
+
var itemData = useContext(SettingsCenterContext);
|
|
81
|
+
var pluginsTabs = getPluginsTabs(itemData, snippets);
|
|
82
|
+
var bookmarkTabs = getBookmarkTabs(pluginsTabs);
|
|
89
83
|
return /*#__PURE__*/React.createElement(ActionContext.Provider, {
|
|
90
84
|
value: {
|
|
91
85
|
visible: visible,
|
|
92
86
|
setVisible: setVisible
|
|
93
87
|
}
|
|
94
88
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
89
|
+
placement: "bottom",
|
|
95
90
|
overlay: /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.ItemGroup, {
|
|
96
91
|
title: t('Bookmark')
|
|
97
|
-
},
|
|
92
|
+
}, bookmarkTabs.map(function (tab) {
|
|
98
93
|
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
99
94
|
onClick: function onClick() {
|
|
100
|
-
history.push('/admin/settings/' +
|
|
95
|
+
history.push('/admin/settings/' + tab.path);
|
|
101
96
|
},
|
|
102
|
-
key:
|
|
103
|
-
},
|
|
97
|
+
key: tab.path
|
|
98
|
+
}, compile(tab.title));
|
|
104
99
|
})), /*#__PURE__*/React.createElement(Menu.Divider, null), /*#__PURE__*/React.createElement(Menu.Item, {
|
|
105
100
|
onClick: function onClick() {
|
|
106
101
|
history.push('/admin/settings');
|
|
107
102
|
},
|
|
108
103
|
key: "/admin/settings"
|
|
109
|
-
}, t('
|
|
104
|
+
}, t('All plugin settings')))
|
|
110
105
|
}, /*#__PURE__*/React.createElement(PluginManager.Toolbar.Item, {
|
|
111
106
|
icon: /*#__PURE__*/React.createElement(SettingOutlined, null)
|
|
112
107
|
})));
|
package/es/pm/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const SettingsCenterContext: React.Context<any>;
|
|
3
|
+
export declare const getPluginsTabs: (items: any, snippets: any) => any[];
|
|
3
4
|
export declare const SettingsCenterProvider: (props: any) => JSX.Element;
|
|
4
5
|
export declare const PMProvider: (props: any) => JSX.Element;
|
|
5
6
|
export default PMProvider;
|
package/es/pm/index.js
CHANGED
|
@@ -20,11 +20,13 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
20
20
|
|
|
21
21
|
import { DeleteOutlined, SettingOutlined } from '@ant-design/icons';
|
|
22
22
|
import { css } from '@emotion/css';
|
|
23
|
-
import { Avatar, Card, Layout, Menu, message, PageHeader, Popconfirm, Spin, Switch, Tabs } from 'antd';
|
|
23
|
+
import { Avatar, Card, Layout, Menu, message, PageHeader, Popconfirm, Result, Spin, Switch, Tabs } from 'antd';
|
|
24
|
+
import { sortBy } from 'lodash';
|
|
24
25
|
import React, { createContext, useContext, useMemo } from 'react';
|
|
25
26
|
import { useTranslation } from 'react-i18next';
|
|
26
27
|
import { Redirect, useHistory, useRouteMatch } from 'react-router-dom';
|
|
27
28
|
import { ACLPane } from '../acl';
|
|
29
|
+
import { useACLRoleContext } from '../acl/ACLProvider';
|
|
28
30
|
import { useAPIClient, useRequest } from '../api-client';
|
|
29
31
|
import { CollectionManagerPane } from '../collection-manager';
|
|
30
32
|
import { useDocumentTitle } from '../document-title';
|
|
@@ -172,7 +174,6 @@ var LocalPlugins = function LocalPlugins() {
|
|
|
172
174
|
|
|
173
175
|
return /*#__PURE__*/React.createElement(React.Fragment, null, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (item) {
|
|
174
176
|
return /*#__PURE__*/React.createElement(PluginCard, {
|
|
175
|
-
key: item.id,
|
|
176
177
|
data: item
|
|
177
178
|
});
|
|
178
179
|
}));
|
|
@@ -229,7 +230,11 @@ var PluginList = function PluginList(props) {
|
|
|
229
230
|
var _useTranslation3 = useTranslation(),
|
|
230
231
|
t = _useTranslation3.t;
|
|
231
232
|
|
|
232
|
-
|
|
233
|
+
var _useACLRoleContext = useACLRoleContext(),
|
|
234
|
+
_useACLRoleContext$sn = _useACLRoleContext.snippets,
|
|
235
|
+
snippets = _useACLRoleContext$sn === void 0 ? [] : _useACLRoleContext$sn;
|
|
236
|
+
|
|
237
|
+
return snippets.includes('pm') ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PageHeader, {
|
|
233
238
|
ghost: false,
|
|
234
239
|
title: t('Plugin manager'),
|
|
235
240
|
footer: /*#__PURE__*/React.createElement(Tabs, {
|
|
@@ -257,7 +262,11 @@ var PluginList = function PluginList(props) {
|
|
|
257
262
|
local: LocalPlugins,
|
|
258
263
|
'built-in': BuiltinPlugins,
|
|
259
264
|
marketplace: MarketplacePlugins
|
|
260
|
-
}[tabName])))
|
|
265
|
+
}[tabName]))) : /*#__PURE__*/React.createElement(Result, {
|
|
266
|
+
status: "404",
|
|
267
|
+
title: "404",
|
|
268
|
+
subTitle: "Sorry, the page you visited does not exist."
|
|
269
|
+
});
|
|
261
270
|
};
|
|
262
271
|
|
|
263
272
|
var settings = {
|
|
@@ -266,16 +275,17 @@ var settings = {
|
|
|
266
275
|
icon: 'LockOutlined',
|
|
267
276
|
tabs: {
|
|
268
277
|
roles: {
|
|
278
|
+
isBookmark: true,
|
|
269
279
|
title: '{{t("Roles & Permissions")}}',
|
|
270
280
|
component: ACLPane
|
|
271
281
|
}
|
|
272
282
|
}
|
|
273
283
|
},
|
|
274
|
-
'
|
|
284
|
+
'ui-schema-storage': {
|
|
275
285
|
title: '{{t("Block templates")}}',
|
|
276
286
|
icon: 'LayoutOutlined',
|
|
277
287
|
tabs: {
|
|
278
|
-
|
|
288
|
+
'block-templates': {
|
|
279
289
|
title: '{{t("Block templates")}}',
|
|
280
290
|
component: BlockTemplatesPane
|
|
281
291
|
}
|
|
@@ -286,6 +296,7 @@ var settings = {
|
|
|
286
296
|
title: '{{t("Collection manager")}}',
|
|
287
297
|
tabs: {
|
|
288
298
|
collections: {
|
|
299
|
+
isBookmark: true,
|
|
289
300
|
title: '{{t("Collections & Fields")}}',
|
|
290
301
|
component: CollectionManagerPane
|
|
291
302
|
}
|
|
@@ -296,33 +307,67 @@ var settings = {
|
|
|
296
307
|
title: '{{t("System settings")}}',
|
|
297
308
|
tabs: {
|
|
298
309
|
'system-settings': {
|
|
310
|
+
isBookmark: true,
|
|
299
311
|
title: '{{t("System settings")}}',
|
|
300
312
|
component: SystemSettingsPane
|
|
301
313
|
}
|
|
302
314
|
}
|
|
303
315
|
}
|
|
304
316
|
};
|
|
317
|
+
export var getPluginsTabs = function getPluginsTabs(items, snippets) {
|
|
318
|
+
var pluginsTabs = Object.keys(items).map(function (plugin) {
|
|
319
|
+
var tabsObj = items[plugin].tabs;
|
|
320
|
+
var tabs = sortBy(Object.keys(tabsObj).map(function (tab) {
|
|
321
|
+
return _objectSpread(_objectSpread({
|
|
322
|
+
key: tab
|
|
323
|
+
}, tabsObj[tab]), {}, {
|
|
324
|
+
isAllow: snippets.includes('pm.*') && !(snippets === null || snippets === void 0 ? void 0 : snippets.includes("!pm.".concat(plugin, ".").concat(tab)))
|
|
325
|
+
});
|
|
326
|
+
}), function (o) {
|
|
327
|
+
return !o.isAllow;
|
|
328
|
+
});
|
|
329
|
+
return _objectSpread(_objectSpread({}, items[plugin]), {}, {
|
|
330
|
+
key: plugin,
|
|
331
|
+
tabs: tabs,
|
|
332
|
+
isAllow: !tabs.every(function (v) {
|
|
333
|
+
return !v.isAllow;
|
|
334
|
+
})
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
return sortBy(pluginsTabs, function (o) {
|
|
338
|
+
return !o.isAllow;
|
|
339
|
+
});
|
|
340
|
+
};
|
|
305
341
|
|
|
306
342
|
var SettingsCenter = function SettingsCenter(props) {
|
|
307
|
-
var _items$
|
|
343
|
+
var _activePlugin$tabs$fi, _items$pluginName2, _items$pluginName2$ta, _items$pluginName2$ta2, _items$pluginName3, _plugin$tabs;
|
|
344
|
+
|
|
345
|
+
var _useACLRoleContext2 = useACLRoleContext(),
|
|
346
|
+
_useACLRoleContext2$s = _useACLRoleContext2.snippets,
|
|
347
|
+
snippets = _useACLRoleContext2$s === void 0 ? [] : _useACLRoleContext2$s;
|
|
308
348
|
|
|
309
349
|
var match = useRouteMatch();
|
|
310
350
|
var history = useHistory();
|
|
311
351
|
var items = useContext(SettingsCenterContext);
|
|
352
|
+
var pluginsTabs = getPluginsTabs(items, snippets);
|
|
312
353
|
var compile = useCompile();
|
|
313
354
|
var firstUri = useMemo(function () {
|
|
314
|
-
var
|
|
315
|
-
|
|
316
|
-
var keys = Object.keys(items).sort();
|
|
317
|
-
var pluginName = keys.shift();
|
|
318
|
-
var tabName = Object.keys((items === null || items === void 0 ? void 0 : (_items$pluginName = items[pluginName]) === null || _items$pluginName === void 0 ? void 0 : _items$pluginName.tabs) || {}).shift();
|
|
355
|
+
var pluginName = pluginsTabs[0].key;
|
|
356
|
+
var tabName = pluginsTabs[0].tabs[0].key;
|
|
319
357
|
return "/admin/settings/".concat(pluginName, "/").concat(tabName);
|
|
320
|
-
}, [
|
|
358
|
+
}, [pluginsTabs]);
|
|
321
359
|
|
|
322
360
|
var _ref2 = match.params || {},
|
|
323
361
|
pluginName = _ref2.pluginName,
|
|
324
362
|
tabName = _ref2.tabName;
|
|
325
363
|
|
|
364
|
+
var activePlugin = pluginsTabs.find(function (v) {
|
|
365
|
+
return v.key === pluginName;
|
|
366
|
+
});
|
|
367
|
+
var aclPluginTabCheck = (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.isAllow) && ((_activePlugin$tabs$fi = activePlugin.tabs.find(function (v) {
|
|
368
|
+
return v.key === tabName;
|
|
369
|
+
})) === null || _activePlugin$tabs$fi === void 0 ? void 0 : _activePlugin$tabs$fi.isAllow);
|
|
370
|
+
|
|
326
371
|
if (!pluginName) {
|
|
327
372
|
return /*#__PURE__*/React.createElement(Redirect, {
|
|
328
373
|
to: firstUri
|
|
@@ -336,33 +381,36 @@ var SettingsCenter = function SettingsCenter(props) {
|
|
|
336
381
|
}
|
|
337
382
|
|
|
338
383
|
if (!tabName) {
|
|
339
|
-
var _items$
|
|
384
|
+
var _items$pluginName;
|
|
340
385
|
|
|
341
|
-
var firstTabName = Object.keys((_items$
|
|
386
|
+
var firstTabName = Object.keys((_items$pluginName = items[pluginName]) === null || _items$pluginName === void 0 ? void 0 : _items$pluginName.tabs).shift();
|
|
342
387
|
return /*#__PURE__*/React.createElement(Redirect, {
|
|
343
388
|
to: "/admin/settings/".concat(pluginName, "/").concat(firstTabName)
|
|
344
389
|
});
|
|
345
390
|
}
|
|
346
391
|
|
|
347
|
-
var component = (_items$
|
|
348
|
-
var
|
|
349
|
-
|
|
350
|
-
|
|
392
|
+
var component = (_items$pluginName2 = items[pluginName]) === null || _items$pluginName2 === void 0 ? void 0 : (_items$pluginName2$ta = _items$pluginName2.tabs) === null || _items$pluginName2$ta === void 0 ? void 0 : (_items$pluginName2$ta2 = _items$pluginName2$ta[tabName]) === null || _items$pluginName2$ta2 === void 0 ? void 0 : _items$pluginName2$ta2.component;
|
|
393
|
+
var plugin = pluginsTabs.find(function (v) {
|
|
394
|
+
return v.key === pluginName;
|
|
395
|
+
});
|
|
396
|
+
var menuItems = pluginsTabs.filter(function (plugin) {
|
|
397
|
+
return plugin.isAllow;
|
|
398
|
+
}).map(function (plugin) {
|
|
351
399
|
return {
|
|
352
|
-
label: compile(
|
|
353
|
-
key: key,
|
|
354
|
-
icon:
|
|
355
|
-
type:
|
|
400
|
+
label: compile(plugin.title),
|
|
401
|
+
key: plugin.key,
|
|
402
|
+
icon: plugin.icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
403
|
+
type: plugin.icon
|
|
356
404
|
}) : null
|
|
357
405
|
};
|
|
358
406
|
});
|
|
359
|
-
return /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement("div", {
|
|
407
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement("div", {
|
|
360
408
|
style: {
|
|
361
409
|
'--side-menu-width': '200px'
|
|
362
410
|
},
|
|
363
|
-
className: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n
|
|
411
|
+
className: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: var(--side-menu-width);\n overflow: hidden;\n flex: 0 0 var(--side-menu-width);\n max-width: var(--side-menu-width);\n min-width: var(--side-menu-width);\n pointer-events: none;\n "])))
|
|
364
412
|
}), /*#__PURE__*/React.createElement(Layout.Sider, {
|
|
365
|
-
className: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n
|
|
413
|
+
className: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n height: 100%;\n position: fixed;\n padding-top: 46px;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0);\n z-index: 100;\n "]))),
|
|
366
414
|
theme: 'light'
|
|
367
415
|
}, /*#__PURE__*/React.createElement(Menu, {
|
|
368
416
|
selectedKeys: [pluginName],
|
|
@@ -377,28 +425,29 @@ var SettingsCenter = function SettingsCenter(props) {
|
|
|
377
425
|
history.push("/admin/settings/".concat(e.key, "/").concat(tabKey));
|
|
378
426
|
},
|
|
379
427
|
items: menuItems
|
|
380
|
-
})), /*#__PURE__*/React.createElement(Layout.Content, null, /*#__PURE__*/React.createElement(PageHeader, {
|
|
428
|
+
})), /*#__PURE__*/React.createElement(Layout.Content, null, aclPluginTabCheck && /*#__PURE__*/React.createElement(PageHeader, {
|
|
381
429
|
ghost: false,
|
|
382
|
-
title: compile((_items$
|
|
430
|
+
title: compile((_items$pluginName3 = items[pluginName]) === null || _items$pluginName3 === void 0 ? void 0 : _items$pluginName3.title),
|
|
383
431
|
footer: /*#__PURE__*/React.createElement(Tabs, {
|
|
384
432
|
activeKey: tabName,
|
|
385
433
|
onChange: function onChange(activeKey) {
|
|
386
434
|
history.push("/admin/settings/".concat(pluginName, "/").concat(activeKey));
|
|
387
435
|
}
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
var tab = (_items$pluginName$tab = items[pluginName].tabs) === null || _items$pluginName$tab === void 0 ? void 0 : _items$pluginName$tab[tabKey];
|
|
392
|
-
return /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
436
|
+
}, (_plugin$tabs = plugin.tabs) === null || _plugin$tabs === void 0 ? void 0 : _plugin$tabs.map(function (tab) {
|
|
437
|
+
return tab.isAllow && /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
393
438
|
tab: compile(tab === null || tab === void 0 ? void 0 : tab.title),
|
|
394
|
-
key:
|
|
439
|
+
key: tab.key
|
|
395
440
|
});
|
|
396
441
|
}))
|
|
397
442
|
}), /*#__PURE__*/React.createElement("div", {
|
|
398
443
|
style: {
|
|
399
444
|
margin: 24
|
|
400
445
|
}
|
|
401
|
-
}, component && /*#__PURE__*/React.createElement(component)
|
|
446
|
+
}, aclPluginTabCheck ? component && /*#__PURE__*/React.createElement(component) : /*#__PURE__*/React.createElement(Result, {
|
|
447
|
+
status: "404",
|
|
448
|
+
title: "404",
|
|
449
|
+
subTitle: "Sorry, the page you visited does not exist."
|
|
450
|
+
})))));
|
|
402
451
|
};
|
|
403
452
|
|
|
404
453
|
export var SettingsCenterProvider = function SettingsCenterProvider(props) {
|
|
@@ -3,6 +3,7 @@ export declare const RecordContext: React.Context<{}>;
|
|
|
3
3
|
export declare const RecordIndexContext: React.Context<any>;
|
|
4
4
|
export declare const RecordProvider: React.FC<{
|
|
5
5
|
record: any;
|
|
6
|
+
parent?: any;
|
|
6
7
|
}>;
|
|
7
8
|
export declare const RecordIndexProvider: React.FC<{
|
|
8
9
|
index: any;
|
|
@@ -10,14 +10,17 @@ export var RecordContext = /*#__PURE__*/createContext({});
|
|
|
10
10
|
export var RecordIndexContext = /*#__PURE__*/createContext(null);
|
|
11
11
|
export var RecordProvider = function RecordProvider(props) {
|
|
12
12
|
var record = props.record,
|
|
13
|
-
children = props.children
|
|
13
|
+
children = props.children,
|
|
14
|
+
_props$parent = props.parent,
|
|
15
|
+
parent = _props$parent === void 0 ? false : _props$parent;
|
|
14
16
|
|
|
15
17
|
var __parent = useContext(RecordContext);
|
|
16
18
|
|
|
19
|
+
var value = _objectSpread({}, record);
|
|
20
|
+
|
|
21
|
+
value['__parent'] = parent ? parent : __parent;
|
|
17
22
|
return /*#__PURE__*/React.createElement(RecordContext.Provider, {
|
|
18
|
-
value:
|
|
19
|
-
__parent: __parent
|
|
20
|
-
})
|
|
23
|
+
value: value
|
|
21
24
|
}, children);
|
|
22
25
|
};
|
|
23
26
|
export var RecordIndexProvider = function RecordIndexProvider(props) {
|
|
@@ -24,17 +24,16 @@ import { css } from '@emotion/css';
|
|
|
24
24
|
import { Layout, Spin } from 'antd';
|
|
25
25
|
import React, { createContext, useContext, useMemo, useRef, useState } from 'react';
|
|
26
26
|
import { useHistory, useRouteMatch } from 'react-router-dom';
|
|
27
|
-
import {
|
|
27
|
+
import { ACLRolesCheckProvider, CurrentUser, CurrentUserProvider, CurrentAppInfoProvider, findByUid, findMenuItem, RemoteCollectionManagerProvider, RemotePluginManagerToolbar, RemoteSchemaTemplateManagerProvider, SchemaComponent, useACLRoleContext, useDocumentTitle, useRequest, useRoute, useSystemSettings } from '../../../';
|
|
28
28
|
import { useCollectionManager } from '../../../collection-manager';
|
|
29
29
|
import { useMutationObserver } from 'ahooks';
|
|
30
30
|
|
|
31
31
|
var filterByACL = function filterByACL(schema, options) {
|
|
32
32
|
var allowAll = options.allowAll,
|
|
33
|
-
allowConfigure = options.allowConfigure,
|
|
34
33
|
_options$allowMenuIte = options.allowMenuItemIds,
|
|
35
34
|
allowMenuItemIds = _options$allowMenuIte === void 0 ? [] : _options$allowMenuIte;
|
|
36
35
|
|
|
37
|
-
if (allowAll
|
|
36
|
+
if (allowAll) {
|
|
38
37
|
return schema;
|
|
39
38
|
}
|
|
40
39
|
|
|
@@ -159,7 +158,7 @@ var MenuEditor = function MenuEditor(props) {
|
|
|
159
158
|
}));
|
|
160
159
|
};
|
|
161
160
|
|
|
162
|
-
var InternalAdminLayout = function InternalAdminLayout(props) {
|
|
161
|
+
export var InternalAdminLayout = function InternalAdminLayout(props) {
|
|
163
162
|
var _result$data, _result$data$data, _result$data$data$log;
|
|
164
163
|
|
|
165
164
|
var sideMenuRef = useRef();
|
|
@@ -218,7 +217,7 @@ var InternalAdminLayout = function InternalAdminLayout(props) {
|
|
|
218
217
|
top: 0,
|
|
219
218
|
right: 0
|
|
220
219
|
}
|
|
221
|
-
}, /*#__PURE__*/React.createElement(
|
|
220
|
+
}, /*#__PURE__*/React.createElement(RemotePluginManagerToolbar, null), /*#__PURE__*/React.createElement(CurrentUser, null)))), /*#__PURE__*/React.createElement("div", {
|
|
222
221
|
style: {
|
|
223
222
|
'--side-menu-width': "".concat(sideMenuWidth, "px")
|
|
224
223
|
},
|
|
@@ -236,7 +235,6 @@ var InternalAdminLayout = function InternalAdminLayout(props) {
|
|
|
236
235
|
className: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n height: 46px;\n line-height: 46px;\n background: transparent;\n pointer-events: none;\n "])))
|
|
237
236
|
}), service.contentLoading ? /*#__PURE__*/React.createElement(Spin, null) : props.children));
|
|
238
237
|
};
|
|
239
|
-
|
|
240
238
|
export var AdminLayout = function AdminLayout(props) {
|
|
241
239
|
return /*#__PURE__*/React.createElement(CurrentAppInfoProvider, null, /*#__PURE__*/React.createElement(CurrentUserProvider, null, /*#__PURE__*/React.createElement(RemoteSchemaTemplateManagerProvider, null, /*#__PURE__*/React.createElement(RemoteCollectionManagerProvider, null, /*#__PURE__*/React.createElement(ACLRolesCheckProvider, null, /*#__PURE__*/React.createElement(InternalAdminLayout, _objectSpread({}, props)))))));
|
|
242
240
|
};
|
|
@@ -83,6 +83,7 @@ export var Action = observer(function (props) {
|
|
|
83
83
|
var form = useForm();
|
|
84
84
|
var designerProps = fieldSchema['x-designer-props'];
|
|
85
85
|
var openMode = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon['openMode'];
|
|
86
|
+
var disabled = form.disabled || field.disabled;
|
|
86
87
|
var openSize = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2['openSize'];
|
|
87
88
|
|
|
88
89
|
var renderButton = function renderButton() {
|
|
@@ -93,23 +94,25 @@ export var Action = observer(function (props) {
|
|
|
93
94
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
94
95
|
type: icon
|
|
95
96
|
}),
|
|
96
|
-
disabled:
|
|
97
|
+
disabled: disabled,
|
|
97
98
|
onClick: function onClick(e) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
if (!disabled) {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
|
|
103
|
+
var onOk = function onOk() {
|
|
104
|
+
_onClick === null || _onClick === void 0 ? void 0 : _onClick(e);
|
|
105
|
+
setVisible(true);
|
|
106
|
+
run();
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
if (confirm) {
|
|
110
|
+
Modal.confirm(_objectSpread(_objectSpread({}, confirm), {}, {
|
|
111
|
+
onOk: onOk
|
|
112
|
+
}));
|
|
113
|
+
} else {
|
|
114
|
+
onOk();
|
|
115
|
+
}
|
|
113
116
|
}
|
|
114
117
|
},
|
|
115
118
|
component: component || Button,
|
|
@@ -2,6 +2,14 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
2
2
|
|
|
3
3
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
4
4
|
|
|
5
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
|
|
7
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
|
|
5
13
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
14
|
|
|
7
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -25,10 +33,10 @@ import { css } from '@emotion/css';
|
|
|
25
33
|
import { useFieldSchema } from '@formily/react';
|
|
26
34
|
import { Col, Collapse, Input, Row, Tree } from 'antd';
|
|
27
35
|
import cls from 'classnames';
|
|
28
|
-
import React, {
|
|
36
|
+
import React, { useState } from 'react';
|
|
29
37
|
import { useRequest } from '../../../api-client';
|
|
30
38
|
import { useBlockRequestContext } from '../../../block-provider';
|
|
31
|
-
import {
|
|
39
|
+
import { mergeFilter } from '../../../block-provider/SharedFilterProvider';
|
|
32
40
|
import { SortableItem } from '../../common';
|
|
33
41
|
import { useCompile, useDesigner } from '../../hooks';
|
|
34
42
|
import { AssociationFilter } from './AssociationFilter';
|
|
@@ -47,12 +55,8 @@ export var AssociationFilterItem = function AssociationFilterItem(props) {
|
|
|
47
55
|
var compile = useCompile();
|
|
48
56
|
|
|
49
57
|
var _useBlockRequestConte = useBlockRequestContext(),
|
|
50
|
-
service = _useBlockRequestConte.service
|
|
51
|
-
|
|
52
|
-
var _useContext = useContext(SharedFilterContext),
|
|
53
|
-
setSharedFilterStore = _useContext.setSharedFilterStore,
|
|
54
|
-
sharedFilterStore = _useContext.sharedFilterStore,
|
|
55
|
-
getFilterParams = _useContext.getFilterParams;
|
|
58
|
+
service = _useBlockRequestConte.service,
|
|
59
|
+
blockProps = _useBlockRequestConte.props;
|
|
56
60
|
|
|
57
61
|
var _useState = useState(false),
|
|
58
62
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -107,27 +111,24 @@ export var AssociationFilterItem = function AssociationFilterItem(props) {
|
|
|
107
111
|
};
|
|
108
112
|
|
|
109
113
|
var onSelect = function onSelect(selectedKeysValue) {
|
|
110
|
-
var _service$params;
|
|
114
|
+
var _service$params, _service$params$, _service$params2, _blockProps$params;
|
|
111
115
|
|
|
112
116
|
setSelectedKeys(selectedKeysValue);
|
|
113
|
-
var
|
|
114
|
-
return _defineProperty({}, collectionFieldName, _defineProperty({}, valueKey, {
|
|
115
|
-
$eq: item
|
|
116
|
-
}));
|
|
117
|
-
});
|
|
118
|
-
var newFilter = orList.length > 0 ? {
|
|
119
|
-
$or: orList
|
|
120
|
-
} : {};
|
|
117
|
+
var filters = ((_service$params = service.params) === null || _service$params === void 0 ? void 0 : (_service$params$ = _service$params[1]) === null || _service$params$ === void 0 ? void 0 : _service$params$.filters) || {};
|
|
121
118
|
|
|
122
|
-
|
|
119
|
+
if (selectedKeysValue.length) {
|
|
120
|
+
filters["af.".concat(collectionFieldName)] = _defineProperty({}, "".concat(collectionFieldName, ".").concat(valueKey, ".$in"), selectedKeysValue);
|
|
121
|
+
} else {
|
|
122
|
+
delete filters["af.".concat(collectionFieldName)];
|
|
123
|
+
}
|
|
123
124
|
|
|
124
|
-
|
|
125
|
-
var paramFilter = getFilterParams(newAssociationFilterStore);
|
|
126
|
-
service.run(_objectSpread(_objectSpread({}, (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params[0]), {}, {
|
|
125
|
+
service.run(_objectSpread(_objectSpread({}, (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2[0]), {}, {
|
|
127
126
|
pageSize: 200,
|
|
128
127
|
page: 1,
|
|
129
|
-
filter:
|
|
130
|
-
})
|
|
128
|
+
filter: mergeFilter([].concat(_toConsumableArray(Object.values(filters)), [blockProps === null || blockProps === void 0 ? void 0 : (_blockProps$params = blockProps.params) === null || _blockProps$params === void 0 ? void 0 : _blockProps$params.filter]))
|
|
129
|
+
}), {
|
|
130
|
+
filters: filters
|
|
131
|
+
});
|
|
131
132
|
};
|
|
132
133
|
|
|
133
134
|
var handleSearchToggle = function handleSearchToggle(e) {
|