Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 585c18d

Browse files
authored
Revert "Member Stats for Private Crowd Members"
1 parent b0ebeea commit 585c18d

File tree

6 files changed

+84
-96
lines changed

6 files changed

+84
-96
lines changed

.circleci/config.yml

Lines changed: 74 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,103 @@
11
version: 2
22

3-
# node image to run aws utilities
4-
node_env: &node_env
3+
# Python image to run aws utilities
4+
python_env: &python_env
55
docker:
6-
- image: circleci/node:8.16.0-jessie-browsers
6+
- image: circleci/python:2.7-stretch-browsers
77

8-
install_deploysuite: &install_deploysuite
9-
name: Installation of install_deploysuite.
8+
# Instructions of installing aws utilities
9+
install_awscli: &install_awscli
10+
name: "Install awscli"
1011
command: |
11-
git clone --branch v1.4.2 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
12-
cp ./../buildscript/master_deploy.sh .
13-
cp ./../buildscript/buildenv.sh .
14-
cp ./../buildscript/awsconfiguration.sh .
12+
sudo pip install awscli awsebcli --upgrade
13+
aws --version
14+
eb --version
1515
16-
install_build_dependencies: &install_build_dependencies
17-
name: Install g++-4.8 and Install node-5.12.0
18-
command: |
19-
sudo apt-get update -y
20-
sudo apt-get install g++-4.8 -y
21-
sudo apt-get install python-pip -y
22-
sudo pip install awscli --upgrade
23-
sudo apt install jq -y
24-
sudo apt install phantomjs -y
25-
aws --version
26-
27-
build_npm_steps: &build_npm_steps
28-
name: "configuring environment building environment"
29-
command: |
30-
./awsconfiguration.sh $DEPLOY_ENV
31-
source awsenvconf
32-
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
33-
source buildenvvar
34-
npm rebuild node-sass
35-
npm run lint && npm run build
36-
#npm test
37-
38-
build_deploy_steps: &build_deploy_steps
39-
- run: *install_build_dependencies
40-
- checkout
41-
- run: *install_deploysuite
42-
- restore_cache:
43-
key: node-modules-{{ checksum "package-lock.json" }}
44-
- run: npm install
45-
- save_cache:
46-
key: node-modules-{{ checksum "package-lock.json" }}
47-
paths:
48-
- node_modules
49-
- run: *build_npm_steps
16+
# Instructinos of deployment
17+
deploy_steps: &deploy_steps
18+
- attach_workspace:
19+
at: .
20+
- run: *install_awscli
5021
- setup_remote_docker
51-
- deploy:
52-
name: Running MasterScript.
53-
command: |
54-
# ./deploy.sh $DEPLOY_ENV
55-
# ./awsconfiguration.sh $DEPLOY_ENV
56-
source awsenvconf
57-
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
58-
source buildenvvar
59-
./master_deploy.sh -d CFRONT -e $DEPLOY_ENV -c true
22+
- run: ./deploy.sh $DEPLOY_ENV
23+
6024

6125
jobs:
62-
63-
build_deploy_dev:
64-
<<: *node_env
26+
build:
27+
machine: true
6528
environment:
6629
CXX: g++-4.8
67-
DEPLOY_ENV: "DEV"
68-
LOGICAL_ENV: "dev"
69-
APPNAME: "topcoder-app"
70-
steps: *build_deploy_steps
30+
steps:
31+
- run:
32+
name: Install g++-4.8
33+
command: |
34+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
35+
sudo apt-get update -y
36+
sudo apt-get install g++-4.8 -y
37+
- run:
38+
name: Install node-5.12.0
39+
command: |
40+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | sudo bash
41+
source ~/.bashrc
42+
nvm install 5.12.0
43+
node --version
44+
npm --version
45+
nvm --version
46+
47+
- checkout
48+
- restore_cache:
49+
key: node-modules-{{ checksum "package-lock.json" }}
50+
- run: npm install
51+
- save_cache:
52+
key: node-modules-{{ checksum "package-lock.json" }}
53+
paths:
54+
- node_modules
55+
- run: ls node_modules/*
56+
- run: npm run lint && npm run build
57+
- run: npm test
58+
- persist_to_workspace:
59+
root: .
60+
paths:
61+
- ./
7162

72-
build_deploy_prod:
73-
<<: *node_env
63+
deploy_prod:
64+
<<: *python_env
7465
environment:
75-
CXX: g++-4.8
7666
DEPLOY_ENV: "PROD"
77-
LOGICAL_ENV: "prod"
78-
APPNAME: "topcoder-app"
79-
steps: *build_deploy_steps
67+
steps: *deploy_steps
8068

81-
build_deploy_qa:
82-
<<: *node_env
69+
deploy_dev:
70+
<<: *python_env
8371
environment:
84-
CXX: g++-4.8
85-
DEPLOY_ENV: "QA"
86-
LOGICAL_ENV: "qa"
87-
APPNAME: "topcoder-app"
88-
steps: *build_deploy_steps
72+
DEPLOY_ENV: "DEV"
73+
steps: *deploy_steps
8974

75+
deploy_qa:
76+
<<: *python_env
77+
environemtn:
78+
DEPLOY_ENV: "QA"
79+
steps: *deploy_steps
9080

9181
workflows:
9282
version: 2
9383
build-and-deploy:
9484
jobs:
95-
- build_deploy_dev:
96-
context : org-global
85+
- build
86+
- deploy_dev:
9787
filters:
9888
branches:
9989
only: [ dev, dev-circleci2 ]
100-
- build_deploy_qa:
101-
context : org-global
90+
requires:
91+
- build
92+
- deploy_prod:
10293
filters:
10394
branches:
104-
only: qa-integration
105-
- build_deploy_prod:
106-
context : org-global
95+
only: master
96+
requires:
97+
- build
98+
- deploy_qa:
10799
filters:
108100
branches:
109-
only: master
110-
101+
only: qa-integration
102+
requires:
103+
- build

app/profile/profile.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Profile Controller', function() {
1818

1919
var profileService = {
2020
getUserStats: function() {
21-
return $q.when({result: {content: [mockStats]}})
21+
return $q.when({result: {content: mockStats}})
2222
},
2323
getUserSkills: function() {
2424
return $q.when({result: {content: mockSkills}})

app/services/profile.service.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,11 @@ import _ from 'lodash'
8080
}
8181

8282
function getUserStats(username) {
83-
return restangular.one('members', username).one('stats').get({ groupIds: CONSTANTS.DEFAULT_GROUP_ID }).then(function(data) {
84-
var stats = {}
85-
if (Array.isArray(data) && data.length) {
86-
stats = data[0]
87-
if (!stats.DEVELOP) stats.DEVELOP = {challenges: 0, wins: 0, subTracks: []}
88-
if (!stats.DESIGN) stats.DESIGN = {challenges: 0, wins: 0, subTracks: []}
89-
if (!stats.DATA_SCIENCE) stats.DATA_SCIENCE = {challenges: 0, wins: 0, SRM: {}, MARATHON_MATCH: {}}
90-
}
91-
return stats
83+
return restangular.one('members', username).one('stats').get().then(function(data) {
84+
if (data && !data.DEVELOP) data.DEVELOP = {challenges: 0, wins: 0, subTracks: []}
85+
if (data && !data.DESIGN) data.DESIGN = {challenges: 0, wins: 0, subTracks: []}
86+
if (data && !data.DATA_SCIENCE) data.DATA_SCIENCE = {challenges: 0, wins: 0, SRM: {}, MARATHON_MATCH: {}}
87+
return data
9288
})
9389
}
9490

app/services/profile.service.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ describe('Profile Service', function() {
2020
.respond(200, {result: {content: mockProfile}})
2121
// mock stats
2222
$httpBackend
23-
.when('GET', apiUrl + '/members/rakesh/stats/?groupIds=' + CONSTANTS.DEFAULT_GROUP_ID)
24-
.respond(200, {result: {content: [mockStats]}})
23+
.when('GET', apiUrl + '/members/rakesh/stats/')
24+
.respond(200, {result: {content: mockStats}})
2525

2626
})
2727

app/topcoder.constants.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,5 @@ angular.module('CONSTANTS', []).constant('CONSTANTS', {
4747
'STATUS_COMPLETED_WITHOUT_WIN' : 'Completed Without Win',
4848
'CHALLENGES_LOADING_CHUNK' : 36,
4949
'INFINITE_SCROLL_OFFSET' : '400', // footer is 300px and challenge tile is 400px
50-
'VIDEO_DEFAULT_HEIGHT': 360,
51-
'DEFAULT_GROUP_ID': 10
50+
'VIDEO_DEFAULT_HEIGHT': 360
5251
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"restangular": "1.6.1",
7474
"tc-accounts": "https://github.com/appirio-tech/accounts-app.git#0.0.7",
7575
"tc-angular-ellipsis": "0.1.6",
76-
"topcoder-app-r": "https://github.com/appirio-tech/topcoder-app-r.git#0.0.2",
76+
"topcoder-app-r": "https://github.com/appirio-tech/topcoder-app-r.git#0.0.1",
7777
"xml2js": "0.4.17",
7878
"zepto": "1.0.1",
7979
"estraverse": "4.1.0",

0 commit comments

Comments
 (0)