-
Notifications
You must be signed in to change notification settings - Fork 211
[PROD] - AI Workflows MVP #7151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8f7393c
8d0fae4
a293808
c2ae9ce
c7d1569
70544e5
1f56c25
640e289
b47b6d4
d8f4d95
cf145f9
b9a6242
9b0f90b
d1bfa6a
18c3db4
0290774
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
|
|
||
|
|
||
| /* Maximum time to wait before timeout on searching past challenges (seconds) | ||
| * when no result at all. | ||
| * Default: 30 seconds. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [💡 |
||
|
|
||
|
|
||
| /* Maximum time to wait before timeout on searching past challenges (seconds) | ||
| * when no result at all. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,34 @@ | ||
| 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) { | ||
| const api = new Api(config.API.V6, tokenV3); | ||
| const url = `/workflows/runs?submissionId=${submissionId}`; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
|
|
||
| return api.get(url) | ||
| .then(res => res.json()) | ||
| .then(data => ({ | ||
| submissionId, | ||
| runs: data, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| })) | ||
| .catch((err) => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [💡 |
||
| throw err; | ||
| }); | ||
| } | ||
|
|
||
| export default redux.createActions({ | ||
| PAGE: { | ||
| SUBMISSION_MANAGEMENT: { | ||
| SHOW_DETAILS: _.identity, | ||
| CANCEL_DELETE: _.noop, | ||
| CONFIRM_DELETE: _.identity, | ||
| LOAD_AI_WORKFLOW_RUNS_INIT: loadAiWorkflowRunsInit, | ||
| LOAD_AI_WORKFLOW_RUNS_DONE: loadAiWorkflowRunsDone, | ||
| }, | ||
| }, | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [💡 |
||
| }; | ||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
|
||
|
|
@@ -28,7 +29,6 @@ import ScreeningStatus from '../ScreeningStatus'; | |
|
|
||
| import './styles.scss'; | ||
|
|
||
|
|
||
| export default function Submission(props) { | ||
| const { | ||
| challenge, | ||
|
|
@@ -48,6 +48,14 @@ 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 tab = submissionObject.type === 'CHECKPOINT_SUBMISSION' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| ? 'checkpoint-submission' | ||
| : 'submission'; | ||
| const url = `${config.REVIEW_APP_URL}/active-challenges/${challenge.id}/challenge-details?tab=${tab}`; | ||
| 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 +125,7 @@ export default function Submission(props) { | |
| : <span /> } | ||
| { !isTopCrowdChallenge | ||
| ? ( | ||
| <Tooltip content={() => <div styleName="tooltip-content">Show Scores</div>}> | ||
| <Tooltip content={() => <div styleName="tooltip-content">Show scores</div>}> | ||
| <button | ||
| onClick={() => onOpenRatingsList()} | ||
| type="button" | ||
|
|
@@ -151,6 +159,19 @@ export default function Submission(props) { | |
| </button> | ||
| ) | ||
| } | ||
| { !isTopCrowdChallenge | ||
| ? ( | ||
| <Tooltip content={() => <div styleName="tooltip-content">View Review Info</div>}> | ||
| <button | ||
| onClick={() => onOpenReviewApp()} | ||
| type="button" | ||
| styleName="review-button" | ||
| > | ||
| Review | ||
| </button> | ||
| </Tooltip> | ||
| ) | ||
| : <span />} | ||
| <button | ||
| styleName={`expand-icon ${(showScreeningDetails ? 'expanded' : '')}`} | ||
| onClick={() => onShowDetails(submissionObject.id)} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ export default function SubmissionManagement(props) { | |
| submissions, | ||
| loadingSubmissions, | ||
| showDetails, | ||
| submissionWorkflowRuns, | ||
| onDelete, | ||
| helpPageUrl, | ||
| onDownload, | ||
|
|
@@ -182,6 +183,7 @@ export default function SubmissionManagement(props) { | |
| <SubmissionsTable | ||
| challenge={challenge} | ||
| submissionObjects={submissions} | ||
| submissionWorkflowRuns={submissionWorkflowRuns} | ||
| showDetails={showDetails} | ||
| track={trackName} | ||
| status={challenge.status} | ||
|
|
@@ -227,6 +229,7 @@ SubmissionManagement.defaultProps = { | |
| SubmissionManagement.propTypes = { | ||
| challenge: PT.shape().isRequired, | ||
| showDetails: PT.shape().isRequired, | ||
| submissionWorkflowRuns: PT.shape().isRequired, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| onDelete: PT.func, | ||
| onlineReviewUrl: PT.string, | ||
| helpPageUrl: PT.string, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ import ScreeningDetails from '../ScreeningDetails'; | |
| import DownloadArtifactsModal from '../DownloadArtifactsModal'; | ||
| import Submission from '../Submission'; | ||
| import RatingsListModal from '../RatingsListModal'; | ||
| import TableWorkflowRuns from '../TableWorkflowRuns'; | ||
|
|
||
| import './styles.scss'; | ||
|
|
||
|
|
@@ -35,6 +36,7 @@ export default function SubmissionsTable(props) { | |
| const { | ||
| challenge, | ||
| submissionObjects, | ||
| submissionWorkflowRuns, | ||
| showDetails, | ||
| track, | ||
| onDelete, | ||
|
|
@@ -92,12 +94,23 @@ export default function SubmissionsTable(props) { | |
| /> | ||
| ); | ||
| submissionsWithDetails.push(submission); | ||
| const workflowRunsForSubmission = submissionWorkflowRuns | ||
| && submissionWorkflowRuns[subObject.id] | ||
| ? submissionWorkflowRuns[subObject.id] | ||
| : null; | ||
|
|
||
| const submissionDetail = ( | ||
| <tr key={subObject.id} styleName="submission-row"> | ||
| {showDetails[subObject.id] | ||
| && ( | ||
| <td colSpan="6" styleName="dev-details"> | ||
| <div styleName="workflow-table"> | ||
| <TableWorkflowRuns | ||
| workflowRuns={workflowRunsForSubmission} | ||
| challengeId={challenge.id} | ||
| /> | ||
| </div> | ||
|
|
||
| <ScreeningDetails | ||
| screeningObject={subObject.screening} | ||
| helpPageUrl={helpPageUrl} | ||
|
|
@@ -186,10 +199,12 @@ SubmissionsTable.defaultProps = { | |
| onlineReviewUrl: '', | ||
| helpPageUrl: '', | ||
| getSubmissionScores: _.noop, | ||
| submissionWorkflowRuns: [], | ||
| }; | ||
|
|
||
| SubmissionsTable.propTypes = { | ||
| challenge: PT.shape().isRequired, | ||
| submissionWorkflowRuns: PT.shape(), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| submissionObjects: PT.arrayOf(SubShape), | ||
| showDetails: PT.shape().isRequired, | ||
| track: PT.string.isRequired, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗
correctness]Passing
nulltoworkflowRunsmight lead to unexpected behavior ifTableWorkflowRunsdoes not handlenullvalues gracefully. Consider ensuring thatTableWorkflowRunscan handlenullor provide a default value.