From 8f7393cbaf55ec08bdacab884a1c690d80d80e6d Mon Sep 17 00:00:00 2001 From: himaniraghav3 Date: Tue, 25 Nov 2025 14:30:18 +0530 Subject: [PATCH 01/12] Update Manage Submissions to accomodate AI Workflows --- config/backup-default.js | 3 + config/default.js | 2 + config/production.js | 3 + .../actions/page/submission_management.js | 25 +++++- .../ScreeningDetails/index.jsx | 2 +- .../SubmissionManagement/Submission/index.jsx | 23 ++++- .../Submission/styles.scss | 1 + .../SubmissionManagement/index.jsx | 3 + .../SubmissionsTable/index.jsx | 15 ++++ .../SubmissionsTable/styles.scss | 10 +++ .../TableWorkflowRuns/index.jsx | 84 +++++++++++++++++++ .../TableWorkflowRuns/styles.scss | 37 ++++++++ .../containers/SubmissionManagement/index.jsx | 30 +++++++ .../reducers/page/submission_management.js | 12 +++ 14 files changed, 246 insertions(+), 4 deletions(-) create mode 100644 src/shared/components/SubmissionManagement/TableWorkflowRuns/index.jsx create mode 100644 src/shared/components/SubmissionManagement/TableWorkflowRuns/styles.scss diff --git a/config/backup-default.js b/config/backup-default.js index 0b29ad84a6..4bacfa2b87 100644 --- a/config/backup-default.js +++ b/config/backup-default.js @@ -177,6 +177,9 @@ module.exports = { * object should be considered outdated, and updated as soon as possible. */ USER_GROUP_MAXAGE: 24 * 60 * 60 * 1000, + REVIEW_APP_URL: 'https://review.topcoder-dev.com', + + /* Maximum time to wait before timeout on searching past challenges (seconds) * when no result at all. * Default: 30 seconds. diff --git a/config/default.js b/config/default.js index b4c990aa37..7ea072a6cc 100644 --- a/config/default.js +++ b/config/default.js @@ -179,6 +179,8 @@ module.exports = { * This value [seconds] specifies the maximum age after which a group data * object should be considered outdated, and updated as soon as possible. */ USER_GROUP_MAXAGE: 24 * 60 * 60 * 1000, + REVIEW_APP_URL: 'https://review.topcoder-dev.com', + /* Maximum time to wait before timeout on searching past challenges (seconds) * when no result at all. diff --git a/config/production.js b/config/production.js index c37c4fd63b..da1d0d0a8a 100644 --- a/config/production.js +++ b/config/production.js @@ -67,6 +67,9 @@ module.exports = { REVIEW_TYPES_API_URL: '/reviewTypes', REVIEW_SUMMATIONS_API_URL: '/reviewSummations', }, + + REVIEW_APP_URL: 'https://review.topcoder.com', + /* Filestack configuration for uploading Submissions * These are for the production back end */ FILESTACK: { diff --git a/src/shared/actions/page/submission_management.js b/src/shared/actions/page/submission_management.js index 32c8627119..bab56a59e6 100644 --- a/src/shared/actions/page/submission_management.js +++ b/src/shared/actions/page/submission_management.js @@ -1,5 +1,26 @@ import _ from 'lodash'; -import { redux } from 'topcoder-react-utils'; +import { redux, config } from 'topcoder-react-utils'; +import { services } from 'topcoder-react-lib'; + +const Api = services.api.default; + +function loadAiWorkflowRunsInit() {} + +function loadAiWorkflowRunsDone(tokenV3, submissionId, aiWorkflowId) { + const api = new Api(config.API.V6, tokenV3); + const url = `/workflows/${aiWorkflowId}/runs?submissionId=${submissionId}`; + + return api.get(url) + .then(res => res.json()) + .then(data => ({ + submissionId, + aiWorkflowId, + runs: data, + })) + .catch((err) => { + throw err; + }); +} export default redux.createActions({ PAGE: { @@ -7,6 +28,8 @@ export default redux.createActions({ SHOW_DETAILS: _.identity, CANCEL_DELETE: _.noop, CONFIRM_DELETE: _.identity, + LOAD_AI_WORKFLOW_RUNS_INIT: loadAiWorkflowRunsInit, + LOAD_AI_WORKFLOW_RUNS_DONE: loadAiWorkflowRunsDone, }, }, }); diff --git a/src/shared/components/SubmissionManagement/ScreeningDetails/index.jsx b/src/shared/components/SubmissionManagement/ScreeningDetails/index.jsx index 37dd7102a1..600ef10ae6 100644 --- a/src/shared/components/SubmissionManagement/ScreeningDetails/index.jsx +++ b/src/shared/components/SubmissionManagement/ScreeningDetails/index.jsx @@ -59,7 +59,7 @@ export default function ScreeningDetails(props) { return { title: '', classname: '', - message: 'Your submission has been received, and will be evaluated during Review phase.', + message: 'Your submission has been received and may undergo AI-assisted review during Submission phase. Results will be available for inspection in the review app and final evaluation occurs during Review phase.', }; }; diff --git a/src/shared/components/SubmissionManagement/Submission/index.jsx b/src/shared/components/SubmissionManagement/Submission/index.jsx index 27b82fe3db..7526a1c460 100644 --- a/src/shared/components/SubmissionManagement/Submission/index.jsx +++ b/src/shared/components/SubmissionManagement/Submission/index.jsx @@ -15,6 +15,7 @@ import _ from 'lodash'; import moment from 'moment'; import React from 'react'; import { CHALLENGE_STATUS, COMPETITION_TRACKS, safeForDownload } from 'utils/tc'; +import { config } from 'topcoder-react-utils'; import PT from 'prop-types'; @@ -25,10 +26,10 @@ import ArtifactsDownloadIcon from '../Icons/IconDownloadArtifacts.svg'; import ReviewRatingListIcon from '../Icons/IconReviewRatingList.svg'; import ExpandIcon from '../Icons/IconMinimalDown.svg'; import ScreeningStatus from '../ScreeningStatus'; +import IconShare from '../Icons/IconShare.svg'; import './styles.scss'; - export default function Submission(props) { const { challenge, @@ -48,6 +49,11 @@ export default function Submission(props) { const safeForDownloadCheck = safeForDownload(submissionObject.url); const onDownloadArtifacts = onOpenDownloadArtifactsModal.bind(1, submissionObject.id); const onOpenRatingsList = onOpenRatingsListModal.bind(1, submissionObject.id); + const onOpenReviewApp = () => { + if (!challenge || !challenge.id) return; + const url = `${config.REVIEW_APP_URL}/active-challenges/${challenge.id}/challenge-details?tab=submission`; + window.open(url, '_blank', 'noopener,noreferrer'); + }; // Determine if a challenge is for Topcrowd so we can edit the UI accordingly let isTopCrowdChallenge = false; @@ -117,7 +123,20 @@ export default function Submission(props) { : } { !isTopCrowdChallenge ? ( -
Show Scores
}> +
View Review Info
}> + +
+ ) + : } + { !isTopCrowdChallenge + ? ( +
Show scores
}> -
- ) - : } { !isTopCrowdChallenge ? (
Show scores
}> @@ -170,6 +159,19 @@ export default function Submission(props) { ) } + { !isTopCrowdChallenge + ? ( +
View Review Info
}> + +
+ ) + : }