@schneideress/dashboardframework 0.0.22 → 0.0.24

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.
@@ -5,6 +5,7 @@ import { BaseService } from '@schneideress/ess-util';
5
5
  import { filter, map } from 'rxjs/operators';
6
6
  import { NgxUiLoaderService, NgxUiLoaderModule } from 'ngx-ui-loader';
7
7
  import { NotifierService, NotifierModule } from 'angular-notifier';
8
+ import { TranslateService } from '@schneideress/ess-base';
8
9
  import { BrowserModule } from '@angular/platform-browser';
9
10
  import { HttpClientModule } from '@angular/common/http';
10
11
  import { CommonModule } from '@angular/common';
@@ -176,6 +177,7 @@ var RaDashboardService = /** @class */ (function (_super) {
176
177
  */
177
178
  function (widgetInfo, appConfig) {
178
179
  this.baseUrl = appConfig.apiBaseUrl;
180
+ console.log('in update widget service');
179
181
  return this.post('widget/UpdateUserWidget', widgetInfo);
180
182
  };
181
183
  /** To Move or change position if current widget container*/
@@ -471,10 +473,11 @@ var GridsterConfigDefaultSettings = {
471
473
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
472
474
  */
473
475
  var RADashboardArea = /** @class */ (function () {
474
- function RADashboardArea(dashboardService, ngZone, ngxService, notifier) {
476
+ function RADashboardArea(dashboardService, ngZone, ngxService, translateService, notifier) {
475
477
  this.dashboardService = dashboardService;
476
478
  this.ngZone = ngZone;
477
479
  this.ngxService = ngxService;
480
+ this.translateService = translateService;
478
481
  this.notifier = notifier;
479
482
  this.widgetList = Array();
480
483
  this.gridheight = 300;
@@ -726,7 +729,7 @@ var RADashboardArea = /** @class */ (function () {
726
729
  this.widgetList.splice(this.widgetList.indexOf(widget[0]), 1);
727
730
  this.setAreaHeight();
728
731
  if (!isalertDisabled) {
729
- this.notifier.notify('success', "Widget (" + widget[0].widgetInfo.widgetTitle + ") deleted successfully!");
732
+ this.notifier.notify('success', " " + this.translateService.translate('DeletedSuccesfully') + " [" + widget[0].widgetInfo.widgetTitle + "] " + this.translateService.translate('Widget') + " ");
730
733
  }
731
734
  }
732
735
  };
@@ -891,6 +894,7 @@ var RADashboardArea = /** @class */ (function () {
891
894
  { type: RaDashboardService },
892
895
  { type: NgZone },
893
896
  { type: NgxUiLoaderService },
897
+ { type: TranslateService },
894
898
  { type: NotifierService }
895
899
  ]; };
896
900
  RADashboardArea.propDecorators = {
@@ -910,9 +914,11 @@ var RADashboardArea = /** @class */ (function () {
910
914
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
911
915
  */
912
916
  var RAWidgetContainer = /** @class */ (function () {
913
- function RAWidgetContainer(dashboardService, ngxService, notifier) {
917
+ function RAWidgetContainer(dashboardService, ngxService, translateService, ngZone, notifier) {
914
918
  this.dashboardService = dashboardService;
915
919
  this.ngxService = ngxService;
920
+ this.translateService = translateService;
921
+ this.ngZone = ngZone;
916
922
  this.notifier = notifier;
917
923
  this.isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent);
918
924
  this.widgetDeleted = new EventEmitter();
@@ -933,7 +939,13 @@ var RAWidgetContainer = /** @class */ (function () {
933
939
  * @return {?}
934
940
  */
935
941
  function (e) {
936
- _this.configChangeEventHandler(e);
942
+ console.log('in config changed subscription');
943
+ _this.ngZone.run((/**
944
+ * @return {?}
945
+ */
946
+ function () {
947
+ _this.configChangeEventHandler(e);
948
+ }));
937
949
  }));
938
950
  }
939
951
  if (this.widgetElement && changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
@@ -1001,7 +1013,7 @@ var RAWidgetContainer = /** @class */ (function () {
1001
1013
  widgetContainerContext.widgetDeleted.emit(_this.data.widgetInfo.widgetInstanceId);
1002
1014
  }
1003
1015
  else {
1004
- widgetContainerContext.notifier.notify('error', "Failed to remove widget (" + _this.data.widgetInfo.widgetTitle + ")!");
1016
+ widgetContainerContext.notifier.notify('error', " " + _this.translateService.translate('FailedToRemoveWidget') + " (" + _this.data.widgetInfo.widgetTitle + ")!");
1005
1017
  }
1006
1018
  }));
1007
1019
  };
@@ -1032,15 +1044,16 @@ var RAWidgetContainer = /** @class */ (function () {
1032
1044
  //this.dashboardService.copyWidget(widgetInfo);
1033
1045
  };
1034
1046
  /**
1035
- * @param {?} config
1047
+ * @param {?} widgetInfo
1036
1048
  * @return {?}
1037
1049
  */
1038
1050
  RAWidgetContainer.prototype.configChangeEventHandler = /**
1039
- * @param {?} config
1051
+ * @param {?} widgetInfo
1040
1052
  * @return {?}
1041
1053
  */
1042
- function (config) {
1043
- this.data.widgetInfo.widgetConfigInfo.config = config;
1054
+ function (widgetInfo) {
1055
+ this.data.widgetInfo = widgetInfo;
1056
+ // this.data.widgetInfo.widgetConfigInfo.config = config;
1044
1057
  this.refreshWidget(this.data.widgetInfo);
1045
1058
  this.updateWidget(this.data.widgetInfo);
1046
1059
  };
@@ -1111,7 +1124,8 @@ var RAWidgetContainer = /** @class */ (function () {
1111
1124
  var widgetConfigFilter = (/** @type {?} */ ({
1112
1125
  config: widgetInfo.widgetConfigInfo.config,
1113
1126
  globalFilter: this.globalFilter,
1114
- appConfig: this.appConfig
1127
+ appConfig: this.appConfig,
1128
+ widgetInfo: widgetInfo
1115
1129
  }));
1116
1130
  widgetContainerContext.widgetElement.loadContent(widgetConfigFilter);
1117
1131
  };
@@ -1126,6 +1140,8 @@ var RAWidgetContainer = /** @class */ (function () {
1126
1140
  RAWidgetContainer.ctorParameters = function () { return [
1127
1141
  { type: RaDashboardService },
1128
1142
  { type: NgxUiLoaderService },
1143
+ { type: TranslateService },
1144
+ { type: NgZone },
1129
1145
  { type: NotifierService }
1130
1146
  ]; };
1131
1147
  RAWidgetContainer.propDecorators = {