@steedos/service-ui 2.6.1-beta.7 → 2.6.2-beta.10
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/client/cordova.push.client.js +112 -0
- package/main/default/routes/objects.router.js +1 -1
- package/package.json +5 -5
- package/package.service.js +2 -2
- package/public/cordova.i18n.js +28 -0
- package/public/steedos-init.js +4 -39
- package/src/routes/objects.router.ts +3 -3
- package/main/default/tabs/.gitkeep +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
if (Meteor.isCordova) {
|
|
2
|
+
Meteor.startup(function () {
|
|
3
|
+
const hasRegister = function () {
|
|
4
|
+
let has = false;
|
|
5
|
+
if (Push.push.handlers.notification && Push.push.handlers.notification.length > 0) {
|
|
6
|
+
Push.push.handlers.notification.forEach(function (handler) {
|
|
7
|
+
if (handler.toString().indexOf('push.setApplicationIconBadgeNumber') > 0) {
|
|
8
|
+
has = true
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
return has;
|
|
13
|
+
}
|
|
14
|
+
document.addEventListener("deviceready", function () {
|
|
15
|
+
return window.setTimeout(function () {
|
|
16
|
+
var ref, ref1;
|
|
17
|
+
|
|
18
|
+
if (hasRegister() == true) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
console.log('app注册push失败, 由client js注册push')
|
|
22
|
+
Push.push.on("notification", function (data) {
|
|
23
|
+
var host, path;
|
|
24
|
+
if (data.additionalData.foreground === true) {
|
|
25
|
+
if (data.count > -1) {
|
|
26
|
+
push.setApplicationIconBadgeNumber(
|
|
27
|
+
function () { },
|
|
28
|
+
function () { },
|
|
29
|
+
data.count
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (typeof data.additionalData.ejson === "string") {
|
|
35
|
+
data.additionalData.ejson = JSON.parse(data.additionalData.ejson);
|
|
36
|
+
}
|
|
37
|
+
host = data.additionalData.ejson.host;
|
|
38
|
+
if (host == null) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
host = host.replace(/\/$/, "");
|
|
42
|
+
if (Servers.serverExists(host) !== true) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
window.AUTOLOAD = false;
|
|
46
|
+
if (data.additionalData.ejson.url) {
|
|
47
|
+
return FlowRouter.go(data.additionalData.ejson.url);
|
|
48
|
+
} else {
|
|
49
|
+
path = "";
|
|
50
|
+
if (
|
|
51
|
+
data.additionalData.ejson.space &&
|
|
52
|
+
data.additionalData.ejson.instance
|
|
53
|
+
) {
|
|
54
|
+
path =
|
|
55
|
+
"workflow/space/" +
|
|
56
|
+
data.additionalData.ejson.space +
|
|
57
|
+
"/inbox/" +
|
|
58
|
+
data.additionalData.ejson.instance;
|
|
59
|
+
}
|
|
60
|
+
navigator.splashscreen.hide();
|
|
61
|
+
if (window.Session && window.Session.get("spaceId")) {
|
|
62
|
+
return FlowRouter.go("/" + path);
|
|
63
|
+
} else {
|
|
64
|
+
return Servers.startServer(host, path, function (err, url) {
|
|
65
|
+
if (err != null) {
|
|
66
|
+
return console.log(err);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
if (
|
|
73
|
+
((ref = device.manufacturer) != null ? ref.toLowerCase() : void 0) ===
|
|
74
|
+
"huawei" &&
|
|
75
|
+
cordova.plugins.huaweipush
|
|
76
|
+
) {
|
|
77
|
+
cordova.plugins.huaweipush.init();
|
|
78
|
+
return document.addEventListener(
|
|
79
|
+
"huaweipush.receiveRegisterResult",
|
|
80
|
+
function (event) {
|
|
81
|
+
var registrationId;
|
|
82
|
+
console.log(event);
|
|
83
|
+
registrationId = "huawei:" + event.token;
|
|
84
|
+
Push.push.emit("registration", {
|
|
85
|
+
registrationId: registrationId,
|
|
86
|
+
});
|
|
87
|
+
}.bind(this),
|
|
88
|
+
false
|
|
89
|
+
);
|
|
90
|
+
} else if (
|
|
91
|
+
((ref1 = device.manufacturer) != null ? ref1.toLowerCase() : void 0) ===
|
|
92
|
+
"xiaomi" &&
|
|
93
|
+
window.plugins.MiPushPlugin
|
|
94
|
+
) {
|
|
95
|
+
window.plugins.MiPushPlugin.init();
|
|
96
|
+
return document.addEventListener(
|
|
97
|
+
"mipush.receiveRegisterResult",
|
|
98
|
+
function (data) {
|
|
99
|
+
var registrationId;
|
|
100
|
+
console.log(data);
|
|
101
|
+
registrationId = "mi:" + data.regId;
|
|
102
|
+
Push.push.emit("registration", {
|
|
103
|
+
registrationId: registrationId,
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
false
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}, 1000);
|
|
110
|
+
});
|
|
111
|
+
})
|
|
112
|
+
}
|
|
@@ -64,7 +64,7 @@ router.get('/service/api/:objectServiceName/uiSchema', core.requireAuthenticatio
|
|
|
64
64
|
const objectName = objectServiceName.substring(1);
|
|
65
65
|
const [result, hasImportTemplates] = yield Promise.all([
|
|
66
66
|
callObjectServiceAction(`objectql.getRecordView`, userSession, { objectName }),
|
|
67
|
-
callObjectServiceAction(
|
|
67
|
+
callObjectServiceAction(`@steedos/data-import.hasImportTemplates`, userSession, {
|
|
68
68
|
objectName: objectName
|
|
69
69
|
})
|
|
70
70
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-ui",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2-beta.10",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"steedos"
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"description": "steedos package",
|
|
12
12
|
"repository": {},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@steedos/core": "2.6.
|
|
15
|
-
"@steedos/i18n": "2.6.
|
|
16
|
-
"@steedos/objectql": "2.6.
|
|
14
|
+
"@steedos/core": "2.6.2-beta.10",
|
|
15
|
+
"@steedos/i18n": "2.6.2-beta.10",
|
|
16
|
+
"@steedos/objectql": "2.6.2-beta.10",
|
|
17
17
|
"express": "4.18.1"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "afbd1c34d1516e44494b5d5a192bbce80e48af93"
|
|
25
25
|
}
|
package/package.service.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2022-06-11 18:09:20
|
|
4
4
|
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2022-06-15 18:08:40
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
"use strict";
|
|
@@ -65,7 +65,7 @@ module.exports = {
|
|
|
65
65
|
* Service started lifecycle event handler
|
|
66
66
|
*/
|
|
67
67
|
async started() {
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
},
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
window._languages = {};
|
|
2
|
+
axios.get("/shared/i18n/en.i18n.json").then(function(result){
|
|
3
|
+
window._languages['en'] = result.data;
|
|
4
|
+
if(!window.languages){
|
|
5
|
+
var sId = setInterval(function(){
|
|
6
|
+
if(window.languages){
|
|
7
|
+
window.languages['en'] = result.data;
|
|
8
|
+
clearInterval(sId)
|
|
9
|
+
}
|
|
10
|
+
}, 10)
|
|
11
|
+
}else{
|
|
12
|
+
window.languages['en'] = result.data;
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
axios.get("/shared/i18n/zh.i18n.json").then(function(result){
|
|
17
|
+
window._languages['zh'] = result.data;
|
|
18
|
+
if(!window.languages){
|
|
19
|
+
var sId = setInterval(function(){
|
|
20
|
+
if(window.languages){
|
|
21
|
+
window.languages['zh'] = result.data;
|
|
22
|
+
clearInterval(sId)
|
|
23
|
+
}
|
|
24
|
+
}, 10)
|
|
25
|
+
}else{
|
|
26
|
+
window.languages['zh'] = result.data;
|
|
27
|
+
}
|
|
28
|
+
})
|
package/public/steedos-init.js
CHANGED
|
@@ -1,47 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2023-02-26 15:22:12
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime: 2023-
|
|
4
|
+
* @LastEditors: liaodaxue
|
|
5
|
+
* @LastEditTime: 2023-12-11 15:35:34
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
function _innerWaitForThing(obj, path, func){
|
|
11
|
-
const timeGap = 100;
|
|
12
|
-
return new Promise((resolve, reject) => {
|
|
13
|
-
setTimeout(() => {
|
|
14
|
-
let thing = null;
|
|
15
|
-
if(lodash.isFunction(func)){
|
|
16
|
-
thing = func(obj, path);
|
|
17
|
-
}else{
|
|
18
|
-
thing = lodash.get(obj, path);
|
|
19
|
-
}
|
|
20
|
-
// console.log(`_innerWaitForThing`, path)
|
|
21
|
-
if (thing) {
|
|
22
|
-
return resolve(thing);
|
|
23
|
-
}
|
|
24
|
-
reject();
|
|
25
|
-
}, timeGap);
|
|
26
|
-
}).catch(() => {
|
|
27
|
-
return _innerWaitForThing(obj, path, func);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
window.waitForThing=(obj, path, func)=>{
|
|
32
|
-
let thing = null;
|
|
33
|
-
if(lodash.isFunction(func)){
|
|
34
|
-
thing = func(obj, path);
|
|
35
|
-
}else{
|
|
36
|
-
thing = lodash.get(obj, path);
|
|
37
|
-
}
|
|
38
|
-
if (thing) {
|
|
39
|
-
return Promise.resolve(thing);
|
|
40
|
-
}
|
|
41
|
-
return _innerWaitForThing(obj, path, func);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
|
|
45
9
|
Steedos.authRequest = function (url, options) {
|
|
46
10
|
var userSession = Creator.USER_CONTEXT;
|
|
47
11
|
var spaceId = userSession.spaceId;
|
|
@@ -174,7 +138,8 @@ try {
|
|
|
174
138
|
|
|
175
139
|
window.getFirstListView = (objectName) => {
|
|
176
140
|
const uiSchema = window.getUISchemaSync(objectName);
|
|
177
|
-
|
|
141
|
+
const disabled_list_views = uiSchema.permissions.disabled_list_views;
|
|
142
|
+
return _.first(_.sortBy(_.values(_.filter(uiSchema.list_views,function(o) { return disabled_list_views.indexOf(o._id)<0; })), "sort_no"));
|
|
178
143
|
};
|
|
179
144
|
|
|
180
145
|
window.getAppsSync = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2022-06-09 10:19:47
|
|
4
|
-
* @LastEditors: sunhaolin@
|
|
5
|
-
* @LastEditTime: 2023-
|
|
4
|
+
* @LastEditors: 孙浩林 sunhaolin@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-11-14 11:11:06
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
import { getSteedosSchema } from "@steedos/objectql";
|
|
@@ -63,7 +63,7 @@ router.get('/service/api/:objectServiceName/uiSchema', core.requireAuthenticatio
|
|
|
63
63
|
const objectName = objectServiceName.substring(1);
|
|
64
64
|
const [ result, hasImportTemplates ] = await Promise.all([
|
|
65
65
|
callObjectServiceAction(`objectql.getRecordView`, userSession, { objectName }),
|
|
66
|
-
callObjectServiceAction(
|
|
66
|
+
callObjectServiceAction(`@steedos/data-import.hasImportTemplates`, userSession, {
|
|
67
67
|
objectName: objectName
|
|
68
68
|
})
|
|
69
69
|
])
|
|
File without changes
|