@ardimedia/angular-portal-azure 0.2.300 → 0.2.301
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/apn.d.ts +0 -5
- package/apn.js +41 -92
- 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
|
@@ -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 = '
|
|
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')
|
|
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')
|
|
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,38 +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
1585
|
console.debug(exception);
|
|
1623
|
-
message = message + '
|
|
1586
|
+
message = message + ': JavaScript-Fehler oder Probleme mit der Internetverbindung. Weitere Informationen im Log. ' + exception;
|
|
1624
1587
|
}
|
|
1625
1588
|
return message;
|
|
1626
1589
|
};
|
|
1627
|
-
// TODO:
|
|
1590
|
+
// TODO:2018-10-10/hp: [angular.IHttpPromiseCallbackArg<angularportalazure.Exception>] should be Response
|
|
1628
1591
|
Exception.prepareException = function (response) {
|
|
1629
1592
|
console.debug('angularportalazure.Exception.prepareException');
|
|
1630
1593
|
console.debug(response);
|
|
1631
1594
|
var exception = angularportalazure.Exception.createException();
|
|
1632
|
-
// #region Process
|
|
1633
|
-
if (response.
|
|
1634
|
-
exception = angularportalazure.Exception.processResponseData(exception, response.
|
|
1635
|
-
}
|
|
1636
|
-
// #endregion
|
|
1637
|
-
// #region Process Angular 1?
|
|
1638
|
-
else if (response.headers === undefined) {
|
|
1639
|
-
exception = angularportalazure.Exception.processResponseWithData(exception, response);
|
|
1595
|
+
// #region Process (Angular 1) response.data.Data
|
|
1596
|
+
if (response.data !== undefined && response.data.Data !== undefined) {
|
|
1597
|
+
exception = angularportalazure.Exception.processResponseData(exception, response.data.Data);
|
|
1640
1598
|
}
|
|
1641
1599
|
// #endregion
|
|
1642
|
-
// #region Process Angular 2
|
|
1643
|
-
else {
|
|
1644
|
-
exception = angularportalazure.Exception.
|
|
1600
|
+
// #region Process (Angular 2) response.json().Data (EntityValidationException, etc.)
|
|
1601
|
+
else if (response.json !== undefined && response.json().Data != undefined) {
|
|
1602
|
+
exception = angularportalazure.Exception.processResponseData(exception, response.json().Data);
|
|
1645
1603
|
}
|
|
1646
1604
|
// #endregion
|
|
1647
|
-
exception.convertResponse(response);
|
|
1605
|
+
//exception.convertResponse(response);
|
|
1648
1606
|
exception.Url = response.url;
|
|
1649
1607
|
exception.Status = response.status;
|
|
1650
1608
|
exception.StatusText = response.statusText;
|
|
@@ -1656,24 +1614,23 @@ var angularportalazure;
|
|
|
1656
1614
|
exception.Messages = [];
|
|
1657
1615
|
return exception;
|
|
1658
1616
|
};
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
};
|
|
1617
|
+
//private static processResponseWithData(exception: angularportalazure.Exception, response: angular.IHttpPromiseCallbackArg<angularportalazure.Exception>): angularportalazure.Exception {
|
|
1618
|
+
// console.debug('angularportalazure.Exception.processResponseWithData');
|
|
1619
|
+
// // #region Convert data to Messages
|
|
1620
|
+
// if (response.data.Data === undefined) {
|
|
1621
|
+
// exception.Messages.push('No further information found in [response.data.Data].');
|
|
1622
|
+
// exception.Messages.push('No further information found in [response.data.Data].');
|
|
1623
|
+
// } else {
|
|
1624
|
+
// let i = 1;
|
|
1625
|
+
// while (response.data.Data[i + ''] !== undefined) {
|
|
1626
|
+
// console.debug('Add to exception.Messages : ' + response.data.Data[i + '']);
|
|
1627
|
+
// exception.Messages.push(response.data.Data[i + '']);
|
|
1628
|
+
// i++;
|
|
1629
|
+
// }
|
|
1630
|
+
// }
|
|
1631
|
+
// // #endregion
|
|
1632
|
+
// return exception;
|
|
1633
|
+
//}
|
|
1677
1634
|
Exception.processResponseData = function (exception, data) {
|
|
1678
1635
|
console.debug('angularportalazure.Exception.processResponseData');
|
|
1679
1636
|
var i = 1;
|
|
@@ -1684,14 +1641,6 @@ var angularportalazure;
|
|
|
1684
1641
|
}
|
|
1685
1642
|
return exception;
|
|
1686
1643
|
};
|
|
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
1644
|
return Exception;
|
|
1696
1645
|
}(angularportalazure.ValidationsExceptionDotNet));
|
|
1697
1646
|
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.
|
|
5
|
+
"version": "0.2.301",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"typings": "apn.d.ts",
|
|
8
8
|
"dependencies": {
|