     if isTeamReactSide() and state is Stopping
       modalOptions.cssClass = 'env-machine-state team full'
 
-    @machineStateModal = new EnvironmentsMachineStateModal modalOptions, machineItem
+    modalClass = if checkFlag 'new-resource-state-modal'
+    then ResourceStateModal
+    else EnvironmentsMachineStateModal
+    @machineStateModal = new modalClass modalOptions, machineItem
 
     @machineStateModal.once 'KDObjectWillBeDestroyed', => @machineStateModal = null
     @machineStateModal.once 'IDEBecameReady', @bound 'handleIDEBecameReady'

environmentDataProvider       = require 'app/userenvironmentdataprovider'
CollaborationController       = require './collaborationcontroller'
EnvironmentsMachineStateModal = require 'app/providers/environmentsmachinestatemodal'
KlientEventManager            = require 'app/kite/klienteventmanager'
IDELayoutManager              = require './workspace/idelayoutmanager'
StackAdminMessageController   = require './views/stacks/stackadminmessagecontroller'

IDEView                       = require './views/tabview/ideview'
FSHelper                      = require 'app/util/fs/fshelper'
showError                     = require 'app/util/showError'
checkFlag                     = require 'app/util/checkFlag'
actionTypes                   = require 'app/flux/environment/actiontypes'
IDEWorkspace                  = require './workspace/ideworkspace'
IDEStatusBar                  = require './views/statusbar/idestatusbar'
