Skip to content

Commit

Permalink
Add fields filter to project index workflows request (#3516)
Browse files Browse the repository at this point in the history
* init add of fields filter to worfklow get

* edit getWorkflow to get full workflow resource

* add completeness to fields param
  • Loading branch information
mcbouslog authored and srallen committed Feb 28, 2017
1 parent 2cd4360 commit af80b8b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions app/pages/project/index.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ ProjectPage = React.createClass
.then (pages) =>
@setState {pages}

getAllWorkflows: (project, query = { active: true }) ->
getAllWorkflows: (project, query = { active: true, fields: "active,completeness,configuration,display_name" }) ->
@setState { loadingSelectedWorkflow: true }
getWorkflowsInOrder(project, query)
.then (activeWorkflows) =>
Expand Down Expand Up @@ -182,10 +182,17 @@ ProjectPage = React.createClass
@state.activeWorkflows[randomIndex].id

getWorkflow: (selectedWorkflowIndex) ->
@setState {
selectedWorkflow: @state.activeWorkflows[selectedWorkflowIndex],
loadingSelectedWorkflow: false
}
apiClient.type('workflows').get({ id: "#{@state.activeWorkflows[selectedWorkflowIndex].id}" })
.catch (error) =>
console.error error
@setState {
loadingSelectedWorkflow: false
}
.then ([workflow]) =>
@setState {
selectedWorkflow: workflow,
loadingSelectedWorkflow: false
}

isWorkflowInactive: (project, selectedWorkflowID) ->
selectedWorkflowIndex = @state.activeWorkflows.findIndex (workflow, index) ->
Expand Down

0 comments on commit af80b8b

Please sign in to comment.