~makyo/juju-gui/coords

« back to all changes in this revision

Viewing changes to app/views/topology/service.js

  • Committer: Jeff Pihach
  • Date: 2013-10-11 20:21:35 UTC
  • mfrom: (1129.2.3 bundle-deploy-button)
  • Revision ID: jeff.pihach@canonical.com-20131011202135-i28ba3kayqgc4qug
Deploy bundles from the bundle detail view

Clicking the 'Deploy' button from the bundle detail view
now deploys the bundle. Also added notifications for this
button and for drag and drop bundle deployment.

R=gary.poster
CC=
https://codereview.appspot.com/14419062

Show diffs side-by-side

added added

removed removed

Lines of Context:
696
696
      var dataTransfer = evt.dataTransfer;
697
697
      var fileSources = dataTransfer.files;
698
698
      var env = topo.get('env');
 
699
      var db = topo.get('db');
 
700
      var notifications = db.notifications;
699
701
      if (fileSources && fileSources.length) {
700
 
        var db = topo.get('db');
701
 
        var notifications = db.notifications;
702
702
        if (!Y.Lang.isFunction(env.deployerImport)) {
703
703
          // Notify the user that their environment is too old and return.
704
704
          notifications.add({
766
766
            // data, so we wrap the entity data in a mapping.  The deployer
767
767
            // format is YAML, but JSON is a subset of YAML, so we can just
768
768
            // encode it this way.
769
 
            env.deployerImport(Y.JSON.stringify({bundle: entityData.data}));
 
769
            env.deployerImport(
 
770
                Y.JSON.stringify({
 
771
                  bundle: entityData.data
 
772
                }), null,
 
773
                Y.bind(utils.deployBundleCallback, null, notifications));
770
774
          }
771
775
        }
772
776
      }