@steedos/service-ui 2.5.5 → 2.6.1-beta.2

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-ui",
3
- "version": "2.5.5",
3
+ "version": "2.6.1-beta.2",
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.5.5",
15
- "@steedos/i18n": "2.5.5",
16
- "@steedos/objectql": "2.5.5",
14
+ "@steedos/core": "2.6.1-beta.2",
15
+ "@steedos/i18n": "2.6.1-beta.2",
16
+ "@steedos/objectql": "2.6.1-beta.2",
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": "f1e15b667da1e140e3003bf836d56cd6e36c79e3"
24
+ "gitHead": "9051772a001ba99aeaf026680ef171d508e92b8f"
25
25
  }
@@ -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: 2022-06-15 18:08:40
5
+ * @LastEditTime: 2023-06-06 10:19:04
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
+ this.broker.broadcastLocal('service-ui.started', { name: this.name })
69
69
  },
70
70
 
71
71
  /**
@@ -2,10 +2,46 @@
2
2
  * @Author: baozhoutao@steedos.com
3
3
  * @Date: 2023-02-26 15:22:12
4
4
  * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-04-27 13:22:22
5
+ * @LastEditTime: 2023-06-06 16:55:36
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
+
9
45
  Steedos.authRequest = function (url, options) {
10
46
  var userSession = Creator.USER_CONTEXT;
11
47
  var spaceId = userSession.spaceId;