@etsoo/react 1.5.4 → 1.5.8
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/lib/app/ServiceApp.js +9 -11
- package/package.json +2 -2
- package/src/app/ServiceApp.ts +11 -10
package/lib/app/ServiceApp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createClient } from '@etsoo/appscript';
|
|
1
|
+
import { BridgeUtils, createClient } from '@etsoo/appscript';
|
|
2
2
|
import { DomUtils } from '@etsoo/shared';
|
|
3
3
|
import { CoreConstants } from './CoreConstants';
|
|
4
4
|
import { ReactApp } from './ReactApp';
|
|
@@ -44,16 +44,14 @@ export class ServiceApp extends ReactApp {
|
|
|
44
44
|
* @param tryLogin Try to login again
|
|
45
45
|
*/
|
|
46
46
|
toLoginPage(tryLogin) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
coreUrl
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this.culture +
|
|
56
|
-
(tryLogin ? '' : '&tryLogin=false');
|
|
47
|
+
const parameters = `?serviceId=${this.settings.serviceId}&${DomUtils.CultureField}=${this.culture}${tryLogin ? '' : '&tryLogin=false'}`;
|
|
48
|
+
if (BridgeUtils.host == null) {
|
|
49
|
+
const coreUrl = this.settings.webUrl;
|
|
50
|
+
window.location.href = coreUrl + parameters;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
BridgeUtils.host.loadApp('core', parameters);
|
|
54
|
+
}
|
|
57
55
|
}
|
|
58
56
|
/**
|
|
59
57
|
* Refresh token
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@emotion/react": "^11.7.1",
|
|
51
51
|
"@emotion/style": "^0.8.0",
|
|
52
52
|
"@emotion/styled": "^11.6.0",
|
|
53
|
-
"@etsoo/appscript": "^1.2.
|
|
53
|
+
"@etsoo/appscript": "^1.2.47",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.1",
|
|
55
55
|
"@etsoo/shared": "^1.1.11",
|
|
56
56
|
"@mui/icons-material": "^5.4.1",
|
package/src/app/ServiceApp.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BridgeUtils,
|
|
2
3
|
createClient,
|
|
3
4
|
IApi,
|
|
4
5
|
IApiPayload,
|
|
@@ -72,16 +73,16 @@ export class ServiceApp<
|
|
|
72
73
|
* @param tryLogin Try to login again
|
|
73
74
|
*/
|
|
74
75
|
override toLoginPage(tryLogin?: boolean) {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
const parameters = `?serviceId=${this.settings.serviceId}&${
|
|
77
|
+
DomUtils.CultureField
|
|
78
|
+
}=${this.culture}${tryLogin ? '' : '&tryLogin=false'}`;
|
|
79
|
+
|
|
80
|
+
if (BridgeUtils.host == null) {
|
|
81
|
+
const coreUrl = this.settings.webUrl;
|
|
82
|
+
window.location.href = coreUrl + parameters;
|
|
83
|
+
} else {
|
|
84
|
+
BridgeUtils.host.loadApp('core', parameters);
|
|
85
|
+
}
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
/**
|