@ardimedia/angular-portal-azure 0.2.110 → 0.2.111

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 +4 -0
  2. package/apn.js +28 -1
  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
  }
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) {
@@ -1160,6 +1164,29 @@ var angularportalazure;
1160
1164
  };
1161
1165
  BladeDetail.prototype.onLoadedItem = function () {
1162
1166
  };
1167
+ BladeDetail.prototype.saveItem = function (func) {
1168
+ var that = this;
1169
+ that.onSaveItem();
1170
+ // Is form valid
1171
+ if (!that.formblade.$valid) {
1172
+ that.statusBar = 'Speichern nicht möglich!';
1173
+ that.statusBarClass = 'message-error message-off';
1174
+ console.log(that.formblade);
1175
+ return;
1176
+ }
1177
+ func().then(function (data) {
1178
+ that.item = data;
1179
+ that.onSavedItem();
1180
+ }).catch(function (exception) {
1181
+ that.setStatusBarException(exception);
1182
+ });
1183
+ };
1184
+ BladeDetail.prototype.onSaveItem = function () {
1185
+ this.setStatusBarSaveData();
1186
+ };
1187
+ BladeDetail.prototype.onSavedItem = function () {
1188
+ this.clearStatusBar();
1189
+ };
1163
1190
  BladeDetail.prototype.onCommandCancel = function () {
1164
1191
  this.close();
1165
1192
  };
@@ -1193,7 +1220,6 @@ var angularportalazure;
1193
1220
  that.onLoadItems();
1194
1221
  func().then(function (data) {
1195
1222
  that.items = data;
1196
- that.clearStatusBar();
1197
1223
  that.onLoadedItems();
1198
1224
  }).catch(function (exception) {
1199
1225
  that.setStatusBarException(exception);
@@ -1203,6 +1229,7 @@ var angularportalazure;
1203
1229
  this.setStatusBarLoadData();
1204
1230
  };
1205
1231
  BladeGrid.prototype.onLoadedItems = function () {
1232
+ this.clearStatusBar();
1206
1233
  };
1207
1234
  //#region Filter
1208
1235
  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.111",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {