@nocobase/plugin-multi-app-share-collection 0.11.0-alpha.1 → 0.11.1-alpha.1
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/client/TableTransfer.js +10 -4
- package/lib/server/plugin.js +1 -1
- package/package.json +11 -11
- package/src/client/TableTransfer.tsx +14 -8
- package/src/server/plugin.ts +1 -0
|
@@ -264,6 +264,10 @@ const TableTransfer = (0, _react().connect)(props => {
|
|
|
264
264
|
});
|
|
265
265
|
const _useTranslation = (0, _reactI18next().useTranslation)('multi-app-share-collection'),
|
|
266
266
|
t = _useTranslation.t;
|
|
267
|
+
const _App$useApp = _antd().App.useApp(),
|
|
268
|
+
modal = _App$useApp.modal;
|
|
269
|
+
const _useToken = (0, _client().useToken)(),
|
|
270
|
+
token = _useToken.token;
|
|
267
271
|
const columns = (0, _react2().useMemo)(() => [{
|
|
268
272
|
title: t('Collection display name'),
|
|
269
273
|
dataIndex: 'title'
|
|
@@ -301,7 +305,8 @@ const TableTransfer = (0, _react().connect)(props => {
|
|
|
301
305
|
`
|
|
302
306
|
}, _react2().default.createElement("strong", {
|
|
303
307
|
style: {
|
|
304
|
-
fontSize:
|
|
308
|
+
fontSize: token.fontSizeLG,
|
|
309
|
+
color: token.colorText
|
|
305
310
|
}
|
|
306
311
|
}, t('Unshared collections')), _react2().default.createElement(_antd().Input.Group, {
|
|
307
312
|
compact: true,
|
|
@@ -364,7 +369,7 @@ const TableTransfer = (0, _react().connect)(props => {
|
|
|
364
369
|
if (adding.length === 1) {
|
|
365
370
|
return change();
|
|
366
371
|
}
|
|
367
|
-
|
|
372
|
+
modal.confirm({
|
|
368
373
|
title: t('Are you sure to add the following collections?'),
|
|
369
374
|
width: '60%',
|
|
370
375
|
content: _react2().default.createElement("div", null, _react2().default.createElement(_antd().Table, {
|
|
@@ -394,7 +399,8 @@ const TableTransfer = (0, _react().connect)(props => {
|
|
|
394
399
|
`
|
|
395
400
|
}, _react2().default.createElement("strong", {
|
|
396
401
|
style: {
|
|
397
|
-
fontSize:
|
|
402
|
+
fontSize: token.fontSizeLG,
|
|
403
|
+
color: token.colorText
|
|
398
404
|
}
|
|
399
405
|
}, t('Shared collections')), _react2().default.createElement(_antd().Input.Group, {
|
|
400
406
|
compact: true,
|
|
@@ -456,7 +462,7 @@ const TableTransfer = (0, _react().connect)(props => {
|
|
|
456
462
|
if (removing.length === 1) {
|
|
457
463
|
return change();
|
|
458
464
|
}
|
|
459
|
-
|
|
465
|
+
modal.confirm({
|
|
460
466
|
title: t('Are you sure to remove the following collections?'),
|
|
461
467
|
width: '60%',
|
|
462
468
|
content: _react2().default.createElement("div", null, _react2().default.createElement(_antd().Table, {
|
package/lib/server/plugin.js
CHANGED
|
@@ -48,7 +48,7 @@ class SubAppPlugin extends _server().Plugin {
|
|
|
48
48
|
beforeLoad() {
|
|
49
49
|
const mainApp = this.options.mainApp;
|
|
50
50
|
const subApp = this.app;
|
|
51
|
-
const sharedCollectionGroups = ['audit-logs', 'workflow', 'charts', 'collection-manager', 'file-manager', 'graph-collection-manager', 'map', 'sequence-field', 'snapshot-field', 'verification'];
|
|
51
|
+
const sharedCollectionGroups = ['audit-logs', 'workflow', 'charts', 'collection-manager', 'file-manager', 'graph-collection-manager', 'map', 'sequence-field', 'snapshot-field', 'verification', 'localization-management'];
|
|
52
52
|
const collectionGroups = mainApp.db.collectionGroupManager.getGroups();
|
|
53
53
|
const sharedCollectionGroupsCollections = [];
|
|
54
54
|
var _iterator = _createForOfIteratorHelper(collectionGroups),
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "多应用数据共享",
|
|
5
5
|
"description": "multi app share collection",
|
|
6
6
|
"description.zh-CN": "多应用数据共享",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.1-alpha.1",
|
|
8
8
|
"main": "./lib/server/index.js",
|
|
9
9
|
"files": [
|
|
10
10
|
"lib",
|
|
@@ -19,18 +19,18 @@
|
|
|
19
19
|
],
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@formily/react": "2.2.26",
|
|
22
|
-
"@nocobase/client": "0.11.
|
|
23
|
-
"@nocobase/database": "0.11.
|
|
24
|
-
"@nocobase/plugin-collection-manager": "0.11.
|
|
25
|
-
"@nocobase/plugin-error-handler": "0.11.
|
|
26
|
-
"@nocobase/plugin-multi-app-manager": "0.11.
|
|
27
|
-
"@nocobase/plugin-users": "0.11.
|
|
28
|
-
"@nocobase/server": "0.11.
|
|
29
|
-
"@nocobase/test": "0.11.
|
|
30
|
-
"@nocobase/utils": "0.11.
|
|
22
|
+
"@nocobase/client": "0.11.1-alpha.1",
|
|
23
|
+
"@nocobase/database": "0.11.1-alpha.1",
|
|
24
|
+
"@nocobase/plugin-collection-manager": "0.11.1-alpha.1",
|
|
25
|
+
"@nocobase/plugin-error-handler": "0.11.1-alpha.1",
|
|
26
|
+
"@nocobase/plugin-multi-app-manager": "0.11.1-alpha.1",
|
|
27
|
+
"@nocobase/plugin-users": "0.11.1-alpha.1",
|
|
28
|
+
"@nocobase/server": "0.11.1-alpha.1",
|
|
29
|
+
"@nocobase/test": "0.11.1-alpha.1",
|
|
30
|
+
"@nocobase/utils": "0.11.1-alpha.1",
|
|
31
31
|
"antd": "^5.6.4",
|
|
32
32
|
"react": "18.x",
|
|
33
33
|
"react-i18next": "^11.15.1"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "9ed1dba520bc5f3a7cb1255ea8d92ccbefc11bc8"
|
|
36
36
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { connect } from '@formily/react';
|
|
2
|
-
import { css, useCollectionManager, useRecord, useRequest } from '@nocobase/client';
|
|
2
|
+
import { css, useCollectionManager, useRecord, useRequest, useToken } from '@nocobase/client';
|
|
3
3
|
import { CollectionsGraph, lodash } from '@nocobase/utils/client';
|
|
4
|
-
import { Col, Input,
|
|
4
|
+
import { App, Col, Input, Row, Select, Spin, Table, Tag } from 'antd';
|
|
5
5
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
@@ -60,7 +60,9 @@ const useCollections = () => {
|
|
|
60
60
|
},
|
|
61
61
|
);
|
|
62
62
|
|
|
63
|
-
const res2 = useRequest
|
|
63
|
+
const res2 = useRequest<{
|
|
64
|
+
data: any[];
|
|
65
|
+
}>({
|
|
64
66
|
url: `collections`,
|
|
65
67
|
params: {
|
|
66
68
|
fields: ['name', 'title', 'hidden', 'category.name', 'category.color', 'category.sort'],
|
|
@@ -69,7 +71,9 @@ const useCollections = () => {
|
|
|
69
71
|
},
|
|
70
72
|
});
|
|
71
73
|
|
|
72
|
-
const res3 = useRequest
|
|
74
|
+
const res3 = useRequest<{
|
|
75
|
+
data: any[];
|
|
76
|
+
}>({
|
|
73
77
|
url: `collectionCategories`,
|
|
74
78
|
params: {
|
|
75
79
|
sort: 'sort',
|
|
@@ -177,6 +181,8 @@ export const TableTransfer = connect((props) => {
|
|
|
177
181
|
const addedDataSource = useAddedDataSource({ collections, removed });
|
|
178
182
|
const removedDataSource = useRemovedDataSource({ collections, removed });
|
|
179
183
|
const { t } = useTranslation('multi-app-share-collection');
|
|
184
|
+
const { modal } = App.useApp();
|
|
185
|
+
const { token } = useToken();
|
|
180
186
|
const columns = useMemo(
|
|
181
187
|
() => [
|
|
182
188
|
{
|
|
@@ -224,7 +230,7 @@ export const TableTransfer = connect((props) => {
|
|
|
224
230
|
margin-bottom: 8px;
|
|
225
231
|
`}
|
|
226
232
|
>
|
|
227
|
-
<strong style={{ fontSize:
|
|
233
|
+
<strong style={{ fontSize: token.fontSizeLG, color: token.colorText }}>{t('Unshared collections')}</strong>
|
|
228
234
|
<Input.Group compact style={{ width: 360 }}>
|
|
229
235
|
<Select
|
|
230
236
|
popupMatchSelectWidth={false}
|
|
@@ -277,7 +283,7 @@ export const TableTransfer = connect((props) => {
|
|
|
277
283
|
if (adding.length === 1) {
|
|
278
284
|
return change();
|
|
279
285
|
}
|
|
280
|
-
|
|
286
|
+
modal.confirm({
|
|
281
287
|
title: t('Are you sure to add the following collections?'),
|
|
282
288
|
width: '60%',
|
|
283
289
|
content: (
|
|
@@ -309,7 +315,7 @@ export const TableTransfer = connect((props) => {
|
|
|
309
315
|
margin-bottom: 8px;
|
|
310
316
|
`}
|
|
311
317
|
>
|
|
312
|
-
<strong style={{ fontSize:
|
|
318
|
+
<strong style={{ fontSize: token.fontSizeLG, color: token.colorText }}>{t('Shared collections')}</strong>
|
|
313
319
|
<Input.Group compact style={{ width: 360 }}>
|
|
314
320
|
<Select
|
|
315
321
|
popupMatchSelectWidth={false}
|
|
@@ -362,7 +368,7 @@ export const TableTransfer = connect((props) => {
|
|
|
362
368
|
if (removing.length === 1) {
|
|
363
369
|
return change();
|
|
364
370
|
}
|
|
365
|
-
|
|
371
|
+
modal.confirm({
|
|
366
372
|
title: t('Are you sure to remove the following collections?'),
|
|
367
373
|
width: '60%',
|
|
368
374
|
content: (
|