@ardimedia/angular-portal-azure 0.2.300 → 0.2.302

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.
Files changed (3) hide show
  1. package/apn.d.ts +0 -5
  2. package/apn.js +43 -100
  3. package/package.json +1 -1
package/apn.d.ts CHANGED
@@ -463,9 +463,6 @@ declare namespace angularportalazure {
463
463
  value: string;
464
464
  }[];
465
465
  ValidationResults: ValidationResultDotNet[];
466
- convertResponse(response: any): void;
467
- protected static convertResponse(exceptionTo: EntityValidationException | ValidationsExceptionDotNet, responseDataFrom: ExceptionDotNet): void;
468
- protected static convertExceptionType(exception: EntityValidationException | ValidationsExceptionDotNet, responseData: any): void;
469
466
  }
470
467
  /**
471
468
  * @deprecated ValidationsExceptionDotNet should be replaced by EntityValidationException
@@ -484,8 +481,6 @@ declare namespace angularportalazure {
484
481
  static getOneLineMessage(exception: angularportalazure.Exception): string;
485
482
  static prepareException(response: angular.IHttpPromiseCallbackArg<angularportalazure.Exception> | any): angularportalazure.Exception;
486
483
  private static createException;
487
- private static processResponseWithData;
488
484
  private static processResponseData;
489
- private static processDotNetException2;
490
485
  }
491
486
  }
package/apn.js CHANGED
@@ -1239,7 +1239,7 @@ var angularportalazure;
1239
1239
  if (!this.formblade.$valid) {
1240
1240
  this.statusBar = 'Speichern nicht möglich! [Console] enthält weitere Informationen.';
1241
1241
  this.statusBarClass = 'apa-statusbar-error';
1242
- console.log(this.formblade);
1242
+ //console.log(this.formblade);
1243
1243
  return;
1244
1244
  }
1245
1245
  // angular: if form valid
@@ -1284,7 +1284,7 @@ var angularportalazure;
1284
1284
  if (!this.formblade.$valid) {
1285
1285
  this.statusBar = 'Speichern nicht möglich! [Console] enthält weitere Informationen.';
1286
1286
  this.statusBarClass = 'apa-statusbar-error';
1287
- console.log(this.formblade);
1287
+ //console.log(this.formblade);
1288
1288
  return;
1289
1289
  }
1290
1290
  // angular: if form valid
@@ -1524,50 +1524,6 @@ var angularportalazure;
1524
1524
  function EntityValidationException() {
1525
1525
  return _super !== null && _super.apply(this, arguments) || this;
1526
1526
  }
1527
- EntityValidationException.prototype.convertResponse = function (response) {
1528
- if (response.headers === undefined) {
1529
- console.debug('angularportalazure.EntityValidationException.convertResponse - response.data');
1530
- ValidationsExceptionDotNet.convertResponse(this, response.data);
1531
- ValidationsExceptionDotNet.convertExceptionType(this, response.data);
1532
- }
1533
- else {
1534
- console.debug('angularportalazure.EntityValidationException.convertResponse - response.json()');
1535
- ValidationsExceptionDotNet.convertResponse(this, response.json());
1536
- ValidationsExceptionDotNet.convertExceptionType(this, response.json());
1537
- }
1538
- };
1539
- EntityValidationException.convertResponse = function (exceptionTo, responseDataFrom) {
1540
- console.debug('angularportalazure.EntityValidationException.convertResponse');
1541
- exceptionTo.ExceptionMessage = responseDataFrom.ExceptionMessage;
1542
- exceptionTo.Message = responseDataFrom.Message;
1543
- exceptionTo.StackTrace = responseDataFrom.StackTrace;
1544
- exceptionTo.InnerException = responseDataFrom.InnerException;
1545
- };
1546
- EntityValidationException.convertExceptionType = function (exception, responseData) {
1547
- if (responseData.ExceptionType === undefined) {
1548
- console.debug('angularportalazure.EntityValidationException.convertExceptionType - undefined');
1549
- return;
1550
- }
1551
- else if (responseData.ExceptionType === 'System.Data.Entity.Validation.DbEntityValidationException') {
1552
- console.debug('angularportalazure.EntityValidationException.convertExceptionType - DbEntityValidationException');
1553
- exception.ExceptionType = 'DbEntityValidationException';
1554
- return;
1555
- }
1556
- else if (responseData.ExceptionType === 'System.Data.Entity.Infrastructure.DbUpdateConcurrencyException') {
1557
- console.debug('angularportalazure.EntityValidationException.convertExceptionType - DbUpdateConcurrencyException');
1558
- exception.ExceptionType = 'DbUpdateConcurrencyException';
1559
- return;
1560
- }
1561
- else if (responseData.ClassName !== undefined && responseData.ClassName.indexOf('ValidationsException') > 0) {
1562
- console.debug('angularportalazure.EntityValidationException.convertExceptionType - ValidationsException');
1563
- exception.ExceptionType = 'ValidationsException';
1564
- return;
1565
- }
1566
- else {
1567
- console.debug('angularportalazure.EntityValidationException.convertExceptionType - else');
1568
- exception.ExceptionType = responseData.ExceptionType;
1569
- }
1570
- };
1571
1527
  return EntityValidationException;
1572
1528
  }(ExceptionDotNet));
1573
1529
  angularportalazure.EntityValidationException = EntityValidationException;
@@ -1596,14 +1552,26 @@ var angularportalazure;
1596
1552
  // #endregion
1597
1553
  // #region Static Methods
1598
1554
  Exception.getOneLineMessage = function (exception) {
1599
- var message = 'FEHLER ';
1555
+ var message = '';
1556
+ // Add Messages, if available
1557
+ if (exception.Messages !== undefined) {
1558
+ exception.Messages.forEach(function (item, index) {
1559
+ if (index > 0) {
1560
+ message = message + ' - ';
1561
+ }
1562
+ message = message + item;
1563
+ });
1564
+ }
1565
+ else {
1566
+ message = 'FEHLER ';
1567
+ }
1600
1568
  if (exception.Message !== undefined) {
1601
1569
  message = message + ': ' + exception.Message + ' ';
1602
1570
  }
1603
- if (exception.ExceptionMessage !== undefined && exception.ExceptionMessage.toLowerCase().indexOf('see the inner exception for details') === -1) {
1571
+ if (exception.ExceptionMessage !== undefined && exception.ExceptionMessage.toLowerCase().indexOf('see the inner exception for details') < 0) {
1604
1572
  message = message + ': ' + exception.ExceptionMessage + ' ';
1605
1573
  }
1606
- if (exception.ExceptionMessage !== undefined && exception.ExceptionMessage.toLowerCase().indexOf('see the inner exception for details') > 0) {
1574
+ if (exception.ExceptionMessage !== undefined && exception.ExceptionMessage.toLowerCase().indexOf('see the inner exception for details') >= 0) {
1607
1575
  if (exception.InnerException !== undefined) {
1608
1576
  if (exception.InnerException.InnerException !== undefined) {
1609
1577
  message = message + ': ' + exception.InnerException.InnerException.ExceptionMessage + ' ';
@@ -1613,42 +1581,28 @@ var angularportalazure;
1613
1581
  }
1614
1582
  }
1615
1583
  }
1616
- if (exception.Messages !== undefined) {
1617
- exception.Messages.forEach(function (item) {
1618
- message = message + '- ' + item + ' ';
1619
- });
1620
- }
1621
1584
  if (message === 'FEHLER ') {
1622
- console.debug(exception);
1623
- message = message + ' : JavaScript-Fehler oder Probleme mit der Internetverbindung. Ggf. weitere Informationen im Log. ' + exception;
1585
+ message = message + ': JavaScript-Fehler oder Probleme mit der Internetverbindung. Weitere Informationen im Log. ' + exception;
1624
1586
  }
1625
1587
  return message;
1626
1588
  };
1627
- // TODO:2017-01-09/hp: [any] will be [Response] in angular2
1589
+ // TODO:2018-10-10/hp: [angular.IHttpPromiseCallbackArg<angularportalazure.Exception>] should be Response
1628
1590
  Exception.prepareException = function (response) {
1629
- console.debug('angularportalazure.Exception.prepareException');
1630
- console.debug(response);
1631
1591
  var exception = angularportalazure.Exception.createException();
1632
- // #region Process EntityValidationException, etc.
1633
- if (response.json().Data != undefined) {
1634
- exception = angularportalazure.Exception.processResponseData(exception, response.json().Data);
1635
- }
1636
- // #endregion
1637
- // #region Process Angular 1?
1638
- else if (response.headers === undefined) {
1639
- exception = angularportalazure.Exception.processResponseWithData(exception, response);
1592
+ // #region Process (Angular 1) response.data.Data
1593
+ if (response.data !== undefined && response.data.Data !== undefined) {
1594
+ exception = angularportalazure.Exception.processResponseData(exception, response.data.Data);
1640
1595
  }
1641
1596
  // #endregion
1642
- // #region Process Angular 2?
1643
- else {
1644
- exception = angularportalazure.Exception.processDotNetException2(exception, response);
1597
+ // #region Process (Angular 2) response.json().Data (EntityValidationException, etc.)
1598
+ else if (response.json !== undefined && response.json().Data != undefined) {
1599
+ exception = angularportalazure.Exception.processResponseData(exception, response.json().Data);
1645
1600
  }
1646
1601
  // #endregion
1647
- exception.convertResponse(response);
1602
+ //exception.convertResponse(response);
1648
1603
  exception.Url = response.url;
1649
1604
  exception.Status = response.status;
1650
1605
  exception.StatusText = response.statusText;
1651
- console.debug(exception);
1652
1606
  return exception;
1653
1607
  };
1654
1608
  Exception.createException = function () {
@@ -1656,42 +1610,31 @@ var angularportalazure;
1656
1610
  exception.Messages = [];
1657
1611
  return exception;
1658
1612
  };
1659
- Exception.processResponseWithData = function (exception, response) {
1660
- console.debug('angularportalazure.Exception.processResponseWithData');
1661
- // #region Convert data to Messages
1662
- if (response.data.Data === undefined) {
1663
- exception.Messages.push('No further information found in [response.data.Data].');
1664
- exception.Messages.push('No further information found in [response.data.Data].');
1665
- }
1666
- else {
1667
- var i = 1;
1668
- while (response.data.Data[i + ''] !== undefined) {
1669
- console.debug('Add to exception.Messages : ' + response.data.Data[i + '']);
1670
- exception.Messages.push(response.data.Data[i + '']);
1671
- i++;
1672
- }
1673
- }
1674
- // #endregion
1675
- return exception;
1676
- };
1613
+ //private static processResponseWithData(exception: angularportalazure.Exception, response: angular.IHttpPromiseCallbackArg<angularportalazure.Exception>): angularportalazure.Exception {
1614
+ // console.debug('angularportalazure.Exception.processResponseWithData');
1615
+ // // #region Convert data to Messages
1616
+ // if (response.data.Data === undefined) {
1617
+ // exception.Messages.push('No further information found in [response.data.Data].');
1618
+ // exception.Messages.push('No further information found in [response.data.Data].');
1619
+ // } else {
1620
+ // let i = 1;
1621
+ // while (response.data.Data[i + ''] !== undefined) {
1622
+ // console.debug('Add to exception.Messages : ' + response.data.Data[i + '']);
1623
+ // exception.Messages.push(response.data.Data[i + '']);
1624
+ // i++;
1625
+ // }
1626
+ // }
1627
+ // // #endregion
1628
+ // return exception;
1629
+ //}
1677
1630
  Exception.processResponseData = function (exception, data) {
1678
- console.debug('angularportalazure.Exception.processResponseData');
1679
1631
  var i = 1;
1680
1632
  while (data[i + ''] !== undefined) {
1681
- console.debug('Add to exception.Messages : ' + data[i + '']);
1682
1633
  exception.Messages.push(data[i + '']);
1683
1634
  i++;
1684
1635
  }
1685
1636
  return exception;
1686
1637
  };
1687
- // TODO:2017-01-09/hp: Implement this function for angular2
1688
- Exception.processDotNetException2 = function (exception, response) {
1689
- console.debug('angularportalazure.Exception.processDotNetException2');
1690
- if (response.json().data !== undefined) {
1691
- console.debug('[angularportalazure.Exception.processDotNetException2] not implemented. Implement it to get proper exception data.');
1692
- }
1693
- return exception;
1694
- };
1695
1638
  return Exception;
1696
1639
  }(angularportalazure.ValidationsExceptionDotNet));
1697
1640
  angularportalazure.Exception = Exception;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ardimedia/angular-portal-azure",
3
3
  "description": "Angular Portal Azure - GUI Framework.",
4
4
  "author": "Ardimedia Anstalt <info@ardimedia.com> (http://www.ardimedia.com)",
5
- "version": "0.2.300",
5
+ "version": "0.2.302",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {