@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
|
@@ -15,15 +15,17 @@ var _apiClient = require("../../api-client");
|
|
|
15
15
|
|
|
16
16
|
var _schemaComponent = require("../../schema-component");
|
|
17
17
|
|
|
18
|
-
var _roles = require("./schemas/roles");
|
|
19
|
-
|
|
20
18
|
var _MenuItemsProvider = require("../Configuration/MenuItemsProvider");
|
|
21
19
|
|
|
20
|
+
var _PermisionProvider = require("../Configuration/PermisionProvider");
|
|
21
|
+
|
|
22
|
+
var _roles = require("./schemas/roles");
|
|
23
|
+
|
|
22
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
25
|
|
|
24
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
27
|
|
|
26
|
-
var AvailableActionsContext = /*#__PURE__*/(0, _react.createContext)(
|
|
28
|
+
var AvailableActionsContext = /*#__PURE__*/(0, _react.createContext)([]);
|
|
27
29
|
|
|
28
30
|
var AvailableActionsProver = function AvailableActionsProver(props) {
|
|
29
31
|
var _useRequest = (0, _apiClient.useRequest)({
|
|
@@ -52,7 +54,9 @@ var RoleTable = function RoleTable() {
|
|
|
52
54
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(AvailableActionsProver, null, /*#__PURE__*/_react.default.createElement(_schemaComponent.SchemaComponent, {
|
|
53
55
|
schema: _roles.roleSchema,
|
|
54
56
|
components: {
|
|
55
|
-
MenuItemsProvider: _MenuItemsProvider.MenuItemsProvider
|
|
57
|
+
MenuItemsProvider: _MenuItemsProvider.MenuItemsProvider,
|
|
58
|
+
SettingCenterPermissionProvider: _PermisionProvider.SettingCenterPermissionProvider,
|
|
59
|
+
PermissionProvider: _PermisionProvider.PermissionProvider
|
|
56
60
|
}
|
|
57
61
|
})));
|
|
58
62
|
};
|
|
@@ -85,8 +85,8 @@ var RolesResourcesActions = (0, _react.connect)(function (props) {
|
|
|
85
85
|
getCollection = _useCollectionManager.getCollection,
|
|
86
86
|
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
87
87
|
|
|
88
|
-
var collection = getCollection(roleCollection.
|
|
89
|
-
var collectionFields = getCollectionFields(roleCollection.
|
|
88
|
+
var collection = getCollection(roleCollection.collectionName);
|
|
89
|
+
var collectionFields = getCollectionFields(roleCollection.collectionName);
|
|
90
90
|
var compile = (0, _.useCompile)();
|
|
91
91
|
|
|
92
92
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
@@ -3,3 +3,4 @@ export { RoleConfigure } from './RoleConfigure';
|
|
|
3
3
|
export { RolesResourcesActions } from './RolesResourcesActions';
|
|
4
4
|
export { RoleTable } from './RoleTable';
|
|
5
5
|
export { StrategyActions } from './StrategyActions';
|
|
6
|
+
export { SettingsCenterConfigure, SettingCenterProvider } from './ConfigureCenter';
|
|
@@ -27,6 +27,18 @@ Object.defineProperty(exports, "RolesResourcesActions", {
|
|
|
27
27
|
return _RolesResourcesActions.RolesResourcesActions;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "SettingCenterProvider", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _ConfigureCenter.SettingCenterProvider;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "SettingsCenterConfigure", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _ConfigureCenter.SettingsCenterConfigure;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
30
42
|
Object.defineProperty(exports, "StrategyActions", {
|
|
31
43
|
enumerable: true,
|
|
32
44
|
get: function get() {
|
|
@@ -42,4 +54,6 @@ var _RolesResourcesActions = require("./RolesResourcesActions");
|
|
|
42
54
|
|
|
43
55
|
var _RoleTable = require("./RoleTable");
|
|
44
56
|
|
|
45
|
-
var _StrategyActions = require("./StrategyActions");
|
|
57
|
+
var _StrategyActions = require("./StrategyActions");
|
|
58
|
+
|
|
59
|
+
var _ConfigureCenter = require("./ConfigureCenter");
|
|
@@ -23,18 +23,34 @@ var collection = {
|
|
|
23
23
|
'x-component': 'Input',
|
|
24
24
|
required: true
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
}, {
|
|
27
|
+
type: 'string',
|
|
28
|
+
name: 'name',
|
|
29
|
+
interface: 'input',
|
|
30
|
+
uiSchema: {
|
|
31
|
+
title: '{{t("Collection name")}}',
|
|
32
|
+
type: 'string',
|
|
33
|
+
'x-component': 'Input'
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
type: 'string',
|
|
37
|
+
name: 'type',
|
|
38
|
+
interface: 'input',
|
|
39
|
+
uiSchema: {
|
|
40
|
+
title: '{{t("Resource type")}}',
|
|
41
|
+
type: 'string',
|
|
42
|
+
'x-component': 'Select',
|
|
43
|
+
enum: [{
|
|
44
|
+
label: '{{t("Collection")}}',
|
|
45
|
+
value: 'collection',
|
|
46
|
+
color: 'green'
|
|
47
|
+
}, {
|
|
48
|
+
label: '{{t("Association")}}',
|
|
49
|
+
value: 'association',
|
|
50
|
+
color: 'blue'
|
|
51
|
+
}]
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
38
54
|
type: 'string',
|
|
39
55
|
name: 'usingConfig',
|
|
40
56
|
interface: 'input',
|
|
@@ -100,7 +116,7 @@ var roleCollectionsSchema = {
|
|
|
100
116
|
useDataSource: '{{ cm.useDataSourceFromRAC }}'
|
|
101
117
|
},
|
|
102
118
|
properties: {
|
|
103
|
-
|
|
119
|
+
column0: {
|
|
104
120
|
type: 'void',
|
|
105
121
|
'x-decorator': 'Table.Column.Decorator',
|
|
106
122
|
'x-component': 'Table.Column',
|
|
@@ -112,6 +128,18 @@ var roleCollectionsSchema = {
|
|
|
112
128
|
}
|
|
113
129
|
}
|
|
114
130
|
},
|
|
131
|
+
// column1: {
|
|
132
|
+
// type: 'void',
|
|
133
|
+
// 'x-decorator': 'Table.Column.Decorator',
|
|
134
|
+
// 'x-component': 'Table.Column',
|
|
135
|
+
// properties: {
|
|
136
|
+
// type: {
|
|
137
|
+
// type: 'string',
|
|
138
|
+
// 'x-component': 'CollectionField',
|
|
139
|
+
// 'x-read-pretty': true,
|
|
140
|
+
// },
|
|
141
|
+
// },
|
|
142
|
+
// },
|
|
115
143
|
column2: {
|
|
116
144
|
type: 'void',
|
|
117
145
|
'x-decorator': 'Table.Column.Decorator',
|
|
@@ -7,12 +7,20 @@ exports.roleSchema = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _shared = require("@formily/shared");
|
|
9
9
|
|
|
10
|
+
var _pick = _interopRequireDefault(require("lodash/pick"));
|
|
11
|
+
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
|
|
10
14
|
var _apiClient = require("../../../api-client");
|
|
11
15
|
|
|
16
|
+
var _recordProvider = require("../../../record-provider");
|
|
17
|
+
|
|
12
18
|
var _schemaComponent = require("../../../schema-component");
|
|
13
19
|
|
|
14
20
|
var _roleCollections = require("./roleCollections");
|
|
15
21
|
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
16
24
|
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; }
|
|
17
25
|
|
|
18
26
|
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; }
|
|
@@ -120,7 +128,8 @@ var roleSchema = {
|
|
|
120
128
|
return (0, _apiClient.useRequest)(function () {
|
|
121
129
|
return Promise.resolve({
|
|
122
130
|
data: {
|
|
123
|
-
name: "r_".concat((0, _shared.uid)())
|
|
131
|
+
name: "r_".concat((0, _shared.uid)()),
|
|
132
|
+
snippets: ['!ui.*', '!pm', '!pm.*']
|
|
124
133
|
}
|
|
125
134
|
});
|
|
126
135
|
}, _objectSpread(_objectSpread({}, options), {}, {
|
|
@@ -236,11 +245,14 @@ var roleSchema = {
|
|
|
236
245
|
type: 'void',
|
|
237
246
|
title: '{{t("Configure")}}',
|
|
238
247
|
'x-component': 'Action.Link',
|
|
248
|
+
'x-decorator': 'ACLActionProvider',
|
|
249
|
+
'x-acl-action': 'roles:update',
|
|
239
250
|
'x-component-props': {},
|
|
240
251
|
properties: {
|
|
241
252
|
drawer: {
|
|
242
253
|
type: 'void',
|
|
243
254
|
'x-component': 'Action.Drawer',
|
|
255
|
+
'x-decorator': 'PermissionProvider',
|
|
244
256
|
title: '{{t("Configure permissions")}}',
|
|
245
257
|
properties: {
|
|
246
258
|
tabs1: {
|
|
@@ -279,6 +291,19 @@ var roleSchema = {
|
|
|
279
291
|
'x-component': 'MenuConfigure'
|
|
280
292
|
}
|
|
281
293
|
}
|
|
294
|
+
},
|
|
295
|
+
tab4: {
|
|
296
|
+
type: 'void',
|
|
297
|
+
title: '{{t("Plugin settings permissions")}}',
|
|
298
|
+
'x-decorator': 'SettingCenterPermissionProvider',
|
|
299
|
+
'x-component': 'Tabs.TabPane',
|
|
300
|
+
'x-component-props': {},
|
|
301
|
+
properties: {
|
|
302
|
+
menu: {
|
|
303
|
+
'x-decorator': 'SettingCenterProvider',
|
|
304
|
+
'x-component': 'SettingsCenterConfigure'
|
|
305
|
+
}
|
|
306
|
+
}
|
|
282
307
|
}
|
|
283
308
|
}
|
|
284
309
|
}
|
|
@@ -289,6 +314,8 @@ var roleSchema = {
|
|
|
289
314
|
update: {
|
|
290
315
|
type: 'void',
|
|
291
316
|
title: '{{t("Edit")}}',
|
|
317
|
+
'x-decorator': 'ACLActionProvider',
|
|
318
|
+
'x-acl-action': 'roles:update',
|
|
292
319
|
'x-component': 'Action.Link',
|
|
293
320
|
'x-component-props': {
|
|
294
321
|
type: 'primary'
|
|
@@ -299,7 +326,23 @@ var roleSchema = {
|
|
|
299
326
|
'x-component': 'Action.Drawer',
|
|
300
327
|
'x-decorator': 'Form',
|
|
301
328
|
'x-decorator-props': {
|
|
302
|
-
useValues:
|
|
329
|
+
useValues: function useValues(options) {
|
|
330
|
+
var record = (0, _recordProvider.useRecord)();
|
|
331
|
+
var result = (0, _apiClient.useRequest)(function () {
|
|
332
|
+
return Promise.resolve({
|
|
333
|
+
data: (0, _pick.default)(record, ['title', 'name', 'default'])
|
|
334
|
+
});
|
|
335
|
+
}, _objectSpread(_objectSpread({}, options), {}, {
|
|
336
|
+
manual: true
|
|
337
|
+
}));
|
|
338
|
+
var ctx = (0, _schemaComponent.useActionContext)();
|
|
339
|
+
(0, _react.useEffect)(function () {
|
|
340
|
+
if (ctx.visible) {
|
|
341
|
+
result.run();
|
|
342
|
+
}
|
|
343
|
+
}, [ctx.visible]);
|
|
344
|
+
return result;
|
|
345
|
+
}
|
|
303
346
|
},
|
|
304
347
|
title: '{{t("Edit role")}}',
|
|
305
348
|
properties: {
|
|
@@ -346,6 +389,8 @@ var roleSchema = {
|
|
|
346
389
|
delete: {
|
|
347
390
|
type: 'void',
|
|
348
391
|
title: '{{ t("Delete") }}',
|
|
392
|
+
'x-acl-action': 'roles:destroy',
|
|
393
|
+
'x-decorator': 'ACLActionProvider',
|
|
349
394
|
'x-component': 'Action.Link',
|
|
350
395
|
'x-component-props': {
|
|
351
396
|
confirm: {
|
|
@@ -236,6 +236,7 @@ var scopesSchema = {
|
|
|
236
236
|
type: 'void',
|
|
237
237
|
title: '{{ t("Edit") }}',
|
|
238
238
|
'x-action': 'update',
|
|
239
|
+
'x-decorator': 'ACLActionProvider',
|
|
239
240
|
'x-component': 'Action.Link',
|
|
240
241
|
'x-component-props': {
|
|
241
242
|
openMode: 'drawer',
|
|
@@ -322,6 +323,7 @@ var scopesSchema = {
|
|
|
322
323
|
destroy: {
|
|
323
324
|
title: '{{ t("Delete") }}',
|
|
324
325
|
'x-action': 'destroy',
|
|
326
|
+
'x-decorator': 'ACLActionProvider',
|
|
325
327
|
'x-component': 'Action.Link',
|
|
326
328
|
'x-designer': 'Action.Designer',
|
|
327
329
|
'x-component-props': {
|
package/lib/acl/index.d.ts
CHANGED
package/lib/acl/index.js
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.AntdConfigProvider = AntdConfigProvider;
|
|
9
|
+
exports.useAppLangContext = exports.AppLangContext = void 0;
|
|
7
10
|
|
|
8
11
|
var _antd = require("antd");
|
|
9
12
|
|
|
10
|
-
var
|
|
13
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
14
|
+
|
|
15
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
16
|
|
|
12
17
|
var _reactI18next = require("react-i18next");
|
|
13
18
|
|
|
14
19
|
var _apiClient = require("../api-client");
|
|
15
20
|
|
|
16
|
-
var
|
|
21
|
+
var _loadConstrueLocale = require("./loadConstrueLocale");
|
|
17
22
|
|
|
18
23
|
var _excluded = ["remoteLocale"];
|
|
19
24
|
|
|
25
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
|
+
|
|
27
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
|
+
|
|
20
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
30
|
|
|
22
31
|
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; }
|
|
@@ -29,7 +38,18 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
29
38
|
|
|
30
39
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
40
|
|
|
41
|
+
var AppLangContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
42
|
+
exports.AppLangContext = AppLangContext;
|
|
43
|
+
|
|
44
|
+
var useAppLangContext = function useAppLangContext() {
|
|
45
|
+
return (0, _react.useContext)(AppLangContext);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports.useAppLangContext = useAppLangContext;
|
|
49
|
+
|
|
32
50
|
function AntdConfigProvider(props) {
|
|
51
|
+
var _data$data9;
|
|
52
|
+
|
|
33
53
|
var remoteLocale = props.remoteLocale,
|
|
34
54
|
others = _objectWithoutProperties(props, _excluded);
|
|
35
55
|
|
|
@@ -42,7 +62,7 @@ function AntdConfigProvider(props) {
|
|
|
42
62
|
url: 'app:getLang'
|
|
43
63
|
}, {
|
|
44
64
|
onSuccess: function onSuccess(data) {
|
|
45
|
-
var _data$data;
|
|
65
|
+
var _data$data, _data$data4, _data$data7, _data$data8;
|
|
46
66
|
|
|
47
67
|
var locale = api.auth.locale;
|
|
48
68
|
|
|
@@ -52,18 +72,32 @@ function AntdConfigProvider(props) {
|
|
|
52
72
|
api.auth.setLocale(data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.lang);
|
|
53
73
|
i18n.changeLanguage(data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.lang);
|
|
54
74
|
}
|
|
75
|
+
|
|
76
|
+
Object.keys((data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : _data$data4.resources) || {}).forEach(function (key) {
|
|
77
|
+
var _data$data5, _data$data6;
|
|
78
|
+
|
|
79
|
+
i18n.addResources(data === null || data === void 0 ? void 0 : (_data$data5 = data.data) === null || _data$data5 === void 0 ? void 0 : _data$data5.lang, key, (data === null || data === void 0 ? void 0 : (_data$data6 = data.data) === null || _data$data6 === void 0 ? void 0 : _data$data6.resources[key]) || {});
|
|
80
|
+
});
|
|
81
|
+
(0, _loadConstrueLocale.loadConstrueLocale)(data === null || data === void 0 ? void 0 : data.data);
|
|
82
|
+
|
|
83
|
+
_moment.default.locale(data === null || data === void 0 ? void 0 : (_data$data7 = data.data) === null || _data$data7 === void 0 ? void 0 : _data$data7.moment);
|
|
84
|
+
|
|
85
|
+
window['cronLocale'] = data === null || data === void 0 ? void 0 : (_data$data8 = data.data) === null || _data$data8 === void 0 ? void 0 : _data$data8.cron;
|
|
55
86
|
},
|
|
56
87
|
manual: !remoteLocale
|
|
57
88
|
}),
|
|
89
|
+
data = _useRequest.data,
|
|
58
90
|
loading = _useRequest.loading;
|
|
59
91
|
|
|
60
92
|
if (loading) {
|
|
61
93
|
return /*#__PURE__*/_react.default.createElement(_antd.Spin, null);
|
|
62
94
|
}
|
|
63
95
|
|
|
64
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement(AppLangContext.Provider, {
|
|
97
|
+
value: data === null || data === void 0 ? void 0 : data.data
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, _objectSpread(_objectSpread({
|
|
65
99
|
dropdownMatchSelectWidth: false
|
|
66
100
|
}, others), {}, {
|
|
67
|
-
locale:
|
|
68
|
-
}), props.children);
|
|
101
|
+
locale: (data === null || data === void 0 ? void 0 : (_data$data9 = data.data) === null || _data$data9 === void 0 ? void 0 : _data$data9.antd) || {}
|
|
102
|
+
}), props.children));
|
|
69
103
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadConstrueLocale: (data: any) => void;
|