@ardimedia/angular-portal-azure 0.2.287 → 0.2.289
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 +24 -4
- package/apn.js +61 -5
- package/package.json +1 -1
package/apn.d.ts
CHANGED
|
@@ -380,14 +380,34 @@ 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
|
|
384
|
-
* -
|
|
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
|
-
*
|
|
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>);
|
|
397
|
+
/**
|
|
398
|
+
* Default behavior for saving any object.
|
|
399
|
+
* - call this.setStatusBarSaveData();
|
|
400
|
+
* - call this.onSaveItem()
|
|
401
|
+
* - validates this.formblade. if not valid, returns without saving
|
|
402
|
+
* - call the provided function
|
|
403
|
+
* THEN
|
|
404
|
+
* - call this.clearStatusBar()
|
|
405
|
+
* - call this.onSavedItem()
|
|
406
|
+
* - returns the saved data
|
|
407
|
+
* CATCH
|
|
408
|
+
* - call this.setStatusBarException
|
|
409
|
+
*/
|
|
410
|
+
saveObject(func: () => (Promise<any> | angular.IHttpPromise<any>), ngForm?: any): (Promise<void | any> | angular.IHttpPromise<void | any>);
|
|
391
411
|
/** Extension point */
|
|
392
412
|
onSaveItem(): void;
|
|
393
413
|
/** 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
|
|
1184
|
-
* -
|
|
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
|
-
*
|
|
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
|
-
|
|
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();
|
|
@@ -1210,6 +1225,47 @@ var angularportalazure;
|
|
|
1210
1225
|
_this.setStatusBarException(exception);
|
|
1211
1226
|
});
|
|
1212
1227
|
};
|
|
1228
|
+
/**
|
|
1229
|
+
* Default behavior for saving any object.
|
|
1230
|
+
* - call this.setStatusBarSaveData();
|
|
1231
|
+
* - call this.onSaveItem()
|
|
1232
|
+
* - validates this.formblade. if not valid, returns without saving
|
|
1233
|
+
* - call the provided function
|
|
1234
|
+
* THEN
|
|
1235
|
+
* - call this.clearStatusBar()
|
|
1236
|
+
* - call this.onSavedItem()
|
|
1237
|
+
* - returns the saved data
|
|
1238
|
+
* CATCH
|
|
1239
|
+
* - call this.setStatusBarException
|
|
1240
|
+
*/
|
|
1241
|
+
BladeDetail.prototype.saveObject = function (func, ngForm) {
|
|
1242
|
+
var _this = this;
|
|
1243
|
+
if (ngForm === void 0) { ngForm = undefined; }
|
|
1244
|
+
this.setStatusBarSaveData();
|
|
1245
|
+
this.onSaveItem();
|
|
1246
|
+
//#region form valid?
|
|
1247
|
+
// angularjs: if form valid
|
|
1248
|
+
if (!this.formblade.$valid) {
|
|
1249
|
+
this.statusBar = 'Speichern nicht möglich! [Console] enthält weitere Informationen.';
|
|
1250
|
+
this.statusBarClass = 'apa-statusbar-error';
|
|
1251
|
+
console.log(this.formblade);
|
|
1252
|
+
return;
|
|
1253
|
+
}
|
|
1254
|
+
// angular: if form valid
|
|
1255
|
+
if (ngForm !== undefined) {
|
|
1256
|
+
if (!ngForm.valid) {
|
|
1257
|
+
return;
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
//#endregion
|
|
1261
|
+
return func().then(function (data) {
|
|
1262
|
+
_this.clearStatusBar();
|
|
1263
|
+
_this.onSavedItem();
|
|
1264
|
+
return data;
|
|
1265
|
+
}).catch(function (exception) {
|
|
1266
|
+
_this.setStatusBarException(exception);
|
|
1267
|
+
});
|
|
1268
|
+
};
|
|
1213
1269
|
/** Extension point */
|
|
1214
1270
|
BladeDetail.prototype.onSaveItem = function () {
|
|
1215
1271
|
};
|
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.289",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"typings": "apn.d.ts",
|
|
8
8
|
"dependencies": {
|