Skip to content

Commit 676ac05

Browse files
committed
Revert "Merge pull request #4204 from appirio-tech/feature/taas-jobs"
This reverts commit 6238fef, reversing changes made to aa61325.
1 parent 10f295d commit 676ac05

File tree

14 files changed

+82
-167
lines changed

14 files changed

+82
-167
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ workflows:
128128
- build-dev
129129
filters:
130130
branches:
131-
only: ['dev', 'feature/taas-jobs']
131+
only: ['dev']
132132

133133
- deployTest01:
134134
context : org-global

config/constants/dev.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,5 @@ module.exports = {
5353

5454
DASHBOARD_FAQ_CONTENT_ID : process.env.DASHBOARD_FAQ_CONTENT_ID,
5555
CONTENTFUL_DELIVERY_KEY : process.env.CONTENTFUL_DELIVERY_KEY,
56-
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID,
57-
58-
SKILL_PROVIDER_ID: '9cc0795a-6e12-4c84-9744-15858dba1861',
59-
TAAS_APP_URL: 'https://mfe.topcoder-dev.com/taas'
56+
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID
6057
}

config/constants/master.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,5 @@ module.exports = {
5353

5454
DASHBOARD_FAQ_CONTENT_ID : process.env.DASHBOARD_FAQ_CONTENT_ID,
5555
CONTENTFUL_DELIVERY_KEY : process.env.CONTENTFUL_DELIVERY_KEY,
56-
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID,
57-
58-
SKILL_PROVIDER_ID: 'e8467a61-7e20-4ed2-a839-c6340d90f408',
59-
TAAS_APP_URL: 'https://mfe.topcoder.com/taas'
56+
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID
6057
}

config/constants/qa.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,5 @@ module.exports = {
4848
TC_SYSTEM_USERID: process.env.QA_TC_SYSTEM_USERID,
4949
MAINTENANCE_MODE: process.env.QA_MAINTENANCE_MODE,
5050

51-
TC_CDN_URL: process.env.TC_CDN_URL,
52-
53-
SKILL_PROVIDER_ID: '9cc0795a-6e12-4c84-9744-15858dba1861',
54-
TAAS_APP_URL: 'https://mfe.topcoder-dev.com/taas'
51+
TC_CDN_URL: process.env.TC_CDN_URL
5552
}

src/config/constants.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -717,13 +717,12 @@ export const PROJECT_ATTACHMENTS_FOLDER = process.env.PROJECT_ATTACHMENTS_FOLDER
717717
export const FILE_PICKER_ACCEPT = process.env.FILE_PICKER_ACCEPT || ['.bmp', '.gif', '.jpg', '.tex', '.xls', '.xlsx', '.doc', '.docx', '.zip', '.txt', '.pdf', '.png', '.ppt', '.pptx', '.rtf', '.csv']
718718

719719
export const SEGMENT_KEY = process.env.CONNECT_SEGMENT_KEY
720-
export const SKILL_PROVIDER_ID = process.env.SKILL_PROVIDER_ID || '9cc0795a-6e12-4c84-9744-15858dba1861'
721720
/*
722721
* URLs
723722
*/
724723
export const DOMAIN = process.env.domain || 'topcoder.com'
725724
export const CONNECT_DOMAIN = `connect.${DOMAIN}`
726-
export const CONNECT_MAIN_PAGE_URL = `https://connect.${DOMAIN}`
725+
export const CONNECT_MAIN_PAGE_URL = `http://connect.${DOMAIN}`
727726
export const ACCOUNTS_APP_CONNECTOR_URL = process.env.ACCOUNTS_APP_CONNECTOR_URL
728727
export const ACCOUNTS_APP_LOGIN_URL = process.env.ACCOUNTS_APP_LOGIN_URL || `https://accounts-auth0.${DOMAIN}`
729728
export const ACCOUNTS_APP_REGISTER_URL = process.env.ACCOUNTS_APP_REGISTER_URL || `https://accounts-auth0.${DOMAIN}`
@@ -1094,13 +1093,3 @@ export const PROFILE_FIELDS_CONFIG = {
10941093
// businessPhone: false,
10951094
}
10961095
}
1097-
1098-
/**
1099-
* The type of the project for talent as a service app.
1100-
*/
1101-
export const PROJECT_TYPE_TALENT_AS_A_SERVICE = 'talent-as-a-service'
1102-
1103-
/**
1104-
* URL to the Topcoder TaaS App
1105-
*/
1106-
export const TAAS_APP_URL = process.env.TAAS_APP_URL || 'https://mfe.topcoder-dev.com/taas'

src/projects/create/components/ProjectSubmitted.jsx

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,32 @@
11
import React from 'react'
22
import PT from 'prop-types'
3-
import qs from 'query-string'
43

54
require('./ProjectSubmitted.scss')
65
import {
7-
CONNECT_MAIN_PAGE_URL, PROJECT_TYPE_TALENT_AS_A_SERVICE, TAAS_APP_URL
6+
CONNECT_DOMAIN
87
} from '../../../config/constants'
98

10-
/**
11-
* Build project URL based on the `type` query param in URL.
12-
*
13-
* @param {String} projectId project id
14-
*/
15-
const formatProjectURL = (projectId) => {
16-
const { type } = qs.parse(window.location.search)
17-
18-
const url = type === PROJECT_TYPE_TALENT_AS_A_SERVICE
19-
// if the project type is TaaS, then use link to TaaS App
20-
? `${TAAS_APP_URL}/myteams/${projectId}`
21-
// otherwise use link inside Connect App
22-
: `${CONNECT_MAIN_PAGE_URL}/projects/${projectId}`
23-
24-
return url
25-
}
26-
279
class ProjectSubmitted extends React.Component {
2810
constructor(props) {
2911
super(props)
3012

3113
this.copyToClipboard = this.copyToClipboard.bind(this)
14+
this.state = {
15+
domain: `${CONNECT_DOMAIN}/`,
16+
url: `projects/${props.params.status || props.projectId}`
17+
}
3218
}
3319

3420
copyToClipboard() {
35-
const url = formatProjectURL(this.props.params.status || this.props.projectId)
3621
const textField = document.createElement('textarea')
37-
textField.innerText = url
22+
textField.innerText = `${this.state.domain}${this.state.url}`
3823
document.body.appendChild(textField)
3924
textField.select()
4025
document.execCommand('copy')
4126
textField.remove()
4227
}
4328

4429
render() {
45-
const url = formatProjectURL(this.props.params.status || this.props.projectId)
46-
4730
return (
4831
<div className="ProjectSubmitted flex column middle center tc-ui">
4932
<div className="container flex column middle center">
@@ -56,11 +39,11 @@ class ProjectSubmitted extends React.Component {
5639
Use the link below to share your project with members of your team. You can also access all your Topcoder projects in one place from your Connect project dashboard.
5740
</div>
5841
<div className="project-link-container flex row middle center">
59-
<a href={url}>{url.replace('https://', '')}</a>
42+
{ `${this.state.domain}${this.state.url}` }
6043
</div>
6144
<div className="button-container flex row middle center">
6245
<a type="button" onClick={this.copyToClipboard} className="copy-link-btn tc-btn tc-btn-sm tc-btn-default flex middle center" disabled={false}>Copy link</a>
63-
<a href={url} type="button" className="go-to-project-dashboard-btn tc-btn tc-btn-sm tc-btn-primary flex middle center" disabled={false}>Go to project dashboard</a>
46+
<a href={this.state.url} type="button" className="go-to-project-dashboard-btn tc-btn tc-btn-sm tc-btn-primary flex middle center" disabled={false}>Go to project dashboard</a>
6447
</div>
6548
</div>
6649
</div>
@@ -69,6 +52,7 @@ class ProjectSubmitted extends React.Component {
6952
}
7053

7154
ProjectSubmitted.defaultProps = {
55+
vm: {},
7256
params: {},
7357
}
7458

src/projects/create/components/ProjectWizard.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,9 @@ class ProjectWizard extends Component {
605605
/>
606606
<div />
607607
<ProjectSubmitted
608+
project={ project }
609+
projectTemplates={ projectTemplates }
610+
dirtyProject={ dirtyProject }
608611
params={ params }
609612
projectId={ projectId }
610613
/>

src/projects/create/containers/CreateContainer.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,11 @@ class CreateContainer extends React.Component {
124124
projectId: nextProjectId,
125125
isProjectDirty: false
126126
}, () => {
127-
const type = _.get(this.state, 'updatedProject.type')
128127
// go to submitted state
129128
console.log('go to submitted state')
130129
window.localStorage.removeItem(LS_INCOMPLETE_PROJECT)
131130
window.localStorage.removeItem(LS_INCOMPLETE_WIZARD)
132-
this.props.history.push('/new-project/submitted/' + nextProjectId + (type ? `?type=${type}` : ''))
131+
this.props.history.push('/new-project/submitted/' + nextProjectId)
133132
})
134133

135134
} else if (this.state.creatingProject !== nextProps.processing) {

src/projects/detail/components/SkillsQuestion/SkillsQuestionBase.jsx

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SkillsCheckboxGroup from './SkillsCheckboxGroup'
44
import Select from '../../../../components/Select/Select'
55
import './SkillsQuestion.scss'
66
import { axiosInstance as axios } from '../../../../api/requestInterceptor'
7-
import { TC_API_URL, SKILL_PROVIDER_ID } from '../../../../config/constants'
7+
import { TC_API_URL } from '../../../../config/constants'
88
import { createFilter } from 'react-select'
99

1010
let cachedOptions
@@ -21,9 +21,6 @@ let cachedOptions
2121
* @returns {Array} available options
2222
*/
2323
const getAvailableOptions = (categoriesMapping, selectedCategories, skillsCategories, options) => {
24-
// NOTE:
25-
// Disable filtering skills by categories for now, because V5 Skills API doesn't have categories for now.
26-
/*
2724
let mappedCategories
2825
if (categoriesMapping) {
2926
mappedCategories = _.map(selectedCategories, (category) => categoriesMapping[category] ? categoriesMapping[category].toLowerCase() : null)
@@ -34,7 +31,6 @@ const getAvailableOptions = (categoriesMapping, selectedCategories, skillsCatego
3431
if (mappedCategories) {
3532
return options.filter(option => _.intersection((option.categories || []).map(c => c.toLowerCase()), mappedCategories).length > 0)
3633
}
37-
*/
3834
return options
3935
}
4036

@@ -52,15 +48,12 @@ class SkillsQuestion extends React.PureComponent {
5248

5349
componentWillMount() {
5450
if (!cachedOptions) {
55-
axios.get(`${TC_API_URL}/v5/skills?skillProviderId=${SKILL_PROVIDER_ID}&perPage=100`)
51+
axios.get(`${TC_API_URL}/v3/tags/?domain=SKILLS&status=APPROVED`)
5652
.then(resp => {
57-
const options = _.get(resp, 'data', [])
53+
const options = _.get(resp.data, 'result.content', {})
5854

59-
cachedOptions = options.map((option) => ({
60-
skillId: option.id,
61-
name: option.name
62-
}))
63-
this.updateOptions(cachedOptions)
55+
cachedOptions = options
56+
this.updateOptions(options)
6457
})
6558
} else {
6659
this.updateOptions(cachedOptions)
@@ -84,7 +77,7 @@ class SkillsQuestion extends React.PureComponent {
8477
this.setState({ options })
8578
this.updateAvailableOptions(this.props, options)
8679
if (onSkillsLoaded) {
87-
onSkillsLoaded(options)
80+
onSkillsLoaded(options.map((option) => _.pick(option, ['id', 'name'])))
8881
}
8982
}
9083

@@ -100,6 +93,7 @@ class SkillsQuestion extends React.PureComponent {
10093

10194
// if have a mapping for categories, then filter options, otherwise use all options
10295
const availableOptions = getAvailableOptions(categoriesMapping, selectedCategories, skillsCategories, options)
96+
.map(option => _.pick(option, ['id', 'name']))
10397
this.setState({ availableOptions })
10498
}
10599

@@ -188,17 +182,17 @@ class SkillsQuestion extends React.PureComponent {
188182
const selectedCategories = _.get(currentProjectData, categoriesField, [])
189183

190184
let currentValues = getValue() || []
191-
// remove from currentValues not available options but still keep created custom options without 'skillId'
192-
currentValues = currentValues.filter(skill => _.some(availableOptions, skill) || !skill.skillId)
185+
// remove from currentValues not available options but still keep created custom options without id
186+
currentValues = currentValues.filter(skill => _.some(availableOptions, skill) || !skill.id)
193187

194188
const questionDisabled = isFormDisabled() || disabled || (selectedCategories.length === 0 && _.isUndefined(skillsCategories))
195189
const hasError = !isPristine() && !isValid()
196190
const errorMessage = getErrorMessage() || validationError
197191

198-
const checkboxGroupOptions = availableOptions.filter(option => frequentSkills.indexOf(option.skillId) > -1)
199-
const checkboxGroupValues = currentValues.filter(val => _.some(checkboxGroupOptions, option => option.skillId === val.skillId ))
192+
const checkboxGroupOptions = availableOptions.filter(option => frequentSkills.indexOf(option.id) > -1)
193+
const checkboxGroupValues = currentValues.filter(val => _.some(checkboxGroupOptions, option => option.id === val.id ))
200194

201-
const selectGroupOptions = availableOptions.filter(option => frequentSkills.indexOf(option.skillId) === -1)
195+
const selectGroupOptions = availableOptions.filter(option => frequentSkills.indexOf(option.id) === -1)
202196
if (customOptionValue) {
203197
selectGroupOptions.unshift({ name: customOptionValue })
204198
}

src/projects/detail/components/TaasProjectWelcome/TaasProjectWelcome.jsx

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

0 commit comments

Comments
 (0)