Skip to content

Commit 3430cd8

Browse files
authored
Merge pull request #7080 from topcoder-platform/develop
PROD RELEASE - Features in CA related to deprecating Submission Review UI app
2 parents d6897f7 + 0de5ca8 commit 3430cd8

File tree

26 files changed

+1099
-85
lines changed

26 files changed

+1099
-85
lines changed

__tests__/shared/components/SubmissionManagement/__snapshots__/Submission.jsx.snap

Lines changed: 136 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,74 @@ exports[`Snapshot match 1`] = `
3838
<td
3939
className="src-shared-components-SubmissionManagement-Submission-___styles__action-col___2M1RY"
4040
>
41-
<div>
42-
<button
43-
onClick={[Function]}
44-
type="button"
45-
/>
41+
<div
42+
className="src-shared-components-SubmissionManagement-Submission-___styles__button-wrapper___3T2jH"
43+
>
44+
<Tooltip
45+
align={Object {}}
46+
className=""
47+
content={[Function]}
48+
defaultVisible={false}
49+
id=""
50+
onTooltipHover={[Function]}
51+
placeArrow={[Function]}
52+
position="top"
53+
suppressDiv={false}
54+
trigger={
55+
Array [
56+
"hover",
57+
]
58+
}
59+
>
60+
<button
61+
onClick={[Function]}
62+
type="button"
63+
/>
64+
</Tooltip>
65+
<Tooltip
66+
align={Object {}}
67+
className=""
68+
content={[Function]}
69+
defaultVisible={false}
70+
id=""
71+
onTooltipHover={[Function]}
72+
placeArrow={[Function]}
73+
position="top"
74+
suppressDiv={false}
75+
trigger={
76+
Array [
77+
"hover",
78+
]
79+
}
80+
>
81+
<button
82+
className="src-shared-components-SubmissionManagement-Submission-___styles__download-artifacts-button___2lSi_"
83+
onClick={[Function]}
84+
type="button"
85+
/>
86+
</Tooltip>
87+
<Tooltip
88+
align={Object {}}
89+
className=""
90+
content={[Function]}
91+
defaultVisible={false}
92+
id=""
93+
onTooltipHover={[Function]}
94+
placeArrow={[Function]}
95+
position="top"
96+
suppressDiv={false}
97+
trigger={
98+
Array [
99+
"hover",
100+
]
101+
}
102+
>
103+
<button
104+
className="src-shared-components-SubmissionManagement-Submission-___styles__download-artifacts-button___2lSi_"
105+
onClick={[Function]}
106+
type="button"
107+
/>
108+
</Tooltip>
46109
<button
47110
className="src-shared-components-SubmissionManagement-Submission-___styles__expand-icon___TDY6Y src-shared-components-SubmissionManagement-Submission-___styles__expanded___8pRX_"
48111
onClick={[Function]}
@@ -101,11 +164,74 @@ exports[`Snapshot match 2`] = `
101164
<td
102165
className="src-shared-components-SubmissionManagement-Submission-___styles__action-col___2M1RY"
103166
>
104-
<div>
105-
<button
106-
onClick={[Function]}
107-
type="button"
108-
/>
167+
<div
168+
className="src-shared-components-SubmissionManagement-Submission-___styles__button-wrapper___3T2jH"
169+
>
170+
<Tooltip
171+
align={Object {}}
172+
className=""
173+
content={[Function]}
174+
defaultVisible={false}
175+
id=""
176+
onTooltipHover={[Function]}
177+
placeArrow={[Function]}
178+
position="top"
179+
suppressDiv={false}
180+
trigger={
181+
Array [
182+
"hover",
183+
]
184+
}
185+
>
186+
<button
187+
onClick={[Function]}
188+
type="button"
189+
/>
190+
</Tooltip>
191+
<Tooltip
192+
align={Object {}}
193+
className=""
194+
content={[Function]}
195+
defaultVisible={false}
196+
id=""
197+
onTooltipHover={[Function]}
198+
placeArrow={[Function]}
199+
position="top"
200+
suppressDiv={false}
201+
trigger={
202+
Array [
203+
"hover",
204+
]
205+
}
206+
>
207+
<button
208+
className="src-shared-components-SubmissionManagement-Submission-___styles__download-artifacts-button___2lSi_"
209+
onClick={[Function]}
210+
type="button"
211+
/>
212+
</Tooltip>
213+
<Tooltip
214+
align={Object {}}
215+
className=""
216+
content={[Function]}
217+
defaultVisible={false}
218+
id=""
219+
onTooltipHover={[Function]}
220+
placeArrow={[Function]}
221+
position="top"
222+
suppressDiv={false}
223+
trigger={
224+
Array [
225+
"hover",
226+
]
227+
}
228+
>
229+
<button
230+
className="src-shared-components-SubmissionManagement-Submission-___styles__download-artifacts-button___2lSi_"
231+
onClick={[Function]}
232+
type="button"
233+
/>
234+
</Tooltip>
109235
<button
110236
className="src-shared-components-SubmissionManagement-Submission-___styles__expand-icon___TDY6Y"
111237
onClick={[Function]}

__tests__/shared/components/SubmissionManagement/__snapshots__/SubmissionsTable.jsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ exports[`Matches shallow shapshot 1`] = `
3232
<Submission
3333
onDelete={[Function]}
3434
onDownload={[Function]}
35+
onOpenDownloadArtifactsModal={[Function]}
36+
onOpenRatingsListModal={[Function]}
3537
onShowDetails={[Function]}
3638
showScreeningDetails={true}
3739
submissionObject={

config/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ module.exports = {
169169
groupId: '20000000', communityId: 'wipro', communityName: 'topgear', userProfile: 'https://topgear-app.wipro.com/user-details',
170170
}],
171171
TIMELINE_WALL_API: 'https://api.topcoder-dev.com/v5/timeline-wall',
172+
REVIEW_API_URL: '/reviewTypes',
172173
},
173174

174175
/* Information about Topcoder user groups can be cached in various places.

config/development.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = {
33
SERVER_API_KEY: '79b2d5eb-c1fd-42c4-9391-6b2c9780d591',
44
URL: {
55
USER_SETTINGS: '', /* No dev server is available for saved searches */
6+
REVIEW_API_URL: '/reviewTypes',
67
},
78
PLATFORM_SITE_URL: 'https://platform.topcoder-dev.com',
89
PLATFORMUI_SITE_URL: 'https://platform-ui.topcoder-dev.com',

config/production.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ module.exports = {
6262
EMAIL_VERIFY_URL: 'http://www.topcoder.com/settings/account/changeEmail',
6363
THRIVE_FEED: 'https://topcoder.com/api/feeds/thrive',
6464
TIMELINE_WALL_API: 'https://api.topcoder.com/v5/timeline-wall',
65+
REVIEW_API_URL: '/reviewTypes',
6566
},
6667
/* Filestack configuration for uploading Submissions
6768
* These are for the production back end */

src/shared/components/ReviewOpportunityDetailsPage/ApplyModal/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class ApplyModal extends React.Component {
8282
onChange={() => toggleRole(position.roleId)}
8383
type="checkbox"
8484
/>
85+
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
8586
<label htmlFor={`${position.roleId}-checkbox`}>
8687
<input type="hidden" />
8788
<div styleName="tc-checkbox-label" />
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/**
2+
* Modal Component for Image Decorators
3+
*/
4+
import _ from 'lodash';
5+
import PT from 'prop-types';
6+
import React, { useEffect, useState } from 'react';
7+
8+
import { Modal, PrimaryButton } from 'topcoder-react-ui-kit';
9+
import tc from 'components/buttons/themed/tc.scss';
10+
11+
import LoadingIndicator from 'components/LoadingIndicator';
12+
import IconClose from 'assets/images/icon-close-green.svg';
13+
import DownloadIcon from '../Icons/IconSquareDownload.svg';
14+
import style from './style.scss';
15+
16+
const theme = {
17+
container: style.modalContainer,
18+
overlay: style.modalOverlay,
19+
};
20+
21+
const buttonThemes = {
22+
tc,
23+
};
24+
25+
export default function DownloadArtifactsModal({
26+
submissionId,
27+
onCancel,
28+
getSubmissionArtifacts,
29+
onDownloadArtifacts,
30+
}) {
31+
const [artifacts, setArtifacts] = useState([]);
32+
const [loading, setLoading] = useState(false);
33+
34+
const getArtifacts = async () => {
35+
const { artifacts: resp } = await getSubmissionArtifacts(submissionId);
36+
setArtifacts(resp);
37+
setLoading(false);
38+
};
39+
40+
useEffect(() => {
41+
setLoading(true);
42+
getArtifacts();
43+
}, [submissionId]);
44+
45+
return (
46+
<div className={style.container}>
47+
<Modal
48+
onCancel={() => onCancel()}
49+
theme={theme}
50+
>
51+
<div className={style['content-wrapper']}>
52+
<div className={style['modal-header']}>
53+
<h2 className={style['modal-title']}>Artifacts</h2>
54+
<div className={style.icon} role="presentation" onClick={() => onCancel()}>
55+
<IconClose />
56+
</div>
57+
</div>
58+
<hr className={style.hr} />
59+
<div className={style['artifacts-list']}>
60+
<div className={style.header}>
61+
<div className={style['header-title']}>Artifact ID</div>
62+
<div>Action</div>
63+
</div>
64+
{
65+
!loading && artifacts.map(item => (
66+
<div className={style['list-item']}>
67+
<div className={style['artifact-name']}>{item}</div>
68+
<button
69+
onClick={() => onDownloadArtifacts(submissionId, item)}
70+
type="button"
71+
className={style['icon-download']}
72+
>
73+
<DownloadIcon />
74+
</button>
75+
</div>
76+
))
77+
}
78+
79+
{
80+
!loading && artifacts.length === 0 && <div className={style['no-artifacts']}>No artifacts found</div>
81+
}
82+
</div>
83+
{loading && <LoadingIndicator />}
84+
</div>
85+
<div className={style['buttons-container']}>
86+
<PrimaryButton
87+
onClick={() => onCancel()}
88+
theme={{
89+
button: buttonThemes.tc['primary-green-md'],
90+
}}
91+
>
92+
Close
93+
</PrimaryButton>
94+
</div>
95+
</Modal>
96+
</div>
97+
);
98+
}
99+
100+
DownloadArtifactsModal.defaultProps = {
101+
onCancel: _.noop,
102+
submissionId: '',
103+
getSubmissionArtifacts: _.noop,
104+
onDownloadArtifacts: _.noop,
105+
};
106+
107+
DownloadArtifactsModal.propTypes = {
108+
onCancel: PT.func,
109+
submissionId: PT.string,
110+
getSubmissionArtifacts: PT.func,
111+
onDownloadArtifacts: PT.func,
112+
};

0 commit comments

Comments
 (0)