@steedos/service-ui 2.3.0-beta.9 → 2.3.0
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.
|
@@ -249,9 +249,11 @@ function getSpaceBootStrap(req, res) {
|
|
|
249
249
|
result.objects[item.object_name].enable_process = true;
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
|
+
const allImportTemplates = yield (0, objectql_1.getSteedosSchema)().broker.call(`~packages-@steedos/data-import.getAllImportTemplates`, {}, { meta: { user: userSession } });
|
|
252
253
|
for (const key in result.objects) {
|
|
253
254
|
if (Object.prototype.hasOwnProperty.call(result.objects, key)) {
|
|
254
255
|
const objectConfig = result.objects[key];
|
|
256
|
+
objectConfig.hasImportTemplates = !_.isEmpty(_.find(allImportTemplates, (item) => { return item.object_name === key; }));
|
|
255
257
|
try {
|
|
256
258
|
objectConfig.details = _.map(_.filter(allRelationsInfo.details, { objectName: key }), 'key');
|
|
257
259
|
objectConfig.masters = _.map(_.filter(allRelationsInfo.masters, { objectName: key }), 'key');
|
|
@@ -393,6 +395,9 @@ function getSpaceObjectBootStrap(req, res) {
|
|
|
393
395
|
delete objectConfig.triggers[key];
|
|
394
396
|
}
|
|
395
397
|
});
|
|
398
|
+
objectConfig.hasImportTemplates = yield (0, objectql_1.getSteedosSchema)().broker.call(`~packages-@steedos/data-import.hasImportTemplates`, {
|
|
399
|
+
objectName: objectConfig.name
|
|
400
|
+
}, { meta: { user: userSession } });
|
|
396
401
|
delete objectConfig.listeners;
|
|
397
402
|
delete objectConfig.__filename;
|
|
398
403
|
delete objectConfig.extend;
|
|
@@ -58,6 +58,9 @@ router.get('/service/api/:objectServiceName/uiSchema', core.requireAuthenticatio
|
|
|
58
58
|
try {
|
|
59
59
|
const { objectServiceName } = req.params;
|
|
60
60
|
const result = yield callObjectServiceAction(`${objectServiceName}.getRecordView`, userSession);
|
|
61
|
+
result.hasImportTemplates = yield callObjectServiceAction(`~packages-@steedos/data-import.hasImportTemplates`, userSession, {
|
|
62
|
+
objectName: result.name
|
|
63
|
+
});
|
|
61
64
|
res.status(200).send(result);
|
|
62
65
|
}
|
|
63
66
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-ui",
|
|
3
|
-
"version": "2.3.0
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"steedos"
|
|
6
6
|
],
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"description": "steedos package",
|
|
11
11
|
"repository": {},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@steedos/core": "2.3.0
|
|
14
|
-
"@steedos/i18n": "2.3.0
|
|
15
|
-
"@steedos/objectql": "2.3.0
|
|
13
|
+
"@steedos/core": "2.3.0",
|
|
14
|
+
"@steedos/i18n": "2.3.0",
|
|
15
|
+
"@steedos/objectql": "2.3.0",
|
|
16
16
|
"express": "4.18.1"
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "b00e79e6fb8549b2fabed7b6cd6d4847775ba5df"
|
|
24
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import steedosI18n = require("@steedos/i18n");
|
|
2
2
|
import { getPlugins, requireAuthentication } from '@steedos/core';
|
|
3
|
-
import { getObject, getObjectLayouts, getLayout, getAppConfigs, getAssignedMenus, getAssignedApps, getAllRelationsInfo, FieldPermission } from '@steedos/objectql'
|
|
3
|
+
import { getObject, getObjectLayouts, getLayout, getAppConfigs, getAssignedMenus, getAssignedApps, getAllRelationsInfo, FieldPermission, getSteedosSchema } from '@steedos/objectql'
|
|
4
4
|
//
|
|
5
5
|
require("@steedos/license");
|
|
6
6
|
const Fiber = require('fibers')
|
|
@@ -295,9 +295,13 @@ export async function getSpaceBootStrap(req, res) {
|
|
|
295
295
|
result.objects[item.object_name].enable_process = true
|
|
296
296
|
}
|
|
297
297
|
})
|
|
298
|
+
|
|
299
|
+
const allImportTemplates = await getSteedosSchema().broker.call(`~packages-@steedos/data-import.getAllImportTemplates`, {}, { meta: { user: userSession}})
|
|
300
|
+
|
|
298
301
|
for (const key in result.objects) {
|
|
299
302
|
if (Object.prototype.hasOwnProperty.call(result.objects, key)) {
|
|
300
303
|
const objectConfig = result.objects[key];
|
|
304
|
+
objectConfig.hasImportTemplates = !_.isEmpty(_.find(allImportTemplates, (item)=>{return item.object_name === key}))
|
|
301
305
|
try {
|
|
302
306
|
// const object = getObject(key);
|
|
303
307
|
// const relationsInfo = await object.getRelationsInfo();
|
|
@@ -447,6 +451,11 @@ export async function getSpaceObjectBootStrap(req, res) {
|
|
|
447
451
|
}
|
|
448
452
|
})
|
|
449
453
|
|
|
454
|
+
objectConfig.hasImportTemplates = await getSteedosSchema().broker.call(`~packages-@steedos/data-import.hasImportTemplates`, {
|
|
455
|
+
objectName: objectConfig.name
|
|
456
|
+
}, { meta: { user: userSession}})
|
|
457
|
+
|
|
458
|
+
|
|
450
459
|
delete objectConfig.listeners
|
|
451
460
|
delete objectConfig.__filename
|
|
452
461
|
delete objectConfig.extend
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2022-06-09 10:19:47
|
|
4
4
|
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-10-29 13:15:06
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
import { getSteedosSchema } from "@steedos/objectql";
|
|
@@ -57,6 +57,9 @@ router.get('/service/api/:objectServiceName/uiSchema', core.requireAuthenticatio
|
|
|
57
57
|
try {
|
|
58
58
|
const { objectServiceName } = req.params;
|
|
59
59
|
const result = await callObjectServiceAction(`${objectServiceName}.getRecordView`, userSession);
|
|
60
|
+
result.hasImportTemplates = await callObjectServiceAction(`~packages-@steedos/data-import.hasImportTemplates`, userSession, {
|
|
61
|
+
objectName: result.name
|
|
62
|
+
})
|
|
60
63
|
res.status(200).send(result);
|
|
61
64
|
} catch (error) {
|
|
62
65
|
res.status(500).send(error.message);
|