@ardimedia/angular-portal-azure 0.2.110 → 0.2.112

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 +6 -2
  2. package/apn.js +31 -3
  3. package/package.json +1 -1
package/apn.d.ts CHANGED
@@ -131,6 +131,7 @@ declare namespace angularportalazure {
131
131
  close(): void;
132
132
  clearStatusBar(): void;
133
133
  setStatusBarLoadData(): void;
134
+ setStatusBarSaveData(): void;
134
135
  setStatusBarException(exception: angularportalazure.Exception): void;
135
136
  onCommandBrowse(): void;
136
137
  onCommandCancel(): void;
@@ -328,6 +329,9 @@ declare namespace angularportalazure {
328
329
  loadItem(func: () => any): void;
329
330
  onLoadItem(): void;
330
331
  onLoadedItem(): void;
332
+ saveItem(func: () => any): void;
333
+ onSaveItem(): void;
334
+ onSavedItem(): void;
331
335
  onCommandCancel(): void;
332
336
  }
333
337
  }
@@ -369,7 +373,7 @@ declare namespace angularportalazure {
369
373
  ClassName: string;
370
374
  Data: Object;
371
375
  Type: string;
372
- Messages?: string[];
376
+ Messages: string[];
373
377
  Message: string;
374
378
  MessageDetail: string;
375
379
  Status: number;
@@ -386,7 +390,7 @@ declare namespace angularportalazure {
386
390
  Data: Object;
387
391
  Type: string;
388
392
  Message: string;
389
- Messages?: string[];
393
+ Messages: string[];
390
394
  }
391
395
  }
392
396
  declare namespace angularportalazure {
package/apn.js CHANGED
@@ -358,6 +358,10 @@ var angularportalazure;
358
358
  this.statusBar = 'Daten laden...';
359
359
  this.statusBarClass = '';
360
360
  };
361
+ Blade.prototype.setStatusBarSaveData = function () {
362
+ this.statusBar = 'Daten speichern...';
363
+ this.statusBarClass = '';
364
+ };
361
365
  Blade.prototype.setStatusBarException = function (exception) {
362
366
  var that = this;
363
367
  if (exception.Message === undefined) {
@@ -365,9 +369,10 @@ var angularportalazure;
365
369
  }
366
370
  else {
367
371
  that.statusBar = 'FEHLER: ' + exception.Message;
368
- that.statusBar += ' - ';
372
+ }
373
+ if (exception.Messages != undefined) {
369
374
  exception.Messages.forEach(function (item) {
370
- that.statusBar += item + ' - ';
375
+ that.statusBar += ' - ' + item;
371
376
  });
372
377
  }
373
378
  that.statusBarClass = 'message-error message-off';
@@ -1160,6 +1165,29 @@ var angularportalazure;
1160
1165
  };
1161
1166
  BladeDetail.prototype.onLoadedItem = function () {
1162
1167
  };
1168
+ BladeDetail.prototype.saveItem = function (func) {
1169
+ var that = this;
1170
+ that.onSaveItem();
1171
+ // Is form valid
1172
+ if (!that.formblade.$valid) {
1173
+ that.statusBar = 'Speichern nicht möglich!';
1174
+ that.statusBarClass = 'message-error message-off';
1175
+ console.log(that.formblade);
1176
+ return;
1177
+ }
1178
+ func().then(function (data) {
1179
+ that.item = data;
1180
+ that.onSavedItem();
1181
+ }).catch(function (exception) {
1182
+ that.setStatusBarException(exception);
1183
+ });
1184
+ };
1185
+ BladeDetail.prototype.onSaveItem = function () {
1186
+ this.setStatusBarSaveData();
1187
+ };
1188
+ BladeDetail.prototype.onSavedItem = function () {
1189
+ this.clearStatusBar();
1190
+ };
1163
1191
  BladeDetail.prototype.onCommandCancel = function () {
1164
1192
  this.close();
1165
1193
  };
@@ -1193,7 +1221,6 @@ var angularportalazure;
1193
1221
  that.onLoadItems();
1194
1222
  func().then(function (data) {
1195
1223
  that.items = data;
1196
- that.clearStatusBar();
1197
1224
  that.onLoadedItems();
1198
1225
  }).catch(function (exception) {
1199
1226
  that.setStatusBarException(exception);
@@ -1203,6 +1230,7 @@ var angularportalazure;
1203
1230
  this.setStatusBarLoadData();
1204
1231
  };
1205
1232
  BladeGrid.prototype.onLoadedItems = function () {
1233
+ this.clearStatusBar();
1206
1234
  };
1207
1235
  //#region Filter
1208
1236
  BladeGrid.prototype.onFilter = function (actual, expected) {
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.110",
5
+ "version": "0.2.112",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {