Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ workflows:
context : org-global
filters:
branches:
only: ['develop', 'feature/bug-bash-jun']
only: ['develop', 'feature/bug-bash-july']

# Production builds are exectuted only on tagged commits to the
# master branch.
Expand Down
30 changes: 21 additions & 9 deletions src/components/ChallengeEditor/ChallengeEditor.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,33 @@
}
}

.title {
@include roboto-bold();
.textCenter {
text-align: center;
}

.topContainer {
margin-top: 30px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
}

.leftContainer {
display: flex;
align-items: center;
.title {
text-align: left;
}
}

.title {
font-size: 24px;
font-weight: 700;
line-height: 29px;
margin-right: 5px;
color: $challenges-title;
margin-top: 30px;
text-align: center;

span {
color: $tc-red;
}

}

.textRequired {
Expand Down Expand Up @@ -255,7 +268,6 @@
}

.actionButtons {
position: absolute;
top: 30px;
a,button {
height: 40px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,32 @@
$tc-dark-blue: #0681ff;
$tc-white: #FFFFFF;

.topContainer {
margin-top: 30px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
}

.leftContainer {
display: flex;
align-items: center;
}
.title {
@include roboto-bold();

font-size: 24px;
font-weight: 700;
line-height: 29px;
margin-right: 5px;
color: $challenges-title;
text-align: left;
}

.actionButtons {
display: flex;
position: absolute;
top: 30px;
margin-top: 53px;
}

.actionButtonsLeft {
Expand Down Expand Up @@ -38,21 +59,6 @@ $tc-white: #FFFFFF;
}
}

.title {
@include roboto-bold();

font-size: 24px;
font-weight: 700;
line-height: 29px;
color: $challenges-title;
margin-top: 25px;
text-align: center;

span {
color: $tc-red;
}
}

.challenge-view-selector {
display: flex;
flex-wrap: wrap;
Expand Down
98 changes: 51 additions & 47 deletions src/components/ChallengeEditor/ChallengeViewTabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,60 +81,64 @@ const ChallengeViewTabs = ({
return (
<div className={styles.list}>
<Helmet title='View Details' />
{!isTask && (
<div className={styles.topContainer}>
<div className={styles.leftContainer}>
<div className={styles.title}>{challenge.name}</div>
{!isTask && (
<div
className={cn(
styles.actionButtons,
styles.button,
styles.actionButtonsLeft
)}
>
<LegacyLinks challenge={challenge} challengeView />
</div>
)}
</div>
<div
className={cn(
styles.actionButtons,
styles.button,
styles.actionButtonsLeft
styles.actionButtonsRight
)}
>
<LegacyLinks challenge={challenge} challengeView />
{(challenge.status === 'Draft' || challenge.status === 'New') && <div className={styles['cancel-button']}><CancelDropDown challenge={challenge} onSelectMenu={cancelChallenge} /></div>}
{challenge.status === 'Draft' && (
<div className={styles.button}>
{challenge.legacyId || isTask ? (
<PrimaryButton
text={'Launch'}
type={'info'}
onClick={onLaunchChallenge}
/>
) : (
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
<PrimaryButton text={'Launch'} type={'disabled'} />
</Tooltip>
)}
</div>
)}
{isTask && challenge.status === 'Active' && (
<div className={styles.button}>
{assignedMemberDetails ? (
<Tooltip content={MESSAGE.MARK_COMPLETE}>
<PrimaryButton text={'Mark Complete'} type={'success'} onClick={onCloseTask} />
</Tooltip>
) : (
<Tooltip content={MESSAGE.NO_TASK_ASSIGNEE}>
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
<PrimaryButton text={'Mark Complete'} type={'disabled'} />
</Tooltip>
)}
</div>
)}
{enableEdit && (
<PrimaryButton text={'Edit'} type={'info'} submit link={`./edit`} />
)}
<PrimaryButton text={'Back'} type={'info'} submit link={`..`} />
</div>
)}
<div className={styles.title}>{challenge.name}</div>
<div
className={cn(
styles.actionButtons,
styles.button,
styles.actionButtonsRight
)}
>
{(challenge.status === 'Draft' || challenge.status === 'New') && <div className={styles['cancel-button']}><CancelDropDown challenge={challenge} onSelectMenu={cancelChallenge} /></div>}
{challenge.status === 'Draft' && (
<div className={styles.button}>
{challenge.legacyId || isTask ? (
<PrimaryButton
text={'Launch'}
type={'info'}
onClick={onLaunchChallenge}
/>
) : (
<Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
<PrimaryButton text={'Launch'} type={'disabled'} />
</Tooltip>
)}
</div>
)}
{isTask && challenge.status === 'Active' && (
<div className={styles.button}>
{assignedMemberDetails ? (
<Tooltip content={MESSAGE.MARK_COMPLETE}>
<PrimaryButton text={'Mark Complete'} type={'success'} onClick={onCloseTask} />
</Tooltip>
) : (
<Tooltip content={MESSAGE.NO_TASK_ASSIGNEE}>
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
<PrimaryButton text={'Mark Complete'} type={'disabled'} />
</Tooltip>
)}
</div>
)}
{enableEdit && (
<PrimaryButton text={'Edit'} type={'info'} submit link={`./edit`} />
)}
<PrimaryButton text={'Back'} type={'info'} submit link={`..`} />
</div>
<div className={styles['challenge-view-selector']}>
<a
Expand Down
24 changes: 13 additions & 11 deletions src/components/ChallengeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ const theme = {
container: styles.modalContainer
}

const getTitle = (isNew) => {
const getTitle = (isNew, challenge) => {
if (isNew) {
return 'Create New Work'
}

return 'Set-Up Work'
return challenge.name || 'Set-Up Work'
}

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

return (
<div className={styles.wrapper}>
<Helmet title={getTitle(isNew)} />
<div className={cn(styles.actionButtons, styles.actionButtonsLeft)}>
{!isNew && <LegacyLinks challenge={challenge} />}
</div>
<div className={styles.title}>{getTitle(isNew)}</div>
<div className={cn(styles.actionButtons, styles.actionButtonsRight)}>
{!isNew && this.props.challengeDetails.status === 'New' && <PrimaryButton text={'Delete'} type={'danger'} onClick={this.deleteModalLaunch} />}
<PrimaryButton text={'Back'} type={'info'} submit link={`/projects/${projectDetail.id}/challenges`} />
<Helmet title={getTitle(isNew, challenge)} />
<div className={styles.topContainer}>
<div className={styles.leftContainer}>
<div className={styles.title}>{getTitle(isNew, challenge)}</div>
{!isNew && <LegacyLinks challenge={challenge} />}
</div>
<div className={cn(styles.actionButtons, styles.actionButtonsRight)}>
{!isNew && this.props.challengeDetails.status === 'New' && <PrimaryButton text={'Delete'} type={'danger'} onClick={this.deleteModalLaunch} />}
<PrimaryButton text={'Back'} type={'info'} submit link={`/projects/${projectDetail.id}/challenges`} />
</div>
</div>
<div className={styles.textRequired}>* Required</div>
<div className={styles.container}>
Expand Down
8 changes: 8 additions & 0 deletions src/components/ChallengesComponent/ChallengeList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class ChallengeList extends Component {
case CHALLENGE_STATUS.COMPLETED:
selectedTab = 3
break
case CHALLENGE_STATUS.CANCELLED:
selectedTab = 4
break
}

let warningModal = null
Expand Down Expand Up @@ -175,13 +178,18 @@ class ChallengeList extends Component {
this.directUpdateSearchParam(searchText, CHALLENGE_STATUS.COMPLETED)
break
}
case 4: {
this.directUpdateSearchParam(searchText, CHALLENGE_STATUS.CANCELLED)
break
}
}
}}>
<TabList>
<Tab>Active</Tab>
<Tab>New</Tab>
<Tab>Draft</Tab>
<Tab>Completed</Tab>
<Tab>Cancelled</Tab>
</TabList>
<TabPanel />
<TabPanel />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

font-size: 24px;
font-weight: 700;
margin-right: 5px;
line-height: 29px;
color: $challenges-title;
text-align: center;
Expand All @@ -22,12 +23,17 @@
justify-content: space-between;
align-items: center;
padding: 0 20px;

}

.titleLinks {
align-items: center;
display: flex;

> span a {
margin: 2px 5px 0;
}

> a + a {
margin-left: 20px;
}
Expand Down
13 changes: 3 additions & 10 deletions src/components/LegacyLinks/LegacyLinks.module.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
@import "../../styles/includes";
.container {
display: flex;
margin-top: auto;
align-items: center;
white-space: nowrap;

button:not(:first-child),
a:not(:first-child) {
margin-left: 20px;
}

button {
height: 40px;
outline: none;
white-space: nowrap;
> a {
margin: 0 5px;
}

.row {
Expand Down
Loading