Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/constants/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
SUBMISSIONS_API_URL: `${DEV_API_HOSTNAME}/v6/submissions`,
REVIEW_TYPE_API_URL: `${DEV_API_HOSTNAME}/v6/reviewTypes`,
SCORECARDS_API_URL: `${DEV_API_HOSTNAME}/v6/scorecards`,
WORKFLOWS_API_URL: `${DEV_API_HOSTNAME}/v6/workflows`,
SUBMISSION_REVIEW_APP_URL: `https://submission-review.${DOMAIN}/challenges`,
STUDIO_URL: `https://studio.${DOMAIN}`,
CONNECT_APP_URL: `https://connect.${DOMAIN}`,
Expand Down
3 changes: 2 additions & 1 deletion config/constants/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ module.exports = {
RESOURCE_ROLES_API_URL: `${PROD_API_HOSTNAME}/v5/resource-roles`,
SUBMISSIONS_API_URL: `${PROD_API_HOSTNAME}/v5/submissions`,
REVIEW_TYPE_API_URL: `${PROD_API_HOSTNAME}/v5/reviewTypes`,
SCORECARDS_API_URL: `${PROD_API_HOSTNAME}/v5/scorecards`, //update to use v6
SCORECARDS_API_URL: `${PROD_API_HOSTNAME}/v5/scorecards`, // update to use v6
WORKFLOWS_API_URL: `${DEV_API_HOSTNAME}/v5/workflows`, // update to use v6
SUBMISSION_REVIEW_APP_URL: `https://submission-review.${DOMAIN}/challenges`,
STUDIO_URL: `https://studio.${DOMAIN}`,
CONNECT_APP_URL: `https://connect.${DOMAIN}`,
Expand Down
27 changes: 26 additions & 1 deletion src/actions/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
deleteResource as deleteResourceAPI,
updateChallengeSkillsApi,
fetchDefaultReviewers,
fetchScorecards
fetchScorecards,
fetchWorkflows
} from '../services/challenges'
import { searchProfilesByUserIds } from '../services/user'
import {
Expand Down Expand Up @@ -817,3 +818,27 @@ export function loadDefaultReviewers (filters = {}) {
}
}
}

/**
* Load workflows
*/
export function loadWorkflows () {
return async (dispatch) => {
try {
const workflows = await fetchWorkflows()
dispatch({
type: LOAD_CHALLENGE_METADATA_SUCCESS,
metadataKey: 'workflows',
metadataValue: workflows || []
})
} catch (error) {
console.error('Error loading workflows:', error)
// Return empty array on error to maintain consistency
dispatch({
type: LOAD_CHALLENGE_METADATA_SUCCESS,
metadataKey: 'workflows',
metadataValue: []
})
}
}
}
Loading