From c3ebfa0b7ded3286dc675d6dbaef70e9562cbf51 Mon Sep 17 00:00:00 2001 From: yoution Date: Thu, 1 Jul 2021 23:31:08 +0800 Subject: [PATCH 1/8] fix issue #1195 #1203 #1204 --- .../ChallengeEditor.module.scss | 23 +++-- .../ChallengeViewTabs.module.scss | 40 ++++---- .../ChallengeViewTabs/index.js | 98 ++++++++++--------- src/components/ChallengeEditor/index.js | 16 +-- .../LegacyLinks/LegacyLinks.module.scss | 12 +-- src/components/LegacyLinks/index.js | 27 +---- 6 files changed, 101 insertions(+), 115 deletions(-) diff --git a/src/components/ChallengeEditor/ChallengeEditor.module.scss b/src/components/ChallengeEditor/ChallengeEditor.module.scss index 79366ade..7e32cc52 100644 --- a/src/components/ChallengeEditor/ChallengeEditor.module.scss +++ b/src/components/ChallengeEditor/ChallengeEditor.module.scss @@ -15,20 +15,26 @@ } } -.title { - @include roboto-bold(); +.topContainer { + margin-top: 30px; + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 20px; +} +.leftContainer { + display: flex; + align-items: center; +} + +.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 { @@ -255,7 +261,6 @@ } .actionButtons { - position: absolute; top: 30px; a,button { height: 40px; diff --git a/src/components/ChallengeEditor/ChallengeViewTabs/ChallengeViewTabs.module.scss b/src/components/ChallengeEditor/ChallengeViewTabs/ChallengeViewTabs.module.scss index 3a4e50c1..fd7a64dd 100644 --- a/src/components/ChallengeEditor/ChallengeViewTabs/ChallengeViewTabs.module.scss +++ b/src/components/ChallengeEditor/ChallengeViewTabs/ChallengeViewTabs.module.scss @@ -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: center; +} + .actionButtons { display: flex; - position: absolute; top: 30px; - margin-top: 53px; } .actionButtonsLeft { @@ -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; diff --git a/src/components/ChallengeEditor/ChallengeViewTabs/index.js b/src/components/ChallengeEditor/ChallengeViewTabs/index.js index e213f179..c431f8d4 100644 --- a/src/components/ChallengeEditor/ChallengeViewTabs/index.js +++ b/src/components/ChallengeEditor/ChallengeViewTabs/index.js @@ -81,60 +81,64 @@ const ChallengeViewTabs = ({ return (
- {!isTask && ( +
+
+
{challenge.name}
+ {!isTask && ( +
+ +
+ )} +
- + {(challenge.status === 'Draft' || challenge.status === 'New') &&
} + {challenge.status === 'Draft' && ( +
+ {challenge.legacyId || isTask ? ( + + ) : ( + + {/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */} + + + )} +
+ )} + {isTask && challenge.status === 'Active' && ( +
+ {assignedMemberDetails ? ( + + + + ) : ( + + {/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */} + + + )} +
+ )} + {enableEdit && ( + + )} +
- )} -
{challenge.name}
-
- {(challenge.status === 'Draft' || challenge.status === 'New') &&
} - {challenge.status === 'Draft' && ( -
- {challenge.legacyId || isTask ? ( - - ) : ( - - {/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */} - - - )} -
- )} - {isTask && challenge.status === 'Active' && ( -
- {assignedMemberDetails ? ( - - - - ) : ( - - {/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */} - - - )} -
- )} - {enableEdit && ( - - )} -
-
- {!isNew && } -
-
{getTitle(isNew)}
-
- {!isNew && this.props.challengeDetails.status === 'New' && } - +
+
+
{getTitle(isNew)}
+ {!isNew && } +
+
+ {!isNew && this.props.challengeDetails.status === 'New' && } + +
* Required
diff --git a/src/components/LegacyLinks/LegacyLinks.module.scss b/src/components/LegacyLinks/LegacyLinks.module.scss index ac057bd4..a15b41c0 100644 --- a/src/components/LegacyLinks/LegacyLinks.module.scss +++ b/src/components/LegacyLinks/LegacyLinks.module.scss @@ -1,18 +1,10 @@ @import "../../styles/includes"; .container { display: flex; - margin-top: auto; align-items: center; - button:not(:first-child), - a:not(:first-child) { - margin-left: 20px; - } - - button { - height: 40px; - outline: none; - white-space: nowrap; + > a { + margin: 0 5px; } .row { diff --git a/src/components/LegacyLinks/index.js b/src/components/LegacyLinks/index.js index c366fd39..48a82282 100644 --- a/src/components/LegacyLinks/index.js +++ b/src/components/LegacyLinks/index.js @@ -5,40 +5,17 @@ import React, { useCallback } from 'react' import PropTypes from 'prop-types' import cn from 'classnames' import styles from './LegacyLinks.module.scss' -import { DIRECT_PROJECT_URL, MESSAGE, ONLINE_REVIEW_URL } from '../../config/constants' -import PrimaryButton from '../Buttons/PrimaryButton' -import Tooltip from '../Tooltip' +import { ONLINE_REVIEW_URL } from '../../config/constants' const LegacyLinks = ({ challenge, challengeView }) => { const onClick = useCallback((e) => { e.stopPropagation() }, []) - const directUrl = `${DIRECT_PROJECT_URL}/contest/detail?projectId=${challenge.legacyId}` const orUrl = `${ONLINE_REVIEW_URL}/review/actions/ViewProjectDetails?pid=${challenge.legacyId}` return (
- {challenge.legacyId ? ( - <> - - - - - - - - ) : ( - <> - - {/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */} - - - - {/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */} - - - - )} + ( Online Review )
{ challengeView && challenge.discussions && challenge.discussions.map(d => (
From c771b8a58d7fa7c1eee2e04a7019677a9c4b4ace Mon Sep 17 00:00:00 2001 From: yoution Date: Fri, 2 Jul 2021 09:31:49 +0800 Subject: [PATCH 2/8] fix: issue #1202 --- .../ChallengesComponent/ChallengesComponent.module.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/ChallengesComponent/ChallengesComponent.module.scss b/src/components/ChallengesComponent/ChallengesComponent.module.scss index c453ea90..c779d15b 100644 --- a/src/components/ChallengesComponent/ChallengesComponent.module.scss +++ b/src/components/ChallengesComponent/ChallengesComponent.module.scss @@ -11,6 +11,7 @@ font-size: 24px; font-weight: 700; + margin-right: 5px; line-height: 29px; color: $challenges-title; text-align: center; @@ -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; } From b38c394f92983c6eea39a6ca0d3a1eb4a9ff49cc Mon Sep 17 00:00:00 2001 From: yoution Date: Fri, 2 Jul 2021 10:04:23 +0800 Subject: [PATCH 3/8] fix: issue #1196 --- src/components/ChallengeEditor/ChallengeEditor.module.scss | 4 ++++ src/components/ChallengeEditor/index.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ChallengeEditor/ChallengeEditor.module.scss b/src/components/ChallengeEditor/ChallengeEditor.module.scss index 7e32cc52..38a3cf6e 100644 --- a/src/components/ChallengeEditor/ChallengeEditor.module.scss +++ b/src/components/ChallengeEditor/ChallengeEditor.module.scss @@ -15,6 +15,10 @@ } } +.textCenter { + text-align: center; +} + .topContainer { margin-top: 30px; display: flex; diff --git a/src/components/ChallengeEditor/index.js b/src/components/ChallengeEditor/index.js index 9c87452b..82cac939 100644 --- a/src/components/ChallengeEditor/index.js +++ b/src/components/ChallengeEditor/index.js @@ -1321,7 +1321,7 @@ class ChallengeEditor extends Component { +

Are you sure want to complete task "{challenge.name}" with the prize ${taskPrize} for {assignedMember}?

} From c07db0bfc07d14c9572b836575b362b25d044cb6 Mon Sep 17 00:00:00 2001 From: yoution Date: Fri, 2 Jul 2021 10:24:28 +0800 Subject: [PATCH 4/8] fix: issue-1019 --- src/components/ChallengesComponent/ChallengeList/index.js | 8 ++++++++ src/config/constants.js | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/ChallengesComponent/ChallengeList/index.js b/src/components/ChallengesComponent/ChallengeList/index.js index e7c355a2..d3398b5b 100644 --- a/src/components/ChallengesComponent/ChallengeList/index.js +++ b/src/components/ChallengesComponent/ChallengeList/index.js @@ -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 @@ -175,6 +178,10 @@ class ChallengeList extends Component { this.directUpdateSearchParam(searchText, CHALLENGE_STATUS.COMPLETED) break } + case 4: { + this.directUpdateSearchParam(searchText, CHALLENGE_STATUS.CANCELLED) + break + } } }}> @@ -182,6 +189,7 @@ class ChallengeList extends Component { New Draft Completed + Cancelled diff --git a/src/config/constants.js b/src/config/constants.js index 357db2f3..2a7285fa 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -162,7 +162,8 @@ export const CHALLENGE_STATUS = { ACTIVE: 'ACTIVE', NEW: 'NEW', DRAFT: 'DRAFT', - COMPLETED: 'COMPLETED' + COMPLETED: 'COMPLETED', + CANCELLED: 'CANCELLED' } export const getTCMemberURL = (handle) => `${COMMUNITY_APP_URL}/members/${handle}` From 99c4cc7c15ddb6f1d79516bf2fa97bf1840ca6f6 Mon Sep 17 00:00:00 2001 From: yoution Date: Fri, 2 Jul 2021 15:12:58 +0800 Subject: [PATCH 5/8] fix issue #1195 #1203 #1204 --- src/components/LegacyLinks/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/LegacyLinks/index.js b/src/components/LegacyLinks/index.js index 48a82282..d1bb20cd 100644 --- a/src/components/LegacyLinks/index.js +++ b/src/components/LegacyLinks/index.js @@ -5,7 +5,8 @@ import React, { useCallback } from 'react' import PropTypes from 'prop-types' import cn from 'classnames' import styles from './LegacyLinks.module.scss' -import { ONLINE_REVIEW_URL } from '../../config/constants' +import Tooltip from '../Tooltip' +import { MESSAGE, ONLINE_REVIEW_URL } from '../../config/constants' const LegacyLinks = ({ challenge, challengeView }) => { const onClick = useCallback((e) => { @@ -15,7 +16,12 @@ const LegacyLinks = ({ challenge, challengeView }) => { const orUrl = `${ONLINE_REVIEW_URL}/review/actions/ViewProjectDetails?pid=${challenge.legacyId}` return (
- ( Online Review ) + ( {challenge.legacyId ? Online Review + : + {/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */} + Online Review + } + )
{ challengeView && challenge.discussions && challenge.discussions.map(d => (
From c016876902bfa63d70a7be612f01d3c1165f38eb Mon Sep 17 00:00:00 2001 From: yoution Date: Mon, 5 Jul 2021 19:53:54 +0800 Subject: [PATCH 6/8] fix issue #1195 #1203 #1204 --- src/components/ChallengeEditor/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ChallengeEditor/index.js b/src/components/ChallengeEditor/index.js index 9c87452b..3ebffeb8 100644 --- a/src/components/ChallengeEditor/index.js +++ b/src/components/ChallengeEditor/index.js @@ -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 { @@ -1600,10 +1600,10 @@ class ChallengeEditor extends Component { return (
- +
-
{getTitle(isNew)}
+
{getTitle(isNew, challenge)}
{!isNew && }
From 2efc9a26686cf93631df3402e5ae400adeb20c61 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Tue, 6 Jul 2021 12:58:39 +0530 Subject: [PATCH 7/8] Deploying feature branch to dev for QA --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9231a0cf..aa29c413 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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. From 855ab967211fe0af268f1dbda2df9965164a2569 Mon Sep 17 00:00:00 2001 From: yoution Date: Sat, 10 Jul 2021 13:40:43 +0800 Subject: [PATCH 8/8] fix: issue #1195 #1102 --- src/components/ChallengeEditor/ChallengeEditor.module.scss | 3 +++ .../ChallengeViewTabs/ChallengeViewTabs.module.scss | 2 +- src/components/LegacyLinks/LegacyLinks.module.scss | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ChallengeEditor/ChallengeEditor.module.scss b/src/components/ChallengeEditor/ChallengeEditor.module.scss index 7e32cc52..7e5d22c3 100644 --- a/src/components/ChallengeEditor/ChallengeEditor.module.scss +++ b/src/components/ChallengeEditor/ChallengeEditor.module.scss @@ -26,6 +26,9 @@ .leftContainer { display: flex; align-items: center; + .title { + text-align: left; + } } .title { diff --git a/src/components/ChallengeEditor/ChallengeViewTabs/ChallengeViewTabs.module.scss b/src/components/ChallengeEditor/ChallengeViewTabs/ChallengeViewTabs.module.scss index fd7a64dd..d6ecc12d 100644 --- a/src/components/ChallengeEditor/ChallengeViewTabs/ChallengeViewTabs.module.scss +++ b/src/components/ChallengeEditor/ChallengeViewTabs/ChallengeViewTabs.module.scss @@ -23,7 +23,7 @@ $tc-white: #FFFFFF; line-height: 29px; margin-right: 5px; color: $challenges-title; - text-align: center; + text-align: left; } .actionButtons { diff --git a/src/components/LegacyLinks/LegacyLinks.module.scss b/src/components/LegacyLinks/LegacyLinks.module.scss index a15b41c0..95abcc77 100644 --- a/src/components/LegacyLinks/LegacyLinks.module.scss +++ b/src/components/LegacyLinks/LegacyLinks.module.scss @@ -2,6 +2,7 @@ .container { display: flex; align-items: center; + white-space: nowrap; > a { margin: 0 5px;