@osovitny/anatoly 2.0.28 → 2.0.30

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.
@@ -847,7 +847,9 @@
847
847
  }
848
848
  });
849
849
  var LocalizationSettingsModule = /** @class */ (function () {
850
- function LocalizationSettingsModule() {
850
+ function LocalizationSettingsModule(injector) {
851
+ this.injector = injector;
852
+ exports.LocalizationInjectorInstance = this.injector;
851
853
  }
852
854
  return LocalizationSettingsModule;
853
855
  }());
@@ -866,7 +868,10 @@
866
868
  ],
867
869
  exports: []
868
870
  },] }
869
- ];
871
+ ];
872
+ LocalizationSettingsModule.ctorParameters = function () { return [
873
+ { type: i0.Injector }
874
+ ]; };
870
875
 
871
876
  /*
872
877
  <file>
@@ -954,7 +959,7 @@
954
959
  Anatoly Osovitny
955
960
 
956
961
  Created:
957
- 13 Nov 2017
962
+ 2 July 2020
958
963
 
959
964
  Version:
960
965
  1.0
@@ -962,120 +967,165 @@
962
967
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
963
968
  </file>
964
969
  */
965
- var BaseApiService = /** @class */ (function () {
966
- function BaseApiService(http) {
967
- this.http = http;
968
- this.baseUrl = '';
970
+ var L10nUtils = /** @class */ (function () {
971
+ function L10nUtils() {
969
972
  }
970
- BaseApiService.prototype.serializeParams = function (data) {
971
- return data ? '?' + $.param(data) : '';
972
- };
973
- // api
974
- BaseApiService.prototype.get = function (action, data, responseType) {
975
- if (!responseType) {
976
- responseType = 'json';
977
- }
978
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
979
- return this.http
980
- .get(url, { responseType: responseType })
981
- .pipe(operators.map(function (res) { return res; }));
982
- };
983
- BaseApiService.prototype.post = function (action, data, responseType) {
984
- if (!responseType) {
985
- responseType = 'text';
986
- }
987
- var url = this.baseUrl + "/" + action;
988
- return this.http.post(url, data, { responseType: responseType });
989
- };
990
- BaseApiService.prototype.postQS = function (action, data, responseType) {
991
- if (!responseType) {
992
- responseType = 'text';
973
+ Object.defineProperty(L10nUtils, "localizationService", {
974
+ // @dynamic
975
+ get: function () {
976
+ var ns = exports.LocalizationInjectorInstance.get(LocalizationService);
977
+ return ns;
978
+ },
979
+ enumerable: false,
980
+ configurable: true
981
+ });
982
+ L10nUtils.getLocalizedValue = function (key, params, defaultKey) {
983
+ // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
984
+ // defaultKey definition:
985
+ // if key is empty and defaultKey is defined => get localization for defaultKey
986
+ // Example: cancel()
987
+ if (!key && defaultKey) {
988
+ return this.localizationService.getLocalizedValue(defaultKey);
993
989
  }
994
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
995
- return this.http.post(url, null, { responseType: responseType });
996
- };
997
- BaseApiService.prototype.delete = function (action, data, responseType) {
998
- if (!responseType) {
999
- responseType = 'text';
990
+ // VadimOS:
991
+ // if key is not empty value MUST be in localization table, othewise we will return key
992
+ if (key) {
993
+ var value = this.localizationService.getLocalizedValue(key, params);
994
+ return value;
1000
995
  }
1001
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
1002
- return this.http.delete(url, { responseType: responseType });
996
+ return key;
1003
997
  };
1004
- // gets
1005
- BaseApiService.prototype.getById = function (id) {
1006
- return this.get('getById', { id: id });
998
+ return L10nUtils;
999
+ }());
1000
+
1001
+ /*
1002
+ <file>
1003
+ Project:
1004
+ @osovitny/anatoly
1005
+
1006
+ Authors:
1007
+ Vadim Osovitny
1008
+ Anatoly Osovitny
1009
+
1010
+ Created:
1011
+ 3 March 2020
1012
+
1013
+ Version:
1014
+ 1.0
1015
+
1016
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1017
+ </file>
1018
+ */
1019
+ var Alerts = /** @class */ (function () {
1020
+ function Alerts() {
1021
+ }
1022
+ Alerts.success = function (text, params, title, successAction) {
1023
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
1024
+ title = L10nUtils.getLocalizedValue(title, null, 'Success');
1025
+ Swal.fire({
1026
+ text: text,
1027
+ title: title,
1028
+ icon: 'success',
1029
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
1030
+ })
1031
+ .then(function () {
1032
+ if (successAction) {
1033
+ successAction();
1034
+ }
1035
+ });
1007
1036
  };
1008
- BaseApiService.prototype.getAll = function (data) {
1009
- return this.get('getall', data).pipe(operators.map(function (res) { return res; }));
1037
+ Alerts.info = function (text, params, title) {
1038
+ text = L10nUtils.getLocalizedValue(text, params);
1039
+ title = L10nUtils.getLocalizedValue(title, null, 'Info');
1040
+ Swal.fire({
1041
+ text: text,
1042
+ title: title,
1043
+ icon: 'info',
1044
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
1045
+ });
1010
1046
  };
1011
- BaseApiService.prototype.getJsonFile = function (fileName) {
1012
- var jsonsUrl = AppCoreSettings.jsonsUrl;
1013
- var jsonVersion = AppCoreSettings.jsonVersion;
1014
- var url = jsonsUrl + '/' + fileName + '?' + jsonVersion;
1015
- return this.http.get(url).pipe(operators.map(function (res) { return res; }));
1047
+ Alerts.warning = function (text, params, title) {
1048
+ text = L10nUtils.getLocalizedValue(text, params);
1049
+ title = L10nUtils.getLocalizedValue(title, null, 'Warning');
1050
+ Swal.fire({
1051
+ text: text,
1052
+ title: title,
1053
+ icon: 'warning',
1054
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
1055
+ });
1016
1056
  };
1017
- return BaseApiService;
1018
- }());
1019
- BaseApiService.decorators = [
1020
- { type: i0.Injectable }
1021
- ];
1022
- BaseApiService.ctorParameters = function () { return [
1023
- { type: i1.HttpClient }
1024
- ]; };
1025
-
1026
- var AppContextService = /** @class */ (function (_super) {
1027
- __extends(AppContextService, _super);
1028
- function AppContextService(http) {
1029
- var _this = _super.call(this, http) || this;
1030
- _this.http = http;
1031
- _this.current = null;
1032
- _this.successes = [];
1033
- _this.subscription = null;
1034
- _this.baseUrl = '/api/appContext';
1035
- return _this;
1036
- }
1037
- AppContextService.prototype.getCurrent = function (success) {
1038
- var _this = this;
1039
- if (typeof success == 'undefined') {
1040
- return;
1041
- }
1042
- if (this.current != null) {
1043
- success(this.current);
1044
- return;
1045
- }
1046
- this.successes.push(success);
1047
- if (this.subscription != null) {
1048
- return;
1049
- }
1050
- this.subscription = this.get('GetCurrentContext', null).subscribe(function (data) {
1051
- _this.dataReceived(data);
1052
- }, function (e) { });
1057
+ Alerts.error = function (text, params, title) {
1058
+ text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
1059
+ title = L10nUtils.getLocalizedValue(title, null, 'Error');
1060
+ Swal.fire({
1061
+ text: text,
1062
+ title: title,
1063
+ icon: 'error',
1064
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
1065
+ });
1053
1066
  };
1054
- AppContextService.prototype.dataReceived = function (data) {
1055
- this.current = data;
1056
- for (var i = 0; i < this.successes.length; i++) {
1057
- var success = this.successes[i];
1058
- success(data);
1059
- }
1060
- this.successes = [];
1061
- this.subscription.unsubscribe();
1062
- this.subscription = null;
1063
- this.current = null;
1067
+ Alerts.cancel = function (text, params, title) {
1068
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
1069
+ title = L10nUtils.getLocalizedValue(title, null, 'Cancelled');
1070
+ Swal.fire({
1071
+ text: text,
1072
+ title: title,
1073
+ icon: 'info'
1074
+ });
1064
1075
  };
1065
- AppContextService.prototype.isUserSignedIn = function () {
1066
- return ContextInitState.isUserSignedIn;
1076
+ Alerts.notImplemented = function () {
1077
+ this.warning('Not Implemented Yet');
1067
1078
  };
1068
- AppContextService.prototype.isUserAdmin = function () {
1069
- return ContextInitState.isUserAdmin;
1079
+ ;
1080
+ Alerts.areYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
1081
+ text = L10nUtils.getLocalizedValue(text);
1082
+ title = L10nUtils.getLocalizedValue(title, null, 'AreYouSure');
1083
+ confirmButtonText = L10nUtils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
1084
+ cancelButtonText = L10nUtils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
1085
+ Swal.fire({
1086
+ text: text,
1087
+ title: title,
1088
+ icon: 'warning',
1089
+ confirmButtonText: confirmButtonText,
1090
+ cancelButtonText: cancelButtonText,
1091
+ showCancelButton: true
1092
+ })
1093
+ .then(function (result) {
1094
+ if (result.value) {
1095
+ if (successAction) {
1096
+ successAction();
1097
+ }
1098
+ }
1099
+ // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
1100
+ else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
1101
+ if (cancelAction) {
1102
+ cancelAction();
1103
+ }
1104
+ }
1105
+ });
1070
1106
  };
1071
- return AppContextService;
1072
- }(BaseApiService));
1073
- AppContextService.decorators = [
1074
- { type: i0.Injectable }
1075
- ];
1076
- AppContextService.ctorParameters = function () { return [
1077
- { type: i1.HttpClient }
1078
- ]; };
1107
+ ;
1108
+ return Alerts;
1109
+ }());
1110
+
1111
+ /*
1112
+ <file>
1113
+ Project:
1114
+ @osovitny/anatoly
1115
+
1116
+ Authors:
1117
+ Vadim Osovitny
1118
+ Anatoly Osovitny
1119
+
1120
+ Created:
1121
+ 2 Jun 2020
1122
+
1123
+ Version:
1124
+ 1.0
1125
+
1126
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1127
+ </file>
1128
+ */
1079
1129
 
1080
1130
  /*
1081
1131
  <file>
@@ -1238,8 +1288,8 @@
1238
1288
  };
1239
1289
  NotificationService.prototype.success = function (text, params, title, createSessionNotification) {
1240
1290
  if (createSessionNotification === void 0) { createSessionNotification = true; }
1241
- text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
1242
- title = Utils.getLocalizedValue(title);
1291
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
1292
+ title = L10nUtils.getLocalizedValue(title);
1243
1293
  this.toastrService.success(text, title, {
1244
1294
  timeOut: 3000,
1245
1295
  progressBar: true
@@ -1249,16 +1299,16 @@
1249
1299
  }
1250
1300
  };
1251
1301
  NotificationService.prototype.info = function (text, params, title) {
1252
- text = Utils.getLocalizedValue(text, params);
1253
- title = Utils.getLocalizedValue(title);
1302
+ text = L10nUtils.getLocalizedValue(text, params);
1303
+ title = L10nUtils.getLocalizedValue(title);
1254
1304
  this.toastrService.info(text, title, {
1255
1305
  timeOut: 3000,
1256
1306
  progressBar: true
1257
1307
  });
1258
1308
  };
1259
1309
  NotificationService.prototype.warning = function (text, params, title) {
1260
- text = Utils.getLocalizedValue(text, params);
1261
- title = Utils.getLocalizedValue(title);
1310
+ text = L10nUtils.getLocalizedValue(text, params);
1311
+ title = L10nUtils.getLocalizedValue(title);
1262
1312
  this.toastrService.warning(text, title, {
1263
1313
  timeOut: 3000,
1264
1314
  progressBar: true
@@ -1266,8 +1316,8 @@
1266
1316
  };
1267
1317
  NotificationService.prototype.error = function (text, params, title, createSessionNotification) {
1268
1318
  if (createSessionNotification === void 0) { createSessionNotification = true; }
1269
- text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
1270
- title = Utils.getLocalizedValue(title);
1319
+ text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
1320
+ title = L10nUtils.getLocalizedValue(title);
1271
1321
  this.toastrService.error(text, title, {
1272
1322
  timeOut: 3000,
1273
1323
  progressBar: true
@@ -1277,8 +1327,8 @@
1277
1327
  }
1278
1328
  };
1279
1329
  NotificationService.prototype.cancel = function (text, params, title) {
1280
- text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
1281
- title = Utils.getLocalizedValue(title);
1330
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
1331
+ title = L10nUtils.getLocalizedValue(title);
1282
1332
  this.toastrService.info(text, title, {
1283
1333
  timeOut: 3000,
1284
1334
  progressBar: true
@@ -1316,31 +1366,6 @@
1316
1366
  { type: i1$2.ToastrService }
1317
1367
  ]; };
1318
1368
 
1319
- var AnatolyCoreModule = /** @class */ (function () {
1320
- function AnatolyCoreModule(injector, parentModule) {
1321
- this.injector = injector;
1322
- throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
1323
- exports.InjectorInstance = this.injector;
1324
- }
1325
- return AnatolyCoreModule;
1326
- }());
1327
- AnatolyCoreModule.decorators = [
1328
- { type: i0.NgModule, args: [{
1329
- imports: [common.CommonModule],
1330
- exports: [],
1331
- providers: [
1332
- LoggingService,
1333
- NotificationService,
1334
- AppContextService,
1335
- LoadingService
1336
- ],
1337
- },] }
1338
- ];
1339
- AnatolyCoreModule.ctorParameters = function () { return [
1340
- { type: i0.Injector },
1341
- { type: AnatolyCoreModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
1342
- ]; };
1343
-
1344
1369
  /*
1345
1370
  <file>
1346
1371
  Project:
@@ -1351,7 +1376,7 @@
1351
1376
  Anatoly Osovitny
1352
1377
 
1353
1378
  Created:
1354
- 19 March 2020
1379
+ 13 Nov 2017
1355
1380
 
1356
1381
  Version:
1357
1382
  1.0
@@ -1359,204 +1384,120 @@
1359
1384
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1360
1385
  </file>
1361
1386
  */
1362
- var Utils = /** @class */ (function () {
1363
- function Utils() {
1387
+ var BaseApiService = /** @class */ (function () {
1388
+ function BaseApiService(http) {
1389
+ this.http = http;
1390
+ this.baseUrl = '';
1364
1391
  }
1365
- Utils.getValueByNameInQS = function (name) {
1366
- return Utils.getValueByName(location.search, name);
1367
- };
1368
- Utils.getValueByName = function (url, name) {
1369
- name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1370
- // tslint:disable-next-line:one-variable-per-declaration
1371
- var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
1372
- return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
1373
- };
1374
- Utils.copyToClipBoard = function (event, val) {
1375
- event.preventDefault();
1376
- var selBox = document.createElement('textarea');
1377
- selBox.style.position = 'fixed';
1378
- selBox.style.left = '0';
1379
- selBox.style.top = '0';
1380
- selBox.style.opacity = '0';
1381
- selBox.value = val;
1382
- document.body.appendChild(selBox);
1383
- selBox.focus();
1384
- selBox.select();
1385
- document.execCommand('copy');
1386
- document.body.removeChild(selBox);
1387
- };
1388
- Utils.downloadFile = function (name, url) {
1389
- var link = document.createElement('a');
1390
- link.download = name;
1391
- link.href = url;
1392
- link.click();
1392
+ BaseApiService.prototype.serializeParams = function (data) {
1393
+ return data ? '?' + $.param(data) : '';
1393
1394
  };
1394
- Object.defineProperty(Utils, "localizationService", {
1395
- // Localization
1396
- // @dynamic
1397
- get: function () {
1398
- var ns = exports.InjectorInstance.get(LocalizationService);
1399
- return ns;
1400
- },
1401
- enumerable: false,
1402
- configurable: true
1403
- });
1404
- Utils.getLocalizedValue = function (key, params, defaultKey) {
1405
- // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
1406
- // defaultKey definition:
1407
- // if key is empty and defaultKey is defined => get localization for defaultKey
1408
- // Example: cancel()
1409
- if (!key && defaultKey) {
1410
- return this.localizationService.getLocalizedValue(defaultKey);
1395
+ // api
1396
+ BaseApiService.prototype.get = function (action, data, responseType) {
1397
+ if (!responseType) {
1398
+ responseType = 'json';
1411
1399
  }
1412
- // VadimOS:
1413
- // if key is not empty value MUST be in localization table, othewise we will return key
1414
- if (key) {
1415
- var value = this.localizationService.getLocalizedValue(key, params);
1416
- return value;
1400
+ var url = this.baseUrl + "/" + action + this.serializeParams(data);
1401
+ return this.http
1402
+ .get(url, { responseType: responseType })
1403
+ .pipe(operators.map(function (res) { return res; }));
1404
+ };
1405
+ BaseApiService.prototype.post = function (action, data, responseType) {
1406
+ if (!responseType) {
1407
+ responseType = 'text';
1417
1408
  }
1418
- return key;
1409
+ var url = this.baseUrl + "/" + action;
1410
+ return this.http.post(url, data, { responseType: responseType });
1419
1411
  };
1420
- Utils.downloadBlobFile = function (value, fileName) {
1421
- if (window.navigator.msSaveOrOpenBlob) {
1422
- window.navigator.msSaveOrOpenBlob(value, fileName);
1412
+ BaseApiService.prototype.postQS = function (action, data, responseType) {
1413
+ if (!responseType) {
1414
+ responseType = 'text';
1423
1415
  }
1424
- else {
1425
- var downloadURL = window.URL.createObjectURL(value);
1426
- Utils.downloadFile(fileName, downloadURL);
1416
+ var url = this.baseUrl + "/" + action + this.serializeParams(data);
1417
+ return this.http.post(url, null, { responseType: responseType });
1418
+ };
1419
+ BaseApiService.prototype.delete = function (action, data, responseType) {
1420
+ if (!responseType) {
1421
+ responseType = 'text';
1427
1422
  }
1423
+ var url = this.baseUrl + "/" + action + this.serializeParams(data);
1424
+ return this.http.delete(url, { responseType: responseType });
1428
1425
  };
1429
- return Utils;
1430
- }());
1431
-
1432
- /*
1433
- <file>
1434
- Project:
1435
- @osovitny/anatoly
1436
-
1437
- Authors:
1438
- Vadim Osovitny
1439
- Anatoly Osovitny
1440
-
1441
- Created:
1442
- 3 March 2020
1443
-
1444
- Version:
1445
- 1.0
1446
-
1447
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1448
- </file>
1449
- */
1450
- var Alerts = /** @class */ (function () {
1451
- function Alerts() {
1452
- }
1453
- Alerts.success = function (text, params, title, successAction) {
1454
- text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
1455
- title = Utils.getLocalizedValue(title, null, 'Success');
1456
- Swal.fire({
1457
- text: text,
1458
- title: title,
1459
- icon: 'success',
1460
- confirmButtonText: Utils.getLocalizedValue('Ok')
1461
- })
1462
- .then(function () {
1463
- if (successAction) {
1464
- successAction();
1465
- }
1466
- });
1426
+ // gets
1427
+ BaseApiService.prototype.getById = function (id) {
1428
+ return this.get('getById', { id: id });
1467
1429
  };
1468
- Alerts.info = function (text, params, title) {
1469
- text = Utils.getLocalizedValue(text, params);
1470
- title = Utils.getLocalizedValue(title, null, 'Info');
1471
- Swal.fire({
1472
- text: text,
1473
- title: title,
1474
- icon: 'info',
1475
- confirmButtonText: Utils.getLocalizedValue('Ok')
1476
- });
1430
+ BaseApiService.prototype.getAll = function (data) {
1431
+ return this.get('getall', data).pipe(operators.map(function (res) { return res; }));
1477
1432
  };
1478
- Alerts.warning = function (text, params, title) {
1479
- text = Utils.getLocalizedValue(text, params);
1480
- title = Utils.getLocalizedValue(title, null, 'Warning');
1481
- Swal.fire({
1482
- text: text,
1483
- title: title,
1484
- icon: 'warning',
1485
- confirmButtonText: Utils.getLocalizedValue('Ok')
1486
- });
1433
+ BaseApiService.prototype.getJsonFile = function (fileName) {
1434
+ var jsonsUrl = AppCoreSettings.jsonsUrl;
1435
+ var jsonVersion = AppCoreSettings.jsonVersion;
1436
+ var url = jsonsUrl + '/' + fileName + '?' + jsonVersion;
1437
+ return this.http.get(url).pipe(operators.map(function (res) { return res; }));
1487
1438
  };
1488
- Alerts.error = function (text, params, title) {
1489
- text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
1490
- title = Utils.getLocalizedValue(title, null, 'Error');
1491
- Swal.fire({
1492
- text: text,
1493
- title: title,
1494
- icon: 'error',
1495
- confirmButtonText: Utils.getLocalizedValue('Ok')
1496
- });
1439
+ return BaseApiService;
1440
+ }());
1441
+ BaseApiService.decorators = [
1442
+ { type: i0.Injectable }
1443
+ ];
1444
+ BaseApiService.ctorParameters = function () { return [
1445
+ { type: i1.HttpClient }
1446
+ ]; };
1447
+
1448
+ var AppContextService = /** @class */ (function (_super) {
1449
+ __extends(AppContextService, _super);
1450
+ function AppContextService(http) {
1451
+ var _this = _super.call(this, http) || this;
1452
+ _this.http = http;
1453
+ _this.current = null;
1454
+ _this.successes = [];
1455
+ _this.subscription = null;
1456
+ _this.baseUrl = '/api/appContext';
1457
+ return _this;
1458
+ }
1459
+ AppContextService.prototype.getCurrent = function (success) {
1460
+ var _this = this;
1461
+ if (typeof success == 'undefined') {
1462
+ return;
1463
+ }
1464
+ if (this.current != null) {
1465
+ success(this.current);
1466
+ return;
1467
+ }
1468
+ this.successes.push(success);
1469
+ if (this.subscription != null) {
1470
+ return;
1471
+ }
1472
+ this.subscription = this.get('GetCurrentContext', null).subscribe(function (data) {
1473
+ _this.dataReceived(data);
1474
+ }, function (e) { });
1497
1475
  };
1498
- Alerts.cancel = function (text, params, title) {
1499
- text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
1500
- title = Utils.getLocalizedValue(title, null, 'Cancelled');
1501
- Swal.fire({
1502
- text: text,
1503
- title: title,
1504
- icon: 'info'
1505
- });
1476
+ AppContextService.prototype.dataReceived = function (data) {
1477
+ this.current = data;
1478
+ for (var i = 0; i < this.successes.length; i++) {
1479
+ var success = this.successes[i];
1480
+ success(data);
1481
+ }
1482
+ this.successes = [];
1483
+ this.subscription.unsubscribe();
1484
+ this.subscription = null;
1485
+ this.current = null;
1506
1486
  };
1507
- Alerts.notImplemented = function () {
1508
- this.warning('Not Implemented Yet');
1487
+ AppContextService.prototype.isUserSignedIn = function () {
1488
+ return ContextInitState.isUserSignedIn;
1509
1489
  };
1510
- ;
1511
- Alerts.areYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
1512
- text = Utils.getLocalizedValue(text);
1513
- title = Utils.getLocalizedValue(title, null, 'AreYouSure');
1514
- confirmButtonText = Utils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
1515
- cancelButtonText = Utils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
1516
- Swal.fire({
1517
- text: text,
1518
- title: title,
1519
- icon: 'warning',
1520
- confirmButtonText: confirmButtonText,
1521
- cancelButtonText: cancelButtonText,
1522
- showCancelButton: true
1523
- })
1524
- .then(function (result) {
1525
- if (result.value) {
1526
- if (successAction) {
1527
- successAction();
1528
- }
1529
- }
1530
- // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
1531
- else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
1532
- if (cancelAction) {
1533
- cancelAction();
1534
- }
1535
- }
1536
- });
1490
+ AppContextService.prototype.isUserAdmin = function () {
1491
+ return ContextInitState.isUserAdmin;
1537
1492
  };
1538
- ;
1539
- return Alerts;
1540
- }());
1541
-
1542
- /*
1543
- <file>
1544
- Project:
1545
- @osovitny/anatoly
1546
-
1547
- Authors:
1548
- Vadim Osovitny
1549
- Anatoly Osovitny
1550
-
1551
- Created:
1552
- 2 Jun 2020
1553
-
1554
- Version:
1555
- 1.0
1556
-
1557
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1558
- </file>
1559
- */
1493
+ return AppContextService;
1494
+ }(BaseApiService));
1495
+ AppContextService.decorators = [
1496
+ { type: i0.Injectable }
1497
+ ];
1498
+ AppContextService.ctorParameters = function () { return [
1499
+ { type: i1.HttpClient }
1500
+ ]; };
1560
1501
 
1561
1502
  /*
1562
1503
  <file>
@@ -1670,6 +1611,31 @@
1670
1611
  ];
1671
1612
  SessionStorageService.ctorParameters = function () { return []; };
1672
1613
 
1614
+ var AnatolyCoreModule = /** @class */ (function () {
1615
+ function AnatolyCoreModule(injector, parentModule) {
1616
+ this.injector = injector;
1617
+ throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
1618
+ exports.InjectorInstance = this.injector;
1619
+ }
1620
+ return AnatolyCoreModule;
1621
+ }());
1622
+ AnatolyCoreModule.decorators = [
1623
+ { type: i0.NgModule, args: [{
1624
+ imports: [common.CommonModule],
1625
+ exports: [],
1626
+ providers: [
1627
+ LoggingService,
1628
+ NotificationService,
1629
+ AppContextService,
1630
+ LoadingService
1631
+ ],
1632
+ },] }
1633
+ ];
1634
+ AnatolyCoreModule.ctorParameters = function () { return [
1635
+ { type: i0.Injector },
1636
+ { type: AnatolyCoreModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
1637
+ ]; };
1638
+
1673
1639
  /*
1674
1640
  <file>
1675
1641
  Project:
@@ -1713,6 +1679,68 @@
1713
1679
  return Subs;
1714
1680
  }());
1715
1681
 
1682
+ /*
1683
+ <file>
1684
+ Project:
1685
+ @osovitny/anatoly
1686
+
1687
+ Authors:
1688
+ Vadim Osovitny
1689
+ Anatoly Osovitny
1690
+
1691
+ Created:
1692
+ 19 March 2020
1693
+
1694
+ Version:
1695
+ 1.0
1696
+
1697
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1698
+ </file>
1699
+ */
1700
+ var Utils = /** @class */ (function () {
1701
+ function Utils() {
1702
+ }
1703
+ Utils.getValueByNameInQS = function (name) {
1704
+ return Utils.getValueByName(location.search, name);
1705
+ };
1706
+ Utils.getValueByName = function (url, name) {
1707
+ name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1708
+ // tslint:disable-next-line:one-variable-per-declaration
1709
+ var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
1710
+ return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
1711
+ };
1712
+ Utils.copyToClipBoard = function (event, val) {
1713
+ event.preventDefault();
1714
+ var selBox = document.createElement('textarea');
1715
+ selBox.style.position = 'fixed';
1716
+ selBox.style.left = '0';
1717
+ selBox.style.top = '0';
1718
+ selBox.style.opacity = '0';
1719
+ selBox.value = val;
1720
+ document.body.appendChild(selBox);
1721
+ selBox.focus();
1722
+ selBox.select();
1723
+ document.execCommand('copy');
1724
+ document.body.removeChild(selBox);
1725
+ };
1726
+ Utils.downloadFile = function (name, url) {
1727
+ var link = document.createElement('a');
1728
+ link.download = name;
1729
+ link.href = url;
1730
+ link.click();
1731
+ };
1732
+ Utils.downloadBlobFile = function (value, fileName) {
1733
+ if (window.navigator.msSaveOrOpenBlob) {
1734
+ window.navigator.msSaveOrOpenBlob(value, fileName);
1735
+ }
1736
+ else {
1737
+ var downloadURL = window.URL.createObjectURL(value);
1738
+ Utils.downloadFile(fileName, downloadURL);
1739
+ }
1740
+ };
1741
+ return Utils;
1742
+ }());
1743
+
1716
1744
  var BaseGridReadService = /** @class */ (function (_super) {
1717
1745
  __extends(BaseGridReadService, _super);
1718
1746
  function BaseGridReadService(http) {