Skip to content

Commit 98e25cf

Browse files
author
vikasrohit
authored
Merge pull request #3441 from appirio-tech/dev
Production Release 2.5
2 parents b31dff1 + f3a6f64 commit 98e25cf

File tree

21 files changed

+269
-264
lines changed

21 files changed

+269
-264
lines changed

.circleci/config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ jobs:
9090
LOGICAL_ENV: "dev"
9191
steps: *deploy_steps
9292

93+
deployTest01:
94+
<<: *deploy_defaults
95+
environment:
96+
DEPLOY_ENV: "DEV"
97+
LOGICAL_ENV: "test01"
98+
steps: *deploy_steps
99+
93100
deployProd:
94101
<<: *deploy_defaults
95102
environment:
@@ -120,6 +127,14 @@ workflows:
120127
branches:
121128
only: ['dev', 'dev-msinteg']
122129

130+
- deployTest01:
131+
context : org-global
132+
requires:
133+
- build-dev
134+
filters:
135+
branches:
136+
only: ['v5-upgrade']
137+
123138
- deployProd:
124139
context : org-global
125140
requires:

docs/LocalSetup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ psql messages coder -h local.topcoder-dev.com
3535
And execute the following statement:
3636

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

4141

src/api/orgConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { PROJECTS_API_URL } from '../config/constants'
1010
* @returns {Promise<Object>} organization config data
1111
*/
1212
export function getOrgConfig(groupIds) {
13-
return axios.get(`${PROJECTS_API_URL}/v4/projects/metadata/orgConfig?filter=orgId=in(${groupIds})`)
13+
return axios.get(`${PROJECTS_API_URL}/v5/projects/metadata/orgConfig?orgId=${groupIds}`)
1414
.then(resp => {
1515
return _.get(resp.data, 'result.content', {})
1616
})

src/api/projectAttachments.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import _ from 'lodash'
21
import { axiosInstance as axios } from './requestInterceptor'
32
import { PROJECTS_API_URL, FILE_PICKER_SUBMISSION_CONTAINER_NAME } from '../config/constants'
43

54
export function addProjectAttachment(projectId, fileData) {
65
// add s3 bucket prop
76
fileData.s3Bucket = FILE_PICKER_SUBMISSION_CONTAINER_NAME
8-
return axios.post(`${PROJECTS_API_URL}/v4/projects/${projectId}/attachments`, { param: fileData })
7+
return axios.post(`${PROJECTS_API_URL}/v5/projects/${projectId}/attachments`, fileData)
98
.then( resp => {
10-
resp.data.result.content.downloadUrl = `/projects/${projectId}/attachments/${resp.data.result.content.id}`
11-
return _.get(resp.data, 'result.content', {})
9+
resp.data.downloadUrl = `/projects/${projectId}/attachments/${resp.data.id}`
10+
return resp.data
1211
})
1312
}
1413

@@ -19,56 +18,54 @@ export function updateProjectAttachment(projectId, attachmentId, attachment) {
1918
allowedUsers: null
2019
}
2120
}
22-
21+
2322
return axios.patch(
24-
`${PROJECTS_API_URL}/v4/projects/${projectId}/attachments/${attachmentId}`,
25-
{ param: attachment })
23+
`${PROJECTS_API_URL}/v5/projects/${projectId}/attachments/${attachmentId}`, attachment)
2624
.then ( resp => {
27-
resp.data.result.content.downloadUrl = `/projects/${projectId}/attachments/${attachmentId}`
28-
return _.get(resp.data, 'result.content', {})
25+
resp.data.downloadUrl = `/projects/${projectId}/attachments/${attachmentId}`
26+
return resp.data
2927
})
3028
}
3129

3230
export function removeProjectAttachment(projectId, attachmentId) {
3331
// return attachmentId so reducer knows which one to remove from list
34-
return axios.delete(`${PROJECTS_API_URL}/v4/projects/${projectId}/attachments/${attachmentId}`)
32+
return axios.delete(`${PROJECTS_API_URL}/v5/projects/${projectId}/attachments/${attachmentId}`)
3533
.then(() => attachmentId)
3634
}
3735

3836
export function getProjectAttachment(projectId, attachmentId) {
3937
return axios.get(
40-
`${PROJECTS_API_URL}/v4/projects/${projectId}/attachments/${attachmentId}`)
41-
.then ( resp => resp.data.result.content.url )
38+
`${PROJECTS_API_URL}/v5/projects/${projectId}/attachments/${attachmentId}`)
39+
.then ( resp => resp.data.url )
4240
}
4341

4442
export function addProductAttachment(projectId, phaseId, productId, fileData) {
4543
// add s3 bucket prop
4644
fileData.s3Bucket = FILE_PICKER_SUBMISSION_CONTAINER_NAME
47-
return axios.post(`${PROJECTS_API_URL}/v4/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments`, { param: fileData })
45+
return axios.post(`${PROJECTS_API_URL}/v5/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments`, fileData)
4846
.then( resp => {
49-
resp.data.result.content.downloadUrl = `/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${resp.data.result.content.id}`
50-
return _.get(resp.data, 'result.content', {})
47+
resp.data.downloadUrl = `/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${resp.data.id}`
48+
return resp.data
5149
})
5250
}
5351

5452
export function updateProductAttachment(projectId, phaseId, productId, attachmentId, attachment) {
5553
return axios.patch(
56-
`${PROJECTS_API_URL}/v4/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`,
57-
{ param: attachment })
54+
`${PROJECTS_API_URL}/v5/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`, attachment)
5855
.then ( resp => {
59-
resp.data.result.content.downloadUrl = `/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`
60-
return _.get(resp.data, 'result.content', {})
56+
resp.data.downloadUrl = `/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`
57+
return resp.data
6158
})
6259
}
6360

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

7067
export function getProductAttachment(projectId, phaseId, productId, attachmentId) {
7168
return axios.get(
72-
`${PROJECTS_API_URL}/v4/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`)
73-
.then(resp => resp.data.result.content.url)
69+
`${PROJECTS_API_URL}/v5/projects/${projectId}/phases/${phaseId}/products/${productId}/attachments/${attachmentId}`)
70+
.then(resp => resp.data.url)
7471
}

src/api/projectMemberInvites.js

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ import { PROJECTS_API_URL } from '../config/constants'
88
* @return {object} project member invite returned by api
99
*/
1010
export function updateProjectMemberInvite(projectId, member) {
11-
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/invite/`
12-
return axios.put(url, { param: member})
13-
.then(resp => {
14-
return resp.data.result.content
15-
})
11+
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/invite/`
12+
return axios.put(url, member)
13+
.then(resp => resp.data)
1614
}
1715

1816
/**
@@ -23,29 +21,25 @@ export function updateProjectMemberInvite(projectId, member) {
2321
*/
2422
export function createProjectMemberInvite(projectId, member) {
2523
const fields = 'id,projectId,userId,email,role,status,createdAt,updatedAt,createdBy,updatedBy,handle,firstName,lastName,photoURL'
26-
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/invite/?fields=` + encodeURIComponent(fields)
24+
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/invite/?fields=` + encodeURIComponent(fields)
2725
return axios({
2826
method: 'post',
2927
url,
30-
data: {
31-
param: member
32-
},
28+
data: member,
3329
validateStatus (status) {
3430
return (status >= 200 && status < 300) || status === 403
3531
},
3632
})
37-
.then(resp => {
38-
return resp.data.result.content
39-
})
33+
.then(resp => resp.data)
4034
}
4135

4236
export function getProjectMemberInvites(projectId) {
4337
const fields = 'id,projectId,userId,email,role,status,createdAt,updatedAt,createdBy,updatedBy,handle,firstName,lastName,photoURL'
44-
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/invites/?fields=`
38+
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/invites/?fields=`
4539
+ encodeURIComponent(fields)
4640
return axios.get(url)
4741
.then( resp => {
48-
return resp.data.result.content
42+
return resp.data
4943
})
5044
}
5145

@@ -55,8 +49,6 @@ export function getProjectMemberInvites(projectId) {
5549
* @return {object} project member invite returned by api
5650
*/
5751
export function getProjectInviteById(projectId) {
58-
return axios.get(`${PROJECTS_API_URL}/v4/projects/${projectId}/members/invite/`)
59-
.then(resp => {
60-
return resp.data.result.content
61-
})
52+
return axios.get(`${PROJECTS_API_URL}/v5/projects/${projectId}/members/invite/`)
53+
.then(resp => resp.data)
6254
}

src/api/projectMembers.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,24 @@ export function loadMemberSuggestions(value) {
4242

4343

4444
export function addProjectMember(projectId, newMember) {
45-
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/`
46-
return axios.post(url, { param: newMember})
47-
.then(resp => {
48-
return resp.data.result.content
49-
})
45+
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/`
46+
return axios.post(url, newMember)
47+
.then(resp => resp.data)
5048
}
5149

5250

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

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

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

8280
export function getProjectMember(projectId, memberId) {
8381
const fields = 'id,userId,role,isPrimary,deletedAt,createdAt,updatedAt,deletedBy,createdBy,updatedBy,handle,firstName,lastName,photoURL,workingHourStart,workingHourEnd,timeZone'
84-
const url = `${PROJECTS_API_URL}/v4/projects/${projectId}/members/${memberId}?fields=`
82+
const url = `${PROJECTS_API_URL}/v5/projects/${projectId}/members/${memberId}?fields=`
8583
+ encodeURIComponent(fields)
8684
return axios.get(url)
8785
.then( resp => {
88-
return resp.data.result.content
86+
return resp.data
8987
})
9088
}

src/api/projectReports.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import { PROJECTS_API_URL } from '../config/constants'
99
*/
1010
export function getProjectSummary(projectId) {
1111

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

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

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

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

0 commit comments

Comments
 (0)