@steedos/service-pages 2.2.24 → 2.2.25

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.
@@ -5,4 +5,6 @@ reference_to: apps
5
5
  reference_to_field: code
6
6
  filters:
7
7
  - ['code','!=','admin']
8
- sort_no: 120
8
+ sort_no: 120
9
+ required: "{{(formData.type == 'appDefault' || formData.type == 'appRecordProfile') ? true : false}}"
10
+ visible_on: "{{(formData.type == 'appDefault' || formData.type == 'appRecordProfile') ? true : false}}"
@@ -1,6 +1,6 @@
1
1
  name: is_system
2
2
  type: boolean
3
- label: System
3
+ label: 系统
4
4
  visible_on: "{{global.mode ==='read' ? true : false}}"
5
5
  readonly: true
6
6
  disabled: true
@@ -2,4 +2,5 @@ name: page
2
2
  label: 页面
3
3
  type: master_detail
4
4
  reference_to: pages
5
- sort_no: 110
5
+ sort_no: 110
6
+ required: true
@@ -4,5 +4,6 @@ label: 简档
4
4
  reference_to: permission_set
5
5
  filters:
6
6
  - ["type","=","profile"]
7
- visible_on: "{{formData.app ? true: false}}"
8
- sort_no: 125
7
+ sort_no: 125
8
+ required: "{{formData.type == 'appRecordProfile' ? true : false}}"
9
+ visible_on: "{{formData.type == 'appRecordProfile' ? true : false}}"
@@ -0,0 +1,12 @@
1
+ name: type
2
+ label: 授权类型
3
+ type: select
4
+ required: true
5
+ defaultValue: orgDefault
6
+ options:
7
+ - label: 组织默认设置
8
+ value: orgDefault
9
+ - label: 应用程序默认设置
10
+ value: appDefault
11
+ - label: 应用程序和简档
12
+ value: appRecordProfile
@@ -1,5 +1,6 @@
1
1
  name: all
2
2
  columns:
3
+ - field: type
3
4
  - field: app
4
5
  - field: profile
5
6
  - field: record_type
@@ -1,5 +1,6 @@
1
1
  name: recent
2
2
  columns:
3
+ - field: type
3
4
  - field: app
4
5
  - field: profile
5
6
  - field: record_type
@@ -7,7 +7,7 @@ enable_chatter: false
7
7
  enable_enhanced_lookup: false
8
8
  enable_events: false
9
9
  enable_files: false
10
- enable_inline_edit: true
10
+ enable_inline_edit: false
11
11
  enable_instances: false
12
12
  enable_notes: false
13
13
  enable_search: false
@@ -10,6 +10,37 @@ module.exports = {
10
10
  throw new Error('禁止给应用程序页面分配权限');
11
11
  }
12
12
  }
13
+
14
+ if(doc.type === 'orgDefault'){
15
+ delete doc.app;
16
+ delete doc.profile;
17
+ }
18
+
19
+ if(doc.type === 'appDefault'){
20
+ delete doc.profile;
21
+ }
22
+
23
+ if(doc.type === 'orgDefault'){
24
+ const count = await objectql.getObject('page_assignments').count({filters: [['page', '=', doc.page], ['type', '=', doc.type]]})
25
+ if(count > 0){
26
+ throw new Error("已存在「组织默认设置」授权")
27
+ }
28
+ }
29
+
30
+ if(doc.type === 'appDefault'){
31
+ const count = await objectql.getObject('page_assignments').count({filters: [['page', '=', doc.page], ['type', '=', doc.type], ['app', '=', doc.app]]})
32
+ if(count > 0){
33
+ throw new Error("已存在「应用程序默认设置」授权")
34
+ }
35
+ }
36
+
37
+ if(doc.type === 'appRecordProfile'){
38
+ const count = await objectql.getObject('page_assignments').count({filters: [['page', '=', doc.page], ['type', '=', doc.type], ['app', '=', doc.app], ['profile', '=', doc.profile]]})
39
+ if(count > 0){
40
+ throw new Error("已存在「应用程序和简档」授权")
41
+ }
42
+ }
43
+
13
44
  },
14
45
  beforeUpdate: async function(){
15
46
  const {object_name, doc, spaceId, id} = this;
@@ -19,5 +50,35 @@ module.exports = {
19
50
  throw new Error('禁止给应用程序页面分配权限');
20
51
  }
21
52
  }
53
+
54
+ if(doc.type === 'orgDefault'){
55
+ doc.app = null;
56
+ doc.profile = null;
57
+ }
58
+
59
+ if(doc.type === 'appDefault'){
60
+ doc.profile = null;
61
+ }
62
+
63
+ if(doc.type === 'orgDefault'){
64
+ const count = await objectql.getObject('page_assignments').count({filters: [['_id', '!=', id], ['page', '=', doc.page], ['type', '=', doc.type]]})
65
+ if(count > 0){
66
+ throw new Error("已存在「组织默认设置」授权")
67
+ }
68
+ }
69
+
70
+ if(doc.type === 'appDefault'){
71
+ const count = await objectql.getObject('page_assignments').count({filters: [['_id', '!=', id], ['page', '=', doc.page], ['type', '=', doc.type], ['app', '=', doc.app]]})
72
+ if(count > 0){
73
+ throw new Error("已存在「应用程序默认设置」授权")
74
+ }
75
+ }
76
+
77
+ if(doc.type === 'appRecordProfile'){
78
+ const count = await objectql.getObject('page_assignments').count({filters: [['_id', '!=', id], ['page', '=', doc.page], ['type', '=', doc.type], ['app', '=', doc.app], ['profile', '=', doc.profile]]})
79
+ if(count > 0){
80
+ throw new Error("已存在「应用程序和简档」授权")
81
+ }
82
+ }
22
83
  }
23
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-pages",
3
- "version": "2.2.24",
3
+ "version": "2.2.25",
4
4
  "main": "package.service.js",
5
5
  "scripts": {},
6
6
  "license": "MIT",
@@ -11,5 +11,5 @@
11
11
  "dependencies": {
12
12
  "@builder.io/react": "^1.1.50"
13
13
  },
14
- "gitHead": "4650f826343d41eb0ccafabc73c721e24b04f50f"
14
+ "gitHead": "e81092f007bce951b627a5c28e286032afbba1fb"
15
15
  }