@ardimedia/angular-portal-azure 0.2.109 → 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.
package/apn.d.ts CHANGED
@@ -58,8 +58,8 @@ declare namespace angularportalazure {
58
58
  'width': string;
59
59
  };
60
60
  isInnerHtml: boolean;
61
- statusbar: string;
62
- statusbarClass: string;
61
+ statusBar: string;
62
+ statusBarClass: string;
63
63
  formblade: any;
64
64
  isCommandBrowse: boolean;
65
65
  commandBrowse: () => void;
@@ -129,8 +129,10 @@ declare namespace angularportalazure {
129
129
  comparePaths(path1: string, path2: string): boolean;
130
130
  /** close blade. */
131
131
  close(): void;
132
- clearStatusbar(): void;
133
- showExceptionOnStatusbar(exception: angularportalazure.Exception): void;
132
+ clearStatusBar(): void;
133
+ setStatusBarLoadData(): void;
134
+ setStatusBarSaveData(): void;
135
+ setStatusBarException(exception: angularportalazure.Exception): void;
134
136
  onCommandBrowse(): void;
135
137
  onCommandCancel(): void;
136
138
  onCommandCopy(): void;
@@ -325,7 +327,11 @@ declare namespace angularportalazure {
325
327
  item: any;
326
328
  constructor(portalService: angularportalazure.PortalService, path: string, title: string, subtitle?: string, width?: number);
327
329
  loadItem(func: () => any): void;
330
+ onLoadItem(): void;
328
331
  onLoadedItem(): void;
332
+ saveItem(func: () => any): void;
333
+ onSaveItem(): void;
334
+ onSavedItem(): void;
329
335
  onCommandCancel(): void;
330
336
  }
331
337
  }
@@ -334,6 +340,7 @@ declare namespace angularportalazure {
334
340
  constructor(portalService: angularportalazure.PortalService, path: string, title: string, subtitle?: string, width?: number);
335
341
  items: any[];
336
342
  loadItems(func: () => angular.IPromise<any>): void;
343
+ onLoadItems(): void;
337
344
  onLoadedItems(): void;
338
345
  onFilter(actual: Object, expected: string): boolean;
339
346
  }
package/apn.js CHANGED
@@ -177,8 +177,8 @@ var angularportalazure;
177
177
  _this.width = { 'width': '0' };
178
178
  _this.widthStackLayout = { 'width': '50px' };
179
179
  _this.isInnerHtml = true;
180
- _this.statusbar = '';
181
- _this.statusbarClass = '';
180
+ _this.statusBar = '';
181
+ _this.statusBarClass = '';
182
182
  //#endregion
183
183
  //#region Commands
184
184
  _this.isCommandBrowse = false;
@@ -349,24 +349,32 @@ var angularportalazure;
349
349
  throw new Error('[angularportalazure.Blade] path: \'' + this.path + '\' could not be removed, since no \'this.portalService.bladeArea\' available.');
350
350
  }
351
351
  };
352
- //#region Show Exceptions
353
- Blade.prototype.clearStatusbar = function () {
354
- this.statusbar = '';
355
- this.statusbarClass = '';
352
+ //#region Set StatusBar
353
+ Blade.prototype.clearStatusBar = function () {
354
+ this.statusBar = '';
355
+ this.statusBarClass = '';
356
356
  };
357
- Blade.prototype.showExceptionOnStatusbar = function (exception) {
357
+ Blade.prototype.setStatusBarLoadData = function () {
358
+ this.statusBar = 'Daten laden...';
359
+ this.statusBarClass = '';
360
+ };
361
+ Blade.prototype.setStatusBarSaveData = function () {
362
+ this.statusBar = 'Daten speichern...';
363
+ this.statusBarClass = '';
364
+ };
365
+ Blade.prototype.setStatusBarException = function (exception) {
358
366
  var that = this;
359
367
  if (exception.Message === undefined) {
360
- that.statusbar = 'FEHLER: ' + exception;
368
+ that.statusBar = 'FEHLER: ' + exception;
361
369
  }
362
370
  else {
363
- that.statusbar = 'FEHLER: ' + exception.Message;
364
- that.statusbar += ' - ';
371
+ that.statusBar = 'FEHLER: ' + exception.Message;
372
+ that.statusBar += ' - ';
365
373
  exception.Messages.forEach(function (item) {
366
- that.statusbar += item + ' - ';
374
+ that.statusBar += item + ' - ';
367
375
  });
368
376
  }
369
- that.statusbarClass = 'message-error message-off';
377
+ that.statusBarClass = 'message-error message-off';
370
378
  };
371
379
  //#endregion
372
380
  //#endregion
@@ -424,30 +432,6 @@ var angularportalazure;
424
432
  };
425
433
  //#endregion
426
434
  //#region OBSOLETE
427
- ///** Obsolete */
428
- //setObsoleteLayoutProperites() {
429
- // angularportalazure.Debug.write('[angularportalazure-debug] \'Blade.setObsoleteLayoutProperites\' called.', [this]);
430
- // //this.blade.title = this.title;
431
- // //this.blade.statusbar = this.statusbar;
432
- // //this.blade.statusbarClass = this.statusbarClass;
433
- // //this.blade.isCommandBrowse = this.isCommandBrowse;
434
- // //this.blade.isCommandCancel = this.isCommandCancel;
435
- // //this.blade.isCommandCopy = this.isCommandCopy;
436
- // //this.blade.isCommandDelete = this.isCommandDelete;
437
- // //this.blade.isCommandDocument = this.isCommandDocument;
438
- // //this.blade.isCommandDocument2 = this.isCommandDocument2;
439
- // //this.blade.isCommandDocument3 = this.isCommandDocument3;
440
- // //this.blade.isCommandDocument4 = this.isCommandDocument4;
441
- // //this.blade.isCommandDocument5 = this.isCommandDocument5;
442
- // //this.blade.isCommandNew = this.isCommandNew;
443
- // //this.blade.isCommandOrder = this.isCommandOrder;
444
- // //this.blade.isCommandRestart = this.isCommandRestart;
445
- // //this.blade.isCommandSave = this.isCommandSave;
446
- // //this.blade.isCommandSearch = this.isCommandSearch;
447
- // //this.blade.isCommandStart = this.isCommandStart;
448
- // //this.blade.isCommandStop = this.isCommandStop;
449
- // //this.blade.isCommandSwap = this.isCommandSwap;
450
- //}
451
435
  /** Obsolete */
452
436
  Blade.prototype.bladeClose = function () {
453
437
  this.close();
@@ -491,16 +475,17 @@ var angularportalazure;
491
475
  //#endregion
492
476
  //#region Methods
493
477
  BladeArea.prototype.raiseAddBladeEvent = function (args) {
494
- var isActivated = false;
478
+ var isBladeAlreadyShown = false;
495
479
  this.blades.forEach(function (blade) {
496
480
  if (blade.path === args.path) {
481
+ // Blade is already show, just activate it again
497
482
  blade.onActivate();
498
- isActivated = true;
483
+ isBladeAlreadyShown = true;
499
484
  return;
500
485
  }
501
486
  });
502
- if (!isActivated) {
503
- console.log('broadcast: BladeArea.AddBlade');
487
+ if (!isBladeAlreadyShown) {
488
+ // Add the blade, since it is not yet shown
504
489
  this.portalService.$rootScope.$broadcast('BladeArea.AddBlade', args);
505
490
  }
506
491
  };
@@ -1151,60 +1136,57 @@ var angularportalazure;
1151
1136
  var _this = _super.call(this, portalService, path, title, subtitle, width) || this;
1152
1137
  //#region Properties
1153
1138
  _this.item = null;
1154
- _this.isCommandNew = true;
1139
+ //this.isCommandNew = true;
1155
1140
  _this.commandNewText = 'neu';
1156
- _this.isCommandSave = true;
1141
+ //this.isCommandSave = true;
1157
1142
  _this.commandSaveText = 'speichern';
1158
- _this.isCommandDelete = true;
1143
+ //this.isCommandDelete = true;
1159
1144
  _this.commandDeleteText = 'löschen';
1160
- _this.isCommandCancel = true;
1145
+ //this.isCommandCancel = true;
1161
1146
  _this.commandCancelText = 'abbrechen';
1162
1147
  return _this;
1163
1148
  }
1164
1149
  //#endregion
1165
1150
  //#region Methods
1166
- //activate() {
1167
- // var that = this;
1168
- // that.statusbar = 'Daten laden...';
1169
- // that.statusbarClass = '';
1170
- // var onActivate = that.onActivate();
1171
- // if (onActivate === null || onActivate === undefined) {
1172
- // that.statusbar = '';
1173
- // that.statusbarClass = '';
1174
- // } else {
1175
- // onActivate.success(function (data: any) {
1176
- // that.item = data;
1177
- // that.statusbar = '';
1178
- // that.statusbarClass = '';
1179
- // that.onActivated();
1180
- // }).error(function (data: any, status: any, headers: any, config: any) {
1181
- // that.item = null;
1182
- // that.statusbar = 'FEHLER: ' + data;
1183
- // that.statusbarClass = 'message-info message-off';
1184
- // that.onActivated();
1185
- // });
1186
- // }
1187
- //}
1188
- //onActivate(): any { // any should be: angular.IHttpPromise<any>
1189
- // throw new Error('[angularportalazure.BladeDetail] \'onActivate\' is an abstract function. Define one in the derived class.');
1190
- //}
1191
- //onActivated(): void {
1192
- // angularportalazure.Debug.write('[angularportalazure-debug] \'onActivated\' called. You could override this.');
1193
- //}
1194
1151
  BladeDetail.prototype.loadItem = function (func) {
1195
1152
  var that = this;
1196
- that.statusbar = 'Daten laden...';
1197
- that.statusbarClass = '';
1153
+ that.onLoadItem();
1198
1154
  func().then(function (data) {
1199
1155
  that.item = data;
1200
- that.clearStatusbar();
1156
+ that.clearStatusBar();
1201
1157
  that.onLoadedItem();
1202
1158
  }).catch(function (exception) {
1203
- that.showExceptionOnStatusbar(exception);
1159
+ that.setStatusBarException(exception);
1204
1160
  });
1205
1161
  };
1162
+ BladeDetail.prototype.onLoadItem = function () {
1163
+ this.setStatusBarLoadData();
1164
+ };
1206
1165
  BladeDetail.prototype.onLoadedItem = function () {
1207
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
+ };
1208
1190
  BladeDetail.prototype.onCommandCancel = function () {
1209
1191
  this.close();
1210
1192
  };
@@ -1235,18 +1217,20 @@ var angularportalazure;
1235
1217
  //#region Methods
1236
1218
  BladeGrid.prototype.loadItems = function (func) {
1237
1219
  var that = this;
1238
- that.statusbar = 'Daten laden...';
1239
- that.statusbarClass = '';
1220
+ that.onLoadItems();
1240
1221
  func().then(function (data) {
1241
1222
  that.items = data;
1242
- that.clearStatusbar();
1243
1223
  that.onLoadedItems();
1244
1224
  }).catch(function (exception) {
1245
- that.showExceptionOnStatusbar(exception);
1225
+ that.setStatusBarException(exception);
1246
1226
  });
1247
1227
  };
1248
- /* Override this function. This function is called from the loadItems function, when the promise is done. */
1249
- BladeGrid.prototype.onLoadedItems = function () { };
1228
+ BladeGrid.prototype.onLoadItems = function () {
1229
+ this.setStatusBarLoadData();
1230
+ };
1231
+ BladeGrid.prototype.onLoadedItems = function () {
1232
+ this.clearStatusBar();
1233
+ };
1250
1234
  //#region Filter
1251
1235
  BladeGrid.prototype.onFilter = function (actual, expected) {
1252
1236
  //#region Documentation
@@ -2,7 +2,7 @@
2
2
  <header class="fxs-blade-header">
3
3
  <div class="fxs-blade-statusbar-wrapper">
4
4
  <div class="fxs-blade-statusbar">
5
- <span ng-class="$ctrl.vm.statusbarClass">{{$ctrl.vm.statusbar}}</span>
5
+ <span ng-class="$ctrl.vm.statusBarClass">{{$ctrl.vm.statusBar}}</span>
6
6
  </div>
7
7
  </div>
8
8
  <div class="fxs-blade-actions">
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.109",
5
+ "version": "0.2.111",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {