@schneideress/dashboardframework 0.0.23 → 0.0.25

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@schneideress/ess-util'), require('rxjs/operators'), require('ngx-ui-loader'), require('angular-notifier'), require('@angular/platform-browser'), require('@angular/common/http'), require('@angular/common')) :
3
- typeof define === 'function' && define.amd ? define('@schneideress/dashboardframework', ['exports', '@angular/core', 'rxjs', '@schneideress/ess-util', 'rxjs/operators', 'ngx-ui-loader', 'angular-notifier', '@angular/platform-browser', '@angular/common/http', '@angular/common'], factory) :
4
- (global = global || self, factory((global.schneideress = global.schneideress || {}, global.schneideress.dashboardframework = {}), global.ng.core, global.rxjs, global['@schneideress/ess-util'], global.rxjs.operators, global['ngx-ui-loader'], global['angular-notifier'], global.ng.platformBrowser, global.ng.common.http, global.ng.common));
5
- }(this, function (exports, core, rxjs, essUtil, operators, ngxUiLoader, angularNotifier, platformBrowser, http, common) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@schneideress/ess-util'), require('rxjs/operators'), require('ngx-ui-loader'), require('angular-notifier'), require('@schneideress/ess-base'), require('@angular/platform-browser'), require('@angular/common/http'), require('@angular/common')) :
3
+ typeof define === 'function' && define.amd ? define('@schneideress/dashboardframework', ['exports', '@angular/core', 'rxjs', '@schneideress/ess-util', 'rxjs/operators', 'ngx-ui-loader', 'angular-notifier', '@schneideress/ess-base', '@angular/platform-browser', '@angular/common/http', '@angular/common'], factory) :
4
+ (global = global || self, factory((global.schneideress = global.schneideress || {}, global.schneideress.dashboardframework = {}), global.ng.core, global.rxjs, global['@schneideress/ess-util'], global.rxjs.operators, global['ngx-ui-loader'], global['angular-notifier'], global.essBase, global.ng.platformBrowser, global.ng.common.http, global.ng.common));
5
+ }(this, function (exports, core, rxjs, essUtil, operators, ngxUiLoader, angularNotifier, essBase, platformBrowser, http, common) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -211,6 +211,7 @@
211
211
  */
212
212
  function (widgetInfo, appConfig) {
213
213
  this.baseUrl = appConfig.apiBaseUrl;
214
+ console.log('in update widget service');
214
215
  return this.post('widget/UpdateUserWidget', widgetInfo);
215
216
  };
216
217
  /** To Move or change position if current widget container*/
@@ -506,10 +507,11 @@
506
507
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
507
508
  */
508
509
  var RADashboardArea = /** @class */ (function () {
509
- function RADashboardArea(dashboardService, ngZone, ngxService, notifier) {
510
+ function RADashboardArea(dashboardService, ngZone, ngxService, translateService, notifier) {
510
511
  this.dashboardService = dashboardService;
511
512
  this.ngZone = ngZone;
512
513
  this.ngxService = ngxService;
514
+ this.translateService = translateService;
513
515
  this.notifier = notifier;
514
516
  this.widgetList = Array();
515
517
  this.gridheight = 300;
@@ -641,10 +643,14 @@
641
643
  * @return {?}
642
644
  */
643
645
  function () {
644
- this.conifgAddClick.unsubscribe();
645
- this.widgetAddEvent.unsubscribe();
646
- this.widgetDeleteEvent.unsubscribe();
647
- this.widgetLibraryDoneClick.unsubscribe();
646
+ if (this.conifgAddClick)
647
+ this.conifgAddClick.unsubscribe();
648
+ if (this.widgetAddEvent)
649
+ this.widgetAddEvent.unsubscribe();
650
+ if (this.widgetDeleteEvent)
651
+ this.widgetDeleteEvent.unsubscribe();
652
+ if (this.widgetLibraryDoneClick)
653
+ this.widgetLibraryDoneClick.unsubscribe();
648
654
  };
649
655
  /**To update position/dimention of all widgets in the area */
650
656
  /**
@@ -757,7 +763,7 @@
757
763
  this.widgetList.splice(this.widgetList.indexOf(widget[0]), 1);
758
764
  this.setAreaHeight();
759
765
  if (!isalertDisabled) {
760
- this.notifier.notify('success', "Widget (" + widget[0].widgetInfo.widgetTitle + ") deleted successfully!");
766
+ this.notifier.notify('success', " " + this.translateService.translate('DeletedSuccesfully') + " [" + widget[0].widgetInfo.widgetTitle + "] " + this.translateService.translate('Widget') + " ");
761
767
  }
762
768
  }
763
769
  };
@@ -922,6 +928,7 @@
922
928
  { type: RaDashboardService },
923
929
  { type: core.NgZone },
924
930
  { type: ngxUiLoader.NgxUiLoaderService },
931
+ { type: essBase.TranslateService },
925
932
  { type: angularNotifier.NotifierService }
926
933
  ]; };
927
934
  RADashboardArea.propDecorators = {
@@ -941,9 +948,11 @@
941
948
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
942
949
  */
943
950
  var RAWidgetContainer = /** @class */ (function () {
944
- function RAWidgetContainer(dashboardService, ngxService, notifier) {
951
+ function RAWidgetContainer(dashboardService, ngxService, translateService, ngZone, notifier) {
945
952
  this.dashboardService = dashboardService;
946
953
  this.ngxService = ngxService;
954
+ this.translateService = translateService;
955
+ this.ngZone = ngZone;
947
956
  this.notifier = notifier;
948
957
  this.isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent);
949
958
  this.widgetDeleted = new core.EventEmitter();
@@ -964,7 +973,13 @@
964
973
  * @return {?}
965
974
  */
966
975
  function (e) {
967
- _this.configChangeEventHandler(e);
976
+ console.log('in config changed subscription');
977
+ _this.ngZone.run((/**
978
+ * @return {?}
979
+ */
980
+ function () {
981
+ _this.configChangeEventHandler(e);
982
+ }));
968
983
  }));
969
984
  }
970
985
  if (this.widgetElement && changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
@@ -993,7 +1008,8 @@
993
1008
  * @return {?}
994
1009
  */
995
1010
  function () {
996
- this.configChanged.unsubscribe();
1011
+ if (this.configChanged)
1012
+ this.configChanged.unsubscribe();
997
1013
  };
998
1014
  /** To Edit current widget configuration*/
999
1015
  /**
@@ -1031,7 +1047,7 @@
1031
1047
  widgetContainerContext.widgetDeleted.emit(_this.data.widgetInfo.widgetInstanceId);
1032
1048
  }
1033
1049
  else {
1034
- widgetContainerContext.notifier.notify('error', "Failed to remove widget (" + _this.data.widgetInfo.widgetTitle + ")!");
1050
+ widgetContainerContext.notifier.notify('error', " " + _this.translateService.translate('FailedToRemoveWidget') + " (" + _this.data.widgetInfo.widgetTitle + ")!");
1035
1051
  }
1036
1052
  }));
1037
1053
  };
@@ -1062,15 +1078,16 @@
1062
1078
  //this.dashboardService.copyWidget(widgetInfo);
1063
1079
  };
1064
1080
  /**
1065
- * @param {?} config
1081
+ * @param {?} widgetInfo
1066
1082
  * @return {?}
1067
1083
  */
1068
1084
  RAWidgetContainer.prototype.configChangeEventHandler = /**
1069
- * @param {?} config
1085
+ * @param {?} widgetInfo
1070
1086
  * @return {?}
1071
1087
  */
1072
- function (config) {
1073
- this.data.widgetInfo.widgetConfigInfo.config = config;
1088
+ function (widgetInfo) {
1089
+ this.data.widgetInfo = widgetInfo;
1090
+ // this.data.widgetInfo.widgetConfigInfo.config = config;
1074
1091
  this.refreshWidget(this.data.widgetInfo);
1075
1092
  this.updateWidget(this.data.widgetInfo);
1076
1093
  };
@@ -1141,7 +1158,8 @@
1141
1158
  var widgetConfigFilter = (/** @type {?} */ ({
1142
1159
  config: widgetInfo.widgetConfigInfo.config,
1143
1160
  globalFilter: this.globalFilter,
1144
- appConfig: this.appConfig
1161
+ appConfig: this.appConfig,
1162
+ widgetInfo: widgetInfo
1145
1163
  }));
1146
1164
  widgetContainerContext.widgetElement.loadContent(widgetConfigFilter);
1147
1165
  };
@@ -1156,6 +1174,8 @@
1156
1174
  RAWidgetContainer.ctorParameters = function () { return [
1157
1175
  { type: RaDashboardService },
1158
1176
  { type: ngxUiLoader.NgxUiLoaderService },
1177
+ { type: essBase.TranslateService },
1178
+ { type: core.NgZone },
1159
1179
  { type: angularNotifier.NotifierService }
1160
1180
  ]; };
1161
1181
  RAWidgetContainer.propDecorators = {
@@ -5726,6 +5746,7 @@
5726
5746
  GridsterModule,
5727
5747
  http.HttpClientModule,
5728
5748
  ngxUiLoader.NgxUiLoaderModule,
5749
+ essBase.TranslateModule,
5729
5750
  angularNotifier.NotifierModule.withConfig(customNotifierOptions)
5730
5751
  ],
5731
5752
  exports: [