Skip to content

Commit 3256977

Browse files
committed
merge dev branch
2 parents b0068b7 + 7aa434e commit 3256977

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1232
-135
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Install dependencies by running the following in the root of the project:
2929
- **Note:** You must use npm 3. Type `npm -v` to ensure you have a 3.x version.
3030

3131
## NPM Commands
32-
- To run locally, run `npm start` and head to `http://localhost:3000/search/challenges`
32+
- To run locally, run `npm start` and head to `http://localhost:3000/new_project`
3333
- Run tests with `npm test` or use `npm run test:watch` to rerun tests after files change
3434
- To make sure your code passes linting: `npm run lint`
3535
- To create the build: `npm run build`

circle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
machine:
22
node:
3-
version: 5.5.0
3+
version: 6.11.2
44
environment:
55
CXX: g++-4.8
66

@@ -19,7 +19,7 @@ compile:
1919

2020
deployment:
2121
development:
22-
branch: dev
22+
branch: [dev]
2323
owner: appirio-tech
2424
commands:
2525
- ./deploy.sh DEV

deploy.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ deploy_s3bucket() {
2121
cat dist/app.2e9868372e0e2992d5d2.css
2222
#aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control private,no-store,no-cache,must-revalidate,max-age=0
2323
#result=`aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control private,no-store,no-cache,must-revalidate,max-age=0`
24-
aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*.txt" --exclude "*.js" --exclude "*.map" --exclude "*.css"
25-
result=`aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*.txt" --exclude "*.js" --exclude "*.map" --exclude "*.css"`
24+
aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*.txt" --exclude "*.js" --exclude "*.css"
25+
result=`aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*.txt" --exclude "*.js" --exclude "*.css"`
2626
if [ $? -eq 0 ]; then
2727
#echo $result
28-
echo "All html, font, image and media files are Deployed without gzip encoding!"
28+
echo "All html, font, image, map and media files are Deployed without gzip encoding!"
2929
else
3030
echo "Deployment Failed - $result"
3131
exit 1
3232
fi
3333
#result=`aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control private,no-store,no-cache,must-revalidate,max-age=0`
34-
aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*" --include "*.txt" --include "*.js" --include "*.map" --include "*.css" --content-encoding gzip
35-
result=`aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*" --include "*.txt" --include "*.js" --include "*.map" --include "*.css" --content-encoding gzip`
34+
aws s3 sync --dryrun ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*" --include "*.txt" --include "*.js" --include "*.css" --content-encoding gzip
35+
result=`aws s3 sync ${HOME}/${CIRCLE_PROJECT_REPONAME}/dist s3://${AWS_S3_BUCKET} --cache-control max-age=0,s-maxage=86400 --exclude "*" --include "*.txt" --include "*.js" --include "*.css" --content-encoding gzip`
3636
if [ $? -eq 0 ]; then
3737
#echo $result
38-
echo "All css, js, and map files are Deployed! with gzip"
38+
echo "All txt, css, and js files are Deployed! with gzip"
3939
else
4040
echo "Deployment Failed - $result"
4141
exit 1

npm-shrinkwrap.json

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Customer pages in React and Redux",
55
"scripts": {
66
"start": "webpack-dev-server --history-api-fallback --dev --hot --inline --progress --tc --port 3000 --host 0.0.0.0",
7-
"build": "webpack --bail --progress --build --tc",
7+
"build": "npm rebuild node-sass; webpack --bail --progress --build --tc",
88
"lint": "eslint --fix --format table --ext .js,.jsx .",
99
"test": "cross-env NODE_ENV=test mocha --colors --reporter nyan --compilers js:babel-core/register --require ignore-styles --recursive \"./src/**/*.spec.js\"",
1010
"test:watch": "watch-run -i -p 'src/**/*' npm run test"
@@ -44,6 +44,7 @@
4444
"draft-js-link-plugin": "^1.2.2",
4545
"draft-js-plugins-editor": "^2.0.0-rc2",
4646
"draft-js-utils": "^0.1.7",
47+
"coffeescript": "^1.12.7",
4748
"fbemitter": "^2.1.1",
4849
"fbjs": "^0.8.12",
4950
"filepicker-js": "^2.4.17",
@@ -56,10 +57,10 @@
5657
"linkify-it": "^2.0.3",
5758
"lodash": "^4.16.4",
5859
"moment": "^2.14.1",
60+
"query-string": "^4.3.4",
5961
"react": "^15.6.1",
6062
"react-addons-css-transition-group": "^15.6.0",
6163
"react-addons-pure-render-mixin": "^15.6.0",
62-
"query-string": "^4.3.4",
6364
"react-color": "^2.13.1",
6465
"react-datetime": "2.7.1",
6566
"react-dom": "^15.6.1",

src/api/projectMembers.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import _ from 'lodash'
22
import { axiosInstance as axios } from './requestInterceptor'
3-
import { TC_API_URL } from '../config/constants'
3+
import { TC_API_URL, CONNECT_MESSAGE_API_URL } from '../config/constants'
44

55
export function getMembersById (userIds) {
66
const _userIdArr = _.map(userIds, _id => `userId:${_id}`)
@@ -29,7 +29,9 @@ export function addProjectMember(projectId, newMember) {
2929
const url = `${TC_API_URL}/v4/projects/${projectId}/members/`
3030
return axios.post(url, { param: newMember})
3131
.then(resp => {
32-
return resp.data.result.content
32+
return axios.put(`${CONNECT_MESSAGE_API_URL}/v4/topics/syncUsers`,
33+
{ reference: 'project', referenceId: projectId })
34+
.then(() => resp.data.result.content)
3335
})
3436
}
3537

@@ -42,11 +44,23 @@ export function updateProjectMember(projectId, memberId, updatedProps) {
4244
})
4345
}
4446

45-
export function removeProjectMember(projectId, memberId) {
47+
export function removeProjectMember(projectId, memberId, isUserLeaving) {
4648
const url = `${TC_API_URL}/v4/projects/${projectId}/members/${memberId}/`
47-
return axios.delete(url)
48-
.then(resp => { // eslint-disable-line no-unused-vars
49-
// return the member id just removed
50-
return memberId
49+
let promise = { then: fn => fn() }
50+
if (isUserLeaving) {
51+
promise = axios.put(`${CONNECT_MESSAGE_API_URL}/v4/topics/syncUsers`,
52+
{ reference: 'project', referenceId: projectId, isUserLeaving })
53+
}
54+
return promise.then(() => {
55+
return axios.delete(url)
56+
.then(() => {
57+
if (!isUserLeaving) {
58+
return axios.put(`${CONNECT_MESSAGE_API_URL}/v4/topics/syncUsers`,
59+
{ reference: 'project', referenceId: projectId })
60+
.then(() => memberId)
61+
}
62+
// return the member id just removed
63+
return memberId
64+
})
5165
})
5266
}

src/api/projects.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,23 @@ export function updateProject(projectId, updatedProps) {
6363

6464

6565
export function createProject(projectProps) {
66+
// Phase out discussions
67+
// TODO: Remove this once none of the active projects
68+
// have the discussions tab enabled
69+
projectProps.details.hideDiscussions = true
70+
6671
return axios.post(`${TC_API_URL}/v4/projects/`, { param: projectProps })
6772
.then( resp => {
6873
return _.get(resp.data, 'result.content', {})
6974
})
7075
}
7176

7277
export function createProjectWithStatus(projectProps, status) {
78+
// Phase out discussions
79+
// TODO: Remove this once none of the active projects
80+
// have the discussions tab enabled
81+
projectProps.details.hideDiscussions = true
82+
7383
return axios.post(`${TC_API_URL}/v4/projects/`, { param: projectProps })
7484
.then( resp => {
7585
return _.get(resp.data, 'result.content', {})
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 27 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)