@ardimedia/angular-portal-azure 0.2.57 → 0.2.58

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 +14 -4
  2. package/apn.js +39 -19
  3. package/package.json +1 -1
package/apn.d.ts CHANGED
@@ -129,6 +129,7 @@ declare namespace angularportalazure {
129
129
  comparePaths(path1: string, path2: string): boolean;
130
130
  /** close blade. */
131
131
  close(): void;
132
+ showExceptionOnStatusbar(data: angularportalazure.Exception): void;
132
133
  onCommandBrowse(): void;
133
134
  onCommandCancel(): void;
134
135
  onCommandCopy(): void;
@@ -318,7 +319,6 @@ declare namespace angularportalazure {
318
319
  declare namespace angularportalazure {
319
320
  class BladeData extends angularportalazure.Blade {
320
321
  constructor(portalService: angularportalazure.PortalService, path: string, title: string, subtitle?: string, width?: number);
321
- processException(data: angularportalazure.Exception): void;
322
322
  }
323
323
  }
324
324
  declare namespace angularportalazure {
@@ -364,7 +364,7 @@ declare namespace angularportalazure {
364
364
  }
365
365
  }
366
366
  declare namespace angularportalazure {
367
- class Exception {
367
+ class Exception implements angularportalazure.IExceptionDotNet {
368
368
  ExceptionType: string;
369
369
  ClassName: string;
370
370
  Data: Object;
@@ -375,8 +375,18 @@ declare namespace angularportalazure {
375
375
  Status: number;
376
376
  StatusText: string;
377
377
  Url: string;
378
- static convertFromWebApiException(ex: angularportalazure.Exception): void;
379
- static onConvertFromWebApiException(ex: angularportalazure.Exception): void;
378
+ processException(response: angular.IHttpPromiseCallbackArg<any>): void;
379
+ convertFromWebApiException(ex: angularportalazure.IExceptionDotNet): void;
380
+ }
381
+ }
382
+ declare namespace angularportalazure {
383
+ class IExceptionDotNet {
384
+ ExceptionType: string;
385
+ ClassName: string;
386
+ Data: Object;
387
+ Type: string;
388
+ Message: string;
389
+ Messages?: string[];
380
390
  }
381
391
  }
382
392
  declare namespace angularportalazure {
package/apn.js CHANGED
@@ -342,6 +342,16 @@ var angularportalazure;
342
342
  throw new Error('[angularportalazure.Blade] path: \'' + this.path + '\' could not be removed, since no \'this.portalService.bladeArea\' available.');
343
343
  }
344
344
  };
345
+ //#region Show Exceptions
346
+ Blade.prototype.showExceptionOnStatusbar = function (data) {
347
+ var that = this;
348
+ that.statusbar = data.Message;
349
+ that.statusbar += ' - ';
350
+ data.Messages.forEach(function (item) {
351
+ that.statusbar += item + ' - ';
352
+ });
353
+ };
354
+ //#endregion
345
355
  //#endregion
346
356
  //#region Commands
347
357
  Blade.prototype.onCommandBrowse = function () {
@@ -1136,19 +1146,6 @@ var angularportalazure;
1136
1146
  angularportalazure.Debug.write('[angularportalazure-debug] \'BladeData\' constructor called.', [_this, portalService, path, title, subtitle, width]);
1137
1147
  return _this;
1138
1148
  }
1139
- //#endregion
1140
- //#region Methods
1141
- BladeData.prototype.processException = function (data) {
1142
- var that = this;
1143
- // Find a better way to log information, maybe to the database or to Google Analytics.
1144
- console.log('Exception:');
1145
- console.log(data);
1146
- that.statusbar = data.Message;
1147
- that.statusbar += ' - ';
1148
- data.Messages.forEach(function (item) {
1149
- that.statusbar += item + ' - ';
1150
- });
1151
- };
1152
1149
  return BladeData;
1153
1150
  }(angularportalazure.Blade));
1154
1151
  angularportalazure.BladeData = BladeData;
@@ -1262,7 +1259,7 @@ var angularportalazure;
1262
1259
  that.statusbar = '';
1263
1260
  that.statusbarClass = '';
1264
1261
  }).catch(function (exception) {
1265
- that.statusbar = 'FEHLER: ' + exception;
1262
+ that.statusbar = 'FEHLER: ' + exception.Message;
1266
1263
  that.statusbarClass = 'message-info message-off';
1267
1264
  });
1268
1265
  };
@@ -1434,7 +1431,23 @@ var angularportalazure;
1434
1431
  function Exception() {
1435
1432
  }
1436
1433
  //#endregion
1437
- Exception.convertFromWebApiException = function (ex) {
1434
+ Exception.prototype.processException = function (response) {
1435
+ var that = this;
1436
+ this.convertFromWebApiException(response.data);
1437
+ that.ExceptionType = response.data.ExceptionType;
1438
+ that.Type = response.data.Type;
1439
+ that.Message = response.data.Message;
1440
+ that.MessageDetail = response.data.MessageDetail;
1441
+ that.Messages = response.data.Messages;
1442
+ that.Url = response.config.url;
1443
+ that.Status = response.status;
1444
+ that.StatusText = response.statusText;
1445
+ // Find a better way to log information, maybe to the database or to Google Analytics.
1446
+ console.log('processException:');
1447
+ console.log(response);
1448
+ console.log(that);
1449
+ };
1450
+ Exception.prototype.convertFromWebApiException = function (ex) {
1438
1451
  //#region Process data to Messages
1439
1452
  ex.Messages = [];
1440
1453
  var i = 1;
@@ -1459,15 +1472,22 @@ var angularportalazure;
1459
1472
  ex.Type = 'ValidationsException';
1460
1473
  }
1461
1474
  //#endregion
1462
- Exception.onConvertFromWebApiException(ex);
1463
- };
1464
- Exception.onConvertFromWebApiException = function (ex) {
1465
- angularportalazure.Debug.write('[angularportalazure-debug] \'Exception.convertFromWebApiException\' not overriden. You could override this.', [this]);
1466
1475
  };
1467
1476
  return Exception;
1468
1477
  }());
1469
1478
  angularportalazure.Exception = Exception;
1470
1479
  })(angularportalazure || (angularportalazure = {}));
1480
+ /// <reference path="debug.ts" />
1481
+ /// <reference path="iexception.ts" />
1482
+ var angularportalazure;
1483
+ (function (angularportalazure) {
1484
+ var IExceptionDotNet = (function () {
1485
+ function IExceptionDotNet() {
1486
+ }
1487
+ return IExceptionDotNet;
1488
+ }());
1489
+ angularportalazure.IExceptionDotNet = IExceptionDotNet;
1490
+ })(angularportalazure || (angularportalazure = {}));
1471
1491
  /// <reference types="angular" />
1472
1492
  var angularportalazure;
1473
1493
  (function (angularportalazure) {
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.57",
5
+ "version": "0.2.58",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {