Beispiel #1
0
 setTimeout(function() {
     if (!nullProject.isEmpty()) {
         actions.NullProjectActions.migrateResourcesIntoProject(nullProject);
     } else {
         actions.NullProjectActions.moveAttachedVolumesIntoCorrectProject();
     }
 }, 1);
    componentDidMount: function () {
      // subscribe to all Stores
      Object.keys(stores).forEach(function (storeName) {
        stores[storeName].addChangeListener(this.updateState);
      }.bind(this));

      // The code below is only relevant to logged in users
      if (!context.hasLoggedInUser()) return;

      // IMPORTANT! We get one shot at this. If the instances and volumes aren't
      // fetched before this component is mounted we miss our opportunity to migrate
      // the users resources (so make sure they're fetched in the Splash Screen)
      var instances = stores.InstanceStore.getInstancesNotInAProject(),
            volumes = stores.VolumeStore.getVolumesNotInAProject(),
            nullProject = new NullProject({instances: instances, volumes: volumes});

      if (!modernizrTest.unsupported()) {
          showUnsupportedModal.showModal(this.closeUnsupportedModal);
      }

      if (modernizrTest.unsupported()) {

        if (!nullProject.isEmpty()) {
            actions.NullProjectActions.migrateResourcesIntoProject(nullProject);
        } else {
            actions.NullProjectActions.moveAttachedVolumesIntoCorrectProject();
        }
      }

      if (globals.BADGES_ENABLED){
        this.loadBadgeData();
      }

    },