Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   for (const dashboard of bundle.dashboards) {
  2.                 const p = getDashboard(dashboard._id).then(d => {
  3.                     if (d) {
  4.                         if (item.replace === true) {
  5.                             return replace.push(d);
  6.                         }
  7.                         messages.push('Dashboard was not imported because it already exists in database: ' + d.dashboardName);
  8.                         return;
  9.                     }
  10.  
  11.                     return importDashboard(dashboard, datasourceRef).then(d => {
  12.                         additions.push(d);
  13.                     });
  14.                 });
  15.                 promises.push(p);
  16.             }
  17.  
  18.             return $q.all(promises).then(() => {
  19.                 return {
  20.                     additions: additions,
  21.                     messages: messages,
  22.                     replace: replace,
  23.                 };
  24.             });
  25.  
  26.   this.replaceDashboard = function () {
  27.         var params = {
  28.             fields: ['_id', 'name']
  29.         };
  30.  
  31.         return connection.post('/api/dashboardsv2/update/:id', params).then(d => d.item);
  32.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement