@ardimedia/angular-portal-azure 0.2.286 → 0.2.288

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 +10 -4
  2. package/apn.js +20 -5
  3. package/package.json +1 -1
package/apn.d.ts CHANGED
@@ -380,14 +380,20 @@ declare namespace angularportalazure {
380
380
  * Default behavior for saving an entity.
381
381
  * - call this.setStatusBarSaveData();
382
382
  * - call this.onSaveItem()
383
- * - validates this.formblade and returns without saving if not valid
384
- * - disables the save command button during save and re enables if after the call
383
+ * - validates this.formblade. if not valid, returns without saving
384
+ * - set this.isCommandSaveEnabled = false
385
+ * - call the provided function
386
+ * THEN
385
387
  * - call this.clearStatusBar()
388
+ * - set this.isCommandSaveEnabled = true
386
389
  * - set this.item to the saved data
387
390
  * - call this.onSavedItem()
388
- * @return {T} return the saved data
391
+ * - returns the saved data
392
+ * CATCH
393
+ * - set this.isCommandSaveEnabled = true
394
+ * - call this.setStatusBarException
389
395
  */
390
- saveItem(func: () => (Promise<T> & angular.IHttpPromise<T>)): (Promise<void | T> | angular.IHttpPromise<void | T>);
396
+ saveItem(func: () => (Promise<T> | angular.IHttpPromise<T>), ngForm?: any): (Promise<void | T> | angular.IHttpPromise<void | T>);
391
397
  /** Extension point */
392
398
  onSaveItem(): void;
393
399
  /** Extension point */
package/apn.js CHANGED
@@ -1180,24 +1180,39 @@ var angularportalazure;
1180
1180
  * Default behavior for saving an entity.
1181
1181
  * - call this.setStatusBarSaveData();
1182
1182
  * - call this.onSaveItem()
1183
- * - validates this.formblade and returns without saving if not valid
1184
- * - disables the save command button during save and re enables if after the call
1183
+ * - validates this.formblade. if not valid, returns without saving
1184
+ * - set this.isCommandSaveEnabled = false
1185
+ * - call the provided function
1186
+ * THEN
1185
1187
  * - call this.clearStatusBar()
1188
+ * - set this.isCommandSaveEnabled = true
1186
1189
  * - set this.item to the saved data
1187
1190
  * - call this.onSavedItem()
1188
- * @return {T} return the saved data
1191
+ * - returns the saved data
1192
+ * CATCH
1193
+ * - set this.isCommandSaveEnabled = true
1194
+ * - call this.setStatusBarException
1189
1195
  */
1190
- BladeDetail.prototype.saveItem = function (func) {
1196
+ BladeDetail.prototype.saveItem = function (func, ngForm) {
1191
1197
  var _this = this;
1198
+ if (ngForm === void 0) { ngForm = undefined; }
1192
1199
  this.setStatusBarSaveData();
1193
1200
  this.onSaveItem();
1194
- // Is form valid
1201
+ //#region form valid?
1202
+ // angularjs: if form valid
1195
1203
  if (!this.formblade.$valid) {
1196
1204
  this.statusBar = 'Speichern nicht möglich! [Console] enthält weitere Informationen.';
1197
1205
  this.statusBarClass = 'apa-statusbar-error';
1198
1206
  console.log(this.formblade);
1199
1207
  return;
1200
1208
  }
1209
+ // angular: if form valid
1210
+ if (ngForm !== undefined) {
1211
+ if (!ngForm.valid) {
1212
+ return;
1213
+ }
1214
+ }
1215
+ //#endregion
1201
1216
  this.isCommandSaveEnabled = false;
1202
1217
  return func().then(function (data) {
1203
1218
  _this.clearStatusBar();
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.286",
5
+ "version": "0.2.288",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {