Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardised skills when creating gigs, and removal of TaaS App links #4605

Merged
merged 9 commits into from
Nov 8, 2023
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
1 change: 0 additions & 1 deletion config/constants/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ module.exports = {
CONTENTFUL_DELIVERY_KEY : process.env.CONTENTFUL_DELIVERY_KEY,
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID,

TAAS_APP_URL: 'https://platform.topcoder-dev.com/taas',
DEFAULT_NDA_UUID: 'e5811a7b-43d1-407a-a064-69e5015b4900',
UNIVERSAL_NAV_URL: '//uni-nav.topcoder-dev.com/v1/tc-universal-nav.js',
HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`,
Expand Down
1 change: 0 additions & 1 deletion config/constants/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ module.exports = {
CONTENTFUL_DELIVERY_KEY : process.env.CONTENTFUL_DELIVERY_KEY,
CONTENTFUL_SPACE_ID : process.env.CONTENTFUL_SPACE_ID,

TAAS_APP_URL: 'https://platform.topcoder.com/taas',
DEFAULT_NDA_UUID: 'c41e90e5-4d0e-4811-bd09-38ff72674490',
UNIVERSAL_NAV_URL: '//uni-nav.topcoder.com/v1/tc-universal-nav.js',
HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`,
Expand Down
1 change: 0 additions & 1 deletion config/constants/qa.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ module.exports = {

TC_CDN_URL: process.env.TC_CDN_URL,

TAAS_APP_URL: 'https://platform.topcoder-dev.com/taas',
DEFAULT_NDA_UUID: 'e5811a7b-43d1-407a-a064-69e5015b4900',
UNIVERSAL_NAV_URL: '//uni-nav.topcoder-dev.com/v1/tc-universal-nav.js',
HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`,
Expand Down
3 changes: 1 addition & 2 deletions connect-automation/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@
"accountAndSecurityUrl": "https://connect.topcoder-dev.com/settings/account",
"notificationsUrl": "https://connect.topcoder-dev.com/notifications",
"allProjectsUrl": "https://connect.topcoder-dev.com/projects",
"expiredProjectUrl": "https://connect.topcoder-dev.com/projects/17236",
"platformUrl": "https://platform.topcoder-dev.com/taas/myteams"
"expiredProjectUrl": "https://connect.topcoder-dev.com/projects/17236"
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ export class CreateProjectPageHelper {
await this.createProjectPageObject.submitJobRequest.click();
const message = await CommonHelper.getAlertMessageAndClosePopup();
expect(message).toContain(`PROJECT '${taasData.title.toUpperCase()}' CREATED`);

await this.createProjectPageObject.viewTalentRequestButton.click();
await CommonHelper.verifyPageUrl(ConfigHelper.getPlatformUrl());
}

private static createProjectPageObject: CreateProjectPageObject;
Expand Down Expand Up @@ -240,7 +237,7 @@ export class CreateProjectPageHelper {

await this.createProjectPageObject.skillsInput.click();
await CommonHelper.waitForListToGetLoaded('xpath', this.createProjectPageObject.multiSelectOptionClassName, 2);

const elements = await this.createProjectPageObject.multiSelectOption;
await elements[1].click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ export class CreateProjectPageObject {
return ElementHelper.getElementByButtonText('Submit job request');
}

/**
* Get view Talent Request button
*/
public get viewTalentRequestButton() {
return ElementHelper.getElementByCss('.go-to-project-dashboard-btn');
}

/**
* Get Current Form Page's title element
*/
Expand Down
7 changes: 0 additions & 7 deletions connect-automation/utils/config-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,4 @@ export const ConfigHelper = {
getExpiredProjectUrl(): string {
return this.getConfig().expiredProjectUrl;
},

/**
* Get platform URL
*/
getPlatformUrl(): string {
return this.getConfig().platformUrl;
},
};
28 changes: 9 additions & 19 deletions src/api/projectMembers.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,32 @@
import _ from 'lodash'
import { axiosInstance as axios } from './requestInterceptor'
import { TC_API_URL, PROJECTS_API_URL } from '../config/constants'

export function getMembersById (userIds) {
const _userIdArr = _.map(userIds, _id => `userId:${_id}`)
// only requesting certain member attributes
const fields = 'userId,handle,photoURL,details'
const query = _userIdArr.join(' OR ')
const url = `${TC_API_URL}/v3/members/_search/?fields=`
+ encodeURIComponent(fields)
+ `&query=${encodeURIComponent(query)}`
+ '&limit=' + userIds.length
const fields = 'userId,handle,photoURL,firstName,lastName'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me what all of these changes are related to -- can you fill me in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had to update our usage of the member API from v3 to v5, which was a separate problem. This was related to that change and just some slight differences between the versions.

const url = `${TC_API_URL}/v5/members?userIds=[${userIds.join(',')}]&fields=${encodeURIComponent(fields)}`
return axios.get(url)
.then(resp => {
return resp.data.result.content
return resp.data
})
}

export function getMembersByHandle (handles) {
const _handlesArr = _.map(handles, _handle => `handleLower:${_handle.toLowerCase()}`)
// only requesting certain member attributes
const fields = 'userId,handle,photoURL,details'
const query = _handlesArr.join(' OR ')
const url = `${TC_API_URL}/v3/members/_search/?fields=`
+ encodeURIComponent(fields)
+ `&query=${encodeURIComponent(query)}`
+ '&limit=' + handles.length
const fields = 'userId,handle,photoURL,firstName,lastName'
const quotedHandles = handles.map(handle => JSON.stringify(handle)).join(',')
const url = `${TC_API_URL}/v5/members?handles=[${quotedHandles}]&fields=${encodeURIComponent(fields)}`
return axios.get(url)
.then(resp => {
return resp.data.result.content
return resp.data
})
}

export function loadMemberSuggestions(value) {
const url = `${TC_API_URL}/v3/members/_suggest/${value}`
const url = `${TC_API_URL}/v5/members/autocomplete?term=${value}`
return axios.get(url)
.then(resp => {
return resp.data.result.content
return resp.data
})
}

Expand Down
49 changes: 0 additions & 49 deletions src/api/skills.js

This file was deleted.

19 changes: 19 additions & 0 deletions src/api/skills.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import _ from 'lodash'
import { TC_API_URL } from '../config/constants'
import { axiosInstance as axios } from './requestInterceptor'
import qs from 'query-string'


/**
* Api request for fetching skills
*
* @param {String} term search key
*
* @returns {Promise<*>}
*/
export const searchSkills = async (term) => {
const skills = await axios.get(`${TC_API_URL}/v5/standardized-skills/skills/autocomplete?${qs.stringify({
term
})}`)
return _.get(skills, 'data', [])
}
20 changes: 10 additions & 10 deletions src/api/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export function updateUserProfile(handle, updatedProfile, queryParams = {}) {
* @returns {Promise<Array>} member traits
*/
export const getMemberTraits = (handle) => {
return axios.get(`${TC_API_URL}/v3/members/${handle}/traits`)
.then(resp => _.get(resp.data, 'result.content', {}))
return axios.get(`${TC_API_URL}/v5/members/${handle}/traits`)
.then(resp => resp.data)
}

/**
Expand All @@ -76,10 +76,10 @@ export const getMemberTraits = (handle) => {
* @returns {Promise<Array>} member traits
*/
export const updateMemberTraits = (handle, updatedTraits) => {
return axios.put(`${TC_API_URL}/v3/members/${handle}/traits`, {
param: updatedTraits
})
.then(resp => _.get(resp.data, 'result.content', {}))
return axios.put(`${TC_API_URL}/v5/members/${handle}/traits`, (updatedTraits || []).map(traitInfo => {
return _.pick(traitInfo, ['categoryName', 'traitId', 'traits', ])
}))
.then(resp => resp.data)
}

/**
Expand All @@ -91,10 +91,10 @@ export const updateMemberTraits = (handle, updatedTraits) => {
* @returns {Promise<Array>} member traits
*/
export const createMemberTraits = (handle, traits) => {
return axios.post(`${TC_API_URL}/v3/members/${handle}/traits`, {
param: traits
})
.then(resp => _.get(resp.data, 'result.content', {}))
return axios.post(`${TC_API_URL}/v5/members/${handle}/traits`, (traits || []).map(traitInfo => {
return _.pick(traitInfo, ['categoryName', 'traitId', 'traits', ])
}))
.then(resp => resp.data)
}

/**
Expand Down
11 changes: 11 additions & 0 deletions src/components/Select/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import React from 'react'
import ReactSelect from 'react-select'
import CreatableSelect from 'react-select/lib/Creatable'
import Async from 'react-select/lib/Async'
import './Select.scss'

const Select = (props) => {
Expand All @@ -30,6 +31,16 @@ const Select = (props) => {
classNamePrefix="react-select"
/>
)
} else if (props.asyncOption) {
return (
<Async
{...props}
createOptionPosition="first"
className={containerclass}
classNamePrefix="react-select"
isClearable
/>
)
} else {
return (
<ReactSelect
Expand Down
5 changes: 0 additions & 5 deletions src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,11 +1134,6 @@ export const PROFILE_FIELDS_CONFIG = {
*/
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://platform.topcoder-dev.com/taas'

/**
* Milestone Types
*/
Expand Down
25 changes: 9 additions & 16 deletions src/projects/create/components/ProjectSubmitted.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,17 @@ import qs from 'query-string'

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

class ProjectSubmitted extends React.Component {
/**
* 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
getProjectUrl(projectId = '') {
return `${CONNECT_MAIN_PAGE_URL}/projects/${projectId}`
}

getPageConfiguration() {
Expand All @@ -45,12 +38,12 @@ In the meantime, get a jump on the process by inviting your coworkers to your pr
leftButton: {
header: 'All Projects',
subText: 'View all of your projects',
url: this.getProjectUrl(isTaas)
url: this.getProjectUrl()
},
rightButton: {
header: 'Go to Project',
subText: 'Invite your team members and share requirements',
url: this.getProjectUrl(isTaas, projectId)
url: this.getProjectUrl(projectId)
},
}

Expand All @@ -64,12 +57,12 @@ In the meantime, get a jump on the process by inviting your coworkers to your pr
leftButton: {
header: 'All Projects',
subText: 'View all of your projects',
url: this.getProjectUrl(false) // also showing link to Connect App Project List
url: this.getProjectUrl() // 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)
header: 'Go to Project',
subText: 'Invite your team members and share requirements',
url: this.getProjectUrl(projectId)
},
}

Expand Down
Loading