@etsoo/react 1.3.34 → 1.3.38

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.
@@ -142,7 +142,7 @@ export class ReactApp extends CoreApp {
142
142
  await callback();
143
143
  else
144
144
  await this.tryLogin();
145
- }, {
145
+ }, undefined, {
146
146
  okLabel: labels.cancel,
147
147
  primaryButton: { fullWidth: true, autoFocus: false },
148
148
  inputs: progress
@@ -25,6 +25,10 @@ export declare class ServiceApp<P extends IServicePageData = IServicePageData, U
25
25
  * @param name Application name
26
26
  */
27
27
  constructor(settings: S, name: string);
28
+ /**
29
+ * Go to the login page
30
+ */
31
+ toLoginPage(): void;
28
32
  /**
29
33
  * User login extended
30
34
  * @param user New user
@@ -1,4 +1,5 @@
1
1
  import { createClient } from '@etsoo/appscript';
2
+ import { DomUtils } from '@etsoo/shared';
2
3
  import { ReactApp } from './ReactApp';
3
4
  /**
4
5
  * Core Service App
@@ -24,6 +25,20 @@ export class ServiceApp extends ReactApp {
24
25
  this.setApi(api);
25
26
  this.coreApi = api;
26
27
  }
28
+ /**
29
+ * Go to the login page
30
+ */
31
+ toLoginPage() {
32
+ const coreUrl = this.settings.coreApi;
33
+ window.location.href =
34
+ coreUrl +
35
+ '?serviceId=' +
36
+ this.settings.serviceId +
37
+ '&' +
38
+ DomUtils.Culture +
39
+ '=' +
40
+ this.culture;
41
+ }
27
42
  /**
28
43
  * User login extended
29
44
  * @param user New user
@@ -36,6 +51,6 @@ export class ServiceApp extends ReactApp {
36
51
  // Core system user
37
52
  this.coreUser = coreUser;
38
53
  // Core system API token
39
- this.api.authorize(this.settings.authScheme, coreUser.token);
54
+ this.coreApi.authorize(this.settings.authScheme, coreUser.token);
40
55
  }
41
56
  }
@@ -350,7 +350,7 @@ export class NotifierMU extends NotifierReact {
350
350
  */
351
351
  addRaw(data, modal) {
352
352
  // Destruct
353
- const { type, content, title, align, timespan, ...rest } = data;
353
+ const { type, content, title, align, timespan = modal ? 0 : undefined, ...rest } = data;
354
354
  // Setup
355
355
  const n = new NotificationMU(type, content, title, align, timespan);
356
356
  // Assign other properties
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.3.34",
3
+ "version": "1.3.38",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,8 +50,8 @@
50
50
  "@emotion/react": "^11.7.0",
51
51
  "@emotion/style": "^0.8.0",
52
52
  "@emotion/styled": "^11.6.0",
53
- "@etsoo/appscript": "^1.1.50",
54
- "@etsoo/notificationbase": "^1.0.93",
53
+ "@etsoo/appscript": "^1.1.53",
54
+ "@etsoo/notificationbase": "^1.0.94",
55
55
  "@etsoo/shared": "^1.0.75",
56
56
  "@mui/icons-material": "^5.2.0",
57
57
  "@mui/material": "^5.2.2",
@@ -87,7 +87,7 @@
87
87
  "eslint-config-airbnb-base": "^15.0.0",
88
88
  "eslint-plugin-import": "^2.25.3",
89
89
  "eslint-plugin-react": "^7.27.1",
90
- "jest": "^27.4.2",
90
+ "jest": "^27.4.3",
91
91
  "react-test-renderer": "^17.0.2",
92
92
  "ts-jest": "^27.0.7",
93
93
  "typescript": "^4.5.2"
@@ -266,6 +266,7 @@ export class ReactApp<
266
266
  if (callback) await callback();
267
267
  else await this.tryLogin();
268
268
  },
269
+ undefined,
269
270
  {
270
271
  okLabel: labels.cancel,
271
272
  primaryButton: { fullWidth: true, autoFocus: false },
@@ -1,4 +1,5 @@
1
1
  import { createClient, IApi } from '@etsoo/appscript';
2
+ import { DomUtils } from '@etsoo/shared';
2
3
  import { ISmartERPUser } from '..';
3
4
  import { IServiceAppSettings } from './IServiceAppSettings';
4
5
  import { IServicePageData } from './IServicePage';
@@ -47,6 +48,21 @@ export class ServiceApp<
47
48
  this.coreApi = api;
48
49
  }
49
50
 
51
+ /**
52
+ * Go to the login page
53
+ */
54
+ override toLoginPage() {
55
+ const coreUrl = this.settings.coreApi;
56
+ window.location.href =
57
+ coreUrl +
58
+ '?serviceId=' +
59
+ this.settings.serviceId +
60
+ '&' +
61
+ DomUtils.Culture +
62
+ '=' +
63
+ this.culture;
64
+ }
65
+
50
66
  /**
51
67
  * User login extended
52
68
  * @param user New user
@@ -65,6 +81,6 @@ export class ServiceApp<
65
81
  this.coreUser = coreUser;
66
82
 
67
83
  // Core system API token
68
- this.api.authorize(this.settings.authScheme, coreUser.token);
84
+ this.coreApi.authorize(this.settings.authScheme, coreUser.token);
69
85
  }
70
86
  }
@@ -581,7 +581,14 @@ export class NotifierMU extends NotifierReact {
581
581
  modal?: boolean
582
582
  ): INotificationReact {
583
583
  // Destruct
584
- const { type, content, title, align, timespan, ...rest } = data;
584
+ const {
585
+ type,
586
+ content,
587
+ title,
588
+ align,
589
+ timespan = modal ? 0 : undefined,
590
+ ...rest
591
+ } = data;
585
592
 
586
593
  // Setup
587
594
  const n = new NotificationMU(type, content, title, align, timespan);