Skip to content

Commit 927d737

Browse files
author
vikasrohit
authored
Merge pull request #1120 from topcoder-platform/revert-1072-feature/timeline-template
Revert "Add an option to select a timeline template"
2 parents 942f682 + e0d9122 commit 927d737

File tree

7 files changed

+15
-224
lines changed

7 files changed

+15
-224
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ workflows:
8383
branches:
8484
only:
8585
- develop
86-
- feature/timeline-template
8786

8887
# Production builds are exectuted only on tagged commits to the
8988
# master branch.

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,16 @@
5252
}
5353
}
5454

55-
.challengeName {
56-
&::-moz-placeholder { /* Mozilla Firefox 19+ */
57-
line-height: 38px;
58-
color: $tc-gray-80;
59-
}
60-
&::-webkit-input-placeholder { /* Webkit */
61-
line-height: 38px;
62-
color: $tc-gray-80;
63-
}
64-
&:-ms-input-placeholder { /* IE */
65-
line-height: 38px;
66-
color: $tc-gray-80;
55+
@-moz-document url-prefix() {
56+
.challengeName {
57+
&::-moz-placeholder { /* Mozilla Firefox 19+ */
58+
line-height: 38px;
59+
}
60+
&::-webkit-input-placeholder { /* Webkit */
61+
line-height: 38px;
62+
}
63+
&:-ms-input-placeholder { /* IE */
64+
line-height: 38px;
65+
}
6766
}
6867
}
69-

src/components/ChallengeEditor/ChallengeView/index.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { isBetaMode } from '../../../util/cookie'
2626
import { loadGroupDetails } from '../../../actions/challenges'
2727
import Tooltip from '../../Tooltip'
2828
import { MESSAGE, REVIEW_TYPES } from '../../../config/constants'
29-
import TimelineTemplateField from '../TimelineTemplate-Field'
3029

3130
const ChallengeView = ({
3231
projectDetail,
@@ -201,13 +200,6 @@ const ChallengeView = ({
201200
{isBetaMode() && (
202201
<UseSchedulingAPIField challenge={challenge} readOnly />
203202
)}
204-
<TimelineTemplateField
205-
challengeTimelines={metadata.challengeTimelines}
206-
timelineTemplates={metadata.timelineTemplates}
207-
challenge={challenge}
208-
onUpdateSelect={() => {}}
209-
readOnly
210-
/>
211203
</>
212204
)}
213205
{

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

Lines changed: 0 additions & 55 deletions
This file was deleted.

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

Lines changed: 0 additions & 126 deletions
This file was deleted.

src/components/ChallengeEditor/index.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import Tooltip from '../Tooltip'
5252
import UseSchedulingAPIField from './UseSchedulingAPIField'
5353
import { getResourceRoleByName } from '../../util/tc'
5454
import { isBetaMode } from '../../util/cookie'
55-
import TimelineTemplateField from './TimelineTemplate-Field'
5655

5756
const theme = {
5857
container: styles.modalContainer
@@ -839,7 +838,7 @@ class ChallengeEditor extends Component {
839838
const STD_DEV_TIMELINE_TEMPLATE = _.find(timelineTemplates, { name: 'Standard Development' })
840839
const avlTemplates = this.getAvailableTimelineTemplates()
841840
// chooses first available timeline template or fallback template for the new challenge
842-
const defaultTemplate = _.find(avlTemplates || [], t => t.isDefault) || STD_DEV_TIMELINE_TEMPLATE
841+
const defaultTemplate = avlTemplates && avlTemplates.length > 0 ? avlTemplates[0] : STD_DEV_TIMELINE_TEMPLATE
843842
const isTask = _.find(metadata.challengeTypes, { id: typeId, isTask: true })
844843
const newChallenge = {
845844
status: 'New',
@@ -852,7 +851,7 @@ class ChallengeEditor extends Component {
852851
reviewType: isTask || isDesignChallenge ? REVIEW_TYPES.INTERNAL : REVIEW_TYPES.COMMUNITY
853852
},
854853
descriptionFormat: 'markdown',
855-
timelineTemplateId: _.get(this.getCurrentTemplate(), 'id', defaultTemplate.id),
854+
timelineTemplateId: defaultTemplate.id,
856855
terms: [{ id: DEFAULT_TERM_UUID, roleId: SUBMITTER_ROLE_UUID }],
857856
groups: []
858857
// prizeSets: this.getDefaultPrizeSets()
@@ -1141,10 +1140,8 @@ class ChallengeEditor extends Component {
11411140

11421141
// all timeline template ids available for the challenge type
11431142
const availableTemplateIds = _.filter(challengeTimelines, ct => ct.typeId === challenge.typeId && ct.trackId === challenge.trackId).map(tt => tt.timelineTemplateId)
1144-
const defaultChallengeTimeline = _.find(challengeTimelines, ct => ct.typeId === challenge.typeId && ct.trackId === challenge.trackId && ct.isDefault)
11451143
// filter and return timeline templates that are available for this challenge type
1146-
const avlTemplates = _.filter(timelineTemplates, tt => availableTemplateIds.indexOf(tt.id) !== -1)
1147-
return _.map(avlTemplates, tt => tt.id === defaultChallengeTimeline.timelineTemplateId ? { ...tt, isDefault: true } : tt)
1144+
return _.filter(timelineTemplates, tt => availableTemplateIds.indexOf(tt.id) !== -1)
11481145
}
11491146

11501147
render () {
@@ -1363,13 +1360,6 @@ class ChallengeEditor extends Component {
13631360
<div className={styles.newFormContainer}>
13641361
<TrackField tracks={metadata.challengeTracks} challenge={challenge} onUpdateOthers={this.onUpdateOthers} />
13651362
<TypeField types={metadata.challengeTypes} onUpdateSelect={this.onUpdateSelect} challenge={challenge} />
1366-
<TimelineTemplateField
1367-
currentTemplate={this.state.currentTemplate}
1368-
challengeTimelines={metadata.challengeTimelines}
1369-
timelineTemplates={metadata.timelineTemplates}
1370-
challenge={challenge}
1371-
onUpdateSelect={this.resetPhase}
1372-
/>
13731363
<ChallengeNameField challenge={challenge} onUpdateInput={this.onUpdateInput} />
13741364
</div>
13751365
{ errorContainer }
@@ -1447,13 +1437,6 @@ class ChallengeEditor extends Component {
14471437
{isBetaMode() && (
14481438
<UseSchedulingAPIField challenge={challenge} toggleUseSchedulingAPI={this.toggleUseSchedulingAPI} />
14491439
)}
1450-
<TimelineTemplateField
1451-
challengeTimelines={metadata.challengeTimelines}
1452-
timelineTemplates={metadata.timelineTemplates}
1453-
challenge={challenge}
1454-
currentTemplate={this.state.currentTemplate}
1455-
onUpdateSelect={this.resetPhase}
1456-
/>
14571440
</React.Fragment>
14581441
)}
14591442
{!isTask && (

src/services/challenges.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export async function fetchTimelineTemplates () {
9191
* @returns {Promise<*>}
9292
*/
9393
export async function fetchChallengeTimelines () {
94-
const response = await axiosInstance.get(`${CHALLENGE_TIMELINES_URL}?page=1&perPage=100`)
94+
const response = await axiosInstance.get(`${CHALLENGE_TIMELINES_URL}?isDefault=true&page=1&perPage=100`)
9595
return _.get(response, 'data', [])
9696
}
9797

0 commit comments

Comments
 (0)