Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c4ba1fc
feat: Metadata migrated to Project Service v5
maxceem Oct 11, 2019
92ebb84
upgrade project api to v5
suppermancool Oct 11, 2019
c7d7c2d
fix lint error
suppermancool Oct 11, 2019
21a7539
upgrade /projects api
suppermancool Oct 14, 2019
e114fe4
update with feedback
suppermancool Oct 14, 2019
9a171fe
update some params
suppermancool Oct 14, 2019
7669609
fix input params
suppermancool Oct 14, 2019
1160c14
revert code
suppermancool Oct 14, 2019
522655d
remove redundant code
suppermancool Oct 14, 2019
97e7504
Merge pull request #3360 from suppermancool/v5-upgrade-diazz
maxceem Oct 14, 2019
ea4acb1
fix: get /timelines by reference/referenceId
maxceem Oct 14, 2019
67b9ecf
Merge branch 'dev' into v5-upgrade
maxceem Oct 17, 2019
4cfb5c0
Deploying v5 changes to separate env
Oct 21, 2019
88eb06b
feat: last endpoints updated to "v5"
maxceem Oct 29, 2019
ab151e8
fix: data from "v5" API not always have initiated optional fields
maxceem Nov 5, 2019
3d9056c
fix: lint
maxceem Nov 9, 2019
b2bd485
chore: timelines API use Project Service base API URL
maxceem Nov 11, 2019
d0764d9
Merge branch 'dev' into v5-upgrade
maxceem Nov 11, 2019
d0de553
Merge branch 'dev' into v5-upgrade
maxceem Nov 12, 2019
94d94a8
Deploying v5 upgrade to regular dev
Nov 19, 2019
5753955
fix: "Join Project" button with v5
maxceem Nov 22, 2019
6073de6
Revert "fix: "Join Project" button with v5"
maxceem Nov 28, 2019
86bcee0
fix: "Join Project" button with v5 using delay
maxceem Nov 28, 2019
c70e59f
Merge branch 'dev' into v5-upgrade
maxceem Nov 29, 2019
bd35b84
Merge branch 'dev' into v5-upgrade
maxceem Dec 2, 2019
863098e
Merge branch 'dev' into v5-upgrade
maxceem Dec 2, 2019
df64fde
feat: show loading indicator during copilot invite request approve/de…
maxceem Dec 2, 2019
c56801b
Merge branch 'dev' into v5-upgrade
maxceem Dec 3, 2019
bc0b638
Merge branch 'dev' into v5-upgrade
maxceem Dec 3, 2019
624dca1
Merge branch 'dev' into v5-upgrade
maxceem Dec 6, 2019
4981a53
Merge branch 'dev' into v5-upgrade
maxceem Dec 11, 2019
3afa74f
Merge branch 'dev' into v5-upgrade
maxceem Dec 11, 2019
888664e
chore: don't deploy "v5-upgrade" branch to DEV env, only to TEST env
maxceem Dec 11, 2019
efee1aa
Merge branch 'dev' into v5-upgrade
maxceem Dec 12, 2019
44234bb
Merge branch 'feature/member-list-redesign' into v5-upgrade-member-li…
maxceem Dec 13, 2019
c5047d2
feat: fix new member/invite endpoints to support v5
maxceem Dec 13, 2019
f0d3abd
Merge branch 'dev' into v5-upgrade
maxceem Dec 14, 2019
7e3fa64
Merge branch 'feature/member-list-redesign' into v5-upgrade-member-li…
maxceem Dec 14, 2019
859b39a
Merge branch 'feature/member-list-redesign' into v5-upgrade-member-li…
maxceem Dec 14, 2019
06e83be
Merge branch 'v5-upgrade' into v5-upgrade-member-list-redesign
maxceem Dec 14, 2019
6fe45eb
Merge pull request #3434 from appirio-tech/v5-upgrade-member-list-red…
maxceem Dec 14, 2019
90b73f5
Merge branch 'feature/member-list-redesign' into v5-upgrade-member-li…
maxceem Dec 16, 2019
b8802a6
Merge branch 'v5-upgrade-member-list-redesign' into v5-upgrade
maxceem Dec 16, 2019
386ae3e
Merge branch 'dev' into v5-upgrade
maxceem Dec 16, 2019
68c8286
Merge branch 'dev' into v5-upgrade
maxceem Dec 16, 2019
9034ae9
Merge branch 'dev' into v5-upgrade
maxceem Dec 16, 2019
73695d3
Merge branch 'dev' into v5-upgrade
maxceem Dec 17, 2019
d6d6835
Merge branch 'dev' into v5-upgrade
maxceem Dec 17, 2019
79eea7a
Merge branch 'dev' into v5-upgrade
maxceem Dec 17, 2019
79df139
fix: working hours/time zone output format
maxceem Dec 17, 2019
c59dd6b
Merge branch 'dev' into v5-upgrade
maxceem Dec 17, 2019
649c959
fix: reloading members/invites after accepting/declining copilot invi…
maxceem Dec 17, 2019
638b5ac
Merge branch 'dev' into v5-upgrade
maxceem Dec 17, 2019
f3a6f64
Merge pull request #3376 from appirio-tech/v5-upgrade
Dec 17, 2019
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
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ jobs:
LOGICAL_ENV: "dev"
steps: *deploy_steps

deployTest01:
<<: *deploy_defaults
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "test01"
steps: *deploy_steps

deployProd:
<<: *deploy_defaults
environment:
Expand Down Expand Up @@ -120,6 +127,14 @@ workflows:
branches:
only: ['dev', 'dev-msinteg']

- deployTest01:
context : org-global
requires:
- build-dev
filters:
branches:
only: ['v5-upgrade']

- deployProd:
context : org-global
requires:
Expand Down
2 changes: 1 addition & 1 deletion docs/LocalSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ psql messages coder -h local.topcoder-dev.com
And execute the following statement:

```sql
INSERT INTO "referenceLookups" (reference, endpoint, "createdAt", "updatedAt") VALUES ('project', 'https://api.topcoder-dev.com/v4/projects/{id}', now(), now());
INSERT INTO "referenceLookups" (reference, endpoint, "createdAt", "updatedAt") VALUES ('project', 'https://api.topcoder-dev.com/v5/projects/{id}', now(), now());
```


Expand Down
2 changes: 1 addition & 1 deletion src/api/orgConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { PROJECTS_API_URL } from '../config/constants'
* @returns {Promise<Object>} organization config data
*/
export function getOrgConfig(groupIds) {
return axios.get(`${PROJECTS_API_URL}/v4/projects/metadata/orgConfig?filter=orgId=in(${groupIds})`)
return axios.get(`${PROJECTS_API_URL}/v5/projects/metadata/orgConfig?orgId=${groupIds}`)
.then(resp => {
return _.get(resp.data, 'result.content', {})
})
Expand Down
41 changes: 19 additions & 22 deletions src/api/projectAttachments.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import _ from 'lodash'
import { axiosInstance as axios } from './requestInterceptor'
import { PROJECTS_API_URL, FILE_PICKER_SUBMISSION_CONTAINER_NAME } from '../config/constants'

export function addProjectAttachment(projectId, fileData) {
// add s3 bucket prop
fileData.s3Bucket = FILE_PICKER_SUBMISSION_CONTAINER_NAME
return axios.post(`${PROJECTS_API_URL}/v4/projects/${projectId}/attachments`, { param: fileData })
return axios.post(`${PROJECTS_API_URL}/v5/projects/${projectId}/attachments`, fileData)
.then( resp => {
resp.data.result.content.downloadUrl = `/projects/${projectId}/attachments/${resp.data.result.content.id}`
return _.get(resp.data, 'result.content', {})
resp.data.downloadUrl = `/projects/${projectId}/attachments/${resp.data.id}`
return resp.data
})
}

Expand All @@ -19,56 +18,54 @@ export function updateProjectAttachment(projectId, attachmentId, attachment) {
allowedUsers: null
}
}

return axios.patch(
`${PROJECTS_API_URL}/v4/projects/${projectId}/attachments/${attachmentId}`,
{ param: attachment })
`${PROJECTS_API_URL}/v5/projects/${projectId}/attachments/${attachmentId}`, attachment)
.then ( resp => {
resp.data.result.content.downloadUrl = `/projects/${projectId}/attachments/${attachmentId}`
return _.get(resp.data, 'result.content', {})
resp.data.downloadUrl = `/projects/${projectId}/attachments/${attachmentId}`
return resp.data
})
}

export function removeProjectAttachment(projectId, attachmentId) {
// return attachmentId so reducer knows which one to remove from list
return axios.delete(`${PROJECTS_API_URL}/v4/projects/${projectId}/attachments/${attachmentId}`)
return axios.delete(`${PROJECTS_API_URL}/v5/projects/${projectId}/attachments/${attachmentId}`)
.then(() => attachmentId)
}

export function getProjectAttachment(projectId, attachmentId) {
return axios.get(
`${PROJECTS_API_URL}/v4/projects/${projectId}/attachments/${attachmentId}`)
.then ( resp => resp.data.result.content.url )
`${PROJECTS_API_URL}/v5/projects/${projectId}/attachments/${attachmentId}`)
.then ( resp => resp.data.url )
}

export function addProductAttachment(projectId, phaseId, productId, fileData) {
// add s3 bucket prop
fileData.s3Bucket = FILE_PICKER_SUBMISSION_CONTAINER_NAME
return axios.post(`${PROJECTS_API_URL}/v4/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments`, { param: fileData })
return axios.post(`${PROJECTS_API_URL}/v5/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments`, fileData)
.then( resp => {
resp.data.result.content.downloadUrl = `/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${resp.data.result.content.id}`
return _.get(resp.data, 'result.content', {})
resp.data.downloadUrl = `/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${resp.data.id}`
return resp.data
})
}

export function updateProductAttachment(projectId, phaseId, productId, attachmentId, attachment) {
return axios.patch(
`${PROJECTS_API_URL}/v4/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`,
{ param: attachment })
`${PROJECTS_API_URL}/v5/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`, attachment)
.then ( resp => {
resp.data.result.content.downloadUrl = `/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`
return _.get(resp.data, 'result.content', {})
resp.data.downloadUrl = `/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`
return resp.data
})
}

export function removeProductAttachment(projectId, phaseId, productId, attachmentId) {
// return attachmentId so reducer knows which one to remove from list
return axios.delete(`${PROJECTS_API_URL}/v4/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`)
return axios.delete(`${PROJECTS_API_URL}/v5/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`)
.then(() => attachmentId)
}

export function getProductAttachment(projectId, phaseId, productId, attachmentId) {
return axios.get(
`${PROJECTS_API_URL}/v4/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`)
.then(resp => resp.data.result.content.url)
`${PROJECTS_API_URL}/v5/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`)
.then(resp => resp.data.url)
}
28 changes: 10 additions & 18 deletions src/api/projectMemberInvites.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import { PROJECTS_API_URL } from '../config/constants'
* @return {object} project member invite returned by api
*/
export function updateProjectMemberInvite(projectId, member) {
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/invite/`
return axios.put(url, { param: member})
.then(resp => {
return resp.data.result.content
})
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/invite/`
return axios.put(url, member)
.then(resp => resp.data)
}

/**
Expand All @@ -23,29 +21,25 @@ export function updateProjectMemberInvite(projectId, member) {
*/
export function createProjectMemberInvite(projectId, member) {
const fields = 'id,projectId,userId,email,role,status,createdAt,updatedAt,createdBy,updatedBy,handle,firstName,lastName,photoURL'
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/invite/?fields=` + encodeURIComponent(fields)
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/invite/?fields=` + encodeURIComponent(fields)
return axios({
method: 'post',
url,
data: {
param: member
},
data: member,
validateStatus (status) {
return (status >= 200 && status < 300) || status === 403
},
})
.then(resp => {
return resp.data.result.content
})
.then(resp => resp.data)
}

export function getProjectMemberInvites(projectId) {
const fields = 'id,projectId,userId,email,role,status,createdAt,updatedAt,createdBy,updatedBy,handle,firstName,lastName,photoURL'
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/invites/?fields=`
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/invites/?fields=`
+ encodeURIComponent(fields)
return axios.get(url)
.then( resp => {
return resp.data.result.content
return resp.data
})
}

Expand All @@ -55,8 +49,6 @@ export function getProjectMemberInvites(projectId) {
* @return {object} project member invite returned by api
*/
export function getProjectInviteById(projectId) {
return axios.get(`${PROJECTS_API_URL}/v4/projects/${projectId}/members/invite/`)
.then(resp => {
return resp.data.result.content
})
return axios.get(`${PROJECTS_API_URL}/v5/projects/${projectId}/members/invite/`)
.then(resp => resp.data)
}
24 changes: 11 additions & 13 deletions src/api/projectMembers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,24 @@ export function loadMemberSuggestions(value) {


export function addProjectMember(projectId, newMember) {
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/`
return axios.post(url, { param: newMember})
.then(resp => {
return resp.data.result.content
})
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/`
return axios.post(url, newMember)
.then(resp => resp.data)
}


export function updateProjectMember(projectId, memberId, updatedProps) {
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,firstName,lastName,photoURL,workingHourStart,workingHourEnd,timeZone'
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/${memberId}/?fields=`
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/${memberId}/?fields=`
+ encodeURIComponent(fields)
return axios.patch(url, { param: updatedProps })
return axios.patch(url, updatedProps)
.then(resp => {
return resp.data.result.content
return resp.data
})
}

export function removeProjectMember(projectId, memberId) {
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/${memberId}/`
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/${memberId}/`
return axios.delete(url)
.then(() => {
// return the member id just removed
Expand All @@ -71,20 +69,20 @@ export function removeProjectMember(projectId, memberId) {

export function getProjectMembers(projectId) {
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,firstName,lastName,photoURL,workingHourStart,workingHourEnd,timeZone'
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/?fields=`
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/?fields=`
+ encodeURIComponent(fields)
return axios.get(url)
.then( resp => {
return resp.data.result.content
return resp.data
})
}

export function getProjectMember(projectId, memberId) {
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,firstName,lastName,photoURL,workingHourStart,workingHourEnd,timeZone'
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/${memberId}?fields=`
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/${memberId}?fields=`
+ encodeURIComponent(fields)
return axios.get(url)
.then( resp => {
return resp.data.result.content
return resp.data
})
}
10 changes: 5 additions & 5 deletions src/api/projectReports.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { PROJECTS_API_URL } from '../config/constants'
*/
export function getProjectSummary(projectId) {

const summaryPromise = axios.get(`${PROJECTS_API_URL}/v4/projects/${projectId}/reports?reportName=summary`)
const budgetPromise = axios.get(`${PROJECTS_API_URL}/v4/projects/${projectId}/reports?reportName=projectBudget`)
const summaryPromise = axios.get(`${PROJECTS_API_URL}/v5/projects/${projectId}/reports?reportName=summary`)
const budgetPromise = axios.get(`${PROJECTS_API_URL}/v5/projects/${projectId}/reports?reportName=projectBudget`)

return Promise.all([summaryPromise, budgetPromise]).then(responses => {
const res = _.get(responses[0].data, 'result.content', {})
const res = responses[0].data
const designMetrics = _.find(res, c => c['challenge.track'] === 'Design') || {}
const totalRegistrants = _.sumBy(res, c => c['challenge.num_registrations'])

const res1 = _.get(responses[1].data, 'result.content', {})
const res1 = responses[1].data
const filterReport = c => `${c['project_stream.tc_connect_project_id']}` === projectId.toString()
const projectBudget = _.find(res1, filterReport) || {}

Expand All @@ -29,7 +29,7 @@ export function getProjectSummary(projectId) {
revenue: parseFloat(projectBudget['project_stream.total_invoiced_amount'] || 0),
remaining: parseFloat(projectBudget['project_stream.remaining_invoiced_budget'] || 0)
},
// null values will be filled in as back-end implementation/integration is done.
// null values will be filled in as back-end implementation/integration is done.
topcoderDifference: {
countries: null,
registrants: totalRegistrants,
Expand Down
Loading