@etsoo/appscript 1.2.90 → 1.2.92

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.
@@ -458,12 +458,6 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
458
458
  * @param tryLogin Try to login again
459
459
  */
460
460
  toLoginPage(tryLogin?: boolean): void;
461
- /**
462
- * Transform URL
463
- * @param url URL
464
- * @returns Transformed url
465
- */
466
- transformUrl(url: string): string;
467
461
  /**
468
462
  * Try login, returning false means is loading
469
463
  * UI get involved while refreshToken not intended
@@ -1089,31 +1089,9 @@ class CoreApp {
1089
1089
  * @param tryLogin Try to login again
1090
1090
  */
1091
1091
  toLoginPage(tryLogin) {
1092
- const url = this.transformUrl('/' + (tryLogin ? '' : '?tryLogin=false'));
1092
+ const url = this.settings.homepage + '/' + (tryLogin ? '' : '?tryLogin=false');
1093
1093
  this.redirectTo(url);
1094
1094
  }
1095
- /**
1096
- * Transform URL
1097
- * @param url URL
1098
- * @returns Transformed url
1099
- */
1100
- transformUrl(url) {
1101
- // Home page for the router
1102
- const home = this.settings.homepage;
1103
- // Default, just leave it
1104
- if (home === '')
1105
- return url;
1106
- // From relative root, like home:/react/, url: /about => /react/about
1107
- if (url.startsWith('/'))
1108
- return home + url.substring(1);
1109
- const pathname = window.location.pathname;
1110
- // Relative
1111
- const pos = pathname.indexOf(home);
1112
- if (pos == -1)
1113
- return url;
1114
- // To /a/b/../ => /a
1115
- return pathname.endsWith('/') ? pathname + url : pathname + '/' + url;
1116
- }
1117
1095
  /**
1118
1096
  * Try login, returning false means is loading
1119
1097
  * UI get involved while refreshToken not intended
@@ -375,12 +375,6 @@ export interface IApp {
375
375
  * @param tryLogin Try to login again
376
376
  */
377
377
  toLoginPage(tryLogin?: boolean): void;
378
- /**
379
- * Transform URL
380
- * @param url URL
381
- * @returns Transformed url
382
- */
383
- transformUrl(url: string): string;
384
378
  /**
385
379
  * Try login, returning false means is loading
386
380
  * UI get involved while refreshToken not intended
@@ -3,6 +3,7 @@
3
3
  "actions": "Actions",
4
4
  "add": "Add",
5
5
  "audits": "Audits",
6
+ "author": "Author",
6
7
  "authorizer": "Authorizer",
7
8
  "applicant": "Applicant",
8
9
  "approve": "Approve it",
@@ -3,6 +3,7 @@
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
5
  "audits": "操作历史",
6
+ "author": "作者",
6
7
  "authorizer": "授权人",
7
8
  "applicant": "申请人",
8
9
  "approve": "批准",
@@ -3,6 +3,7 @@
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
5
  "audits": "操作歷史",
6
+ "author": "作者",
6
7
  "authorizer": "授權人",
7
8
  "applicant": "申請人",
8
9
  "approve": "批准",
@@ -458,12 +458,6 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
458
458
  * @param tryLogin Try to login again
459
459
  */
460
460
  toLoginPage(tryLogin?: boolean): void;
461
- /**
462
- * Transform URL
463
- * @param url URL
464
- * @returns Transformed url
465
- */
466
- transformUrl(url: string): string;
467
461
  /**
468
462
  * Try login, returning false means is loading
469
463
  * UI get involved while refreshToken not intended
@@ -1086,31 +1086,9 @@ export class CoreApp {
1086
1086
  * @param tryLogin Try to login again
1087
1087
  */
1088
1088
  toLoginPage(tryLogin) {
1089
- const url = this.transformUrl('/' + (tryLogin ? '' : '?tryLogin=false'));
1089
+ const url = this.settings.homepage + '/' + (tryLogin ? '' : '?tryLogin=false');
1090
1090
  this.redirectTo(url);
1091
1091
  }
1092
- /**
1093
- * Transform URL
1094
- * @param url URL
1095
- * @returns Transformed url
1096
- */
1097
- transformUrl(url) {
1098
- // Home page for the router
1099
- const home = this.settings.homepage;
1100
- // Default, just leave it
1101
- if (home === '')
1102
- return url;
1103
- // From relative root, like home:/react/, url: /about => /react/about
1104
- if (url.startsWith('/'))
1105
- return home + url.substring(1);
1106
- const pathname = window.location.pathname;
1107
- // Relative
1108
- const pos = pathname.indexOf(home);
1109
- if (pos == -1)
1110
- return url;
1111
- // To /a/b/../ => /a
1112
- return pathname.endsWith('/') ? pathname + url : pathname + '/' + url;
1113
- }
1114
1092
  /**
1115
1093
  * Try login, returning false means is loading
1116
1094
  * UI get involved while refreshToken not intended
@@ -375,12 +375,6 @@ export interface IApp {
375
375
  * @param tryLogin Try to login again
376
376
  */
377
377
  toLoginPage(tryLogin?: boolean): void;
378
- /**
379
- * Transform URL
380
- * @param url URL
381
- * @returns Transformed url
382
- */
383
- transformUrl(url: string): string;
384
378
  /**
385
379
  * Try login, returning false means is loading
386
380
  * UI get involved while refreshToken not intended
@@ -3,6 +3,7 @@
3
3
  "actions": "Actions",
4
4
  "add": "Add",
5
5
  "audits": "Audits",
6
+ "author": "Author",
6
7
  "authorizer": "Authorizer",
7
8
  "applicant": "Applicant",
8
9
  "approve": "Approve it",
@@ -3,6 +3,7 @@
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
5
  "audits": "操作历史",
6
+ "author": "作者",
6
7
  "authorizer": "授权人",
7
8
  "applicant": "申请人",
8
9
  "approve": "批准",
@@ -3,6 +3,7 @@
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
5
  "audits": "操作歷史",
6
+ "author": "作者",
6
7
  "authorizer": "授權人",
7
8
  "applicant": "申請人",
8
9
  "approve": "批准",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.2.90",
3
+ "version": "1.2.92",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -53,26 +53,26 @@
53
53
  "homepage": "https://github.com/ETSOO/AppScript#readme",
54
54
  "dependencies": {
55
55
  "@etsoo/notificationbase": "^1.1.7",
56
- "@etsoo/restclient": "^1.0.71",
57
- "@etsoo/shared": "^1.1.53",
56
+ "@etsoo/restclient": "^1.0.73",
57
+ "@etsoo/shared": "^1.1.57",
58
58
  "@types/crypto-js": "^4.1.1",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@babel/cli": "^7.18.10",
63
- "@babel/core": "^7.19.0",
64
- "@babel/plugin-transform-runtime": "^7.18.10",
65
- "@babel/preset-env": "^7.19.0",
66
- "@babel/runtime-corejs3": "^7.19.0",
67
- "@types/jest": "^29.0.0",
68
- "@typescript-eslint/eslint-plugin": "^5.36.2",
69
- "@typescript-eslint/parser": "^5.36.2",
70
- "eslint": "^8.23.0",
63
+ "@babel/core": "^7.19.1",
64
+ "@babel/plugin-transform-runtime": "^7.19.1",
65
+ "@babel/preset-env": "^7.19.1",
66
+ "@babel/runtime-corejs3": "^7.19.1",
67
+ "@types/jest": "^29.0.3",
68
+ "@typescript-eslint/eslint-plugin": "^5.37.0",
69
+ "@typescript-eslint/parser": "^5.37.0",
70
+ "eslint": "^8.23.1",
71
71
  "eslint-config-airbnb-base": "^15.0.0",
72
72
  "eslint-plugin-import": "^2.26.0",
73
73
  "jest": "^29.0.3",
74
74
  "jest-environment-jsdom": "^29.0.3",
75
- "ts-jest": "^29.0.0",
75
+ "ts-jest": "^29.0.1",
76
76
  "typescript": "^4.8.3"
77
77
  }
78
78
  }
@@ -1437,37 +1437,11 @@ export abstract class CoreApp<
1437
1437
  * @param tryLogin Try to login again
1438
1438
  */
1439
1439
  toLoginPage(tryLogin?: boolean) {
1440
- const url = this.transformUrl(
1441
- '/' + (tryLogin ? '' : '?tryLogin=false')
1442
- );
1440
+ const url =
1441
+ this.settings.homepage + '/' + (tryLogin ? '' : '?tryLogin=false');
1443
1442
  this.redirectTo(url);
1444
1443
  }
1445
1444
 
1446
- /**
1447
- * Transform URL
1448
- * @param url URL
1449
- * @returns Transformed url
1450
- */
1451
- transformUrl(url: string) {
1452
- // Home page for the router
1453
- const home = this.settings.homepage;
1454
-
1455
- // Default, just leave it
1456
- if (home === '') return url;
1457
-
1458
- // From relative root, like home:/react/, url: /about => /react/about
1459
- if (url.startsWith('/')) return home + url.substring(1);
1460
-
1461
- const pathname = window.location.pathname;
1462
-
1463
- // Relative
1464
- const pos = pathname.indexOf(home);
1465
- if (pos == -1) return url;
1466
-
1467
- // To /a/b/../ => /a
1468
- return pathname.endsWith('/') ? pathname + url : pathname + '/' + url;
1469
- }
1470
-
1471
1445
  /**
1472
1446
  * Try login, returning false means is loading
1473
1447
  * UI get involved while refreshToken not intended
package/src/app/IApp.ts CHANGED
@@ -490,13 +490,6 @@ export interface IApp {
490
490
  */
491
491
  toLoginPage(tryLogin?: boolean): void;
492
492
 
493
- /**
494
- * Transform URL
495
- * @param url URL
496
- * @returns Transformed url
497
- */
498
- transformUrl(url: string): string;
499
-
500
493
  /**
501
494
  * Try login, returning false means is loading
502
495
  * UI get involved while refreshToken not intended
@@ -3,6 +3,7 @@
3
3
  "actions": "Actions",
4
4
  "add": "Add",
5
5
  "audits": "Audits",
6
+ "author": "Author",
6
7
  "authorizer": "Authorizer",
7
8
  "applicant": "Applicant",
8
9
  "approve": "Approve it",
@@ -3,6 +3,7 @@
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
5
  "audits": "操作历史",
6
+ "author": "作者",
6
7
  "authorizer": "授权人",
7
8
  "applicant": "申请人",
8
9
  "approve": "批准",
@@ -3,6 +3,7 @@
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
5
  "audits": "操作歷史",
6
+ "author": "作者",
6
7
  "authorizer": "授權人",
7
8
  "applicant": "申請人",
8
9
  "approve": "批准",