@nocobase/client 0.10.0-alpha.4 → 0.10.0-alpha.5
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/Configuration/StrategyActions.js +1 -0
- package/es/api-client/APIClient.js +21 -5
- package/es/collection-manager/Configuration/components/index.js +3 -0
- package/es/collection-manager/templates/components/PreviewFields.js +2 -0
- package/es/locale/uk_UA.d.ts +714 -0
- package/es/locale/uk_UA.js +713 -0
- package/es/pm/index.js +0 -3
- package/es/schema-component/antd/association-field/InternalPicker.js +3 -2
- package/es/schema-component/antd/calendar/ViewSelect.js +1 -0
- package/es/schema-component/antd/collection-select/CollectionSelect.js +2 -1
- package/es/schema-component/antd/cron/CronSet.d.ts +1 -1
- package/es/schema-component/antd/cron/CronSet.js +4 -3
- package/es/schema-component/antd/filter/FilterGroup.js +1 -1
- package/es/schema-component/antd/filter/FilterItem.js +1 -0
- package/es/schema-component/antd/form-v2/Templates.js +2 -3
- package/es/schema-component/antd/preview/Preview.js +31 -6
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +1 -0
- package/es/schema-component/antd/upload/ReadPretty.js +74 -15
- package/es/schema-component/antd/upload/Upload.js +102 -24
- package/es/schema-component/antd/upload/shared.d.ts +5 -3
- package/es/schema-component/antd/upload/shared.js +6 -1
- package/es/schema-component/antd/upload/style.less +1 -1
- package/es/schema-component/antd/variable/Input.js +3 -4
- package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +2 -2
- package/es/schema-initializer/buttons/TableColumnInitializers.js +4 -4
- package/es/schema-initializer/components/assigned-field/AssignedField.js +5 -0
- package/es/schema-settings/DataTemplates/components/Designer.js +1 -0
- package/es/schema-settings/LinkageRules/LinkageRuleAction.js +2 -0
- package/es/user/LanguageSettings.js +1 -0
- package/es/user/SwitchRole.js +1 -0
- package/es/user/ThemeSettings.js +1 -0
- package/lib/acl/Configuration/StrategyActions.js +1 -0
- package/lib/api-client/APIClient.js +21 -5
- package/lib/collection-manager/Configuration/components/index.js +3 -0
- package/lib/collection-manager/templates/components/PreviewFields.js +2 -0
- package/lib/locale/uk_UA.d.ts +714 -0
- package/lib/locale/uk_UA.js +720 -0
- package/lib/pm/index.js +0 -3
- package/lib/schema-component/antd/association-field/InternalPicker.js +2 -1
- package/lib/schema-component/antd/calendar/ViewSelect.js +1 -0
- package/lib/schema-component/antd/collection-select/CollectionSelect.js +2 -1
- package/lib/schema-component/antd/cron/CronSet.d.ts +1 -1
- package/lib/schema-component/antd/cron/CronSet.js +17 -16
- package/lib/schema-component/antd/filter/FilterGroup.js +1 -1
- package/lib/schema-component/antd/filter/FilterItem.js +1 -0
- package/lib/schema-component/antd/form-v2/Templates.js +2 -3
- package/lib/schema-component/antd/preview/Preview.js +30 -5
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +1 -0
- package/lib/schema-component/antd/upload/ReadPretty.js +72 -13
- package/lib/schema-component/antd/upload/Upload.js +99 -21
- package/lib/schema-component/antd/upload/shared.d.ts +5 -3
- package/lib/schema-component/antd/upload/shared.js +8 -2
- package/lib/schema-component/antd/upload/style.less +1 -1
- package/lib/schema-component/antd/variable/Input.js +2 -2
- package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +2 -2
- package/lib/schema-initializer/buttons/TableColumnInitializers.js +7 -7
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +5 -0
- package/lib/schema-settings/DataTemplates/components/Designer.js +1 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleAction.js +2 -0
- package/lib/user/LanguageSettings.js +1 -0
- package/lib/user/SwitchRole.js +1 -0
- package/lib/user/ThemeSettings.js +1 -0
- package/package.json +5 -5
|
@@ -93,6 +93,7 @@ export var StrategyActions = connect(function (props) {
|
|
|
93
93
|
title: t('Data scope'),
|
|
94
94
|
render: function render(scope, action) {
|
|
95
95
|
return !action.onNewRecord && /*#__PURE__*/React.createElement(Select, {
|
|
96
|
+
dropdownMatchSelectWidth: false,
|
|
96
97
|
size: 'small',
|
|
97
98
|
value: scope,
|
|
98
99
|
options: [{
|
|
@@ -31,6 +31,7 @@ var handleErrorMessage = function handleErrorMessage(error) {
|
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
+
var errorCache = new Map();
|
|
34
35
|
export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
35
36
|
_inherits(APIClient, _APIClientSDK);
|
|
36
37
|
var _super = _createSuper(APIClient);
|
|
@@ -82,12 +83,27 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
82
83
|
if ((error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : _error$response3$data.type) === 'application/json') {
|
|
83
84
|
handleErrorMessage(error);
|
|
84
85
|
} else {
|
|
85
|
-
var _error$response4, _error$response4$data,
|
|
86
|
+
var _error$response4, _error$response4$data, _errs, _errs$map;
|
|
87
|
+
if (errorCache.size > 10) {
|
|
88
|
+
errorCache.clear();
|
|
89
|
+
}
|
|
90
|
+
var errs = (error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : _error$response4$data.errors) || [{
|
|
91
|
+
message: 'Server error'
|
|
92
|
+
}];
|
|
93
|
+
errs = errs.filter(function (error) {
|
|
94
|
+
var lastTime = errorCache.get(error.message);
|
|
95
|
+
if (lastTime && new Date().getTime() - lastTime < 500) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
errorCache.set(error.message, new Date().getTime());
|
|
99
|
+
return true;
|
|
100
|
+
});
|
|
101
|
+
if (errs.length === 0) {
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
86
104
|
_notification.error({
|
|
87
|
-
message:
|
|
88
|
-
return /*#__PURE__*/React.createElement('div', {
|
|
89
|
-
children: error.message
|
|
90
|
-
});
|
|
105
|
+
message: (_errs = errs) === null || _errs === void 0 ? void 0 : (_errs$map = _errs.map) === null || _errs$map === void 0 ? void 0 : _errs$map.call(_errs, function (error) {
|
|
106
|
+
return /*#__PURE__*/React.createElement('div', {}, error.message);
|
|
91
107
|
})
|
|
92
108
|
});
|
|
93
109
|
}
|
|
@@ -38,6 +38,7 @@ export var ThroughForeignKey = observer(function () {
|
|
|
38
38
|
getCollectionFields = _useCollectionManager3.getCollectionFields;
|
|
39
39
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
|
|
40
40
|
allowClear: true,
|
|
41
|
+
dropdownMatchSelectWidth: false,
|
|
41
42
|
placeholder: '留空时,自动生成 FK 字段',
|
|
42
43
|
disabled: field.disabled,
|
|
43
44
|
value: field.value,
|
|
@@ -61,6 +62,7 @@ export var TargetForeignKey = observer(function () {
|
|
|
61
62
|
getCollectionFields = _useCollectionManager4.getCollectionFields;
|
|
62
63
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
|
|
63
64
|
allowClear: true,
|
|
65
|
+
dropdownMatchSelectWidth: false,
|
|
64
66
|
placeholder: '留空时,自动生成 FK 字段',
|
|
65
67
|
disabled: field.disabled,
|
|
66
68
|
value: field.value,
|
|
@@ -85,6 +87,7 @@ export var SourceCollection = observer(function () {
|
|
|
85
87
|
var compile = useCompile();
|
|
86
88
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
|
|
87
89
|
disabled: true,
|
|
90
|
+
dropdownMatchSelectWidth: false,
|
|
88
91
|
value: collection.name,
|
|
89
92
|
options: [{
|
|
90
93
|
value: collection.name,
|
|
@@ -160,6 +160,7 @@ var PreviewCom = function PreviewCom(props) {
|
|
|
160
160
|
var item = dataSource[index];
|
|
161
161
|
return (item === null || item === void 0 ? void 0 : item.source) || !(item === null || item === void 0 ? void 0 : item.possibleTypes) ? /*#__PURE__*/React.createElement(Tag, null, text) : /*#__PURE__*/React.createElement(Select, {
|
|
162
162
|
defaultValue: text,
|
|
163
|
+
dropdownMatchSelectWidth: false,
|
|
163
164
|
style: {
|
|
164
165
|
width: '100%'
|
|
165
166
|
},
|
|
@@ -189,6 +190,7 @@ var PreviewCom = function PreviewCom(props) {
|
|
|
189
190
|
style: {
|
|
190
191
|
width: '100%'
|
|
191
192
|
},
|
|
193
|
+
dropdownMatchSelectWidth: false,
|
|
192
194
|
onChange: function onChange(value) {
|
|
193
195
|
var _interfaceConfig$defa;
|
|
194
196
|
var interfaceConfig = getInterface(value);
|