dtpublic/malhar-angular-dashboard

adding Layout with explicit save options does not work

Closed this issue · 2 comments

Hi, I have the simple dashboard (no layout, no save option) working. Once I replace the DemoCtrl controller by LayoutsDemoExplicitSaveCtrl, the HTML Web page ui-view only shows a "+" icon without the list of layouts. Firefox debugger shows the layoutOptions is undefined. I would appreciate if any one could share how to modify/add the dashboard controller. I may have some mis-configuration in passing the $scope when using the new layout controller. Thanks.

Summary of issues
Replacing default DemoCtrl by LayoutsDemoExplicitSaveCtrl cannot render the layout page.

Similarly, if i want to replace DemoCtrl by ExplicitSaveDemoCtrl, the layout page does not render.

From demo.js, this angularjs ui.router definition will use the controller 'DemoCtrl' (from https://github.com/DataTorrent/malhar-angular-dashboard/blob/master/src/app/demo.js).

.state("dashboard-noborder", {
      url: "/dashboard-noborder",
      views: {
         "dashboard-noborder" : {
           templateUrl: "app/views/mal/layouts.html"
         }
      },
      //previously:  controller: 'DemoCtrl'
      controller: 'LayoutsDemoExplicitSaveCtrl'
  })

The templateUrl points to app/views/mal/layouts.html, which is the exact copy from https://github.com/DataTorrent/malhar-angular-dashboard/blob/master/src/app/template/layouts.html

Errors
From Firefox browser:

Error: dst is undefined.

From debugging:
scope.options is undefined

Change Details
Here're the changes I made so far

demo.js:

  • Change from ng-router to ui-router
  • Reduce the number of widgets to 2 (namely, wt-time, wtHistoricalChart) for testing

malhar-angular-dashboard.js:

  • Replace $uibModal by $modal, and $uibModalInstance by $modalInstance

malhar-angular-widgets.js
Comment out unused modules

  • angular.module('ui.widgets', ['datatorrent.mlhrTable', 'nvd3ChartDirectives']);
  • factory methods: RandomPercentageDataModel, RandomMetricsTimeSeriesDataModel, RandomMinutesDataModel, PieChartDataModel
  • function Gauge()
  • directives wtBarChart, wtGauge, wtMetricsChart, wtNvd3LineChart, wtPieChart, wtScopeWatch, wtSelect, wtTopN
wvary commented

Hi @rayymlai,

Can you provide a branch with your code so we can help you with this issue?

Regards,

Willet

wvary commented

No response from OP so closing issue.