@osovitny/anatoly 2.0.10 → 2.0.11

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.
@@ -882,7 +882,7 @@
882
882
  <file>
883
883
  Project:
884
884
  @osovitny/anatoly
885
-
885
+ ./go/base-go.service
886
886
  Authors:
887
887
  Vadim Osovitny
888
888
  Anatoly Osovitny
@@ -1095,6 +1095,76 @@
1095
1095
  </file>
1096
1096
  */
1097
1097
 
1098
+ /*
1099
+ <file>
1100
+ Project:
1101
+ @osovitny/anatoly
1102
+
1103
+ Authors:
1104
+ Vadim Osovitny
1105
+ Anatoly Osovitny
1106
+
1107
+ Created:
1108
+ 14 Aug 2018
1109
+
1110
+ Version:
1111
+ 1.0
1112
+
1113
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1114
+ </file>
1115
+ */
1116
+ var BuyAccessButtonComponent = /** @class */ (function () {
1117
+ function BuyAccessButtonComponent(appcontext, api) {
1118
+ this.appcontext = appcontext;
1119
+ this.api = api;
1120
+ this.contextUpdated = false;
1121
+ this.isUserSignedIn = false;
1122
+ this.currentPlan = 0;
1123
+ this.currentPlanTitle = "";
1124
+ }
1125
+ BuyAccessButtonComponent.prototype.ngOnInit = function () {
1126
+ var _this = this;
1127
+ if (!this.appcontext.isUserSignedIn()) {
1128
+ this.contextUpdated = true;
1129
+ return;
1130
+ }
1131
+ this.appcontext.getCurrent(function (current) {
1132
+ _this.isUserSignedIn = current.isUserSignedIn;
1133
+ if (_this.isUserSignedIn) {
1134
+ _this.currentPlan = current.account.billingPlan;
1135
+ _this.currentPlanTitle = current.account.billingPlanAsString;
1136
+ }
1137
+ _this.contextUpdated = true;
1138
+ });
1139
+ };
1140
+ BuyAccessButtonComponent.prototype.onBuyPlan = function () {
1141
+ var text = "Requested plan: " + this.plantitle + " ";
1142
+ var that = this;
1143
+ Alerts.AreYouSure(text, "Buying access", "Confirm change", "Cancel", function () {
1144
+ that.api.buyAccess(that.plan, function () {
1145
+ Alerts.Success("Access Granted", null, function () {
1146
+ window.location.reload();
1147
+ });
1148
+ });
1149
+ });
1150
+ };
1151
+ return BuyAccessButtonComponent;
1152
+ }());
1153
+ BuyAccessButtonComponent.decorators = [
1154
+ { type: i0.Component, args: [{
1155
+ selector: "anatoly-buyaccess-button",
1156
+ template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n"
1157
+ },] }
1158
+ ];
1159
+ BuyAccessButtonComponent.ctorParameters = function () { return [
1160
+ { type: AppContextService },
1161
+ { type: BillingApiService }
1162
+ ]; };
1163
+ BuyAccessButtonComponent.propDecorators = {
1164
+ plan: [{ type: i0.Input }],
1165
+ plantitle: [{ type: i0.Input }]
1166
+ };
1167
+
1098
1168
  /*
1099
1169
  <file>
1100
1170
  Project:
@@ -1217,7 +1287,7 @@
1217
1287
  Anatoly Osovitny
1218
1288
 
1219
1289
  Created:
1220
- 14 Aug 2018
1290
+ 4 Jul 2018
1221
1291
 
1222
1292
  Version:
1223
1293
  1.0
@@ -1225,56 +1295,20 @@
1225
1295
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1226
1296
  </file>
1227
1297
  */
1228
- var BuyAccessButtonComponent = /** @class */ (function () {
1229
- function BuyAccessButtonComponent(appcontext, api) {
1230
- this.appcontext = appcontext;
1231
- this.api = api;
1232
- this.contextUpdated = false;
1233
- this.isUserSignedIn = false;
1234
- this.currentPlan = 0;
1235
- this.currentPlanTitle = "";
1298
+ var SignInButtonComponent = /** @class */ (function () {
1299
+ function SignInButtonComponent() {
1236
1300
  }
1237
- BuyAccessButtonComponent.prototype.ngOnInit = function () {
1238
- var _this = this;
1239
- if (!this.appcontext.isUserSignedIn()) {
1240
- this.contextUpdated = true;
1241
- return;
1242
- }
1243
- this.appcontext.getCurrent(function (current) {
1244
- _this.isUserSignedIn = current.isUserSignedIn;
1245
- if (_this.isUserSignedIn) {
1246
- _this.currentPlan = current.account.billingPlan;
1247
- _this.currentPlanTitle = current.account.billingPlanAsString;
1248
- }
1249
- _this.contextUpdated = true;
1250
- });
1251
- };
1252
- BuyAccessButtonComponent.prototype.onBuyPlan = function () {
1253
- var text = "Requested plan: " + this.plantitle + " ";
1254
- var that = this;
1255
- Alerts.AreYouSure(text, "Buying access", "Confirm change", "Cancel", function () {
1256
- that.api.buyAccess(that.plan, function () {
1257
- Alerts.Success("Access Granted", null, function () {
1258
- window.location.reload();
1259
- });
1260
- });
1261
- });
1262
- };
1263
- return BuyAccessButtonComponent;
1301
+ return SignInButtonComponent;
1264
1302
  }());
1265
- BuyAccessButtonComponent.decorators = [
1303
+ SignInButtonComponent.decorators = [
1266
1304
  { type: i0.Component, args: [{
1267
- selector: "anatoly-buyaccess-button",
1268
- template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n"
1305
+ selector: "anatoly-signin-button",
1306
+ template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
1269
1307
  },] }
1270
1308
  ];
1271
- BuyAccessButtonComponent.ctorParameters = function () { return [
1272
- { type: AppContextService },
1273
- { type: BillingApiService }
1274
- ]; };
1275
- BuyAccessButtonComponent.propDecorators = {
1276
- plan: [{ type: i0.Input }],
1277
- plantitle: [{ type: i0.Input }]
1309
+ SignInButtonComponent.ctorParameters = function () { return []; };
1310
+ SignInButtonComponent.propDecorators = {
1311
+ classbtn: [{ type: i0.Input }]
1278
1312
  };
1279
1313
 
1280
1314
  /*
@@ -1295,19 +1329,19 @@
1295
1329
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1296
1330
  </file>
1297
1331
  */
1298
- var SignInButtonComponent = /** @class */ (function () {
1299
- function SignInButtonComponent() {
1332
+ var SignOutButtonComponent = /** @class */ (function () {
1333
+ function SignOutButtonComponent() {
1300
1334
  }
1301
- return SignInButtonComponent;
1335
+ return SignOutButtonComponent;
1302
1336
  }());
1303
- SignInButtonComponent.decorators = [
1337
+ SignOutButtonComponent.decorators = [
1304
1338
  { type: i0.Component, args: [{
1305
- selector: "anatoly-signin-button",
1306
- template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
1339
+ selector: "anatoly-signout-button",
1340
+ template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
1307
1341
  },] }
1308
1342
  ];
1309
- SignInButtonComponent.ctorParameters = function () { return []; };
1310
- SignInButtonComponent.propDecorators = {
1343
+ SignOutButtonComponent.ctorParameters = function () { return []; };
1344
+ SignOutButtonComponent.propDecorators = {
1311
1345
  classbtn: [{ type: i0.Input }]
1312
1346
  };
1313
1347
 
@@ -1354,7 +1388,7 @@
1354
1388
  Anatoly Osovitny
1355
1389
 
1356
1390
  Created:
1357
- 4 Jul 2018
1391
+ 23 Apr 2018
1358
1392
 
1359
1393
  Version:
1360
1394
  1.0
@@ -1362,20 +1396,24 @@
1362
1396
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1363
1397
  </file>
1364
1398
  */
1365
- var SignOutButtonComponent = /** @class */ (function () {
1366
- function SignOutButtonComponent() {
1399
+ var ContentHeaderComponent = /** @class */ (function () {
1400
+ function ContentHeaderComponent() {
1367
1401
  }
1368
- return SignOutButtonComponent;
1402
+ ContentHeaderComponent.prototype.ngOnInit = function () {
1403
+ if (this.title == null) {
1404
+ this.title = "";
1405
+ }
1406
+ };
1407
+ return ContentHeaderComponent;
1369
1408
  }());
1370
- SignOutButtonComponent.decorators = [
1409
+ ContentHeaderComponent.decorators = [
1371
1410
  { type: i0.Component, args: [{
1372
- selector: "anatoly-signout-button",
1373
- template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
1411
+ selector: "anatoly-content-header",
1412
+ template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
1374
1413
  },] }
1375
1414
  ];
1376
- SignOutButtonComponent.ctorParameters = function () { return []; };
1377
- SignOutButtonComponent.propDecorators = {
1378
- classbtn: [{ type: i0.Input }]
1415
+ ContentHeaderComponent.propDecorators = {
1416
+ title: [{ type: i0.Input }]
1379
1417
  };
1380
1418
 
1381
1419
  /*
@@ -1468,96 +1506,6 @@
1468
1506
  formSubmitted: [{ type: i0.Input }]
1469
1507
  };
1470
1508
 
1471
- var ValidationSummaryComponent = /** @class */ (function (_super) {
1472
- __extends(ValidationSummaryComponent, _super);
1473
- function ValidationSummaryComponent() {
1474
- return _super.call(this) || this;
1475
- }
1476
- ValidationSummaryComponent.prototype.getFormValidationMessages = function () {
1477
- var _this = this;
1478
- var messages = [];
1479
- Object.keys(this.formGroup.controls).forEach(function (k) {
1480
- var control = _this.formGroup.controls[k];
1481
- if (control.controls != null) {
1482
- Object.keys(control.controls).forEach(function (k) {
1483
- var child = control.controls[k];
1484
- _this.getValidationMessages(child, k).forEach(function (m) { return messages.push(m); });
1485
- });
1486
- }
1487
- else {
1488
- _this.getValidationMessages(control, k).forEach(function (m) { return messages.push(m); });
1489
- }
1490
- });
1491
- return messages;
1492
- };
1493
- ValidationSummaryComponent.prototype.getValidationMessages = function (state, thingName) {
1494
- var thing = state.path || thingName;
1495
- var messages = [];
1496
- if (state.errors) {
1497
- for (var errorName in state.errors) {
1498
- if (state.errors.hasOwnProperty(errorName)) {
1499
- switch (errorName) {
1500
- case "required":
1501
- messages.push(thing + " is required");
1502
- break;
1503
- case "minlength":
1504
- messages.push(thing + " must be at least " + state.errors["minlength"].requiredLength + " characters");
1505
- break;
1506
- case "pattern":
1507
- messages.push(thing + " contains illegal characters");
1508
- break;
1509
- }
1510
- }
1511
- }
1512
- }
1513
- return messages;
1514
- };
1515
- return ValidationSummaryComponent;
1516
- }(BaseEditComponent));
1517
-
1518
- var FormValidationSummaryComponent = /** @class */ (function (_super) {
1519
- __extends(FormValidationSummaryComponent, _super);
1520
- function FormValidationSummaryComponent() {
1521
- var _this = _super.call(this) || this;
1522
- _this.isVisible = false;
1523
- return _this;
1524
- }
1525
- FormValidationSummaryComponent.prototype.getErrors = function () {
1526
- var messages = this.getFormValidationMessages();
1527
- return messages;
1528
- };
1529
- return FormValidationSummaryComponent;
1530
- }(ValidationSummaryComponent));
1531
- FormValidationSummaryComponent.decorators = [
1532
- { type: i0.Component, args: [{
1533
- selector: "anatoly-form-validation-summary",
1534
- template: "<div class=\"callout callout-danger\" *ngIf=\"isVisible\">\r\n <h4 class=\"box-title\">There are problems with the form</h4>\r\n <p *ngFor=\"let error of getErrors()\">\r\n <span class=\"help-block\" style=\"color: white;\">{{ error }}</span>\r\n </p>\r\n</div>\r\n"
1535
- },] }
1536
- ];
1537
- FormValidationSummaryComponent.ctorParameters = function () { return []; };
1538
- FormValidationSummaryComponent.propDecorators = {
1539
- isVisible: [{ type: i0.Input }]
1540
- };
1541
-
1542
- var ItemValidationSummaryComponent = /** @class */ (function (_super) {
1543
- __extends(ItemValidationSummaryComponent, _super);
1544
- function ItemValidationSummaryComponent() {
1545
- return _super.call(this) || this;
1546
- }
1547
- return ItemValidationSummaryComponent;
1548
- }(ValidationSummaryComponent));
1549
- ItemValidationSummaryComponent.decorators = [
1550
- { type: i0.Component, args: [{
1551
- selector: "anatoly-item-validation-summary",
1552
- template: "<ul class=\"list-unstyled\" *ngIf=\"isItemInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n"
1553
- },] }
1554
- ];
1555
- ItemValidationSummaryComponent.ctorParameters = function () { return []; };
1556
- ItemValidationSummaryComponent.propDecorators = {
1557
- controlName: [{ type: i0.Input }],
1558
- controlTitle: [{ type: i0.Input }]
1559
- };
1560
-
1561
1509
  /*
1562
1510
  <file>
1563
1511
  Project:
@@ -1784,85 +1732,94 @@
1784
1732
  editorFormKey: [{ type: i0.Input }]
1785
1733
  };
1786
1734
 
1787
- /*
1788
- <file>
1789
- Project:
1790
- @osovitny/anatoly
1791
-
1792
- Authors:
1793
- Vadim Osovitny
1794
- Anatoly Osovitny
1795
-
1796
- Created:
1797
- 23 Apr 2018
1798
-
1799
- Version:
1800
- 1.0
1801
-
1802
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1803
- </file>
1804
- */
1805
- var ContentHeaderComponent = /** @class */ (function () {
1806
- function ContentHeaderComponent() {
1735
+ var ValidationSummaryComponent = /** @class */ (function (_super) {
1736
+ __extends(ValidationSummaryComponent, _super);
1737
+ function ValidationSummaryComponent() {
1738
+ return _super.call(this) || this;
1807
1739
  }
1808
- ContentHeaderComponent.prototype.ngOnInit = function () {
1809
- if (this.title == null) {
1810
- this.title = "";
1740
+ ValidationSummaryComponent.prototype.getFormValidationMessages = function () {
1741
+ var _this = this;
1742
+ var messages = [];
1743
+ Object.keys(this.formGroup.controls).forEach(function (k) {
1744
+ var control = _this.formGroup.controls[k];
1745
+ if (control.controls != null) {
1746
+ Object.keys(control.controls).forEach(function (k) {
1747
+ var child = control.controls[k];
1748
+ _this.getValidationMessages(child, k).forEach(function (m) { return messages.push(m); });
1749
+ });
1750
+ }
1751
+ else {
1752
+ _this.getValidationMessages(control, k).forEach(function (m) { return messages.push(m); });
1753
+ }
1754
+ });
1755
+ return messages;
1756
+ };
1757
+ ValidationSummaryComponent.prototype.getValidationMessages = function (state, thingName) {
1758
+ var thing = state.path || thingName;
1759
+ var messages = [];
1760
+ if (state.errors) {
1761
+ for (var errorName in state.errors) {
1762
+ if (state.errors.hasOwnProperty(errorName)) {
1763
+ switch (errorName) {
1764
+ case "required":
1765
+ messages.push(thing + " is required");
1766
+ break;
1767
+ case "minlength":
1768
+ messages.push(thing + " must be at least " + state.errors["minlength"].requiredLength + " characters");
1769
+ break;
1770
+ case "pattern":
1771
+ messages.push(thing + " contains illegal characters");
1772
+ break;
1773
+ }
1774
+ }
1775
+ }
1811
1776
  }
1777
+ return messages;
1812
1778
  };
1813
- return ContentHeaderComponent;
1814
- }());
1815
- ContentHeaderComponent.decorators = [
1779
+ return ValidationSummaryComponent;
1780
+ }(BaseEditComponent));
1781
+
1782
+ var FormValidationSummaryComponent = /** @class */ (function (_super) {
1783
+ __extends(FormValidationSummaryComponent, _super);
1784
+ function FormValidationSummaryComponent() {
1785
+ var _this = _super.call(this) || this;
1786
+ _this.isVisible = false;
1787
+ return _this;
1788
+ }
1789
+ FormValidationSummaryComponent.prototype.getErrors = function () {
1790
+ var messages = this.getFormValidationMessages();
1791
+ return messages;
1792
+ };
1793
+ return FormValidationSummaryComponent;
1794
+ }(ValidationSummaryComponent));
1795
+ FormValidationSummaryComponent.decorators = [
1816
1796
  { type: i0.Component, args: [{
1817
- selector: "anatoly-content-header",
1818
- template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
1797
+ selector: "anatoly-form-validation-summary",
1798
+ template: "<div class=\"callout callout-danger\" *ngIf=\"isVisible\">\r\n <h4 class=\"box-title\">There are problems with the form</h4>\r\n <p *ngFor=\"let error of getErrors()\">\r\n <span class=\"help-block\" style=\"color: white;\">{{ error }}</span>\r\n </p>\r\n</div>\r\n"
1819
1799
  },] }
1820
1800
  ];
1821
- ContentHeaderComponent.propDecorators = {
1822
- title: [{ type: i0.Input }]
1801
+ FormValidationSummaryComponent.ctorParameters = function () { return []; };
1802
+ FormValidationSummaryComponent.propDecorators = {
1803
+ isVisible: [{ type: i0.Input }]
1823
1804
  };
1824
1805
 
1825
- /*
1826
- <file>
1827
- Project:
1828
- @osovitny/anatoly
1829
-
1830
- Authors:
1831
- Vadim Osovitny
1832
- Anatoly Osovitny
1833
-
1834
- Created:
1835
- 26 Jun 2020
1836
-
1837
- Version:
1838
- 1.0
1839
-
1840
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1841
- </file>
1842
- */
1843
- var Copy2ClipboardComponent = /** @class */ (function () {
1844
- function Copy2ClipboardComponent() {
1845
- this.tooltip = "Copy to clipboard";
1846
- this.text = "";
1806
+ var ItemValidationSummaryComponent = /** @class */ (function (_super) {
1807
+ __extends(ItemValidationSummaryComponent, _super);
1808
+ function ItemValidationSummaryComponent() {
1809
+ return _super.call(this) || this;
1847
1810
  }
1848
- Copy2ClipboardComponent.prototype.onCopy2Clipboard = function (event) {
1849
- var _this = this;
1850
- this.tooltip = "Copied";
1851
- setTimeout(function () {
1852
- _this.tooltip = "Copy to clipboard";
1853
- }, 1000);
1854
- Utils.copyToClipBoard(event, this.text);
1855
- };
1856
- return Copy2ClipboardComponent;
1857
- }());
1858
- Copy2ClipboardComponent.decorators = [
1811
+ return ItemValidationSummaryComponent;
1812
+ }(ValidationSummaryComponent));
1813
+ ItemValidationSummaryComponent.decorators = [
1859
1814
  { type: i0.Component, args: [{
1860
- selector: "anatoly-copy-2-clipboard",
1861
- template: "<span kendoTooltip filter=\".helptooltip\" tooltipClass=\"help-tooltip\" [tooltipTemplate]=\"template\">\r\n <ng-template #template let-anchor>\r\n <span [innerHTML]='tooltip'></span>\r\n </ng-template> \r\n \r\n <span class=\"helptooltip\">\r\n <a class=\"btn btn-primary btn-sm active\" (click)=\"onCopy2Clipboard($event)\"><i class=\"fa fa-copy\"></i></a>\r\n </span>\r\n</span>\r\n\r\n"
1815
+ selector: "anatoly-item-validation-summary",
1816
+ template: "<ul class=\"list-unstyled\" *ngIf=\"isItemInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n"
1862
1817
  },] }
1863
1818
  ];
1864
- Copy2ClipboardComponent.propDecorators = {
1865
- text: [{ type: i0.Input }]
1819
+ ItemValidationSummaryComponent.ctorParameters = function () { return []; };
1820
+ ItemValidationSummaryComponent.propDecorators = {
1821
+ controlName: [{ type: i0.Input }],
1822
+ controlTitle: [{ type: i0.Input }]
1866
1823
  };
1867
1824
 
1868
1825
  /*
@@ -1910,8 +1867,7 @@
1910
1867
  ItemValidationSummaryComponent,
1911
1868
  HtmlEditorComponent,
1912
1869
  FormsHtmlEditorComponent,
1913
- ContentHeaderComponent,
1914
- Copy2ClipboardComponent,
1870
+ ContentHeaderComponent
1915
1871
  ],
1916
1872
  exports: [
1917
1873
  SubscribePlanButtonComponent,
@@ -1924,8 +1880,7 @@
1924
1880
  ItemValidationSummaryComponent,
1925
1881
  HtmlEditorComponent,
1926
1882
  FormsHtmlEditorComponent,
1927
- ContentHeaderComponent,
1928
- Copy2ClipboardComponent,
1883
+ ContentHeaderComponent
1929
1884
  ],
1930
1885
  },] }
1931
1886
  ];