@steedos/standard-process-approval 2.3.6 → 2.3.7

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.
Files changed (22) hide show
  1. package/main/default/client/core.client.js +1 -1
  2. package/main/default/client/process.client.js +1 -2
  3. package/main/default/objects/process/approval/process_definition.action.js +1 -2
  4. package/main/default/objects/process/approval/process_definition.object.yml +5 -1
  5. package/main/default/objects/process/process_instance/process_instance.object.yml +1 -1
  6. package/main/default/objects/{process_instance_history → process/process_instance}/process_instance_history.object.yml +0 -0
  7. package/main/default/objects/workflow-actions/action_field_updates.action.js +1 -2
  8. package/main/default/objects/workflow-actions/action_field_updates.object.yml +5 -5
  9. package/main/default/objects/workflow-actions/workflow_notifications.action.js +1 -2
  10. package/main/default/objects/workflow-actions/workflow_notifications.object.yml +4 -2
  11. package/main/default/objects/workflow-actions/workflow_rule.action.js +1 -2
  12. package/main/default/objects/workflow-actions/workflow_rule.object.yml +4 -2
  13. package/package.json +3 -3
  14. package/package.service.js +2 -3
  15. package/main/default/objects/process_instance_history/buttons/approve.button.js +0 -12
  16. package/main/default/objects/process_instance_history/buttons/approve.button.yml +0 -105
  17. package/main/default/objects/process_instance_history/buttons/reassign.button.js +0 -12
  18. package/main/default/objects/process_instance_history/buttons/reassign.button.yml +0 -104
  19. package/main/default/objects/process_instance_history/buttons/recall.button.js +0 -5
  20. package/main/default/objects/process_instance_history/buttons/recall.button.yml +0 -97
  21. package/main/default/objects/process_instance_history/buttons/reject.button.js +0 -12
  22. package/main/default/objects/process_instance_history/buttons/reject.button.yml +0 -97
@@ -74,7 +74,7 @@ Steedos.getDisplayObjects = function(filterFunction){
74
74
  if (filterFunction && _.isFunction(filterFunction)) {
75
75
  filterReturn = filterFunction(object);
76
76
  }
77
- if (filterReturn && !object.hidden && !_.includes(['cfs_instances_filerecord'], object.name)) {
77
+ if (filterReturn && !object.hidden && !_.include(['cfs_instances_filerecord'], object.name)) {
78
78
  objects.push(object)
79
79
  }
80
80
  })
@@ -38,8 +38,7 @@ Steedos.ProcessManager.allowSubmit = function(object_name, record_id){
38
38
  if(!object_name || !record_id){
39
39
  return false;
40
40
  }
41
- const object = this.object || window.Creator?.getObject(object_name)
42
- if(!object.enable_process){
41
+ if(!Creator.getObject(object_name).enable_process){
43
42
  return false;
44
43
  }
45
44
  var result = Steedos.authRequest(`/api/v4/process/permission/submit/${object_name}/${record_id}`, {type: 'get', async: false});
@@ -56,8 +56,7 @@ module.exports = {
56
56
  }
57
57
  });
58
58
  },
59
- customizeVisible: function (object_name, record_id, record_permissions, data) {
60
- var record = data && data.record;
59
+ customizeVisible: function (object_name, record_id, record_permissions, record) {
61
60
  if (!record) {
62
61
  record = {}
63
62
  }
@@ -18,8 +18,12 @@ fields:
18
18
  is_wide: true
19
19
  filterable: true
20
20
  create: false
21
- reference_to: objects
21
+ # reference_to: objects
22
22
  reference_to_field: name
23
+ optionsFunction: !!js/function |
24
+ function(){
25
+ return Steedos.getObjectsOptions();
26
+ }
23
27
  description:
24
28
  label: Description
25
29
  type: textarea
@@ -6,7 +6,7 @@ fields:
6
6
  name:
7
7
  type: text
8
8
  process_definition:
9
- type: lookup
9
+ type: master_detail
10
10
  is_wide: true
11
11
  reference_to: process_definition
12
12
  target_object:
@@ -24,8 +24,7 @@ module.exports = {
24
24
  }
25
25
  });
26
26
  },
27
- customizeVisible: function(object_name, record_id, record_permissions, data){
28
- var record = data && data.record;
27
+ customizeVisible: function(object_name, record_id, record_permissions, record){
29
28
  if(!record){
30
29
  record = {}
31
30
  }
@@ -3,7 +3,7 @@ label: Field Updates
3
3
  icon: record
4
4
  hidden: true
5
5
  enable_inline_edit: false
6
- version: 2
6
+ # version: 2
7
7
  enable_enhanced_lookup: true
8
8
  fields:
9
9
  name:
@@ -16,8 +16,10 @@ fields:
16
16
  object_name:
17
17
  label: Object Name
18
18
  type: lookup
19
- reference_to: objects
20
- reference_to_field: name
19
+ optionsFunction: !!js/function |
20
+ function () {
21
+ return Steedos.getObjectsOptions();
22
+ }
21
23
  target_object:
22
24
  type: lookup
23
25
  label: Object to Update
@@ -125,12 +127,10 @@ fields:
125
127
  formula:
126
128
  type: textarea
127
129
  is_wide: true
128
- visible_on: "{{formData.operation === 'formula' ? true: false}}"
129
130
  literal_value:
130
131
  type: text
131
132
  is_wide: true
132
133
  label: Literal value
133
- visible_on: "{{formData.operation === 'literal' ? true: false}}"
134
134
  notify_assignee:
135
135
  type: boolean
136
136
  hidden: true
@@ -24,8 +24,7 @@ module.exports = {
24
24
  }
25
25
  });
26
26
  },
27
- customizeVisible: function(object_name, record_id, record_permissions, data){
28
- var record = data && data.record;
27
+ customizeVisible: function(object_name, record_id, record_permissions, record){
29
28
  if(!record){
30
29
  record = {}
31
30
  }
@@ -21,8 +21,10 @@ fields:
21
21
  type: lookup
22
22
  required: true
23
23
  is_wide: true
24
- reference_to: objects
25
- reference_to_field: name
24
+ optionsFunction: !!js/function |
25
+ function () {
26
+ return Steedos.getObjectsOptions();
27
+ }
26
28
  title:
27
29
  label: Title
28
30
  type: textarea
@@ -24,8 +24,7 @@ module.exports = {
24
24
  }
25
25
  });
26
26
  },
27
- customizeVisible: function(object_name, record_id, record_permissions, data){
28
- var record = data && data.record;
27
+ customizeVisible: function(object_name, record_id, record_permissions, record){
29
28
  if(!record){
30
29
  record = {}
31
30
  }
@@ -10,8 +10,10 @@ fields:
10
10
  type: lookup
11
11
  required: true
12
12
  is_wide: true
13
- reference_to: objects
14
- reference_to_field: name
13
+ optionsFunction: !!js/function |
14
+ function () {
15
+ return Steedos.getObjectsOptions();
16
+ }
15
17
  name:
16
18
  type: text
17
19
  required: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-process-approval",
3
- "version": "2.3.6",
3
+ "version": "2.3.7",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -10,10 +10,10 @@
10
10
  "steedos"
11
11
  ],
12
12
  "dependencies": {
13
- "@steedos/process": "2.3.6"
13
+ "@steedos/process": "2.3.7"
14
14
  },
15
15
  "description": "steedos package",
16
16
  "repository": {},
17
17
  "license": "MIT",
18
- "gitHead": "3ef6bf3744c616d6a961b3264e5f204b9697ef6a"
18
+ "gitHead": "e81279db5d8aab35332334cf3eeecf5fd8ead99f"
19
19
  }
@@ -2,7 +2,7 @@
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2022-07-29 09:40:31
4
4
  * @LastEditors: sunhaolin@hotoa.com
5
- * @LastEditTime: 2022-12-09 13:41:05
5
+ * @LastEditTime: 2022-07-29 14:37:14
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
@@ -22,8 +22,7 @@ module.exports = {
22
22
  settings: {
23
23
  packageInfo: {
24
24
  path: __dirname,
25
- name: packageName,
26
- isPackage: false
25
+ name: packageName
27
26
  }
28
27
  },
29
28
 
@@ -1,12 +0,0 @@
1
- /*
2
- * @Author: baozhoutao@steedos.com
3
- * @Date: 2023-01-07 09:43:43
4
- * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-01-07 09:45:30
6
- * @Description:
7
- */
8
- module.exports = {
9
- approveVisible: function(object_name, record_id, record_permissions){
10
- return Steedos.ProcessManager.allowApprover(object_name, record_id)
11
- }
12
- }
@@ -1,105 +0,0 @@
1
- name: approve
2
- amis_schema: |-
3
- {
4
- "type": "service",
5
- "body": [
6
- {
7
- "type": "button",
8
- "label": "批准",
9
- "id": "u:standard_submit_for_approval",
10
- "onEvent": {
11
- "click": {
12
- "actions": [
13
- {
14
- "actionType": "dialog",
15
- "dialog": {
16
- "type": "dialog",
17
- "title": "批准",
18
- "body": [
19
- {
20
- "type": "form",
21
- "id": "u:1eb06e6962d8",
22
- "title": "表单",
23
- "body": [
24
- {
25
- "type": "steedos-field",
26
- "id": "u:9f4486c22f52",
27
- "field": "{\n \"label\": \"意见\",\n \"name\": \"comment\",\n \"type\": \"textarea\",\n \"rows\": 3,\n \"is_wide\": true\n}",
28
- "name": "comment"
29
- },
30
- {
31
- "type": "steedos-field",
32
- "id": "u:9f4486c22f52",
33
- "field": "{\n \"label\": \"选择下一位批准人\",\n \"name\": \"approver\",\n \"type\": \"lookup\",\n \"reference_to\": \"space_users\",\n \"reference_to_field\": \"user\",\n \"required\": true,\n \"is_wide\": true\n}",
34
- "name": "approver",
35
- "placeholder": "",
36
- "visibleOn": "${showApprover === true}"
37
- }
38
- ],
39
- "wrapWithPanel": false,
40
- "mode": "normal",
41
- "api": {
42
- "method": "post",
43
- "url": "${context.rootUrl}/api/v4/process/approve/${objectName}/${recordId}",
44
- "data": {
45
- "&": "$$"
46
- },
47
- "requestAdaptor": "console.log(\"api\", api)\n\napi.data = {\n comment: api.body.comment\n};\n\nif (api.body.approver) {\n api.data.approver = api.body.approver;\n}\n\nreturn api;",
48
- "adaptor": "console.log(\"payload====>\", payload);\npayload.data = {};\npayload.data.showApprover = payload.error === 'process_approval_error_needToChooseApprover'\n\nif (payload.state === 'FAILURE') {\n if (payload.data.showApprover) {\n payload.msg = \"请选择下一位批准人\";\n } else { \n payload.msg = window.t(payload.error)\n }\n}\n\n\nreturn payload;",
49
- "responseData": {
50
- "&": "$$"
51
- },
52
- "headers": {
53
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
54
- }
55
- },
56
- "debug": false,
57
- "onEvent": {
58
- "submitSucc": {
59
- "weight": 0,
60
- "actions": [
61
- {
62
- "actionType": "custom",
63
- "script": "const id = SteedosUI.getRef(event.data.scopeId).getComponents()[0].props.id;doAction({'actionType': 'reload','componentId': id,});"
64
- }
65
- ]
66
- }
67
- }
68
- }
69
- ],
70
- "id": "u:7a3f92e56805",
71
- "closeOnEsc": false,
72
- "closeOnOutside": false,
73
- "showCloseButton": true,
74
- "size": "md"
75
- }
76
- }
77
- ],
78
- "weight": 0
79
- }
80
- }
81
- }
82
- ],
83
- "regions": [
84
- "body"
85
- ],
86
- "data": {
87
- "context": {
88
- "rootUrl": "http://127.0.0.1:5300"
89
- },
90
- "app_id": "",
91
- "tab_id": "",
92
- "object_name": "",
93
- "dataComponentId": "",
94
- "record_id": "",
95
- "record": {},
96
- "permissions": {}
97
- },
98
- "bodyClassName": "p-0",
99
- "id": "u:50444554a302"
100
- }
101
- is_enable: true
102
- label: 核准
103
- 'on': record_only
104
- type: amis_button
105
- visible: true
@@ -1,12 +0,0 @@
1
- /*
2
- * @Author: baozhoutao@steedos.com
3
- * @Date: 2023-01-07 09:44:02
4
- * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-01-07 09:45:48
6
- * @Description:
7
- */
8
- module.exports = {
9
- reassignVisible: function(object_name, record_id, record_permissions){
10
- return Steedos.ProcessManager.allowApprover(object_name, record_id)
11
- }
12
- }
@@ -1,104 +0,0 @@
1
- name: reassign
2
- amis_schema: |-
3
- {
4
- "type": "service",
5
- "body": [
6
- {
7
- "type": "button",
8
- "label": "转签核",
9
- "id": "u:standard_submit_for_approval",
10
- "onEvent": {
11
- "click": {
12
- "actions": [
13
- {
14
- "actionType": "dialog",
15
- "dialog": {
16
- "type": "dialog",
17
- "title": "转签核批准请求",
18
- "body": [
19
- {
20
- "type": "form",
21
- "id": "u:1eb06e6962d8",
22
- "title": "表单",
23
- "body": [
24
- {
25
- "type": "steedos-field",
26
- "id": "u:9f4486c22f52",
27
- "field": "{\n \"label\": \"转签核处理人\",\n \"name\": \"approver\",\n \"type\": \"lookup\",\n \"reference_to\": \"space_users\",\n \"reference_to_field\": \"user\",\n \"required\": true,\n \"is_wide\": true\n}",
28
- "name": "approver",
29
- "placeholder": ""
30
- },
31
- {
32
- "type": "steedos-field",
33
- "id": "u:9f4486c22f52",
34
- "field": "{\n \"label\": \"意见\",\n \"name\": \"comment\",\n \"type\": \"textarea\",\n \"rows\": 3,\n \"is_wide\": true\n}",
35
- "name": "comment"
36
- }
37
- ],
38
- "wrapWithPanel": false,
39
- "mode": "normal",
40
- "api": {
41
- "method": "post",
42
- "url": "${context.rootUrl}/api/v4/process/reassign/${objectName}/${recordId}",
43
- "data": {
44
- "&": "$$"
45
- },
46
- "requestAdaptor": "console.log(\"api\", api)\n\napi.data = {\n comment: api.body.comment\n};\n\nif (api.body.approver) {\n api.data.approver = api.body.approver;\n}\n\nreturn api;",
47
- "adaptor": "console.log(\"payload====>\", payload);\nif (payload.state === 'FAILURE') {\n payload.msg = window.t(payload.error)\n}\nreturn payload;",
48
- "responseData": {
49
- "&": "$$"
50
- },
51
- "headers": {
52
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
53
- }
54
- },
55
- "debug": false,
56
- "onEvent": {
57
- "submitSucc": {
58
- "weight": 0,
59
- "actions": [
60
- {
61
- "actionType": "custom",
62
- "script": "const id = SteedosUI.getRef(event.data.scopeId).getComponents()[0].props.id;doAction({'actionType': 'reload','componentId': id,});"
63
- }
64
- ]
65
- }
66
- }
67
- }
68
- ],
69
- "id": "u:7a3f92e56805",
70
- "closeOnEsc": false,
71
- "closeOnOutside": false,
72
- "showCloseButton": true,
73
- "size": "md"
74
- }
75
- }
76
- ],
77
- "weight": 0
78
- }
79
- }
80
- }
81
- ],
82
- "regions": [
83
- "body"
84
- ],
85
- "data": {
86
- "context": {
87
- "rootUrl": "http://127.0.0.1:5300"
88
- },
89
- "app_id": "",
90
- "tab_id": "",
91
- "object_name": "",
92
- "dataComponentId": "",
93
- "record_id": "",
94
- "record": {},
95
- "permissions": {}
96
- },
97
- "bodyClassName": "p-0",
98
- "id": "u:50444554a302"
99
- }
100
- is_enable: true
101
- label: 转签核
102
- 'on': record_only
103
- type: amis_button
104
- visible: true
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- recallVisible: function(){
3
- return Steedos.ProcessManager.allowRecall(Session.get("object_name"), Session.get("record_id"))
4
- }
5
- }
@@ -1,97 +0,0 @@
1
- name: recall
2
- amis_schema: |-
3
- {
4
- "type": "service",
5
- "body": [
6
- {
7
- "type": "button",
8
- "label": "取消申请",
9
- "id": "u:standard_submit_for_approval",
10
- "onEvent": {
11
- "click": {
12
- "actions": [
13
- {
14
- "actionType": "dialog",
15
- "dialog": {
16
- "type": "dialog",
17
- "title": "取消申请",
18
- "body": [
19
- {
20
- "type": "form",
21
- "id": "u:1eb06e6962d8",
22
- "title": "表单",
23
- "body": [
24
- {
25
- "type": "steedos-field",
26
- "id": "u:9f4486c22f52",
27
- "field": "{\n \"label\": \"意见\",\n \"name\": \"comment\",\n \"type\": \"textarea\",\n \"rows\": 3,\n \"is_wide\": true\n}",
28
- "name": "comment"
29
- }
30
- ],
31
- "wrapWithPanel": false,
32
- "mode": "normal",
33
- "api": {
34
- "method": "post",
35
- "url": "${context.rootUrl}/api/v4/process/recall/${objectName}/${recordId}",
36
- "data": {
37
- "&": "$$"
38
- },
39
- "requestAdaptor": "api.data = {\n comment: api.body.comment\n};\nreturn api;",
40
- "adaptor": "console.log(\"payload====>\", payload);\nif (payload.state === 'FAILURE') {\n payload.msg = window.t(payload.error)\n}\n\nreturn payload;",
41
- "responseData": {
42
- "&": "$$"
43
- },
44
- "headers": {
45
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
46
- }
47
- },
48
- "debug": false,
49
- "onEvent": {
50
- "submitSucc": {
51
- "weight": 0,
52
- "actions": [
53
- {
54
- "actionType": "custom",
55
- "script": "const id = SteedosUI.getRef(event.data.scopeId).getComponents()[0].props.id;doAction({'actionType': 'reload','componentId': id,});"
56
- }
57
- ]
58
- }
59
- }
60
- }
61
- ],
62
- "id": "u:7a3f92e56805",
63
- "closeOnEsc": false,
64
- "closeOnOutside": false,
65
- "showCloseButton": true,
66
- "size": "md"
67
- }
68
- }
69
- ],
70
- "weight": 0
71
- }
72
- }
73
- }
74
- ],
75
- "regions": [
76
- "body"
77
- ],
78
- "data": {
79
- "context": {
80
- "rootUrl": "http://127.0.0.1:5300"
81
- },
82
- "app_id": "",
83
- "tab_id": "",
84
- "object_name": "",
85
- "dataComponentId": "",
86
- "record_id": "",
87
- "record": {},
88
- "permissions": {}
89
- },
90
- "bodyClassName": "p-0",
91
- "id": "u:50444554a302"
92
- }
93
- is_enable: true
94
- label: 取消申请
95
- 'on': record_only
96
- type: amis_button
97
- visible: true
@@ -1,12 +0,0 @@
1
- /*
2
- * @Author: baozhoutao@steedos.com
3
- * @Date: 2023-01-07 09:44:36
4
- * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-01-07 09:46:18
6
- * @Description:
7
- */
8
- module.exports = {
9
- rejectVisible: function(object_name, record_id, record_permissions){
10
- return Steedos.ProcessManager.allowApprover(object_name, record_id)
11
- }
12
- }
@@ -1,97 +0,0 @@
1
- name: reject
2
- amis_schema: |-
3
- {
4
- "type": "service",
5
- "body": [
6
- {
7
- "type": "button",
8
- "label": "拒绝",
9
- "id": "u:standard_submit_for_approval",
10
- "onEvent": {
11
- "click": {
12
- "actions": [
13
- {
14
- "actionType": "dialog",
15
- "dialog": {
16
- "type": "dialog",
17
- "title": "拒绝",
18
- "body": [
19
- {
20
- "type": "form",
21
- "id": "u:1eb06e6962d8",
22
- "title": "表单",
23
- "body": [
24
- {
25
- "type": "steedos-field",
26
- "id": "u:9f4486c22f52",
27
- "field": "{\n \"label\": \"意见\",\n \"name\": \"comment\",\n \"type\": \"textarea\",\n \"rows\": 3,\n \"is_wide\": true\n}",
28
- "name": "comment"
29
- }
30
- ],
31
- "wrapWithPanel": false,
32
- "mode": "normal",
33
- "api": {
34
- "method": "post",
35
- "url": "${context.rootUrl}/api/v4/process/reject/${objectName}/${recordId}",
36
- "data": {
37
- "&": "$$"
38
- },
39
- "requestAdaptor": "api.data = {\n comment: api.body.comment\n};\nreturn api;",
40
- "adaptor": "console.log(\"payload====>\", payload);\nif (payload.state === 'FAILURE') {\n payload.msg = window.t(payload.error)\n}\n\nreturn payload;",
41
- "responseData": {
42
- "&": "$$"
43
- },
44
- "headers": {
45
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
46
- }
47
- },
48
- "debug": false,
49
- "onEvent": {
50
- "submitSucc": {
51
- "weight": 0,
52
- "actions": [
53
- {
54
- "actionType": "custom",
55
- "script": "const id = SteedosUI.getRef(event.data.scopeId).getComponents()[0].props.id;doAction({'actionType': 'reload','componentId': id,});"
56
- }
57
- ]
58
- }
59
- }
60
- }
61
- ],
62
- "id": "u:7a3f92e56805",
63
- "closeOnEsc": false,
64
- "closeOnOutside": false,
65
- "showCloseButton": true,
66
- "size": "md"
67
- }
68
- }
69
- ],
70
- "weight": 0
71
- }
72
- }
73
- }
74
- ],
75
- "regions": [
76
- "body"
77
- ],
78
- "data": {
79
- "context": {
80
- "rootUrl": "http://127.0.0.1:5300"
81
- },
82
- "app_id": "",
83
- "tab_id": "",
84
- "object_name": "",
85
- "dataComponentId": "",
86
- "record_id": "",
87
- "record": {},
88
- "permissions": {}
89
- },
90
- "bodyClassName": "p-0",
91
- "id": "u:50444554a302"
92
- }
93
- is_enable: true
94
- label: 拒绝
95
- 'on': record_only
96
- type: amis_button
97
- visible: true