Skip to content

Commit 9a3268d

Browse files
authored
Merge pull request #1036 from topcoder-platform/cf-jan-2021
Community Fixes January 2021
2 parents 39671b8 + b2a15b4 commit 9a3268d

File tree

34 files changed

+696
-244
lines changed

34 files changed

+696
-244
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ npm install
3939

4040
1. copy the environment file in docs/dev.env to /.env
4141

42-
1. add `127.0.0.1 local.topcoder-dev.com` to your /etc/hosts file
43-
4442
1. If you are using local instances of the API's, change the DEV_API_HOSTNAME in configs/constants/development.js to match your local api endpoint.
4543
- For example change it to 'http://localhost:3000/',
4644

@@ -50,7 +48,7 @@ npm install
5048
npm run dev
5149
```
5250

53-
You can access the app from [http://local.topcoder-dev.com:3001/](http://local.topcoder-dev.com:3001/)
51+
You can access the app from [http://localhost:3000/](http://localhost:3000/)
5452

5553
The page will reload if you make edits.
5654

config/constants/development.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module.exports = {
77
COMMUNITY_APP_URL: `https://www.${DOMAIN}`,
88
MEMBER_API_URL: `${DEV_API_HOSTNAME}/v4/members`,
99
MEMBER_API_V3_URL: `${DEV_API_HOSTNAME}/v3/members`,
10-
DEV_APP_URL: `http://local.${DOMAIN}`,
1110
CHALLENGE_API_URL: `${DEV_API_HOSTNAME}/v5/challenges`,
1211
CHALLENGE_TIMELINE_TEMPLATES_URL: `${DEV_API_HOSTNAME}/v5/timeline-templates`,
1312
CHALLENGE_TYPES_URL: `${DEV_API_HOSTNAME}/v5/challenge-types`,

config/constants/production.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module.exports = {
77
COMMUNITY_APP_URL: `https://www.${DOMAIN}`,
88
MEMBER_API_URL: `${PROD_API_HOSTNAME}/v4/members`,
99
MEMBER_API_V3_URL: `${PROD_API_HOSTNAME}/v3/members`,
10-
DEV_APP_URL: `https://submission-review.${DOMAIN}`,
1110
CHALLENGE_API_URL: `${PROD_API_HOSTNAME}/v5/challenges`,
1211
CHALLENGE_TIMELINE_TEMPLATES_URL: `${PROD_API_HOSTNAME}/v5/timeline-templates`,
1312
CHALLENGE_TYPES_URL: `${PROD_API_HOSTNAME}/v5/challenge-types`,

package-lock.json

Lines changed: 155 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"react-redux": "^6.0.0",
8080
"react-redux-toastr": "^7.5.1",
8181
"react-router-dom": "^4.3.1",
82-
"react-select": "^1.2.0",
82+
"react-select": "^3.1.1",
8383
"react-stickynode": "^2.1.1",
8484
"react-svg": "^4.1.1",
8585
"react-tabs": "^3.0.0",

public/favicon.ico

15.4 KB
Binary file not shown.

scripts/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ checkBrowsers(paths.appPath, isInteractive)
9999
clearConsole()
100100
}
101101
console.log(chalk.cyan('Starting the development server...\n'))
102-
openBrowser(constants.DEV_APP_URL ? `${constants.DEV_APP_URL}:${process.env.PORT || 3000}` : urls.localUrlForBrowser)
102+
openBrowser(urls.localUrlForBrowser)
103103
})
104104

105105
const SIGNALS = ['SIGINT', 'SIGTERM']

src/actions/challenges.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import {
1313
fetchResourceRoles,
1414
fetchChallengeTimelines,
1515
fetchChallengeTracks,
16+
fetchGroupDetail,
1617
updateChallenge,
1718
patchChallenge,
19+
deleteChallenge as deleteChallengeAPI,
1820
createChallenge as createChallengeAPI,
1921
createResource as createResourceAPI,
2022
deleteResource as deleteResourceAPI
@@ -38,6 +40,9 @@ import {
3840
CREATE_CHALLENGE_PENDING,
3941
CREATE_CHALLENGE_SUCCESS,
4042
CREATE_CHALLENGE_FAILURE,
43+
DELETE_CHALLENGE_PENDING,
44+
DELETE_CHALLENGE_SUCCESS,
45+
DELETE_CHALLENGE_FAILURE,
4146
LOAD_CHALLENGE_RESOURCES
4247
} from '../config/constants'
4348
import { loadProject } from './projects'
@@ -182,6 +187,14 @@ export function loadChallengeDetails (projectId, challengeId) {
182187
}
183188
}
184189

190+
/**
191+
* Loads group details
192+
*/
193+
export function loadGroupDetails (groupIds) {
194+
const promiseAll = groupIds.map(id => fetchGroupDetail(id))
195+
return Promise.all(promiseAll)
196+
}
197+
185198
/**
186199
* Update challenge details
187200
*
@@ -267,6 +280,26 @@ export function partiallyUpdateChallengeDetails (challengeId, partialChallengeDe
267280
}
268281
}
269282

283+
export function deleteChallenge (challengeId) {
284+
return async (dispatch) => {
285+
dispatch({
286+
type: DELETE_CHALLENGE_PENDING
287+
})
288+
289+
return deleteChallengeAPI(challengeId).then((challenge) => {
290+
return dispatch({
291+
type: DELETE_CHALLENGE_SUCCESS,
292+
challengeDetails: challenge
293+
})
294+
}).catch((error) => {
295+
dispatch({
296+
type: DELETE_CHALLENGE_FAILURE
297+
})
298+
throw error
299+
})
300+
}
301+
}
302+
270303
export function loadTimelineTemplates () {
271304
return async (dispatch) => {
272305
const timelineTemplates = await fetchTimelineTemplates()

src/components/ChallengeEditor/AssignedMember-Field/AssignedMember-Field.module.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,10 @@
4545
.readOnlyValue {
4646
margin-bottom: 0.5rem; // the same like `label` to be aligned
4747
}
48+
49+
.assignSelfField {
50+
margin-left: 20px;
51+
padding-top: 6px;
52+
}
4853
}
4954

0 commit comments

Comments
 (0)