Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1e5a1f8
Test environment variables
gus-costa Apr 14, 2017
62207d4
Updated README
gus-costa Apr 14, 2017
9eb2d1e
README updates
gus-costa Apr 16, 2017
f929900
Merge pull request #65 from GSTVAC/dev
sah2ed Apr 16, 2017
e2a029d
throwing a warning if environment variables are not set when running …
gus-costa Apr 16, 2017
bd496bc
throwing an exception if environment variables are not set when runni…
gus-costa Apr 16, 2017
81e93c0
Merge remote-tracking branch 'upstream/dev' into dev
gus-costa Apr 16, 2017
34e3891
Merge pull request #66 from GSTVAC/dev
sah2ed Apr 17, 2017
dee96e4
roles management
huangqun May 15, 2017
5c9527e
Merge pull request #70 from huangqun/dev
ajefts May 15, 2017
935b664
adding deployment commands
ajefts May 15, 2017
3da5f75
Update circle.yml
ajefts May 15, 2017
77c2a25
updating circle ci and addign new deploy script
May 15, 2017
dbb0a0b
Merge pull request #1 from topcoder-platform/dev
huangqun May 16, 2017
8816f10
minor fixes
May 16, 2017
c2cf2c0
switching to dev branch
May 16, 2017
a23c31d
Merge branch 'feature/ci-deploy' into dev
May 16, 2017
7ce0a6f
Merge branch 'dev' of github.com:appirio-tech/admin-app into dev
May 16, 2017
a97f362
updating deploy script to include public read option
May 16, 2017
5916172
updating deploy scripts
May 16, 2017
b1c8f9f
Update circle.yml
ajefts May 17, 2017
e80cdb6
Update circle.yml
ajefts May 17, 2017
17a534c
Update circle.yml
ajefts May 17, 2017
242a065
Update circle.yml
ajefts May 17, 2017
e1b2d63
updating for circleci build
ajefts May 17, 2017
b1b788d
Update circle.yml
ajefts May 17, 2017
13440ea
Update circle.yml
ajefts May 17, 2017
63542a8
trial fix for build failure
huangqun May 18, 2017
73592ed
trial fix for build failure
huangqun May 18, 2017
acba791
trying to fix angular issue
ajefts May 18, 2017
0e45f78
Merge pull request #3 from topcoder-platform/dev
huangqun May 19, 2017
1c69145
challenge #30057836 - 72H ADMIN APP - REPLACE LOGIN IMPLEMENTATION
maxceem Jun 7, 2017
d2a386d
Cleared one more file from unnecessary changes
maxceem Jun 7, 2017
8c0e1a7
Merge pull request #5 from maxceem/replace-login2
huangqun Jun 7, 2017
96ff8e9
Merge pull request #71 from huangqun/dev
ajefts Jun 7, 2017
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
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![CircleCI](https://circleci.com/gh/topcoder-platform/admin-app.svg?style=svg)](https://circleci.com/gh/topcoder-platform/admin-app)
# support-admin-app
Support application

Expand Down Expand Up @@ -27,32 +28,36 @@ The following configuration parameters are available:

| Name | Description |
|--------------------------|---------------------------------|
| ES_PROJECT_API_URL | URL of the ES project API |
| API_URL | URL of the topcoder API |
| WORK_API_URL | URL of the topcoder work API |
| ADMIN_TOOL_URL | URL of the admin tool API |
| API_VERSION_PATH | Version of the API |
| AUTH0_CLIENT_ID | Client ID for Auth0 |
| AUTH0_DOMAIN | Domain for Auth0 authentication |
| AUTH0_TOKEN_NAME | Auth0 token name |
| AUTH0_REFRESH_TOKEN_NAME | Auth0 refresh token name |
| COOKIES_SECURE | If true the cookies set by this App will only be transmitted over secure protocols like https. |
| AUTH_URL | Url of Topcoder auth form |
| ACCOUNTS_CONNECTOR_URL | Url to TC account connector |
| JWT_V3_NAME | jwt V3 cookie name |
| JWT_V2_NAME | jwt V2 cookie name |

## Start the Application

As application uses Topcoder authorization we have to run it on the one of allowed domains. For development purposes we can use `local.topcoder-dev.com:3000`. So before run we have to add into `hosts` file the line `127.0.0.1 local.topcoder-dev.com`. Be aware, that we also have to run on the port `3000` to be able to authorize when run locally.

Simply execute the following command to start the app in development mode (with browsersync)
```
npm install
npm start
```
Application will be hosted and running at http://locahost:3000

To build the application to be hosted on a real webserver run:
```
npm run build
gulp build
gulp serve
```
Application will be hosted and running at http://local.topcoder-dev.com:3000.

## Execute E2E Tests

Before executing the end-to-end (e2e) protractor tests, these environment variables should be set:

| Name | Description | Default Value |
| --- | --- | --- |
| BUILD_ENV | Deployment configuration to be tested by e2e tests. | See [Configuration](#configuration) for possible values. Defaults to `dev`. |
| TEST_PORT | Port from which to serve the app for e2e tests. | Defaults to `3000`. |

```npm test```

## Fallback instruction in case the npm scripts fail
Expand Down
9 changes: 3 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"angular-sanitize": "~1.4.4",
"angular-resource": "~1.4.4",
"angular-ui-router": "~0.2.13",
"bootstrap": "~3.3.5",
"angular-bootstrap": "0.12.x",
"angular": "~1.4.4",
"PACE": "https://github.com/HubSpot/pace.git#~1.0.2",
"metisMenu": "~2.0.2",
Expand All @@ -23,17 +21,16 @@
"a0-angular-storage": "~0.0.11",
"angular-jwt": "~0.0.9",
"angular-footable": "~1.0.3",
"appirio-tech-ng-auth": "git://github.com/appirio-tech/ng-auth.git#3.2.10",
"appirio-tech-ng-login-reg": "0.x.x",
"appirio-tech-ng-api-services": "0.x.x",
"angular-clipboard": "~1.2.1",
"lodash": "~4.2.0",
"angular-moment": "~1.0.0-beta.3",
"moment": "~2.11.2",
"moment-timezone": "~0.5.0",
"ng-file-model": "https://github.com/mistralworks/ng-file-model.git#fd1889b28e279944012919574bbcaaf45c1540d6",
"bootstrap": "~3.3.5",
"angular-bootstrap-multiselect": "*",
"bootstrap-ui-datetime-picker": "^2.4.0"
"bootstrap-ui-datetime-picker": "^2.4.0",
"angular-bootstrap": "^2.5.0"
},
"overrides": {
"bootstrap": {
Expand Down
25 changes: 20 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,38 @@
machine:
node:
version: 6.8.1

# Add some environment variables
environment:
CIRCLE_ENV: dev


## Customize dependencies
dependencies:
pre:
- curl -s https://raw.githubusercontent.com/chronogolf/circleci-google-chrome/master/use_chrome_stable_version.sh | bash

override:
- rm -rf bower_components
- npm install

post:
- ./node_modules/gulp/bin/gulp.js clean
- ./node_modules/gulp/bin/gulp.js build
- ./node_modules/gulp/bin/gulp.js publish

compile:
override:
- npm run build
## - npm run build

test:
override:
- npm run test

deployment:
prod:
branch: master
commands:
- ./deploy.sh PROD admin.topcoder.com
dev:
branch: dev
commands:
- ./deploy.sh DEV admin.topcoder-dev.com
44 changes: 20 additions & 24 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
{
"local": {
"ES_PROJECT_API_URL": "http://127.0.0.1:8553",
"API_URL" : "https://127.0.0.1:8443",
"WORK_API_URL" : "https://127.0.0.1:8443",
"ADMIN_TOOL_URL" : "http://localhost:8080/api/v2",
"API_VERSION_PATH" : "v3",
"AUTH0_CLIENT_ID" : "JFDo7HMkf0q2CkVFHojy3zHWafziprhT",
"AUTH0_DOMAIN" : "127.0.0.1:8443",
"AUTH0_TOKEN_NAME" : "userJWTToken",
"AUTH0_REFRESH_TOKEN_NAME" : "userRefreshJWTToken"
"COOKIES_SECURE": false,
"AUTH_URL": "https://accounts.topcoder-dev.com/member",
"ACCOUNTS_CONNECTOR_URL": "https://accounts.topcoder-dev.com/connector.html",
"JWT_V3_NAME": "v3jwt",
"JWT_V2_NAME": "tcjwt"
},
"dev": {
"ES_PROJECT_API_URL": "https://internal-api.topcoder-dev.com",
"API_URL" : "https://api.topcoder-dev.com",
"WORK_API_URL" : "https://api-work.topcoder-dev.com",
"ADMIN_TOOL_URL" : "https://api.topcoder-dev.com/v2",
"API_VERSION_PATH" : "v3",
"AUTH0_CLIENT_ID" : "JFDo7HMkf0q2CkVFHojy3zHWafziprhT",
"AUTH0_DOMAIN" : "topcoder-dev.auth0.com",
"AUTH0_TOKEN_NAME" : "userJWTToken",
"AUTH0_REFRESH_TOKEN_NAME" : "userRefreshJWTToken"
"COOKIES_SECURE": false,
"AUTH_URL": "https://accounts.topcoder-dev.com/member",
"ACCOUNTS_CONNECTOR_URL": "https://accounts.topcoder-dev.com/connector.html",
"JWT_V3_NAME": "v3jwt",
"JWT_V2_NAME": "tcjwt"
},
"qa": {
"ES_PROJECT_API_URL": "https://internal-api.topcoder-qa.com",
"API_URL" : "https://api.topcoder-qa.com",
"WORK_API_URL" : "https://api-work.topcoder-qa.com",
"ADMIN_TOOL_URL" : "https://api.topcoder-qa.com/v2",
"API_VERSION_PATH" : "v3",
"AUTH0_CLIENT_ID" : "EVOgWZlCtIFlbehkq02treuRRoJk12UR",
"AUTH0_DOMAIN" : "topcoder-qa.auth0.com",
"AUTH0_TOKEN_NAME" : "userJWTToken",
"AUTH0_REFRESH_TOKEN_NAME" : "userRefreshJWTToken"
"COOKIES_SECURE": false,
"AUTH_URL": "https://accounts.topcoder-qa.com/member",
"ACCOUNTS_CONNECTOR_URL": "https://accounts.topcoder-qa.com/connector.html",
"JWT_V3_NAME": "v3jwt",
"JWT_V2_NAME": "tcjwt"
},
"prod": {
"API_URL" : "https://api.topcoder.com",
"WORK_API_URL" : "https://api-work.topcoder.com",
"ES_PROJECT_API_URL": "https://internal-api.topcoder.com",
"ADMIN_TOOL_URL" : "https://api.topcoder.com/v2",
"API_VERSION_PATH" : "v3",
"AUTH0_CLIENT_ID" : "6ZwZEUo2ZK4c50aLPpgupeg5v2Ffxp9P",
"AUTH0_DOMAIN" : "topcoder.auth0.com",
"AUTH0_TOKEN_NAME" : "userJWTToken",
"AUTH0_REFRESH_TOKEN_NAME" : "userRefreshJWTToken"
"COOKIES_SECURE": false,
"AUTH_URL": "https://accounts.topcoder.com/member",
"ACCOUNTS_CONNECTOR_URL": "https://accounts.topcoder.com/connector.html",
"JWT_V3_NAME": "v3jwt",
"JWT_V2_NAME": "tcjwt"
}
}
11 changes: 11 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash


echo "Deploying to S3"
ENV=$1
BUCKET_URL=$2
AWS_ACCESS_KEY_ID=$(eval "echo \$${ENV}_AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY=$(eval "echo \$${ENV}_AWS_SECRET_ACCESS_KEY")

# aws s3 sync dist s3://${BUCKET_URL} --acl public-read --delete
AWS_BUCKET=$BUCKET_URL AWS_KEY=$AWS_ACCESS_KEY_ID AWS_SECRET=$AWS_SECRET_ACCESS_KEY ./node_modules/.bin/gulp publish
15 changes: 2 additions & 13 deletions e2e/dashboard.spec.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
'use strict';

describe('The dashboard view', function () {
var page;
var mainPage;
var testPort = process.env.TEST_PORT || 3000;

beforeEach(function () {
browser.get('http://localhost:3000/');
page = require('./login.po');
browser.get('http://localhost:' + testPort + '/');
mainPage = require('./main.po');
page.usernameInput.sendKeys('amy_admin');
page.passwordInput.sendKeys('topcoder1');
page.loginButton.click();
});

it('should find members', function() {
mainPage.searchHandleInput.sendKeys('sah2ed');
mainPage.searchButton.click();
expect(mainPage.users.count()).toBe(1);
expect(mainPage.users.get(0).element(by.cssContainingText('td', 'sah2ed')).getText()).toBe('sah2ed');
});
});
22 changes: 0 additions & 22 deletions e2e/login.po.js

This file was deleted.

48 changes: 0 additions & 48 deletions e2e/login.spec.js

This file was deleted.

4 changes: 3 additions & 1 deletion gulp/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ function browserSyncInit(baseDir, files, browser) {
middleware: middleware,
routes: routes
},
browser: browser
browser: browser,
host: 'local.topcoder-dev.com',
open: 'external'
});
}

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"gulp-useref": "~1.0.2",
"http-proxy": "~1.7.0",
"jasmine-core": "^2.5.2",
"jshint":"~2.9.4",
"jshint": "~2.9.4",
"jshint-stylish": "~1.0.0",
"main-bower-files": "~2.13.1",
"protractor": "~5.1.1",
Expand All @@ -46,8 +46,9 @@
},
"scripts": {
"postinstall": "bower install --config.interactive=false",
"clean": "gulp clean",
"build": "gulp build",
"start": "gulp serve",
"start": "gulp publish",
"test": "gulp protractor"
}
}
2 changes: 1 addition & 1 deletion src/app/addmembers/add.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var module = angular.module('supportAdminApp');

module.controller('addmembers.AddMemberController', ['$log', '$scope', '$parse', 'AuthService', 'MemberService', function ($log, $scope, $parse, $authService, $memberService) {
module.controller('addmembers.AddMemberController', ['$log', '$scope', '$parse', 'MemberService', function ($log, $scope, $parse, $memberService) {

$scope.errors = [];
$scope.response = [];
Expand Down
Loading