File tree Expand file tree Collapse file tree 7 files changed +282
-104
lines changed
components/ChallengeEditor Expand file tree Collapse file tree 7 files changed +282
-104
lines changed Original file line number Diff line number Diff 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 } ` ,
Original file line number Diff line number Diff 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 } ` ,
Original file line number Diff line number Diff 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'
2728import { searchProfilesByUserIds } from '../services/user'
2829import {
@@ -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+ }
You can’t perform that action at this time.
0 commit comments