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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ test('Matches shallow shapshot', () => {
const renderer = new Renderer();
renderer.render((
<SubmissionsTable
challenge={{ id: 'test-challenge' }}
showDetails={{ 12345: true }}
submissionObjects={[{
id: '12345',
Expand All @@ -17,6 +18,7 @@ test('Matches shallow shapshot', () => {

renderer.render((
<SubmissionsTable
challenge={{ id: 'test-challenge' }}
showDetails={{ 12345: true }}
track="Design"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports[`Snapshot match 1`] = `
</p>
</div>
<p>
Your submission has been received, and will be evaluated during Review phase.
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.
<a
className="src-shared-components-SubmissionManagement-ScreeningDetails-___styles__help-link___41Oxm"
href=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,30 @@ exports[`Snapshot match 1`] = `
type="button"
/>
</Tooltip>
<Tooltip
align={Object {}}
className=""
content={[Function]}
defaultVisible={false}
id=""
onTooltipHover={[Function]}
placeArrow={[Function]}
position="top"
suppressDiv={false}
trigger={
Array [
"hover",
]
}
>
<button
className="src-shared-components-SubmissionManagement-Submission-___styles__review-button___ibvdb"
onClick={[Function]}
type="button"
>
Review
</button>
</Tooltip>
<button
className="src-shared-components-SubmissionManagement-Submission-___styles__expand-icon___TDY6Y src-shared-components-SubmissionManagement-Submission-___styles__expanded___8pRX_"
onClick={[Function]}
Expand Down Expand Up @@ -232,6 +256,30 @@ exports[`Snapshot match 2`] = `
type="button"
/>
</Tooltip>
<Tooltip
align={Object {}}
className=""
content={[Function]}
defaultVisible={false}
id=""
onTooltipHover={[Function]}
placeArrow={[Function]}
position="top"
suppressDiv={false}
trigger={
Array [
"hover",
]
}
>
<button
className="src-shared-components-SubmissionManagement-Submission-___styles__review-button___ibvdb"
onClick={[Function]}
type="button"
>
Review
</button>
</Tooltip>
<button
className="src-shared-components-SubmissionManagement-Submission-___styles__expand-icon___TDY6Y"
onClick={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ exports[`Matches shallow shapshot 1`] = `
</thead>
<tbody>
<Submission
challenge={
Object {
"id": "test-challenge",
}
}
onDelete={[Function]}
onDownload={[Function]}
onOpenDownloadArtifactsModal={[Function]}
Expand All @@ -45,6 +50,14 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-SubmissionManagement-SubmissionsTable-___styles__dev-details___2GC2b"
colSpan="6"
>
<div
className="src-shared-components-SubmissionManagement-SubmissionsTable-___styles__workflow-table___WCWMZ"
>
<TableWorkflowRuns
challengeId="test-challenge"
workflowRuns={null}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Passing null to workflowRuns might lead to unexpected behavior if TableWorkflowRuns does not handle null values gracefully. Consider ensuring that TableWorkflowRuns can handle null or provide a default value.

/>
</div>
<ScreeningDetails
helpPageUrl=""
onlineReviewUrl=""
Expand Down
3 changes: 3 additions & 0 deletions config/backup-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The REVIEW_APP_URL is hardcoded to a specific environment (topcoder-dev). If this configuration is intended to be used across different environments, consider parameterizing this URL to avoid potential issues when deploying to production or other environments.



/* Maximum time to wait before timeout on searching past challenges (seconds)
* when no result at all.
* Default: 30 seconds.
Expand Down
2 changes: 2 additions & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 maintainability]
Consider adding a comment or documentation for REVIEW_APP_URL to clarify its purpose and usage, especially if it is intended for a specific environment or use case. This will help maintainability by ensuring future developers understand its role.



/* Maximum time to wait before timeout on searching past challenges (seconds)
* when no result at all.
Expand Down
3 changes: 3 additions & 0 deletions config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
24 changes: 23 additions & 1 deletion src/shared/actions/page/submission_management.js
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}`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The removal of aiWorkflowId from the URL path changes the endpoint being called. Ensure that this change is intentional and that the endpoint /workflows/runs is correct and expected to handle requests without the aiWorkflowId parameter.


return api.get(url)
.then(res => res.json())
.then(data => ({
submissionId,
runs: data,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The aiWorkflowId property is removed from the returned object. Verify that this change does not affect any consumers of this function that might rely on aiWorkflowId being present in the response.

}))
.catch((err) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 maintainability]
Catching the error and re-throwing it without additional handling or logging may not be useful. Consider logging the error or providing more context before re-throwing.

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
Expand Up @@ -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.',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 readability]
The updated message is longer and more complex, which could impact readability. Consider breaking it into shorter sentences or simplifying the language to improve clarity.

};
};

Expand Down
25 changes: 23 additions & 2 deletions src/shared/components/SubmissionManagement/Submission/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -28,7 +29,6 @@ import ScreeningStatus from '../ScreeningStatus';

import './styles.scss';


export default function Submission(props) {
const {
challenge,
Expand All @@ -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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The removal of the condition submissionObject.type === 'CONTEST_SUBMISSION' may affect the logic for determining the tab value. Ensure that this change is intentional and that CONTEST_SUBMISSION should no longer be treated as a 'checkpoint-submission'.

? '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;
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,17 @@ $submission-space-50: $base-unit * 10;
.download-artifacts-button {
svg {
width: 24px;
fill: $color-turq-160;
}
}

.review-button {
cursor: pointer;
color: $color-turq-160;
font-size: medium;
font-weight: 700;
}

.download-button {
@include button;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function SubmissionManagement(props) {
submissions,
loadingSubmissions,
showDetails,
submissionWorkflowRuns,
onDelete,
helpPageUrl,
onDownload,
Expand Down Expand Up @@ -182,6 +183,7 @@ export default function SubmissionManagement(props) {
<SubmissionsTable
challenge={challenge}
submissionObjects={submissions}
submissionWorkflowRuns={submissionWorkflowRuns}
showDetails={showDetails}
track={trackName}
status={challenge.status}
Expand Down Expand Up @@ -227,6 +229,7 @@ SubmissionManagement.defaultProps = {
SubmissionManagement.propTypes = {
challenge: PT.shape().isRequired,
showDetails: PT.shape().isRequired,
submissionWorkflowRuns: PT.shape().isRequired,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The submissionWorkflowRuns prop is defined as PT.shape().isRequired, but the shape is not specified. Consider defining the expected shape for better type safety and to prevent runtime errors.

onDelete: PT.func,
onlineReviewUrl: PT.string,
helpPageUrl: PT.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -35,6 +36,7 @@ export default function SubmissionsTable(props) {
const {
challenge,
submissionObjects,
submissionWorkflowRuns,
showDetails,
track,
onDelete,
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -186,10 +199,12 @@ SubmissionsTable.defaultProps = {
onlineReviewUrl: '',
helpPageUrl: '',
getSubmissionScores: _.noop,
submissionWorkflowRuns: [],
};

SubmissionsTable.propTypes = {
challenge: PT.shape().isRequired,
submissionWorkflowRuns: PT.shape(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The submissionWorkflowRuns prop is defined as a PT.shape(), which implies an object, but its default value is set to an empty array in defaultProps. This mismatch can lead to unexpected behavior. Consider setting the default value to an empty object {} to match the prop type.

submissionObjects: PT.arrayOf(SubShape),
showDetails: PT.shape().isRequired,
track: PT.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ $submission-space-50: $base-unit * 10;
border-top: 0;
padding-top: 0;

.workflow-table {
@media (max-width: 768px) {
display: none;
}
}

.upload-artifact-btn {
@include roboto-medium;

Expand Down
Loading
Loading