@etsoo/react 1.3.72 → 1.3.76

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.
@@ -1,4 +1,5 @@
1
1
  import { CoreApp, createClient } from '@etsoo/appscript';
2
+ import { WindowStorage } from '@etsoo/shared';
2
3
  import React from 'react';
3
4
  import { NotifierMU } from '../mu/NotifierMU';
4
5
  import { ProgressCount } from '../mu/ProgressCount';
@@ -55,7 +56,11 @@ export class ReactApp extends CoreApp {
55
56
  * @param name Application name
56
57
  */
57
58
  constructor(settings, name) {
58
- super(settings, ReactApp.createApi(settings), ReactApp.createNotifier(), name);
59
+ super(settings, ReactApp.createApi(settings), ReactApp.createNotifier(), new WindowStorage([
60
+ CoreApp.deviceIdField,
61
+ CoreApp.headerTokenField,
62
+ CoreApp.serversideDeviceIdField
63
+ ]), name);
59
64
  /**
60
65
  * User state
61
66
  */
@@ -10,6 +10,10 @@ export declare type RefreshTokenRQ = {
10
10
  * Login password
11
11
  */
12
12
  pwd?: string;
13
+ /**
14
+ * Service device id
15
+ */
16
+ serviceDeviceId?: string;
13
17
  /**
14
18
  * Service id
15
19
  */
@@ -16,14 +16,16 @@ export declare class ServiceApp<P extends IServicePageData = IServicePageData, U
16
16
  * Service API
17
17
  */
18
18
  readonly serviceApi: IApi;
19
+ private _serviceUser?;
19
20
  /**
20
21
  * Service user
21
22
  */
22
- serviceUser?: ISmartERPUser;
23
+ get serviceUser(): IServiceUser | undefined;
24
+ protected set serviceUser(value: IServiceUser | undefined);
23
25
  /**
24
26
  * Service passphrase
25
27
  */
26
- servicePassphrase: string;
28
+ protected servicePassphrase: string;
27
29
  /**
28
30
  * Constructor
29
31
  * @param settings Settings
@@ -30,6 +30,15 @@ export class ServiceApp extends ReactApp {
30
30
  this.setApi(api);
31
31
  this.serviceApi = api;
32
32
  }
33
+ /**
34
+ * Service user
35
+ */
36
+ get serviceUser() {
37
+ return this._serviceUser;
38
+ }
39
+ set serviceUser(value) {
40
+ this._serviceUser = value;
41
+ }
33
42
  /**
34
43
  * Go to the login page
35
44
  */
@@ -39,6 +48,8 @@ export class ServiceApp extends ReactApp {
39
48
  coreUrl +
40
49
  '?serviceId=' +
41
50
  this.settings.serviceId +
51
+ '&serviceDeviceId=' +
52
+ encodeURIComponent(this.deviceId) +
42
53
  '&' +
43
54
  DomUtils.Culture +
44
55
  '=' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.3.72",
3
+ "version": "1.3.76",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,16 +50,16 @@
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.1.85",
54
- "@etsoo/notificationbase": "^1.0.94",
55
- "@etsoo/shared": "^1.0.78",
56
- "@mui/icons-material": "^5.2.4",
57
- "@mui/material": "^5.2.4",
53
+ "@etsoo/appscript": "^1.1.93",
54
+ "@etsoo/notificationbase": "^1.0.95",
55
+ "@etsoo/shared": "^1.0.83",
56
+ "@mui/icons-material": "^5.2.5",
57
+ "@mui/material": "^5.2.5",
58
58
  "@reach/router": "^1.3.4",
59
59
  "@types/pica": "^5.1.3",
60
60
  "@types/pulltorefreshjs": "^0.1.5",
61
- "@types/reach__router": "^1.3.9",
62
- "@types/react": "^17.0.37",
61
+ "@types/reach__router": "^1.3.10",
62
+ "@types/react": "^17.0.38",
63
63
  "@types/react-avatar-editor": "^10.3.6",
64
64
  "@types/react-dom": "^17.0.11",
65
65
  "@types/react-input-mask": "^3.0.1",
@@ -81,12 +81,12 @@
81
81
  "@babel/runtime-corejs3": "^7.16.5",
82
82
  "@types/jest": "^27.0.3",
83
83
  "@types/react-test-renderer": "^17.0.1",
84
- "@typescript-eslint/eslint-plugin": "^5.7.0",
85
- "@typescript-eslint/parser": "^5.7.0",
84
+ "@typescript-eslint/eslint-plugin": "^5.8.0",
85
+ "@typescript-eslint/parser": "^5.8.0",
86
86
  "eslint": "^8.5.0",
87
87
  "eslint-config-airbnb-base": "^15.0.0",
88
88
  "eslint-plugin-import": "^2.25.3",
89
- "eslint-plugin-react": "^7.27.1",
89
+ "eslint-plugin-react": "^7.28.0",
90
90
  "jest": "^27.4.5",
91
91
  "react-test-renderer": "^17.0.2",
92
92
  "ts-jest": "^27.1.2",
@@ -7,7 +7,7 @@ import {
7
7
  IUserData
8
8
  } from '@etsoo/appscript';
9
9
  import { NotificationRenderProps } from '@etsoo/notificationbase';
10
- import { DataTypes } from '@etsoo/shared';
10
+ import { DataTypes, WindowStorage } from '@etsoo/shared';
11
11
  import React from 'react';
12
12
  import { NotifierMU } from '../mu/NotifierMU';
13
13
  import { ProgressCount } from '../mu/ProgressCount';
@@ -188,6 +188,11 @@ export class ReactApp<
188
188
  settings,
189
189
  ReactApp.createApi(settings),
190
190
  ReactApp.createNotifier(),
191
+ new WindowStorage([
192
+ CoreApp.deviceIdField,
193
+ CoreApp.headerTokenField,
194
+ CoreApp.serversideDeviceIdField
195
+ ]),
191
196
  name
192
197
  );
193
198
  this.cultureState = new CultureState(settings.currentCulture);
@@ -12,6 +12,11 @@ export type RefreshTokenRQ = {
12
12
  */
13
13
  pwd?: string;
14
14
 
15
+ /**
16
+ * Service device id
17
+ */
18
+ serviceDeviceId?: string;
19
+
15
20
  /**
16
21
  * Service id
17
22
  */
@@ -30,15 +30,21 @@ export class ServiceApp<
30
30
  */
31
31
  readonly serviceApi: IApi;
32
32
 
33
+ private _serviceUser?: IServiceUser;
33
34
  /**
34
35
  * Service user
35
36
  */
36
- serviceUser?: ISmartERPUser;
37
+ get serviceUser() {
38
+ return this._serviceUser;
39
+ }
40
+ protected set serviceUser(value: IServiceUser | undefined) {
41
+ this._serviceUser = value;
42
+ }
37
43
 
38
44
  /**
39
45
  * Service passphrase
40
46
  */
41
- servicePassphrase: string = '';
47
+ protected servicePassphrase: string = '';
42
48
 
43
49
  /**
44
50
  * Constructor
@@ -70,6 +76,8 @@ export class ServiceApp<
70
76
  coreUrl +
71
77
  '?serviceId=' +
72
78
  this.settings.serviceId +
79
+ '&serviceDeviceId=' +
80
+ encodeURIComponent(this.deviceId) +
73
81
  '&' +
74
82
  DomUtils.Culture +
75
83
  '=' +