   getQuery: (which) ->
     qs.parse(location.search.slice(1))[which]
 
-  getWorkflow: (workflowID, idx) ->
-    @props.project.get('workflows', id: workflowID).then ([workflow]) =>
-      unless workflow?
-        throw new Error "No workflow #{workflowID} for project #{@props.project.id}"
-      currentList = @state.workflowList
-      currentList[idx] = workflow
-      @setState({workflowList: currentList})
+  # getWorkflow: (workflowID, idx) ->
+  #   @props.project.get('workflows', id: workflowID).then ([workflow]) =>
+  #     unless workflow?
+  #       throw new Error "No workflow #{workflowID} for project #{@props.project.id}"
+  #     currentList = @state.workflowList
+  #     currentList[idx] = workflow
+  #     @setState({workflowList: currentList})
 
   render: ->
     queryProps =

    query["#{which}Range"] = undefined
    {owner, name} = @props.params
    @history.replaceState(null, "/projects/#{owner}/#{name}/stats/", query)
    
  handleWorkflowChange: (which, e) ->
    query = qs.parse location.search.slice 1
    [name, value] = e.target.value.split('=')

PromiseToSetState = require '../../../lib/promise-to-set-state'
qs = require 'qs'
ProjectStatsPage = require './stats'
getWorkflowsInOrder = require '../../../lib/get-workflows-in-order'

ProjectStatsPageController = React.createClass
  mixins: [History, PromiseToSetState]

  getInitialState: ->
    workflowList: []

  componentDidMount: ->
    getWorkflowsInOrder(@props.project)
      .then (workflows) =>
        @setState workflowList: workflows

  handleGraphChange: (which, e) ->
    query = qs.parse location.search.slice 1
