@etsoo/appscript 1.2.92 → 1.2.94

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.
@@ -407,14 +407,14 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
407
407
  */
408
408
  hasPermission(roles: number | UserRole | number[] | UserRole[]): boolean;
409
409
  /**
410
- * Callback where exit a page
410
+ * Navigate the Url
411
+ * @param url Url
411
412
  */
412
- pageExit(): void;
413
+ navigate(url: string): void;
413
414
  /**
414
- * Redirect to the Url
415
- * @param url Url
415
+ * Callback where exit a page
416
416
  */
417
- redirectTo(url: string): void;
417
+ pageExit(): void;
418
418
  /**
419
419
  * Refresh countdown
420
420
  * @param seconds Seconds
@@ -978,6 +978,13 @@ class CoreApp {
978
978
  return true;
979
979
  return false;
980
980
  }
981
+ /**
982
+ * Navigate the Url
983
+ * @param url Url
984
+ */
985
+ navigate(url) {
986
+ globalThis.location.href = this.settings.homepage + url;
987
+ }
981
988
  /**
982
989
  * Callback where exit a page
983
990
  */
@@ -985,13 +992,6 @@ class CoreApp {
985
992
  var _a;
986
993
  (_a = this.lastWarning) === null || _a === void 0 ? void 0 : _a.dismiss();
987
994
  }
988
- /**
989
- * Redirect to the Url
990
- * @param url Url
991
- */
992
- redirectTo(url) {
993
- window.location.href = url;
994
- }
995
995
  /**
996
996
  * Refresh countdown
997
997
  * @param seconds Seconds
@@ -1089,8 +1089,8 @@ class CoreApp {
1089
1089
  * @param tryLogin Try to login again
1090
1090
  */
1091
1091
  toLoginPage(tryLogin) {
1092
- const url = this.settings.homepage + '/' + (tryLogin ? '' : '?tryLogin=false');
1093
- this.redirectTo(url);
1092
+ const url = '/' + (tryLogin ? '' : '?tryLogin=false');
1093
+ this.navigate(url);
1094
1094
  }
1095
1095
  /**
1096
1096
  * Try login, returning false means is loading
@@ -335,6 +335,11 @@ export interface IApp {
335
335
  * @param password Input password
336
336
  */
337
337
  isValidPassword(password: string): boolean;
338
+ /**
339
+ * Navigate the Url
340
+ * @param url Url
341
+ */
342
+ navigate(url: string): void;
338
343
  /**
339
344
  * Callback where exit a page
340
345
  */
@@ -359,11 +364,6 @@ export interface IApp {
359
364
  * Persist settings to source when application exit
360
365
  */
361
366
  persist(): void;
362
- /**
363
- * Redirect to the Url
364
- * @param url Url
365
- */
366
- redirectTo(url: string): void;
367
367
  /**
368
368
  * Switch organization
369
369
  * @param id Organization id
@@ -407,14 +407,14 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
407
407
  */
408
408
  hasPermission(roles: number | UserRole | number[] | UserRole[]): boolean;
409
409
  /**
410
- * Callback where exit a page
410
+ * Navigate the Url
411
+ * @param url Url
411
412
  */
412
- pageExit(): void;
413
+ navigate(url: string): void;
413
414
  /**
414
- * Redirect to the Url
415
- * @param url Url
415
+ * Callback where exit a page
416
416
  */
417
- redirectTo(url: string): void;
417
+ pageExit(): void;
418
418
  /**
419
419
  * Refresh countdown
420
420
  * @param seconds Seconds
@@ -975,6 +975,13 @@ export class CoreApp {
975
975
  return true;
976
976
  return false;
977
977
  }
978
+ /**
979
+ * Navigate the Url
980
+ * @param url Url
981
+ */
982
+ navigate(url) {
983
+ globalThis.location.href = this.settings.homepage + url;
984
+ }
978
985
  /**
979
986
  * Callback where exit a page
980
987
  */
@@ -982,13 +989,6 @@ export class CoreApp {
982
989
  var _a;
983
990
  (_a = this.lastWarning) === null || _a === void 0 ? void 0 : _a.dismiss();
984
991
  }
985
- /**
986
- * Redirect to the Url
987
- * @param url Url
988
- */
989
- redirectTo(url) {
990
- window.location.href = url;
991
- }
992
992
  /**
993
993
  * Refresh countdown
994
994
  * @param seconds Seconds
@@ -1086,8 +1086,8 @@ export class CoreApp {
1086
1086
  * @param tryLogin Try to login again
1087
1087
  */
1088
1088
  toLoginPage(tryLogin) {
1089
- const url = this.settings.homepage + '/' + (tryLogin ? '' : '?tryLogin=false');
1090
- this.redirectTo(url);
1089
+ const url = '/' + (tryLogin ? '' : '?tryLogin=false');
1090
+ this.navigate(url);
1091
1091
  }
1092
1092
  /**
1093
1093
  * Try login, returning false means is loading
@@ -335,6 +335,11 @@ export interface IApp {
335
335
  * @param password Input password
336
336
  */
337
337
  isValidPassword(password: string): boolean;
338
+ /**
339
+ * Navigate the Url
340
+ * @param url Url
341
+ */
342
+ navigate(url: string): void;
338
343
  /**
339
344
  * Callback where exit a page
340
345
  */
@@ -359,11 +364,6 @@ export interface IApp {
359
364
  * Persist settings to source when application exit
360
365
  */
361
366
  persist(): void;
362
- /**
363
- * Redirect to the Url
364
- * @param url Url
365
- */
366
- redirectTo(url: string): void;
367
367
  /**
368
368
  * Switch organization
369
369
  * @param id Organization id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.2.92",
3
+ "version": "1.2.94",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -1304,18 +1304,18 @@ export abstract class CoreApp<
1304
1304
  }
1305
1305
 
1306
1306
  /**
1307
- * Callback where exit a page
1307
+ * Navigate the Url
1308
+ * @param url Url
1308
1309
  */
1309
- pageExit() {
1310
- this.lastWarning?.dismiss();
1310
+ navigate(url: string): void {
1311
+ globalThis.location.href = this.settings.homepage + url;
1311
1312
  }
1312
1313
 
1313
1314
  /**
1314
- * Redirect to the Url
1315
- * @param url Url
1315
+ * Callback where exit a page
1316
1316
  */
1317
- redirectTo(url: string): void {
1318
- window.location.href = url;
1317
+ pageExit() {
1318
+ this.lastWarning?.dismiss();
1319
1319
  }
1320
1320
 
1321
1321
  /**
@@ -1437,9 +1437,8 @@ export abstract class CoreApp<
1437
1437
  * @param tryLogin Try to login again
1438
1438
  */
1439
1439
  toLoginPage(tryLogin?: boolean) {
1440
- const url =
1441
- this.settings.homepage + '/' + (tryLogin ? '' : '?tryLogin=false');
1442
- this.redirectTo(url);
1440
+ const url = '/' + (tryLogin ? '' : '?tryLogin=false');
1441
+ this.navigate(url);
1443
1442
  }
1444
1443
 
1445
1444
  /**
package/src/app/IApp.ts CHANGED
@@ -437,6 +437,12 @@ export interface IApp {
437
437
  */
438
438
  isValidPassword(password: string): boolean;
439
439
 
440
+ /**
441
+ * Navigate the Url
442
+ * @param url Url
443
+ */
444
+ navigate(url: string): void;
445
+
440
446
  /**
441
447
  * Callback where exit a page
442
448
  */
@@ -471,12 +477,6 @@ export interface IApp {
471
477
  */
472
478
  persist(): void;
473
479
 
474
- /**
475
- * Redirect to the Url
476
- * @param url Url
477
- */
478
- redirectTo(url: string): void;
479
-
480
480
  /**
481
481
  * Switch organization
482
482
  * @param id Organization id