Skip to content

Commit 27a8d35

Browse files
committed
Merge branch 'v6' of github.com:topcoder-platform/work-manager into v6
2 parents 2434bac + 469a67d commit 27a8d35

File tree

7 files changed

+282
-104
lines changed

7 files changed

+282
-104
lines changed

config/constants/development.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = {
2828
SUBMISSIONS_API_URL: `${DEV_API_HOSTNAME}/v6/submissions`,
2929
REVIEW_TYPE_API_URL: `${DEV_API_HOSTNAME}/v6/reviewTypes`,
3030
SCORECARDS_API_URL: `${DEV_API_HOSTNAME}/v6/scorecards`,
31+
WORKFLOWS_API_URL: `${DEV_API_HOSTNAME}/v6/workflows`,
3132
SUBMISSION_REVIEW_APP_URL: `https://submission-review.${DOMAIN}/challenges`,
3233
STUDIO_URL: `https://studio.${DOMAIN}`,
3334
CONNECT_APP_URL: `https://connect.${DOMAIN}`,

config/constants/production.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ module.exports = {
2828
RESOURCE_ROLES_API_URL: `${PROD_API_HOSTNAME}/v5/resource-roles`,
2929
SUBMISSIONS_API_URL: `${PROD_API_HOSTNAME}/v5/submissions`,
3030
REVIEW_TYPE_API_URL: `${PROD_API_HOSTNAME}/v5/reviewTypes`,
31-
SCORECARDS_API_URL: `${PROD_API_HOSTNAME}/v5/scorecards`, //update to use v6
31+
SCORECARDS_API_URL: `${PROD_API_HOSTNAME}/v5/scorecards`, // update to use v6
32+
WORKFLOWS_API_URL: `${DEV_API_HOSTNAME}/v5/workflows`, // update to use v6
3233
SUBMISSION_REVIEW_APP_URL: `https://submission-review.${DOMAIN}/challenges`,
3334
STUDIO_URL: `https://studio.${DOMAIN}`,
3435
CONNECT_APP_URL: `https://connect.${DOMAIN}`,

src/actions/challenges.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import {
2222
deleteResource as deleteResourceAPI,
2323
updateChallengeSkillsApi,
2424
fetchDefaultReviewers,
25-
fetchScorecards
25+
fetchScorecards,
26+
fetchWorkflows
2627
} from '../services/challenges'
2728
import { searchProfilesByUserIds } from '../services/user'
2829
import {
@@ -817,3 +818,27 @@ export function loadDefaultReviewers (filters = {}) {
817818
}
818819
}
819820
}
821+
822+
/**
823+
* Load workflows
824+
*/
825+
export function loadWorkflows () {
826+
return async (dispatch) => {
827+
try {
828+
const workflows = await fetchWorkflows()
829+
dispatch({
830+
type: LOAD_CHALLENGE_METADATA_SUCCESS,
831+
metadataKey: 'workflows',
832+
metadataValue: workflows || []
833+
})
834+
} catch (error) {
835+
console.error('Error loading workflows:', error)
836+
// Return empty array on error to maintain consistency
837+
dispatch({
838+
type: LOAD_CHALLENGE_METADATA_SUCCESS,
839+
metadataKey: 'workflows',
840+
metadataValue: []
841+
})
842+
}
843+
}
844+
}

0 commit comments

Comments
 (0)