Skip to content

Commit b1f397e

Browse files
author
vikasrohit
authored
Merge pull request #1216 from topcoder-platform/develop
Prod Release - 0.11.0
2 parents 12865a0 + 34a30b0 commit b1f397e

File tree

10 files changed

+135
-120
lines changed

10 files changed

+135
-120
lines changed

.circleci/config.yml

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

8686
# Production builds are exectuted only on tagged commits to the
8787
# master branch.

src/components/ChallengeEditor/ChallengeEditor.module.scss

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,33 @@
1515
}
1616
}
1717

18-
.title {
19-
@include roboto-bold();
18+
.textCenter {
19+
text-align: center;
20+
}
21+
22+
.topContainer {
23+
margin-top: 30px;
24+
display: flex;
25+
justify-content: space-between;
26+
align-items: center;
27+
padding: 0 20px;
28+
}
2029

30+
.leftContainer {
31+
display: flex;
32+
align-items: center;
33+
.title {
34+
text-align: left;
35+
}
36+
}
37+
38+
.title {
2139
font-size: 24px;
2240
font-weight: 700;
2341
line-height: 29px;
42+
margin-right: 5px;
2443
color: $challenges-title;
25-
margin-top: 30px;
2644
text-align: center;
27-
28-
span {
29-
color: $tc-red;
30-
}
31-
3245
}
3346

3447
.textRequired {
@@ -255,7 +268,6 @@
255268
}
256269

257270
.actionButtons {
258-
position: absolute;
259271
top: 30px;
260272
a,button {
261273
height: 40px;

src/components/ChallengeEditor/ChallengeViewTabs/ChallengeViewTabs.module.scss

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,32 @@
33
$tc-dark-blue: #0681ff;
44
$tc-white: #FFFFFF;
55

6+
.topContainer {
7+
margin-top: 30px;
8+
display: flex;
9+
justify-content: space-between;
10+
align-items: center;
11+
padding: 0 20px;
12+
}
13+
14+
.leftContainer {
15+
display: flex;
16+
align-items: center;
17+
}
18+
.title {
19+
@include roboto-bold();
20+
21+
font-size: 24px;
22+
font-weight: 700;
23+
line-height: 29px;
24+
margin-right: 5px;
25+
color: $challenges-title;
26+
text-align: left;
27+
}
28+
629
.actionButtons {
730
display: flex;
8-
position: absolute;
931
top: 30px;
10-
margin-top: 53px;
1132
}
1233

1334
.actionButtonsLeft {
@@ -38,21 +59,6 @@ $tc-white: #FFFFFF;
3859
}
3960
}
4061

41-
.title {
42-
@include roboto-bold();
43-
44-
font-size: 24px;
45-
font-weight: 700;
46-
line-height: 29px;
47-
color: $challenges-title;
48-
margin-top: 25px;
49-
text-align: center;
50-
51-
span {
52-
color: $tc-red;
53-
}
54-
}
55-
5662
.challenge-view-selector {
5763
display: flex;
5864
flex-wrap: wrap;

src/components/ChallengeEditor/ChallengeViewTabs/index.js

Lines changed: 51 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -81,60 +81,64 @@ const ChallengeViewTabs = ({
8181
return (
8282
<div className={styles.list}>
8383
<Helmet title='View Details' />
84-
{!isTask && (
84+
<div className={styles.topContainer}>
85+
<div className={styles.leftContainer}>
86+
<div className={styles.title}>{challenge.name}</div>
87+
{!isTask && (
88+
<div
89+
className={cn(
90+
styles.actionButtons,
91+
styles.button,
92+
styles.actionButtonsLeft
93+
)}
94+
>
95+
<LegacyLinks challenge={challenge} challengeView />
96+
</div>
97+
)}
98+
</div>
8599
<div
86100
className={cn(
87101
styles.actionButtons,
88102
styles.button,
89-
styles.actionButtonsLeft
103+
styles.actionButtonsRight
90104
)}
91105
>
92-
<LegacyLinks challenge={challenge} challengeView />
106+
{(challenge.status === 'Draft' || challenge.status === 'New') && <div className={styles['cancel-button']}><CancelDropDown challenge={challenge} onSelectMenu={cancelChallenge} /></div>}
107+
{challenge.status === 'Draft' && (
108+
<div className={styles.button}>
109+
{challenge.legacyId || isTask ? (
110+
<PrimaryButton
111+
text={'Launch'}
112+
type={'info'}
113+
onClick={onLaunchChallenge}
114+
/>
115+
) : (
116+
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
117+
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
118+
<PrimaryButton text={'Launch'} type={'disabled'} />
119+
</Tooltip>
120+
)}
121+
</div>
122+
)}
123+
{isTask && challenge.status === 'Active' && (
124+
<div className={styles.button}>
125+
{assignedMemberDetails ? (
126+
<Tooltip content={MESSAGE.MARK_COMPLETE}>
127+
<PrimaryButton text={'Mark Complete'} type={'success'} onClick={onCloseTask} />
128+
</Tooltip>
129+
) : (
130+
<Tooltip content={MESSAGE.NO_TASK_ASSIGNEE}>
131+
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
132+
<PrimaryButton text={'Mark Complete'} type={'disabled'} />
133+
</Tooltip>
134+
)}
135+
</div>
136+
)}
137+
{enableEdit && (
138+
<PrimaryButton text={'Edit'} type={'info'} submit link={`./edit`} />
139+
)}
140+
<PrimaryButton text={'Back'} type={'info'} submit link={`..`} />
93141
</div>
94-
)}
95-
<div className={styles.title}>{challenge.name}</div>
96-
<div
97-
className={cn(
98-
styles.actionButtons,
99-
styles.button,
100-
styles.actionButtonsRight
101-
)}
102-
>
103-
{(challenge.status === 'Draft' || challenge.status === 'New') && <div className={styles['cancel-button']}><CancelDropDown challenge={challenge} onSelectMenu={cancelChallenge} /></div>}
104-
{challenge.status === 'Draft' && (
105-
<div className={styles.button}>
106-
{challenge.legacyId || isTask ? (
107-
<PrimaryButton
108-
text={'Launch'}
109-
type={'info'}
110-
onClick={onLaunchChallenge}
111-
/>
112-
) : (
113-
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
114-
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
115-
<PrimaryButton text={'Launch'} type={'disabled'} />
116-
</Tooltip>
117-
)}
118-
</div>
119-
)}
120-
{isTask && challenge.status === 'Active' && (
121-
<div className={styles.button}>
122-
{assignedMemberDetails ? (
123-
<Tooltip content={MESSAGE.MARK_COMPLETE}>
124-
<PrimaryButton text={'Mark Complete'} type={'success'} onClick={onCloseTask} />
125-
</Tooltip>
126-
) : (
127-
<Tooltip content={MESSAGE.NO_TASK_ASSIGNEE}>
128-
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
129-
<PrimaryButton text={'Mark Complete'} type={'disabled'} />
130-
</Tooltip>
131-
)}
132-
</div>
133-
)}
134-
{enableEdit && (
135-
<PrimaryButton text={'Edit'} type={'info'} submit link={`./edit`} />
136-
)}
137-
<PrimaryButton text={'Back'} type={'info'} submit link={`..`} />
138142
</div>
139143
<div className={styles['challenge-view-selector']}>
140144
<a

src/components/ChallengeEditor/index.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ const theme = {
5959
container: styles.modalContainer
6060
}
6161

62-
const getTitle = (isNew) => {
62+
const getTitle = (isNew, challenge) => {
6363
if (isNew) {
6464
return 'Create New Work'
6565
}
6666

67-
return 'Set-Up Work'
67+
return challenge.name || 'Set-Up Work'
6868
}
6969

7070
class ChallengeEditor extends Component {
@@ -1321,7 +1321,7 @@ class ChallengeEditor extends Component {
13211321
<ConfirmationModal
13221322
title='Complete Task Confirmation'
13231323
message={
1324-
<p>
1324+
<p className={styles.textCenter}>
13251325
Are you sure want to complete task <strong>"{challenge.name}"</strong> with the prize <strong>${taskPrize}</strong> for <strong>{assignedMember}</strong>?
13261326
</p>
13271327
}
@@ -1600,14 +1600,16 @@ class ChallengeEditor extends Component {
16001600

16011601
return (
16021602
<div className={styles.wrapper}>
1603-
<Helmet title={getTitle(isNew)} />
1604-
<div className={cn(styles.actionButtons, styles.actionButtonsLeft)}>
1605-
{!isNew && <LegacyLinks challenge={challenge} />}
1606-
</div>
1607-
<div className={styles.title}>{getTitle(isNew)}</div>
1608-
<div className={cn(styles.actionButtons, styles.actionButtonsRight)}>
1609-
{!isNew && this.props.challengeDetails.status === 'New' && <PrimaryButton text={'Delete'} type={'danger'} onClick={this.deleteModalLaunch} />}
1610-
<PrimaryButton text={'Back'} type={'info'} submit link={`/projects/${projectDetail.id}/challenges`} />
1603+
<Helmet title={getTitle(isNew, challenge)} />
1604+
<div className={styles.topContainer}>
1605+
<div className={styles.leftContainer}>
1606+
<div className={styles.title}>{getTitle(isNew, challenge)}</div>
1607+
{!isNew && <LegacyLinks challenge={challenge} />}
1608+
</div>
1609+
<div className={cn(styles.actionButtons, styles.actionButtonsRight)}>
1610+
{!isNew && this.props.challengeDetails.status === 'New' && <PrimaryButton text={'Delete'} type={'danger'} onClick={this.deleteModalLaunch} />}
1611+
<PrimaryButton text={'Back'} type={'info'} submit link={`/projects/${projectDetail.id}/challenges`} />
1612+
</div>
16111613
</div>
16121614
<div className={styles.textRequired}>* Required</div>
16131615
<div className={styles.container}>

src/components/ChallengesComponent/ChallengeList/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ class ChallengeList extends Component {
121121
case CHALLENGE_STATUS.COMPLETED:
122122
selectedTab = 3
123123
break
124+
case CHALLENGE_STATUS.CANCELLED:
125+
selectedTab = 4
126+
break
124127
}
125128

126129
let warningModal = null
@@ -175,13 +178,18 @@ class ChallengeList extends Component {
175178
this.directUpdateSearchParam(searchText, CHALLENGE_STATUS.COMPLETED)
176179
break
177180
}
181+
case 4: {
182+
this.directUpdateSearchParam(searchText, CHALLENGE_STATUS.CANCELLED)
183+
break
184+
}
178185
}
179186
}}>
180187
<TabList>
181188
<Tab>Active</Tab>
182189
<Tab>New</Tab>
183190
<Tab>Draft</Tab>
184191
<Tab>Completed</Tab>
192+
<Tab>Cancelled</Tab>
185193
</TabList>
186194
<TabPanel />
187195
<TabPanel />

src/components/ChallengesComponent/ChallengesComponent.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
font-size: 24px;
1313
font-weight: 700;
14+
margin-right: 5px;
1415
line-height: 29px;
1516
color: $challenges-title;
1617
text-align: center;
@@ -22,12 +23,17 @@
2223
justify-content: space-between;
2324
align-items: center;
2425
padding: 0 20px;
26+
2527
}
2628

2729
.titleLinks {
2830
align-items: center;
2931
display: flex;
3032

33+
> span a {
34+
margin: 2px 5px 0;
35+
}
36+
3137
> a + a {
3238
margin-left: 20px;
3339
}

src/components/LegacyLinks/LegacyLinks.module.scss

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
@import "../../styles/includes";
22
.container {
33
display: flex;
4-
margin-top: auto;
54
align-items: center;
5+
white-space: nowrap;
66

7-
button:not(:first-child),
8-
a:not(:first-child) {
9-
margin-left: 20px;
10-
}
11-
12-
button {
13-
height: 40px;
14-
outline: none;
15-
white-space: nowrap;
7+
> a {
8+
margin: 0 5px;
169
}
1710

1811
.row {

0 commit comments

Comments
 (0)