@steedos/standard-object-database 2.5.0-beta.30 → 2.5.0-beta.33
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/main/default/objects/object_triggers.object.yml +6 -1
- package/main/default/objects/objects.object.yml +1 -0
- package/main/default/pages/object_detail.page.amis.json +22 -2
- package/main/default/services/database-objects.service.js +24 -2
- package/main/default/services/suggestions.service.js +6 -4
- package/package.json +2 -2
|
@@ -59,7 +59,12 @@ fields:
|
|
|
59
59
|
is_wide: true
|
|
60
60
|
required: true
|
|
61
61
|
defaultValue: |-
|
|
62
|
-
|
|
62
|
+
// _ : lodash
|
|
63
|
+
// moment: moment
|
|
64
|
+
// validator: validator
|
|
65
|
+
// ctx
|
|
66
|
+
// objects
|
|
67
|
+
// services
|
|
63
68
|
editorDidMount: |-
|
|
64
69
|
if(window._registerCompletionItemProviderTrigger){
|
|
65
70
|
return ;
|
|
@@ -182,10 +182,29 @@
|
|
|
182
182
|
"className": "object-detail-tabs mt-3 bg-white border-b sm:shadow sm:rounded sm:border border-slate-300",
|
|
183
183
|
"toolbarClassName": "",
|
|
184
184
|
"linksClassName": "",
|
|
185
|
-
"contentClassName": "bg-white"
|
|
185
|
+
"contentClassName": "bg-white",
|
|
186
|
+
"onEvent": {
|
|
187
|
+
"change": {
|
|
188
|
+
"weight": 0,
|
|
189
|
+
"actions": [
|
|
190
|
+
{
|
|
191
|
+
"actionType": "custom",
|
|
192
|
+
"script": "var objectName = event.data._master?.record?.name;\nvar activeKey = event.data.value;\nif (objectName && activeKey) { \n var activeKeys = {};\n activeKeys[objectName] = activeKey;\n sessionStorage.setItem(\"object_detail_tabs_activeKeys\", JSON.stringify(activeKeys));\n}"
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"recordLoaded": {
|
|
197
|
+
"weight": 0,
|
|
198
|
+
"actions": [
|
|
199
|
+
{
|
|
200
|
+
"actionType": "custom",
|
|
201
|
+
"script": "var activeKeys = sessionStorage.getItem(\"object_detail_tabs_activeKeys\");\nvar objectName = event.data.record?.name;\nif (activeKeys && objectName) {\n activeKeys = JSON.parse(activeKeys);\n var activeKey = activeKeys[objectName];\n if (activeKey) {\n doAction({\n actionType: 'changeActiveKey',\n args: {\n activeKey: activeKey\n }\n });\n }\n}"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
}
|
|
186
206
|
}
|
|
187
207
|
],
|
|
188
|
-
"objectApiName": "${objectName}",
|
|
189
208
|
"data": {
|
|
190
209
|
"objectName": "objects",
|
|
191
210
|
"recordId": "space_users",
|
|
@@ -197,6 +216,7 @@
|
|
|
197
216
|
}
|
|
198
217
|
},
|
|
199
218
|
"id": "page_objects_record_detail",
|
|
219
|
+
"objectApiName": "${objectName}",
|
|
200
220
|
"name": "page_objects_record_detail",
|
|
201
221
|
"bodyClassName": "",
|
|
202
222
|
"className": "object-detail-page"
|
|
@@ -2,11 +2,30 @@
|
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2023-04-21 16:25:07
|
|
4
4
|
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
-
* @LastEditTime: 2023-
|
|
5
|
+
* @LastEditTime: 2023-05-18 09:26:18
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
var packageServiceName = '~database-objects'
|
|
9
|
-
|
|
9
|
+
function isPatternTrigger(data){
|
|
10
|
+
const {listenTo} = data;
|
|
11
|
+
if(listenTo === '*'){
|
|
12
|
+
return true;
|
|
13
|
+
}else if(_.isArray(listenTo)){
|
|
14
|
+
return true;
|
|
15
|
+
}else if(_.isRegExp(listenTo)){
|
|
16
|
+
return true;
|
|
17
|
+
}else if(_.isString(listenTo) && listenTo.startsWith("/")){
|
|
18
|
+
try {
|
|
19
|
+
if(_.isRegExp(eval(listenTo))){
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
} catch (error) {
|
|
23
|
+
return false
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
10
29
|
module.exports = {
|
|
11
30
|
name: packageServiceName,
|
|
12
31
|
namespace: "steedos",
|
|
@@ -33,6 +52,9 @@ module.exports = {
|
|
|
33
52
|
methods: {
|
|
34
53
|
changeTriggerMetadata: {
|
|
35
54
|
async handler(trigger){
|
|
55
|
+
if(isPatternTrigger(trigger)){
|
|
56
|
+
trigger.isPattern = true
|
|
57
|
+
}
|
|
36
58
|
await this.broker.call(`object_triggers.add`, { apiName: `${trigger.listenTo}.${trigger.name}`, data: trigger }, {
|
|
37
59
|
meta: {
|
|
38
60
|
metadataServiceName: packageServiceName,
|
|
@@ -63,11 +63,13 @@ module.exports = {
|
|
|
63
63
|
|
|
64
64
|
declare type CTXType = {
|
|
65
65
|
params: TriggerParams;
|
|
66
|
-
meta: any;
|
|
67
|
-
call: any;
|
|
68
|
-
emit: any;
|
|
69
|
-
broadcast: any;
|
|
70
66
|
broker: {
|
|
67
|
+
meta: any;
|
|
68
|
+
call: any;
|
|
69
|
+
mcall: any;
|
|
70
|
+
emit: any;
|
|
71
|
+
broadcast: any;
|
|
72
|
+
broadcastLocal: any;
|
|
71
73
|
namespace: string;
|
|
72
74
|
nodeID: string;
|
|
73
75
|
instanceID: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-object-database",
|
|
3
|
-
"version": "2.5.0-beta.
|
|
3
|
+
"version": "2.5.0-beta.33",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
},
|
|
16
16
|
"repository": {},
|
|
17
17
|
"license": "MIT",
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "370c9eaa707a6932f3eb12fb3d711e679bcd2484"
|
|
19
19
|
}
|