Skip to content

Commit 12865a0

Browse files
author
vikasrohit
authored
Merge pull request #1201 from topcoder-platform/develop
Prod Release - Registrations and Submissions for Challenges
2 parents 89b7109 + 2d7372a commit 12865a0

File tree

32 files changed

+2927
-276
lines changed

32 files changed

+2927
-276
lines changed

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ workflows:
8181
context : org-global
8282
filters:
8383
branches:
84-
only:
85-
- develop
84+
only: ['develop', 'feature/bug-bash-jun']
8685

8786
# Production builds are exectuted only on tagged commits to the
8887
# master branch.

config/constants/development.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ module.exports = {
1818
TERMS_API_URL: `${DEV_API_HOSTNAME}/v5/terms`,
1919
RESOURCES_API_URL: `${DEV_API_HOSTNAME}/v5/resources`,
2020
RESOURCE_ROLES_API_URL: `${DEV_API_HOSTNAME}/v5/resource-roles`,
21+
SUBMISSIONS_API_URL: `${DEV_API_HOSTNAME}/v5/submissions`,
2122
PLATFORMS_V4_API_URL: `${DEV_API_HOSTNAME}/v4/platforms`,
2223
TECHNOLOGIES_V4_API_URL: `${DEV_API_HOSTNAME}/v4/technologies`,
24+
SUBMISSION_REVIEW_APP_URL: `https://submission-review.${DOMAIN}/challenges`,
25+
STUDIO_URL: `https://studio.${DOMAIN}`,
2326
CONNECT_APP_URL: `https://connect.${DOMAIN}`,
2427
DIRECT_PROJECT_URL: `https://www.${DOMAIN}/direct`,
2528
ONLINE_REVIEW_URL: `https://software.${DOMAIN}`,

config/constants/production.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ module.exports = {
1818
TERMS_API_URL: `${PROD_API_HOSTNAME}/v5/terms`,
1919
RESOURCES_API_URL: `${PROD_API_HOSTNAME}/v5/resources`,
2020
RESOURCE_ROLES_API_URL: `${PROD_API_HOSTNAME}/v5/resource-roles`,
21+
SUBMISSIONS_API_URL: `${PROD_API_HOSTNAME}/v5/submissions`,
2122
PLATFORMS_V4_API_URL: `${PROD_API_HOSTNAME}/v4/platforms`,
2223
TECHNOLOGIES_V4_API_URL: `${PROD_API_HOSTNAME}/v4/technologies`,
24+
SUBMISSION_REVIEW_APP_URL: `https://submission-review.${DOMAIN}/challenges`,
25+
STUDIO_URL: `https://studio.${DOMAIN}`,
2326
CONNECT_APP_URL: `https://connect.${DOMAIN}`,
2427
DIRECT_PROJECT_URL: `https://www.${DOMAIN}/direct`,
2528
ONLINE_REVIEW_URL: `https://software.${DOMAIN}`,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"prop-types": "^15.6.2",
6464
"qs": "^6.7.0",
6565
"query-string": "^6.12.1",
66+
"rc-dropdown": "^3.2.0",
6667
"rc-time-picker": "^3.6.4",
6768
"react": "^16.7.0",
6869
"react-app-polyfill": "^0.2.0",

src/actions/challengeSubmissions.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { fetchSubmissions } from '../services/challenges'
2+
3+
import { LOAD_CHALLENGE_SUBMISSIONS } from '../config/constants'
4+
5+
export function loadSubmissions (challengeId) {
6+
return dispatch => {
7+
if (challengeId) {
8+
dispatch({
9+
type: LOAD_CHALLENGE_SUBMISSIONS,
10+
payload: fetchSubmissions(challengeId)
11+
})
12+
}
13+
}
14+
}

src/assets/images/arrow-down.svg

Lines changed: 19 additions & 0 deletions
Loading

src/assets/images/check-mark.svg

Lines changed: 9 additions & 0 deletions
Loading

src/assets/images/lock.svg

Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
@import "../../../styles/includes";
2+
3+
.menus {
4+
outline: none;
5+
position: relative;
6+
list-style-type: none;
7+
padding: 0;
8+
margin: 2px 0 0 0;
9+
text-align: left;
10+
background-color: #fff;
11+
border-radius: 3px;
12+
box-shadow: 0 1px 5px #ccc;
13+
background-clip: padding-box;
14+
border: 1px solid #ccc;
15+
cursor: pointer;
16+
17+
.menu {
18+
height: 30px;
19+
line-height: 30px;
20+
padding: 0 10px;
21+
&:hover {
22+
background-color: #d5d5d5;
23+
}
24+
}
25+
}
26+
27+
.pop-container {
28+
height: 100%;
29+
}
30+
31+
.modalContainer {
32+
padding: 0;
33+
position: fixed;
34+
overflow: auto;
35+
z-index: 10000;
36+
top: 0;
37+
right: 0;
38+
bottom: 0;
39+
left: 0;
40+
box-sizing: border-box;
41+
width: auto;
42+
max-width: none;
43+
transform: none;
44+
background: transparent;
45+
color: $text-color;
46+
opacity: 1;
47+
display: flex;
48+
justify-content: center;
49+
align-items: center;
50+
51+
.contentContainer {
52+
box-sizing: border-box;
53+
background: red;
54+
opacity: 1;
55+
position: relative;
56+
display: flex;
57+
flex-direction: column;
58+
justify-content: flex-start;
59+
align-items: center;
60+
border-radius: 6px;
61+
margin: 0 auto;
62+
width: 600px;
63+
padding: 30px;
64+
65+
.content {
66+
padding: 30px;
67+
width: 100%;
68+
height: 100%;
69+
}
70+
71+
.title {
72+
@include roboto-bold();
73+
74+
font-size: 30px;
75+
line-height: 36px;
76+
margin-bottom: 30px;
77+
margin-top: 0;
78+
79+
}
80+
81+
span {
82+
@include roboto;
83+
84+
font-size: 22px;
85+
font-weight: 400;
86+
line-height: 26px;
87+
}
88+
89+
&.confirm {
90+
width: 999px;
91+
92+
.buttonGroup {
93+
display: flex;
94+
justify-content: space-between;
95+
margin-top: 30px;
96+
97+
.buttonSizeA {
98+
width: 193px;
99+
height: 40px;
100+
margin-right: 33px;
101+
102+
span {
103+
font-size: 18px;
104+
font-weight: 500;
105+
}
106+
}
107+
108+
.buttonSizeB{
109+
width: 160px;
110+
height: 40px;
111+
112+
span {
113+
font-size: 18px;
114+
font-weight: 500;
115+
line-height: 22px;
116+
}
117+
}
118+
}
119+
}
120+
121+
.buttonGroup {
122+
display: flex;
123+
justify-content: space-between;
124+
margin-top: 30px;
125+
126+
.button {
127+
width: 135px;
128+
height: 40px;
129+
margin-right: 66px;
130+
131+
span {
132+
font-size: 18px;
133+
font-weight: 500;
134+
}
135+
}
136+
137+
.button:last-child {
138+
margin-right: 0;
139+
}
140+
}
141+
}
142+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import React, { useState, useRef } from 'react'
2+
import PropTypes from 'prop-types'
3+
import Dropdown from 'rc-dropdown'
4+
import styles from './Cancel-DropDown.module.scss'
5+
import { CANCEL_REASONS } from '../../../config/constants'
6+
import cn from 'classnames'
7+
import 'rc-dropdown/assets/index.css'
8+
import { PrimaryButton } from '../../Buttons'
9+
import ConfirmationModal from '../../Modal/ConfirmationModal'
10+
import _ from 'lodash'
11+
12+
const theme = {
13+
container: styles.modalContainer
14+
}
15+
const CancelDropDown = ({ challenge, onSelectMenu }) => {
16+
const [cancelReason, setCancelReason] = useState('')
17+
const [showModal, setShowModal] = useState(false)
18+
const popupContainerEl = useRef(null)
19+
20+
const onSelect = v => {
21+
setCancelReason(v)
22+
setShowModal(true)
23+
}
24+
25+
const menu = (
26+
<div className={cn(styles['menus'])}>
27+
{_.map(CANCEL_REASONS, r => {
28+
return (
29+
<div
30+
className={styles.menu}
31+
onClick={() => {
32+
onSelect(r)
33+
}}
34+
>
35+
{r}
36+
</div>
37+
)
38+
})}
39+
</div>
40+
)
41+
42+
return (
43+
<>
44+
<Dropdown trigger={['click']} overlay={menu} animation='slide-up' getPopupContainer={() => {
45+
return popupContainerEl.current
46+
}}>
47+
<div ref={popupContainerEl} className={styles['pop-container']}>
48+
<PrimaryButton text={'Cancel'} type={'danger'} />
49+
</div>
50+
</Dropdown>
51+
{showModal && (
52+
<ConfirmationModal
53+
message={'Do you want to cancel the challenge ?'}
54+
theme={theme}
55+
cancelText='Cancel'
56+
confirmText='Continue'
57+
onCancel={() => {
58+
setShowModal(false)
59+
}}
60+
onConfirm={() => { onSelectMenu(challenge, cancelReason) }}
61+
/>
62+
)}
63+
</>
64+
)
65+
}
66+
67+
CancelDropDown.defaultProps = {}
68+
69+
CancelDropDown.propTypes = {
70+
challenge: PropTypes.shape().isRequired,
71+
onSelectMenu: PropTypes.func.isRequired
72+
}
73+
74+
export default CancelDropDown

0 commit comments

Comments
 (0)