@steedos/service-ui 2.2.55-beta.6 → 2.2.55

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.
@@ -1,13 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- /*
5
- * @Author: baozhoutao@steedos.com
6
- * @Date: 2022-06-08 23:28:39
7
- * @LastEditors: baozhoutao@steedos.com
8
- * @LastEditTime: 2022-06-09 10:21:45
9
- * @Description:
10
- */
11
4
  const express = require("express");
12
5
  const core_1 = require("@steedos/core");
13
6
  const objectql_1 = require("@steedos/objectql");
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
5
5
  const steedosI18n = require("@steedos/i18n");
6
6
  const core_1 = require("@steedos/core");
7
7
  const objectql_1 = require("@steedos/objectql");
8
- //
9
8
  require("@steedos/license");
10
9
  const Fiber = require('fibers');
11
10
  const clone = require("clone");
@@ -20,11 +19,6 @@ function getUserProfileObjectsLayout(userId, spaceId, objectName) {
20
19
  spaceUser = spaceUsers[0];
21
20
  }
22
21
  if (spaceUser && spaceUser.profile) {
23
- // let filters = [['space', '=', spaceId],['profiles', '=', spaceUser.profile]];
24
- // if(objectName){
25
- // filters.push(['object_name', '=', objectName])
26
- // }
27
- // return await getObject("object_layouts").directFind({filters: filters})
28
22
  return yield (0, objectql_1.getObjectLayouts)(spaceUser.profile, spaceId, objectName);
29
23
  }
30
24
  });
@@ -34,7 +28,6 @@ function getUserObjects(userId, spaceId, objects) {
34
28
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
29
  const objectsLayout = yield getUserProfileObjectsLayout(userId, spaceId);
36
30
  for (const objectName in objects) {
37
- // objects[objectName].list_views = await getUserObjectListViews(userId, spaceId, objectName)
38
31
  let userObjectLayout = null;
39
32
  if (objectsLayout) {
40
33
  userObjectLayout = _.find(objectsLayout, function (objectLayout) {
@@ -104,14 +97,12 @@ function getUserObject(userId, spaceId, object, layout) {
104
97
  _object.fields[fieldApiName].hidden = true;
105
98
  _object.fields[fieldApiName].sort_no = 99999;
106
99
  });
107
- // let _buttons = {};
108
100
  _.each(layout.buttons, function (button) {
109
101
  const action = _object.actions[button.button_name];
110
102
  if (action) {
111
103
  if (button.visible_on) {
112
104
  action._visible = button.visible_on;
113
105
  }
114
- // _buttons[button.button_name] = action
115
106
  }
116
107
  });
117
108
  const layoutButtonsName = _.pluck(layout.buttons, 'button_name');
@@ -121,9 +112,6 @@ function getUserObject(userId, spaceId, object, layout) {
121
112
  action._visible = function () { return false; }.toString();
122
113
  }
123
114
  });
124
- // _object.actions = _buttons;
125
- // _object.allow_customActions = userObjectLayout.custom_actions || []
126
- // _object.exclude_actions = userObjectLayout.exclude_actions || []
127
115
  _object.related_lists = layout.related_lists || [];
128
116
  _.each(_object.related_lists, (related_list) => {
129
117
  if (related_list.sort_field_name && _.isArray(related_list.sort_field_name) && related_list.sort_field_name.length > 0) {
@@ -149,7 +137,6 @@ function getSpaceBootStrap(req, res) {
149
137
  const { userId, language: lng } = userSession;
150
138
  let spaceId = req.headers['x-space-id'] || urlParams.spaceId;
151
139
  let space = yield (0, objectql_1.getObject)("spaces").findOne(spaceId, { fields: ['name'] });
152
- //TODO 无需再从getAllPermissions中获取用户的对象权限
153
140
  let result = Creator.getAllPermissions(spaceId, userId);
154
141
  steedosI18n.translationObjects(lng, result.objects);
155
142
  result.user = userSession;
@@ -157,24 +144,9 @@ function getSpaceBootStrap(req, res) {
157
144
  result.dashboards = clone(Creator.Dashboards);
158
145
  result.object_workflows = Meteor.call('object_workflows.get', spaceId, userId);
159
146
  result.object_listviews = yield getUserObjectsListViews(userId, spaceId);
160
- // result.apps = clone(Creator.Apps)
161
147
  result.apps = yield (0, objectql_1.getAppConfigs)(spaceId);
162
148
  result.assigned_apps = yield (0, objectql_1.getAssignedApps)(userSession);
163
149
  let datasources = Creator.steedosSchema.getDataSources();
164
- // for (const datasourceName in datasources) {
165
- // if(datasourceName != 'default'){
166
- // let datasource = datasources[datasourceName];
167
- // const datasourceObjects = datasource.getObjects();
168
- // for (const objectName in datasourceObjects) {
169
- // const object = datasourceObjects[objectName];
170
- // const _obj = Creator.convertObject(clone(object.toConfig()), spaceId)
171
- // _obj.name = objectName
172
- // _obj.database_name = datasourceName
173
- // _obj.permissions = await object.getUserObjectPermission(userSession)
174
- // result.objects[_obj.name] = _obj
175
- // }
176
- // }
177
- // }
178
150
  const spaceProcessDefinition = yield (0, objectql_1.getObject)("process_definition").find({ filters: [['space', '=', spaceId], ['active', '=', true]] });
179
151
  const spaceObjectsProcessDefinition = _.groupBy(spaceProcessDefinition, 'object_name');
180
152
  const dbListViews = yield (0, objectql_1.getObject)("object_listviews").directFind({ filters: [['space', '=', userSession.spaceId], [['owner', '=', userSession.userId], 'or', ['shared', '=', true]]] });
@@ -272,7 +244,6 @@ function getSpaceBootStrap(req, res) {
272
244
  result.dashboards = _Dashboards;
273
245
  result.plugins = core_1.getPlugins ? (0, core_1.getPlugins)() : null;
274
246
  yield getUserObjects(userId, spaceId, result.objects);
275
- // TODO object layout 是否需要控制审批记录显示?
276
247
  _.each(spaceProcessDefinition, function (item) {
277
248
  if (result.objects[item.object_name]) {
278
249
  result.objects[item.object_name].enable_process = true;
@@ -282,11 +253,6 @@ function getSpaceBootStrap(req, res) {
282
253
  if (Object.prototype.hasOwnProperty.call(result.objects, key)) {
283
254
  const objectConfig = result.objects[key];
284
255
  try {
285
- // const object = getObject(key);
286
- // const relationsInfo = await object.getRelationsInfo();
287
- // objectConfig.details = relationsInfo.details;
288
- // objectConfig.masters = relationsInfo.masters;
289
- // objectConfig.lookup_details = relationsInfo.lookup_details;
290
256
  objectConfig.details = _.map(_.filter(allRelationsInfo.details, { objectName: key }), 'key');
291
257
  objectConfig.masters = _.map(_.filter(allRelationsInfo.masters, { objectName: key }), 'key');
292
258
  objectConfig.lookup_details = _.map(_.filter(allRelationsInfo.lookup_details, { objectName: key }));
@@ -365,14 +331,6 @@ function getUserObjectsListViews(userId, spaceId) {
365
331
  });
366
332
  }
367
333
  ;
368
- // async function getUserObjectListViews(userId, spaceId, object_name){
369
- // const _user_object_list_views = {};
370
- // const object_listview = await getObject("object_listviews").find({filters: [['object_name', '=', object_name],['space', '=', spaceId],[ [ "owner", "=", userId ], "or", [ "shared", "=", true ] ]]});
371
- // object_listview.forEach(function(listview) {
372
- // return _user_object_list_views[listview._id] = listview;
373
- // });
374
- // return _user_object_list_views;
375
- // }
376
334
  function getSpaceObjectBootStrap(req, res) {
377
335
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
378
336
  return Fiber(function () {
@@ -424,10 +382,8 @@ function getSpaceObjectBootStrap(req, res) {
424
382
  }
425
383
  if (objectConfig) {
426
384
  delete objectConfig.db;
427
- // objectConfig.list_views = await getUserObjectListViews(userId, spaceId, objectName)
428
385
  steedosI18n.translationObject(lng, objectConfig.name, objectConfig);
429
386
  objectConfig = yield getUserObject(userId, spaceId, objectConfig);
430
- // TODO object layout 是否需要控制审批记录显示?
431
387
  let spaceProcessDefinition = yield (0, objectql_1.getObject)("process_definition").directFind({ filters: [['space', '=', spaceId], ['object_name', '=', objectName], ['active', '=', true]] });
432
388
  if (spaceProcessDefinition.length > 0) {
433
389
  objectConfig.enable_process = true;
@@ -1,13 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- /*
5
- * @Author: baozhoutao@steedos.com
6
- * @Date: 2022-06-09 10:19:47
7
- * @LastEditors: baozhoutao@steedos.com
8
- * @LastEditTime: 2022-06-10 15:52:17
9
- * @Description:
10
- */
11
4
  const objectql_1 = require("@steedos/objectql");
12
5
  const express = require("express");
13
6
  const router = express.Router();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-ui",
3
- "version": "2.2.55-beta.6",
3
+ "version": "2.2.55",
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.2.55-beta.6",
14
- "@steedos/i18n": "2.2.55-beta.6",
15
- "@steedos/objectql": "2.2.55-beta.6",
13
+ "@steedos/core": "2.2.55",
14
+ "@steedos/i18n": "2.2.55",
15
+ "@steedos/objectql": "2.2.55",
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": "8cbd922fc597d7618dd4bb76a8cd20fadcded144"
23
+ "gitHead": "1d94628192d53118f66a75f2399f2b3e1cec184b"
24
24
  }
package/tsconfig.json CHANGED
@@ -27,6 +27,7 @@
27
27
  "es2017",
28
28
  "esnext"
29
29
  ],
30
+ "removeComments": true
30
31
  },
31
32
  "include": [
32
33
  "./src/**/*"