@steedos/service-pages 2.1.8 → 2.1.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-pages",
3
- "version": "2.1.8",
3
+ "version": "2.1.12",
4
4
  "main": "package.service.js",
5
5
  "scripts": {},
6
6
  "license": "MIT",
@@ -8,5 +8,5 @@
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
- "gitHead": "744583b5cd2e8240c2f72bb8dad0b2ecc95f4fa7"
11
+ "gitHead": "3a9f8d7ff6e17fcea9bcd4dee22ce6a6df1b8da1"
12
12
  }
@@ -60,6 +60,7 @@ module.exports = {
60
60
  if(pages.length > 0){
61
61
  page = pages[0];
62
62
  }
63
+ if(!page){return null}
63
64
  page.can_edit = userSession.is_space_admin && page.is_system != true //仅工作区管理员可以编辑
64
65
  page.user = { name: 'true' } //TODO
65
66
  page.layout = [] //TODO
@@ -67,7 +68,13 @@ module.exports = {
67
68
  page.tags = []
68
69
  page.updated_at = page.modified
69
70
  page.user_id = ''
70
- page.widgets = await objectql.getObject('widgets').find({ filters: [['page', '=', apiName]] });
71
+ if(page.is_system == true){
72
+ _.each(page.widgets, (widget)=>{
73
+ widget._id = widget.name;
74
+ })
75
+ }else{
76
+ page.widgets = await objectql.getObject('widgets').find({ filters: [['page', '=', apiName]] });
77
+ }
71
78
  page.options = {};
72
79
  for (const widget of page.widgets) {
73
80
  if(widget.type === 'charts'){