Skip to content

Commit e6edb31

Browse files
committed
Merge branch 'develop' of github.com:topcoder-platform/work-manager into v6
2 parents aa2c591 + 754a730 commit e6edb31

File tree

24 files changed

+412
-279
lines changed

24 files changed

+412
-279
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ yarn-error.log*
2828
*.pem
2929
*.vscode
3030
*.pem
31+
*.vscode
32+
3133
# e2e test case
3234
test-automation/temp
3335
test-automation/test-results

config/constants/development.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ module.exports = {
1414
MEMBER_API_URL: `${DEV_API_HOSTNAME}/v6/members`,
1515
CHALLENGE_API_URL: `${DEV_API_HOSTNAME}/v6/challenges`,
1616
CHALLENGE_API_VERSION: '1.1.0',
17-
CHALLENGE_TIMELINE_TEMPLATES_URL: `${DEV_API_HOSTNAME}/v6/timeline-templates`,
18-
CHALLENGE_TYPES_URL: `${DEV_API_HOSTNAME}/v6/challenge-types`,
19-
CHALLENGE_TRACKS_URL: `${DEV_API_HOSTNAME}/v6/challenge-tracks`,
20-
CHALLENGE_PHASES_URL: `${DEV_API_HOSTNAME}/v6/challenge-phases`,
21-
CHALLENGE_TIMELINES_URL: `${DEV_API_HOSTNAME}/v6/challenge-timelines`,
17+
CHALLENGE_TIMELINE_TEMPLATES_URL: `${DEV_API_HOSTNAME}/v5/timeline-templates`,
18+
CHALLENGE_TYPES_URL: `${DEV_API_HOSTNAME}/v5/challenge-types`,
19+
CHALLENGE_TRACKS_URL: `${DEV_API_HOSTNAME}/v5/challenge-tracks`,
20+
CHALLENGE_PHASES_URL: `${DEV_API_HOSTNAME}/v5/challenge-phases`,
21+
CHALLENGE_TIMELINES_URL: `${DEV_API_HOSTNAME}/v5/challenge-timelines`,
2222
PROJECT_API_URL: `${DEV_API_HOSTNAME}/v5/projects`,
2323
GROUPS_API_URL: `${DEV_API_HOSTNAME}/v6/groups`,
2424
TERMS_API_URL: `${DEV_API_HOSTNAME}/v5/terms`,

package-lock.json

Lines changed: 99 additions & 101 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@
129129
"build": "node scripts/build.js",
130130
"lint": "eslint ./src",
131131
"lint:fix": "eslint --fix ./src",
132-
"test": "node scripts/test.js",
133-
"restart": "node scripts/build.js && node server.js"
132+
"test": "node scripts/test.js"
134133
},
135134
"eslintConfig": {
136135
"extends": [

server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ function check () {
1717
}
1818
app.use(healthCheck.middleware([check]))
1919
app.use((req, res, next) => {
20-
//res.header('Referrer-Policy', 'strict-origin-when-cross-origin')
20+
res.header('Referrer-Policy', 'strict-origin-when-cross-origin')
2121
res.header('Permissions-Policy', 'geolocation=(), microphone=(), camera=()')
2222
res.header('X-Content-Type-Options', 'nosniff')
23-
// res.header('Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload')
23+
res.header('Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload')
2424
res.header('Cache-control', 'public, max-age=0')
2525
res.header('Pragma', 'no-cache')
2626
res.setHeader('X-Frame-Options', 'DENY')

src/actions/projects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function _loadProjects (projectNameOrIdFilter = '', paramFilters = {}) {
5252
if (!isNaN(projectNameOrIdFilter)) { // if it is number
5353
filters['id'] = parseInt(projectNameOrIdFilter, 10)
5454
} else { // text search
55-
filters['keyword'] = decodeURIComponent(projectNameOrIdFilter)
55+
filters['keyword'] = `"${decodeURIComponent(projectNameOrIdFilter)}"`
5656
}
5757
}
5858

src/actions/users.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function searchUserProjects (isAdmin = true, keyword) {
8282
sort: 'updatedAt desc',
8383
perPage: 20,
8484
page: 1,
85-
keyword
85+
keyword: `"${keyword}"`
8686
}
8787
if (!isAdmin) {
8888
filters['memberOnly'] = true

src/components/Buttons/OutlineButton/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const OutlineButton = ({ type, text, link, onClick, url, className, submit, disa
2222

2323
if (!_.isEmpty(link)) {
2424
return (
25-
<Link className={cn(styles.container, styles[type], className)} to={`${link}`}>
25+
<Link className={cn(styles.container, styles[type], className)} to={link}>
2626
<span>{text}</span>
2727
</Link>
2828
)
@@ -38,7 +38,7 @@ const OutlineButton = ({ type, text, link, onClick, url, className, submit, disa
3838
OutlineButton.propTypes = {
3939
type: PropTypes.string.isRequired,
4040
text: PropTypes.string.isRequired,
41-
link: PropTypes.string,
41+
link: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
4242
url: PropTypes.string,
4343
className: PropTypes.string,
4444
onClick: PropTypes.func,

src/components/ChallengeEditor/ChallengeName-Field/index.js

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,47 @@ import styles from './ChallengeName-Field.module.scss'
44
import cn from 'classnames'
55

66
const ChallengeNameField = ({ challenge, onUpdateInput }) => {
7+
const handleChange = (e) => {
8+
// Remove any characters that are NOT letters, numbers, or spaces
9+
const sanitizedValue = e.target.value.replace(/[^a-zA-Z0-9 ]/g, '')
10+
onUpdateInput({
11+
target: {
12+
name: e.target.name,
13+
value: sanitizedValue
14+
}
15+
})
16+
}
17+
718
return (
819
<>
920
<div className={styles.row}>
1021
<div className={cn(styles.field, styles.col1)}>
11-
<label htmlFor='challengeName'>Work Name <span>*</span> :</label>
22+
<label htmlFor='challengeName'>
23+
Work Name <span>*</span> :
24+
</label>
1225
</div>
1326
<div className={cn(styles.field, styles.col2)}>
14-
<input className={styles.challengeName} id='name' name='name' type='text' placeholder='Work Name' value={challenge.name} maxLength='200' required onChange={onUpdateInput} />
27+
<input
28+
className={styles.challengeName}
29+
id='name'
30+
name='name'
31+
type='text'
32+
placeholder='Work Name'
33+
value={challenge.name}
34+
maxLength='200'
35+
required
36+
onChange={handleChange}
37+
/>
1538
</div>
1639
</div>
17-
{ challenge.submitTriggered && !challenge.name && <div className={styles.row}>
18-
<div className={cn(styles.field, styles.col1)} />
19-
<div className={cn(styles.field, styles.col2, styles.error)}>
20-
Work Name is required field
40+
{challenge.submitTriggered && !challenge.name && (
41+
<div className={styles.row}>
42+
<div className={cn(styles.field, styles.col1)} />
43+
<div className={cn(styles.field, styles.col2, styles.error)}>
44+
Work Name is required field
45+
</div>
2146
</div>
22-
</div> }
47+
)}
2348
</>
2449
)
2550
}

src/components/ChallengeEditor/ChallengeViewTabs/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ const ChallengeViewTabs = ({
210210
(<div className={styles['cancel-button']}><CancelDropDown challenge={challenge} onSelectMenu={cancelChallenge} /></div>)}
211211
{canLaunch && (
212212
<div className={styles.button}>
213-
{challenge ? (
213+
{challenge.legacyId || isTask ? (
214214
<PrimaryButton
215215
text='Launch'
216216
type='info'

0 commit comments

Comments
 (0)