@osovitny/anatoly 2.0.27 → 2.0.29
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.
- package/bundles/osovitny-anatoly.umd.js +353 -329
- package/bundles/osovitny-anatoly.umd.js.map +1 -1
- package/bundles/osovitny-anatoly.umd.min.js +1 -1
- package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
- package/esm2015/lib/core/core.module.js +1 -1
- package/esm2015/lib/core/interceptors/httpInterceptor.js +1 -1
- package/esm2015/lib/core/localization/localization.service.js +1 -1
- package/esm2015/lib/core/localization/localizationSettings.module.js +10 -2
- package/esm2015/lib/core/localization/utils.js +45 -0
- package/esm2015/lib/core/notifications/alerts.js +20 -20
- package/esm2015/lib/core/notifications/services/notification-service.js +12 -12
- package/esm2015/lib/core/utils.js +1 -26
- package/esm2015/lib/data/base/base-api.service.js +7 -9
- package/esm2015/lib/ui/ui.module.js +5 -3
- package/fesm2015/osovitny-anatoly.js +323 -299
- package/fesm2015/osovitny-anatoly.js.map +1 -1
- package/lib/core/localization/localizationSettings.module.d.ts +3 -0
- package/lib/core/localization/utils.d.ts +5 -0
- package/lib/core/utils.d.ts +0 -3
- package/lib/data/base/base-api.service.d.ts +1 -1
- package/osovitny-anatoly.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -543,7 +543,12 @@ const TranslateModuleAtRoot = TranslateModule.forRoot({
|
|
|
543
543
|
deps: [HttpClient]
|
|
544
544
|
}
|
|
545
545
|
});
|
|
546
|
+
let LocalizationInjectorInstance;
|
|
546
547
|
class LocalizationSettingsModule {
|
|
548
|
+
constructor(injector) {
|
|
549
|
+
this.injector = injector;
|
|
550
|
+
LocalizationInjectorInstance = this.injector;
|
|
551
|
+
}
|
|
547
552
|
}
|
|
548
553
|
LocalizationSettingsModule.decorators = [
|
|
549
554
|
{ type: NgModule, args: [{
|
|
@@ -560,6 +565,9 @@ LocalizationSettingsModule.decorators = [
|
|
|
560
565
|
],
|
|
561
566
|
exports: []
|
|
562
567
|
},] }
|
|
568
|
+
];
|
|
569
|
+
LocalizationSettingsModule.ctorParameters = () => [
|
|
570
|
+
{ type: Injector }
|
|
563
571
|
];
|
|
564
572
|
|
|
565
573
|
/*
|
|
@@ -644,7 +652,7 @@ GlobalErrorHandler.ctorParameters = () => [
|
|
|
644
652
|
Anatoly Osovitny
|
|
645
653
|
|
|
646
654
|
Created:
|
|
647
|
-
|
|
655
|
+
2 July 2020
|
|
648
656
|
|
|
649
657
|
Version:
|
|
650
658
|
1.0
|
|
@@ -652,69 +660,29 @@ GlobalErrorHandler.ctorParameters = () => [
|
|
|
652
660
|
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
653
661
|
</file>
|
|
654
662
|
*/
|
|
655
|
-
class
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
serializeParams(data) {
|
|
661
|
-
return data ? '?' + $.param(data) : '';
|
|
662
|
-
}
|
|
663
|
-
// api
|
|
664
|
-
get(action, data, responseType) {
|
|
665
|
-
if (!responseType) {
|
|
666
|
-
responseType = 'json';
|
|
667
|
-
}
|
|
668
|
-
const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
|
|
669
|
-
return this.http
|
|
670
|
-
.get(url, { responseType })
|
|
671
|
-
.pipe(map((res) => res));
|
|
672
|
-
}
|
|
673
|
-
post(action, data, responseType) {
|
|
674
|
-
if (!responseType) {
|
|
675
|
-
responseType = 'text';
|
|
676
|
-
}
|
|
677
|
-
const url = `${this.baseUrl}/${action}`;
|
|
678
|
-
return this.http.post(url, data, { responseType });
|
|
679
|
-
}
|
|
680
|
-
postQS(action, data, responseType) {
|
|
681
|
-
if (!responseType) {
|
|
682
|
-
responseType = 'text';
|
|
683
|
-
}
|
|
684
|
-
const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
|
|
685
|
-
return this.http.post(url, null, { responseType });
|
|
686
|
-
}
|
|
687
|
-
delete(action, data, responseType) {
|
|
688
|
-
if (!responseType) {
|
|
689
|
-
responseType = 'text';
|
|
690
|
-
}
|
|
691
|
-
const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
|
|
692
|
-
return this.http.delete(url, { responseType });
|
|
693
|
-
}
|
|
694
|
-
// gets
|
|
695
|
-
getById(id) {
|
|
696
|
-
return this.get('getById', { id });
|
|
697
|
-
}
|
|
698
|
-
getAll(data) {
|
|
699
|
-
return this.get('getall', data).pipe(map((res) => res));
|
|
663
|
+
class L10nUtils {
|
|
664
|
+
// @dynamic
|
|
665
|
+
static get localizationService() {
|
|
666
|
+
const ns = LocalizationInjectorInstance.get(LocalizationService);
|
|
667
|
+
return ns;
|
|
700
668
|
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
669
|
+
static getLocalizedValue(key, params, defaultKey) {
|
|
670
|
+
// VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
|
|
671
|
+
// defaultKey definition:
|
|
672
|
+
// if key is empty and defaultKey is defined => get localization for defaultKey
|
|
673
|
+
// Example: cancel()
|
|
674
|
+
if (!key && defaultKey) {
|
|
675
|
+
return this.localizationService.getLocalizedValue(defaultKey);
|
|
704
676
|
}
|
|
705
|
-
|
|
706
|
-
|
|
677
|
+
// VadimOS:
|
|
678
|
+
// if key is not empty value MUST be in localization table, othewise we will return key
|
|
679
|
+
if (key) {
|
|
680
|
+
const value = this.localizationService.getLocalizedValue(key, params);
|
|
681
|
+
return value;
|
|
707
682
|
}
|
|
708
|
-
|
|
709
|
-
return this.http.get(url).pipe(map((res) => res));
|
|
683
|
+
return key;
|
|
710
684
|
}
|
|
711
|
-
}
|
|
712
|
-
BaseApiService.decorators = [
|
|
713
|
-
{ type: Injectable }
|
|
714
|
-
];
|
|
715
|
-
BaseApiService.ctorParameters = () => [
|
|
716
|
-
{ type: HttpClient }
|
|
717
|
-
];
|
|
685
|
+
}
|
|
718
686
|
|
|
719
687
|
/*
|
|
720
688
|
<file>
|
|
@@ -726,7 +694,7 @@ BaseApiService.ctorParameters = () => [
|
|
|
726
694
|
Anatoly Osovitny
|
|
727
695
|
|
|
728
696
|
Created:
|
|
729
|
-
|
|
697
|
+
3 March 2020
|
|
730
698
|
|
|
731
699
|
Version:
|
|
732
700
|
1.0
|
|
@@ -734,55 +702,113 @@ BaseApiService.ctorParameters = () => [
|
|
|
734
702
|
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
735
703
|
</file>
|
|
736
704
|
*/
|
|
737
|
-
class
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
705
|
+
class Alerts {
|
|
706
|
+
static success(text, params, title, successAction) {
|
|
707
|
+
text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
|
|
708
|
+
title = L10nUtils.getLocalizedValue(title, null, 'Success');
|
|
709
|
+
Swal.fire({
|
|
710
|
+
text,
|
|
711
|
+
title,
|
|
712
|
+
icon: 'success',
|
|
713
|
+
confirmButtonText: L10nUtils.getLocalizedValue('Ok')
|
|
714
|
+
})
|
|
715
|
+
.then(() => {
|
|
716
|
+
if (successAction) {
|
|
717
|
+
successAction();
|
|
718
|
+
}
|
|
719
|
+
});
|
|
745
720
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
if (this.subscription != null) {
|
|
756
|
-
return;
|
|
757
|
-
}
|
|
758
|
-
this.subscription = this.get('GetCurrentContext', null).subscribe((data) => {
|
|
759
|
-
this.dataReceived(data);
|
|
760
|
-
}, (e) => { });
|
|
721
|
+
static info(text, params, title) {
|
|
722
|
+
text = L10nUtils.getLocalizedValue(text, params);
|
|
723
|
+
title = L10nUtils.getLocalizedValue(title, null, 'Info');
|
|
724
|
+
Swal.fire({
|
|
725
|
+
text,
|
|
726
|
+
title,
|
|
727
|
+
icon: 'info',
|
|
728
|
+
confirmButtonText: L10nUtils.getLocalizedValue('Ok')
|
|
729
|
+
});
|
|
761
730
|
}
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
this.current = null;
|
|
731
|
+
static warning(text, params, title) {
|
|
732
|
+
text = L10nUtils.getLocalizedValue(text, params);
|
|
733
|
+
title = L10nUtils.getLocalizedValue(title, null, 'Warning');
|
|
734
|
+
Swal.fire({
|
|
735
|
+
text,
|
|
736
|
+
title,
|
|
737
|
+
icon: 'warning',
|
|
738
|
+
confirmButtonText: L10nUtils.getLocalizedValue('Ok')
|
|
739
|
+
});
|
|
772
740
|
}
|
|
773
|
-
|
|
774
|
-
|
|
741
|
+
static error(text, params, title) {
|
|
742
|
+
text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
|
|
743
|
+
title = L10nUtils.getLocalizedValue(title, null, 'Error');
|
|
744
|
+
Swal.fire({
|
|
745
|
+
text,
|
|
746
|
+
title,
|
|
747
|
+
icon: 'error',
|
|
748
|
+
confirmButtonText: L10nUtils.getLocalizedValue('Ok')
|
|
749
|
+
});
|
|
775
750
|
}
|
|
776
|
-
|
|
777
|
-
|
|
751
|
+
static cancel(text, params, title) {
|
|
752
|
+
text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
|
|
753
|
+
title = L10nUtils.getLocalizedValue(title, null, 'Cancelled');
|
|
754
|
+
Swal.fire({
|
|
755
|
+
text,
|
|
756
|
+
title,
|
|
757
|
+
icon: 'info'
|
|
758
|
+
});
|
|
778
759
|
}
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
760
|
+
static notImplemented() {
|
|
761
|
+
this.warning('Not Implemented Yet');
|
|
762
|
+
}
|
|
763
|
+
;
|
|
764
|
+
static areYouSure(text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
|
|
765
|
+
text = L10nUtils.getLocalizedValue(text);
|
|
766
|
+
title = L10nUtils.getLocalizedValue(title, null, 'AreYouSure');
|
|
767
|
+
confirmButtonText = L10nUtils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
|
|
768
|
+
cancelButtonText = L10nUtils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
|
|
769
|
+
Swal.fire({
|
|
770
|
+
text,
|
|
771
|
+
title,
|
|
772
|
+
icon: 'warning',
|
|
773
|
+
confirmButtonText,
|
|
774
|
+
cancelButtonText,
|
|
775
|
+
showCancelButton: true
|
|
776
|
+
})
|
|
777
|
+
.then((result) => {
|
|
778
|
+
if (result.value) {
|
|
779
|
+
if (successAction) {
|
|
780
|
+
successAction();
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
// result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
|
|
784
|
+
else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
|
|
785
|
+
if (cancelAction) {
|
|
786
|
+
cancelAction();
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/*
|
|
795
|
+
<file>
|
|
796
|
+
Project:
|
|
797
|
+
@osovitny/anatoly
|
|
798
|
+
|
|
799
|
+
Authors:
|
|
800
|
+
Vadim Osovitny
|
|
801
|
+
Anatoly Osovitny
|
|
802
|
+
|
|
803
|
+
Created:
|
|
804
|
+
2 Jun 2020
|
|
805
|
+
|
|
806
|
+
Version:
|
|
807
|
+
1.0
|
|
808
|
+
|
|
809
|
+
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
810
|
+
</file>
|
|
811
|
+
*/
|
|
786
812
|
|
|
787
813
|
/*
|
|
788
814
|
<file>
|
|
@@ -960,8 +986,8 @@ class NotificationService {
|
|
|
960
986
|
}
|
|
961
987
|
}
|
|
962
988
|
success(text, params, title, createSessionNotification = true) {
|
|
963
|
-
text =
|
|
964
|
-
title =
|
|
989
|
+
text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
|
|
990
|
+
title = L10nUtils.getLocalizedValue(title);
|
|
965
991
|
this.toastrService.success(text, title, {
|
|
966
992
|
timeOut: 3000,
|
|
967
993
|
progressBar: true
|
|
@@ -971,24 +997,24 @@ class NotificationService {
|
|
|
971
997
|
}
|
|
972
998
|
}
|
|
973
999
|
info(text, params, title) {
|
|
974
|
-
text =
|
|
975
|
-
title =
|
|
1000
|
+
text = L10nUtils.getLocalizedValue(text, params);
|
|
1001
|
+
title = L10nUtils.getLocalizedValue(title);
|
|
976
1002
|
this.toastrService.info(text, title, {
|
|
977
1003
|
timeOut: 3000,
|
|
978
1004
|
progressBar: true
|
|
979
1005
|
});
|
|
980
1006
|
}
|
|
981
1007
|
warning(text, params, title) {
|
|
982
|
-
text =
|
|
983
|
-
title =
|
|
1008
|
+
text = L10nUtils.getLocalizedValue(text, params);
|
|
1009
|
+
title = L10nUtils.getLocalizedValue(title);
|
|
984
1010
|
this.toastrService.warning(text, title, {
|
|
985
1011
|
timeOut: 3000,
|
|
986
1012
|
progressBar: true
|
|
987
1013
|
});
|
|
988
1014
|
}
|
|
989
1015
|
error(text, params, title, createSessionNotification = true) {
|
|
990
|
-
text =
|
|
991
|
-
title =
|
|
1016
|
+
text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
|
|
1017
|
+
title = L10nUtils.getLocalizedValue(title);
|
|
992
1018
|
this.toastrService.error(text, title, {
|
|
993
1019
|
timeOut: 3000,
|
|
994
1020
|
progressBar: true
|
|
@@ -998,8 +1024,8 @@ class NotificationService {
|
|
|
998
1024
|
}
|
|
999
1025
|
}
|
|
1000
1026
|
cancel(text, params, title) {
|
|
1001
|
-
text =
|
|
1002
|
-
title =
|
|
1027
|
+
text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
|
|
1028
|
+
title = L10nUtils.getLocalizedValue(title);
|
|
1003
1029
|
this.toastrService.info(text, title, {
|
|
1004
1030
|
timeOut: 3000,
|
|
1005
1031
|
progressBar: true
|
|
@@ -1028,31 +1054,6 @@ NotificationService.ctorParameters = () => [
|
|
|
1028
1054
|
{ type: ToastrService }
|
|
1029
1055
|
];
|
|
1030
1056
|
|
|
1031
|
-
let InjectorInstance;
|
|
1032
|
-
class AnatolyCoreModule {
|
|
1033
|
-
constructor(injector, parentModule) {
|
|
1034
|
-
this.injector = injector;
|
|
1035
|
-
throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
|
|
1036
|
-
InjectorInstance = this.injector;
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
AnatolyCoreModule.decorators = [
|
|
1040
|
-
{ type: NgModule, args: [{
|
|
1041
|
-
imports: [CommonModule],
|
|
1042
|
-
exports: [],
|
|
1043
|
-
providers: [
|
|
1044
|
-
LoggingService,
|
|
1045
|
-
NotificationService,
|
|
1046
|
-
AppContextService,
|
|
1047
|
-
LoadingService
|
|
1048
|
-
],
|
|
1049
|
-
},] }
|
|
1050
|
-
];
|
|
1051
|
-
AnatolyCoreModule.ctorParameters = () => [
|
|
1052
|
-
{ type: Injector },
|
|
1053
|
-
{ type: AnatolyCoreModule, decorators: [{ type: Optional }, { type: SkipSelf }] }
|
|
1054
|
-
];
|
|
1055
|
-
|
|
1056
1057
|
/*
|
|
1057
1058
|
<file>
|
|
1058
1059
|
Project:
|
|
@@ -1063,7 +1064,7 @@ AnatolyCoreModule.ctorParameters = () => [
|
|
|
1063
1064
|
Anatoly Osovitny
|
|
1064
1065
|
|
|
1065
1066
|
Created:
|
|
1066
|
-
|
|
1067
|
+
13 Nov 2017
|
|
1067
1068
|
|
|
1068
1069
|
Version:
|
|
1069
1070
|
1.0
|
|
@@ -1071,68 +1072,65 @@ AnatolyCoreModule.ctorParameters = () => [
|
|
|
1071
1072
|
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1072
1073
|
</file>
|
|
1073
1074
|
*/
|
|
1074
|
-
class
|
|
1075
|
-
|
|
1076
|
-
|
|
1075
|
+
class BaseApiService {
|
|
1076
|
+
constructor(http) {
|
|
1077
|
+
this.http = http;
|
|
1078
|
+
this.baseUrl = '';
|
|
1077
1079
|
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
// tslint:disable-next-line:one-variable-per-declaration
|
|
1081
|
-
const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
|
|
1082
|
-
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
|
|
1080
|
+
serializeParams(data) {
|
|
1081
|
+
return data ? '?' + $.param(data) : '';
|
|
1083
1082
|
}
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
selBox.style.left = '0';
|
|
1089
|
-
selBox.style.top = '0';
|
|
1090
|
-
selBox.style.opacity = '0';
|
|
1091
|
-
selBox.value = val;
|
|
1092
|
-
document.body.appendChild(selBox);
|
|
1093
|
-
selBox.focus();
|
|
1094
|
-
selBox.select();
|
|
1095
|
-
document.execCommand('copy');
|
|
1096
|
-
document.body.removeChild(selBox);
|
|
1097
|
-
}
|
|
1098
|
-
static downloadFile(name, url) {
|
|
1099
|
-
const link = document.createElement('a');
|
|
1100
|
-
link.download = name;
|
|
1101
|
-
link.href = url;
|
|
1102
|
-
link.click();
|
|
1103
|
-
}
|
|
1104
|
-
// Localization
|
|
1105
|
-
// @dynamic
|
|
1106
|
-
static get localizationService() {
|
|
1107
|
-
const ns = InjectorInstance.get(LocalizationService);
|
|
1108
|
-
return ns;
|
|
1109
|
-
}
|
|
1110
|
-
static getLocalizedValue(key, params, defaultKey) {
|
|
1111
|
-
// VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
|
|
1112
|
-
// defaultKey definition:
|
|
1113
|
-
// if key is empty and defaultKey is defined => get localization for defaultKey
|
|
1114
|
-
// Example: cancel()
|
|
1115
|
-
if (!key && defaultKey) {
|
|
1116
|
-
return this.localizationService.getLocalizedValue(defaultKey);
|
|
1083
|
+
// api
|
|
1084
|
+
get(action, data, responseType) {
|
|
1085
|
+
if (!responseType) {
|
|
1086
|
+
responseType = 'json';
|
|
1117
1087
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1088
|
+
const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
|
|
1089
|
+
return this.http
|
|
1090
|
+
.get(url, { responseType })
|
|
1091
|
+
.pipe(map((res) => res));
|
|
1092
|
+
}
|
|
1093
|
+
post(action, data, responseType) {
|
|
1094
|
+
if (!responseType) {
|
|
1095
|
+
responseType = 'text';
|
|
1123
1096
|
}
|
|
1124
|
-
|
|
1097
|
+
const url = `${this.baseUrl}/${action}`;
|
|
1098
|
+
return this.http.post(url, data, { responseType });
|
|
1125
1099
|
}
|
|
1126
|
-
|
|
1127
|
-
if (
|
|
1128
|
-
|
|
1100
|
+
postQS(action, data, responseType) {
|
|
1101
|
+
if (!responseType) {
|
|
1102
|
+
responseType = 'text';
|
|
1129
1103
|
}
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1104
|
+
const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
|
|
1105
|
+
return this.http.post(url, null, { responseType });
|
|
1106
|
+
}
|
|
1107
|
+
delete(action, data, responseType) {
|
|
1108
|
+
if (!responseType) {
|
|
1109
|
+
responseType = 'text';
|
|
1133
1110
|
}
|
|
1111
|
+
const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
|
|
1112
|
+
return this.http.delete(url, { responseType });
|
|
1134
1113
|
}
|
|
1135
|
-
|
|
1114
|
+
// gets
|
|
1115
|
+
getById(id) {
|
|
1116
|
+
return this.get('getById', { id });
|
|
1117
|
+
}
|
|
1118
|
+
getAll(data) {
|
|
1119
|
+
return this.get('getall', data).pipe(map((res) => res));
|
|
1120
|
+
}
|
|
1121
|
+
getJsonFile(fileName) {
|
|
1122
|
+
const jsonsUrl = AppCoreSettings.jsonsUrl;
|
|
1123
|
+
const jsonVersion = AppCoreSettings.jsonVersion;
|
|
1124
|
+
const url = jsonsUrl + '/' + fileName + '?' + jsonVersion;
|
|
1125
|
+
return this.http.get(url).pipe(map((res) => res));
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
BaseApiService.decorators = [
|
|
1129
|
+
{ type: Injectable }
|
|
1130
|
+
];
|
|
1131
|
+
BaseApiService.ctorParameters = () => [
|
|
1132
|
+
{ type: HttpClient }
|
|
1133
|
+
];
|
|
1136
1134
|
|
|
1137
1135
|
/*
|
|
1138
1136
|
<file>
|
|
@@ -1144,7 +1142,7 @@ class Utils {
|
|
|
1144
1142
|
Anatoly Osovitny
|
|
1145
1143
|
|
|
1146
1144
|
Created:
|
|
1147
|
-
|
|
1145
|
+
13 Nov 2017
|
|
1148
1146
|
|
|
1149
1147
|
Version:
|
|
1150
1148
|
1.0
|
|
@@ -1152,113 +1150,55 @@ class Utils {
|
|
|
1152
1150
|
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1153
1151
|
</file>
|
|
1154
1152
|
*/
|
|
1155
|
-
class
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
confirmButtonText: Utils.getLocalizedValue('Ok')
|
|
1164
|
-
})
|
|
1165
|
-
.then(() => {
|
|
1166
|
-
if (successAction) {
|
|
1167
|
-
successAction();
|
|
1168
|
-
}
|
|
1169
|
-
});
|
|
1170
|
-
}
|
|
1171
|
-
static info(text, params, title) {
|
|
1172
|
-
text = Utils.getLocalizedValue(text, params);
|
|
1173
|
-
title = Utils.getLocalizedValue(title, null, 'Info');
|
|
1174
|
-
Swal.fire({
|
|
1175
|
-
text,
|
|
1176
|
-
title,
|
|
1177
|
-
icon: 'info',
|
|
1178
|
-
confirmButtonText: Utils.getLocalizedValue('Ok')
|
|
1179
|
-
});
|
|
1180
|
-
}
|
|
1181
|
-
static warning(text, params, title) {
|
|
1182
|
-
text = Utils.getLocalizedValue(text, params);
|
|
1183
|
-
title = Utils.getLocalizedValue(title, null, 'Warning');
|
|
1184
|
-
Swal.fire({
|
|
1185
|
-
text,
|
|
1186
|
-
title,
|
|
1187
|
-
icon: 'warning',
|
|
1188
|
-
confirmButtonText: Utils.getLocalizedValue('Ok')
|
|
1189
|
-
});
|
|
1153
|
+
class AppContextService extends BaseApiService {
|
|
1154
|
+
constructor(http) {
|
|
1155
|
+
super(http);
|
|
1156
|
+
this.http = http;
|
|
1157
|
+
this.current = null;
|
|
1158
|
+
this.successes = [];
|
|
1159
|
+
this.subscription = null;
|
|
1160
|
+
this.baseUrl = '/api/appContext';
|
|
1190
1161
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1162
|
+
getCurrent(success) {
|
|
1163
|
+
if (typeof success == 'undefined') {
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
if (this.current != null) {
|
|
1167
|
+
success(this.current);
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
this.successes.push(success);
|
|
1171
|
+
if (this.subscription != null) {
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
this.subscription = this.get('GetCurrentContext', null).subscribe((data) => {
|
|
1175
|
+
this.dataReceived(data);
|
|
1176
|
+
}, (e) => { });
|
|
1200
1177
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1178
|
+
dataReceived(data) {
|
|
1179
|
+
this.current = data;
|
|
1180
|
+
for (let i = 0; i < this.successes.length; i++) {
|
|
1181
|
+
let success = this.successes[i];
|
|
1182
|
+
success(data);
|
|
1183
|
+
}
|
|
1184
|
+
this.successes = [];
|
|
1185
|
+
this.subscription.unsubscribe();
|
|
1186
|
+
this.subscription = null;
|
|
1187
|
+
this.current = null;
|
|
1209
1188
|
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1189
|
+
isUserSignedIn() {
|
|
1190
|
+
return ContextInitState.isUserSignedIn;
|
|
1212
1191
|
}
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
text = Utils.getLocalizedValue(text);
|
|
1216
|
-
title = Utils.getLocalizedValue(title, null, 'AreYouSure');
|
|
1217
|
-
confirmButtonText = Utils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
|
|
1218
|
-
cancelButtonText = Utils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
|
|
1219
|
-
Swal.fire({
|
|
1220
|
-
text,
|
|
1221
|
-
title,
|
|
1222
|
-
icon: 'warning',
|
|
1223
|
-
confirmButtonText,
|
|
1224
|
-
cancelButtonText,
|
|
1225
|
-
showCancelButton: true
|
|
1226
|
-
})
|
|
1227
|
-
.then((result) => {
|
|
1228
|
-
if (result.value) {
|
|
1229
|
-
if (successAction) {
|
|
1230
|
-
successAction();
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
// result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
|
|
1234
|
-
else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
|
|
1235
|
-
if (cancelAction) {
|
|
1236
|
-
cancelAction();
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
});
|
|
1192
|
+
isUserAdmin() {
|
|
1193
|
+
return ContextInitState.isUserAdmin;
|
|
1240
1194
|
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
Authors:
|
|
1250
|
-
Vadim Osovitny
|
|
1251
|
-
Anatoly Osovitny
|
|
1252
|
-
|
|
1253
|
-
Created:
|
|
1254
|
-
2 Jun 2020
|
|
1255
|
-
|
|
1256
|
-
Version:
|
|
1257
|
-
1.0
|
|
1258
|
-
|
|
1259
|
-
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1260
|
-
</file>
|
|
1261
|
-
*/
|
|
1195
|
+
}
|
|
1196
|
+
AppContextService.decorators = [
|
|
1197
|
+
{ type: Injectable }
|
|
1198
|
+
];
|
|
1199
|
+
AppContextService.ctorParameters = () => [
|
|
1200
|
+
{ type: HttpClient }
|
|
1201
|
+
];
|
|
1262
1202
|
|
|
1263
1203
|
/*
|
|
1264
1204
|
<file>
|
|
@@ -1381,6 +1321,31 @@ SessionStorageService.decorators = [
|
|
|
1381
1321
|
];
|
|
1382
1322
|
SessionStorageService.ctorParameters = () => [];
|
|
1383
1323
|
|
|
1324
|
+
let InjectorInstance;
|
|
1325
|
+
class AnatolyCoreModule {
|
|
1326
|
+
constructor(injector, parentModule) {
|
|
1327
|
+
this.injector = injector;
|
|
1328
|
+
throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
|
|
1329
|
+
InjectorInstance = this.injector;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
AnatolyCoreModule.decorators = [
|
|
1333
|
+
{ type: NgModule, args: [{
|
|
1334
|
+
imports: [CommonModule],
|
|
1335
|
+
exports: [],
|
|
1336
|
+
providers: [
|
|
1337
|
+
LoggingService,
|
|
1338
|
+
NotificationService,
|
|
1339
|
+
AppContextService,
|
|
1340
|
+
LoadingService
|
|
1341
|
+
],
|
|
1342
|
+
},] }
|
|
1343
|
+
];
|
|
1344
|
+
AnatolyCoreModule.ctorParameters = () => [
|
|
1345
|
+
{ type: Injector },
|
|
1346
|
+
{ type: AnatolyCoreModule, decorators: [{ type: Optional }, { type: SkipSelf }] }
|
|
1347
|
+
];
|
|
1348
|
+
|
|
1384
1349
|
/*
|
|
1385
1350
|
<file>
|
|
1386
1351
|
Project:
|
|
@@ -1415,6 +1380,65 @@ class Subs {
|
|
|
1415
1380
|
}
|
|
1416
1381
|
}
|
|
1417
1382
|
|
|
1383
|
+
/*
|
|
1384
|
+
<file>
|
|
1385
|
+
Project:
|
|
1386
|
+
@osovitny/anatoly
|
|
1387
|
+
|
|
1388
|
+
Authors:
|
|
1389
|
+
Vadim Osovitny
|
|
1390
|
+
Anatoly Osovitny
|
|
1391
|
+
|
|
1392
|
+
Created:
|
|
1393
|
+
19 March 2020
|
|
1394
|
+
|
|
1395
|
+
Version:
|
|
1396
|
+
1.0
|
|
1397
|
+
|
|
1398
|
+
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1399
|
+
</file>
|
|
1400
|
+
*/
|
|
1401
|
+
class Utils {
|
|
1402
|
+
static getValueByNameInQS(name) {
|
|
1403
|
+
return Utils.getValueByName(location.search, name);
|
|
1404
|
+
}
|
|
1405
|
+
static getValueByName(url, name) {
|
|
1406
|
+
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
|
|
1407
|
+
// tslint:disable-next-line:one-variable-per-declaration
|
|
1408
|
+
const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
|
|
1409
|
+
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
|
|
1410
|
+
}
|
|
1411
|
+
static copyToClipBoard(event, val) {
|
|
1412
|
+
event.preventDefault();
|
|
1413
|
+
const selBox = document.createElement('textarea');
|
|
1414
|
+
selBox.style.position = 'fixed';
|
|
1415
|
+
selBox.style.left = '0';
|
|
1416
|
+
selBox.style.top = '0';
|
|
1417
|
+
selBox.style.opacity = '0';
|
|
1418
|
+
selBox.value = val;
|
|
1419
|
+
document.body.appendChild(selBox);
|
|
1420
|
+
selBox.focus();
|
|
1421
|
+
selBox.select();
|
|
1422
|
+
document.execCommand('copy');
|
|
1423
|
+
document.body.removeChild(selBox);
|
|
1424
|
+
}
|
|
1425
|
+
static downloadFile(name, url) {
|
|
1426
|
+
const link = document.createElement('a');
|
|
1427
|
+
link.download = name;
|
|
1428
|
+
link.href = url;
|
|
1429
|
+
link.click();
|
|
1430
|
+
}
|
|
1431
|
+
static downloadBlobFile(value, fileName) {
|
|
1432
|
+
if (window.navigator.msSaveOrOpenBlob) {
|
|
1433
|
+
window.navigator.msSaveOrOpenBlob(value, fileName);
|
|
1434
|
+
}
|
|
1435
|
+
else {
|
|
1436
|
+
const downloadURL = window.URL.createObjectURL(value);
|
|
1437
|
+
Utils.downloadFile(fileName, downloadURL);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1418
1442
|
/*
|
|
1419
1443
|
<file>
|
|
1420
1444
|
Project:
|
|
@@ -2929,5 +2953,5 @@ AnatolyUIModule.decorators = [
|
|
|
2929
2953
|
* Generated bundle index. Do not edit.
|
|
2930
2954
|
*/
|
|
2931
2955
|
|
|
2932
|
-
export { Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BillingApiService, BuyAccessButtonComponent, ContentHeaderComponent, ContextInitState, Convert, DefaultEditorOptions, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, Guid, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NotificationService, NotificationsApiService, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, SpinnerComponent, Subs, SubscribePlanButtonComponent, TranslateModuleAtRoot, UpgradePlanButtonComponent, Urls, Utils, ValidationSummaryComponent, consts, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
|
|
2956
|
+
export { Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BillingApiService, BuyAccessButtonComponent, ContentHeaderComponent, ContextInitState, Convert, DefaultEditorOptions, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, Guid, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NotificationService, NotificationsApiService, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, SpinnerComponent, Subs, SubscribePlanButtonComponent, TranslateModuleAtRoot, UpgradePlanButtonComponent, Urls, Utils, ValidationSummaryComponent, consts, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
|
|
2933
2957
|
//# sourceMappingURL=osovitny-anatoly.js.map
|