@schneideress/dashboardframework 0.0.28 → 0.0.30

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.
@@ -466,17 +466,44 @@ class RADashboardArea {
466
466
  */
467
467
  () => {
468
468
  if (widgetList) {
469
- widgetList.forEach((/**
470
- * @param {?} widgetInfo
471
- * @return {?}
472
- */
473
- widgetInfo => {
474
- this.addWidget(widgetInfo);
475
- }));
469
+ // widgetList.forEach(widgetInfo => {
470
+ // this.addWidget(widgetInfo);
471
+ // });
472
+ this.addWidgetListToGridster(widgetList, 0);
476
473
  }
477
474
  }));
478
475
  }));
479
476
  }
477
+ /**
478
+ * temp fix- recursive method to iterate over the list of items
479
+ * and add them to gridster in the given order
480
+ * @param {?} widgetList -list of widgets
481
+ * @param {?} index -index of the current value to be added
482
+ * @return {?}
483
+ */
484
+ addWidgetListToGridster(widgetList, index) {
485
+ /** @type {?} */
486
+ let areaContext = this;
487
+ /** @type {?} */
488
+ let indexVal = index + 1;
489
+ if (index > widgetList.length - 1)
490
+ return;
491
+ else {
492
+ if (index == 0) {
493
+ areaContext.addWidget(widgetList[index]);
494
+ areaContext.addWidgetListToGridster(widgetList, indexVal);
495
+ }
496
+ else {
497
+ setTimeout((/**
498
+ * @return {?}
499
+ */
500
+ () => {
501
+ areaContext.addWidget(widgetList[index]);
502
+ areaContext.addWidgetListToGridster(widgetList, indexVal);
503
+ }), 1000);
504
+ }
505
+ }
506
+ }
480
507
  /**
481
508
  * @return {?}
482
509
  */
@@ -575,7 +602,7 @@ class RADashboardArea {
575
602
  this.widgetList.splice(this.widgetList.indexOf(widget[0]), 1);
576
603
  this.setAreaHeight();
577
604
  if (!isalertDisabled) {
578
- this.notifier.notify('success', " " + this.translateService.translate('DeletedSuccesfully') + " [" + widget[0].widgetInfo.widgetTitle + "] " + this.translateService.translate('Widget') + " ");
605
+ this.notifier.notify('success', " " + this.translateService.translate('Widget') + " [" + widget[0].widgetInfo.widgetTitle + "] " + this.translateService.translate('DeletedSuccesfully') + " ");
579
606
  }
580
607
  }
581
608
  }
@@ -857,6 +884,7 @@ class RAWidgetContainer {
857
884
  * @return {?}
858
885
  */
859
886
  () => {
887
+ console.log('widget initialized ' + widgetInfo.widgetInstanceId);
860
888
  widgetConfigFilter.appConfig = this.appConfig;
861
889
  widgetConfigFilter.widgetInfo = (/** @type {?} */ ({}));
862
890
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
@@ -4936,6 +4964,14 @@ class RaBaseDashboardTemplate {
4936
4964
  this.init();
4937
4965
  });
4938
4966
  }
4967
+ /**
4968
+ * @return {?}
4969
+ */
4970
+ ngOnInit() {
4971
+ /** @type {?} */
4972
+ var myEvent = new CustomEvent("event-template-initiated");
4973
+ document.body.dispatchEvent(myEvent);
4974
+ }
4939
4975
  }
4940
4976
  RaBaseDashboardTemplate.propDecorators = {
4941
4977
  dashboardId: [{ type: Input, args: ['dashboard-id',] }],