Skip to content

Commit

Permalink
Tidy up workflow display names
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed Feb 18, 2021
1 parent a0f0347 commit a28708d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function fetchPreviewImage (subjectSet, env) {
subjectSet.subjects = linked.subjects
}

async function buildWorkflow(workflow, displayNames, subjectSets, isDefault) {
async function buildWorkflow(workflow, displayName, subjectSets, isDefault) {
const subjectSetCounts = await fetchWorkflowCellectStatus(workflow)
const workflowSubjectSets = workflow.links.subject_sets
.map(subjectSetID => {
Expand All @@ -62,7 +62,7 @@ async function buildWorkflow(workflow, displayNames, subjectSets, isDefault) {
return {
completeness: workflow.completeness || 0,
default: isDefault,
displayName: displayNames[workflow.id],
displayName,
grouped: workflow.grouped,
id: workflow.id,
subjectSets: workflowSubjectSets
Expand All @@ -76,7 +76,8 @@ async function fetchWorkflowsHelper (language = 'en', activeWorkflows, defaultWo

const awaitWorkflows = workflows.map(workflow => {
const isDefault = workflows.length === 1 || workflow.id === defaultWorkflow
return buildWorkflow(workflow, displayNames, subjectSets, isDefault)
const displayName = displayNames[workflow.id]
return buildWorkflow(workflow, displayName, subjectSets, isDefault)
})
const workflowStatuses = await Promise.allSettled(awaitWorkflows)
const workflowsWithSubjectSets = workflowStatuses.map(result => result.value)
Expand Down

0 comments on commit a28708d

Please sign in to comment.