From af80b8bf5df582a7ff4983e522d9c5cb23da33f2 Mon Sep 17 00:00:00 2001 From: Mark Bouslog Date: Tue, 28 Feb 2017 09:54:27 -0600 Subject: [PATCH] Add fields filter to project index workflows request (#3516) * init add of fields filter to worfklow get * edit getWorkflow to get full workflow resource * add completeness to fields param --- app/pages/project/index.cjsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/pages/project/index.cjsx b/app/pages/project/index.cjsx index 34304311d6..f7ef63bfc2 100644 --- a/app/pages/project/index.cjsx +++ b/app/pages/project/index.cjsx @@ -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) => @@ -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) ->