Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9adc587
chore: deploy 'feature/taas-jobs-2'
maxceem Dec 12, 2020
478deba
load and cache all skills for skills question
vignesh-at-alation Dec 12, 2020
ad04c7b
add new line at the end of the file - skills.js
vignesh-at-alation Dec 12, 2020
89359de
handle error while loading skills
vignesh-at-alation Dec 13, 2020
3f03f88
Merge pull request #4211 from vigneshTheDev/feature/taas-jobs-2
maxceem Dec 14, 2020
5779223
fix: lint
maxceem Dec 14, 2020
5ae825c
chore: deploy 'feature/taas-jobs-2' to TEST01
maxceem Dec 14, 2020
68aebd6
fix: update TaaS URL
maxceem Dec 15, 2020
8d5daec
Merge branch 'dev' into feature/taas-jobs-2
maxceem Jan 4, 2021
75ffc0a
fix use DEV auth instead of local
maxceem Jan 6, 2021
3051ef4
fix: showing all the skills
maxceem Jan 6, 2021
8e883e2
Revert "Revert "Merge pull request #4204 from appirio-tech/feature/ta…
maxceem Jan 6, 2021
dd7b0f7
fix: lint
maxceem Jan 6, 2021
ea7acc9
fix: #4206
yoution Jan 6, 2021
f1cc084
Merge pull request #4245 from yoution/feature/taas-jobs-2
maxceem Jan 7, 2021
3c8a847
feat: jobs form improvements
maxceem Jan 7, 2021
5a74c42
refactor: use unique id for key
maxceem Jan 7, 2021
a95c2e0
Merge branch 'dev' into feature/taas-jobs-2
maxceem Jan 8, 2021
40fa219
Add error message when comments doesn't render properly
Jan 8, 2021
0cb26fe
Merge branch 'dev' of https://github.com/appirio-tech/connect-app int…
Jan 8, 2021
752a698
Fix: lint error
Jan 8, 2021
1b93f39
fix:issue #4254
yoution Jan 9, 2021
53a8e40
fix:issue-4206
yoution Jan 9, 2021
f208d9e
Merge pull request #4255 from yoution/feature/issue-4254
maxceem Jan 9, 2021
28c0988
Merge pull request #4256 from yoution/feature/issue-4206
maxceem Jan 9, 2021
c536d7b
Merge pull request #4253 from sanju-singh/emptyMsgBreak
maxceem Jan 9, 2021
c3abca6
fix: make "All Projects" button lead to Connect
maxceem Jan 10, 2021
5e229b1
feat: project submitted buttons change
maxceem Jan 11, 2021
68b3364
Merge branch 'dev' into feature/taas-jobs-2
maxceem Jan 11, 2021
6eddaad
Merge pull request #4259 from appirio-tech/hotfix/v2-project-cannot-load
Jan 12, 2021
05a3023
Merge branch 'dev' into feature/taas-jobs-2
maxceem Jan 12, 2021
31bed5e
fix: #4206 add trim()
yoution Jan 12, 2021
7be4678
Merge pull request #4261 from yoution/feature/issus-4206
maxceem Jan 12, 2021
104c5ad
fix: #4206 disblae next button when add empty job
yoution Jan 13, 2021
2161684
Merge pull request #4264 from yoution/feature/issus-4206
maxceem Jan 13, 2021
5b7b222
fix: issue #4263 add validation
yoution Jan 15, 2021
9734a24
Merge pull request #4277 from yoution/hotfix/isue-4263
maxceem Jan 15, 2021
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 @@ -136,7 +136,7 @@ workflows:
- build-dev
filters:
branches:
only: ['feature/unified-permissions', 'feature/accept-reject-terms-in-profile']
only: ['feature/taas-jobs-2']

- deployProd:
context : org-global
Expand Down
4 changes: 3 additions & 1 deletion config/constants/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@ module.exports = {

DASHBOARD_FAQ_CONTENT_ID : process.env.DASHBOARD_FAQ_CONTENT_ID,
CONTENTFUL_DELIVERY_KEY : process.env.CONTENTFUL_DELIVERY_KEY,
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID,

TAAS_APP_URL: 'https://platform.topcoder-dev.com/taas'
}
4 changes: 3 additions & 1 deletion config/constants/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@ module.exports = {

DASHBOARD_FAQ_CONTENT_ID : process.env.DASHBOARD_FAQ_CONTENT_ID,
CONTENTFUL_DELIVERY_KEY : process.env.CONTENTFUL_DELIVERY_KEY,
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID,

TAAS_APP_URL: 'https://platform.topcoder.com/taas'
}
4 changes: 3 additions & 1 deletion config/constants/qa.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ module.exports = {
TC_SYSTEM_USERID: process.env.QA_TC_SYSTEM_USERID,
MAINTENANCE_MODE: process.env.QA_MAINTENANCE_MODE,

TC_CDN_URL: process.env.TC_CDN_URL
TC_CDN_URL: process.env.TC_CDN_URL,

TAAS_APP_URL: 'https://platform.topcoder-dev.com/taas'
}
49 changes: 49 additions & 0 deletions src/api/skills.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { TC_API_URL } from '../config/constants'
import { axiosInstance as axios } from './requestInterceptor'

const skillPageSize = 100
let cachedSkillsAsPromise

/**
* Loads and caches all the skills the first time. Returns the skills list from the cache from the second time.
*/
export function getSkills() {
cachedSkillsAsPromise = cachedSkillsAsPromise || getAllSkills().catch(ex => {
console.error('Error loading skills', ex)
cachedSkillsAsPromise = null
return []
})

return cachedSkillsAsPromise
}

/**
* Recursively loads all the pages from skills api.
*/
function getAllSkills() {
let skills = []

return new Promise((resolve, reject) => {
const loop = (page) => getSkillsPage(page)
.then((skillResponse) => {
skills = skills.concat(skillResponse.data)
if (skillResponse.data.length === skillPageSize) {
page++
loop(page)
} else {
resolve(skills)
}
})
.catch(ex => reject(ex))

loop(1)
})
}

/**
* Loads the skills in the given page.
* @param {number} page The page number to load
*/
function getSkillsPage(page) {
return axios.get(`${TC_API_URL}/v5/taas-teams/skills?perPage=${skillPageSize}&orderBy=name&page=${page}`)
}
17 changes: 16 additions & 1 deletion src/components/Feed/FeedComments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@ class FeedComments extends React.Component {
}
}

convertMdToHtml(markdown) {
try {
return (<div dangerouslySetInnerHTML={{__html: markdownToHTML(markdown)}} />)
} catch (e) {
return (
<div>
<p>{markdown}</p>
<p styleName="comment-render-error">
This message could not be rendered properly, please contact Topcoder Support.
</p>
</div>
)
}
}

render() {
const {
currentUser, onLoadMoreComments, isLoadingComments, hasMoreComments, onAddNewComment,
Expand Down Expand Up @@ -325,7 +340,7 @@ class FeedComments extends React.Component {
canDelete={comments && (idx !== comments.length - 1)} // cannot delete the first post which is now shown as a last one
commentAnchorPrefix={commentAnchorPrefix}
>
<div dangerouslySetInnerHTML={{__html: markdownToHTML(itemContent)}} />
{ this.convertMdToHtml(itemContent) }
</Comment>
)
})
Expand Down
8 changes: 8 additions & 0 deletions src/components/Feed/FeedComments.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
padding-bottom: 2 * $base-unit;
}

.comment-render-error {
border: 1px dashed $tc-orange-70;
color: $tc-orange-70;
text-align: center;
padding: 2px;
margin-top: 5px;
}

.load-more {
background-color: $tc-white;
padding: 2 * $base-unit 0 $base-unit;
Expand Down
4 changes: 2 additions & 2 deletions src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ export const SEGMENT_KEY = process.env.CONNECT_SEGMENT_KEY
*/
export const DOMAIN = process.env.domain || 'topcoder.com'
export const CONNECT_DOMAIN = `connect.${DOMAIN}`
export const CONNECT_MAIN_PAGE_URL = `http://connect.${DOMAIN}`
export const CONNECT_MAIN_PAGE_URL = `https://connect.${DOMAIN}`
export const ACCOUNTS_APP_CONNECTOR_URL = process.env.ACCOUNTS_APP_CONNECTOR_URL
export const ACCOUNTS_APP_LOGIN_URL = process.env.ACCOUNTS_APP_LOGIN_URL || `https://accounts-auth0.${DOMAIN}`
export const ACCOUNTS_APP_REGISTER_URL = process.env.ACCOUNTS_APP_REGISTER_URL || `https://accounts-auth0.${DOMAIN}`
Expand Down Expand Up @@ -1109,7 +1109,7 @@ export const PROJECT_TYPE_TALENT_AS_A_SERVICE = 'talent-as-a-service'
/**
* URL to the Topcoder TaaS App
*/
export const TAAS_APP_URL = process.env.TAAS_APP_URL || 'https://mfe.topcoder-dev.com/taas'
export const TAAS_APP_URL = process.env.TAAS_APP_URL || 'https://platform.topcoder-dev.com/taas'

/**
* Milestone Types
Expand Down
5 changes: 1 addition & 4 deletions src/helpers/markdownToState.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {convertFromRaw} from 'draft-js'
import sanitizeHtml from 'sanitize-html'
import Alert from 'react-s-alert'
const Remarkable = require('remarkable')

// Block level items, key is Remarkable's key for them, value returned is
Expand Down Expand Up @@ -363,13 +362,11 @@ function markdownToState(markdown, options = {}) {
// If any error occurs set value to plain text
const plainTextBlock = getNewBlock(BlockTypes['paragraph_open']())
plainTextBlock.text = markdown

result = convertFromRaw({
entityMap: [],
blocks: [plainTextBlock],
})

Alert.warning('Some message could not be rendered properly, please contact Topcoder Support')
}

return result
Expand Down
106 changes: 86 additions & 20 deletions src/projects/create/components/ProjectSubmitted.jsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,104 @@
import React from 'react'
import PT from 'prop-types'
import qs from 'query-string'

require('./ProjectSubmitted.scss')
import {
CONNECT_MAIN_PAGE_URL, PROJECT_TYPE_TALENT_AS_A_SERVICE, TAAS_APP_URL
} from '../../../config/constants'

class ProjectSubmitted extends React.Component {
constructor(props) {
super(props)
this.state = {
url: `projects/${props.params.status || props.projectId}`
/**
* Build project URL based on the `type` query param in URL.
*
* @param {boolean} isTaas
* @param {String} projectId project id
*/
getProjectUrl(isTaas, projectId = '') {
const url = isTaas
// if the project type is TaaS, then use link to TaaS App
? `${TAAS_APP_URL}/myteams/${projectId}`
// otherwise use link inside Connect App
: `${CONNECT_MAIN_PAGE_URL}/projects/${projectId}`

return url
}

getPageConfiguration() {
const { type } = qs.parse(window.location.search)
const isTaas = type === PROJECT_TYPE_TALENT_AS_A_SERVICE

const projectId = this.props.params.status || this.props.projectId

const project = {
headerSubTitle: 'Your project has been created',
textBody: (
<div className="content">
Topcoder will be contacting you soon to discuss your project proposal.
<br />
<br />
<span>
In the meantime, get a jump on the process by inviting your coworkers to your project and securely share any detailed requirements documents you have inside your project.
</span>
</div>
),
leftButton: {
header: 'All Projects',
subText: 'View all of your projects',
url: this.getProjectUrl(isTaas)
},
rightButton: {
header: 'Go to Project',
subText: 'Invite your team members and share requirements',
url: this.getProjectUrl(isTaas, projectId)
},
}

const taas = {
headerSubTitle: 'Your talent request has been created',
textBody: (
<div className="content">
Topcoder will be contacting you soon to discuss your talent needs.
</div>
),
leftButton: {
header: 'All Projects',
subText: 'View all of your projects',
url: this.getProjectUrl(false) // also showing link to Connect App Project List
},
rightButton: {
header: 'View Talent Request',
subText: 'Modify your request and track fulfillment',
url: this.getProjectUrl(isTaas, projectId)
},
}

return isTaas? taas: project
}

render() {

const {
headerSubTitle,
textBody,
leftButton,
rightButton
} = this.getPageConfiguration()

return (
<div className="ProjectSubmitted flex column middle center tc-ui">
<div className="container flex column middle center">
<div className="title">Congratulations!</div>
<div className="sub-title">Your project has been created</div>
<div className="content">
Topcoder will be contacting you soon to discuss your project proposal.
<br />
<br />
<span>
In the meantime, get a jump on the process by inviting your coworkers to your project and securely share any detailed requirements documents you have inside your project.
</span>
</div>
<div className="sub-title">{headerSubTitle}</div>
{textBody}
<div className="button-container flex row middle center">
<a type="button" href={this.state.url} className="go-to-project-btn tc-btn tc-btn-sm tc-btn-default flex middle center" disabled={false}>
Go to Project
<small>Invite your team members and share requirements</small>
<a type="button" href={leftButton.url} className="go-to-project-btn tc-btn tc-btn-sm tc-btn-default flex middle center">
{leftButton.header}
<small>{leftButton.subText}</small>
</a>
<a href="projects" type="button" className="go-to-project-dashboard-btn tc-btn tc-btn-sm tc-btn-primary flex middle center" disabled={false}>
All Projects
<small>View all of your projects</small>
<a href={rightButton.url} type="button" className="go-to-project-dashboard-btn tc-btn tc-btn-sm tc-btn-primary flex middle center">
{rightButton.header}
<small>{rightButton.subText}</small>
</a>
</div>
</div>
Expand All @@ -41,7 +108,6 @@ In the meantime, get a jump on the process by inviting your coworkers to your pr
}

ProjectSubmitted.defaultProps = {
vm: {},
params: {},
}

Expand Down
3 changes: 0 additions & 3 deletions src/projects/create/components/ProjectWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,6 @@ class ProjectWizard extends Component {
/>
<div />
<ProjectSubmitted
project={ project }
projectTemplates={ projectTemplates }
dirtyProject={ dirtyProject }
params={ params }
projectId={ projectId }
/>
Expand Down
3 changes: 2 additions & 1 deletion src/projects/create/containers/CreateContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ class CreateContainer extends React.Component {
projectId: nextProjectId,
isProjectDirty: false
}, () => {
const type = _.get(this.state, 'updatedProject.type')
// go to submitted state
console.log('go to submitted state')
window.localStorage.removeItem(LS_INCOMPLETE_PROJECT)
window.localStorage.removeItem(LS_INCOMPLETE_WIZARD)
this.props.history.push('/new-project/submitted/' + nextProjectId)
this.props.history.push('/new-project/submitted/' + nextProjectId + (type ? `?type=${type}` : ''))
})

} else if (this.state.creatingProject !== nextProps.processing) {
Expand Down
4 changes: 4 additions & 0 deletions src/projects/detail/components/Accordion/Accordion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const TYPE = {
SELECT_DROPDOWN: 'select-dropdown',
TALENT_PICKER: 'talent-picker',
TALENT_PICKER_V2: 'talent-picker-v2',
JOBS_PICKER: 'jobs-picker',
}

/**
Expand Down Expand Up @@ -180,6 +181,9 @@ class Accordion extends React.Component {
const totalPeoplePerRole = _.mapValues(_.groupBy(value, v => v.role), valuesUnderGroup => _.sumBy(valuesUnderGroup, v => Number(v.people)))
return _.toPairs(totalPeoplePerRole).filter(([, people]) => people > 0).map(([role, people]) => `${getRoleName(role)}: ${people}`).join(', ')
}
case TYPE.JOBS_PICKER: {
return _.map(value, 'title').join(', ')
}
default: return value
}
}
Expand Down
Loading