Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #102 from broadinstitute/merged_production
Browse files Browse the repository at this point in the history
Production Release 5/26
  • Loading branch information
rushtong committed May 26, 2016
2 parents 0c1903e + 159f043 commit 7d22bda
Show file tree
Hide file tree
Showing 115 changed files with 2,404 additions and 878 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service-name: travis-pro
7 changes: 6 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@
"afterEach": false,
"module": false,
"inject": false
}
},
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"devel" : true,
"predef" : ["gapi", "google"]


}
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: node_js
node_js:
- 0.10
script:
- npm install -g wrench
- npm install -g gulp
- npm install -g bower
- bower install
- gulp build
after_script:
- node_modules/.bin/karma start karma.conf.js
- COVERALLS_SERVICE_NAME=travis-pro cat ./coverage/lcov.info | node_modules/coveralls/bin/coveralls.js && rm -rf coverage
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Consent-UI v1
=============

[![Build Status](https://travis-ci.com/broadinstitute/consent-ui.svg?token=3ve6QNemvC5zpJzsoKzf&branch=develop)](https://travis-ci.com/broadinstitute/consent-ui)

consent-ui is an angularJS application that requires consent-ws up and running
with some preloaded data: dacUser table at least or nobody will be able to log in.

Expand Down
2 changes: 1 addition & 1 deletion gulp/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ gulp.task('swagger', ['clean'], function () {
return gulp.src(['swagger/**/*'], {
base: 'swagger'
}).pipe(gulp.dest(conf.paths.dist + "/swagger"));
});;
});

gulp.task('clean', function (done) {
$.del([path.join(conf.paths.dist, '/'), path.join(conf.paths.tmp, '/')], done);
Expand Down
118 changes: 68 additions & 50 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,86 @@ var _ = require('lodash');
var wiredep = require('wiredep');

function listFiles() {
var wiredepOptions = _.extend({}, conf.wiredep, {
dependencies: true,
devDependencies: true
});

return wiredep(wiredepOptions).js
.concat([
path.join(conf.paths.src, '/app/**/*.module.js'),
path.join(conf.paths.src, '/app/**/*.js'),
path.join(conf.paths.src, '/**/*.spec.js'),
path.join(conf.paths.src, '/**/*.mock.js'),
path.join(conf.paths.src, '/**/*.html')
]);
var wiredepOptions = _.extend({}, conf.wiredep, {
dependencies: true,
devDependencies: true
});

return wiredep(wiredepOptions).js
.concat([
path.join(conf.paths.src, '/app/**/*.module.js'),
path.join(conf.paths.src, '/app/**/*.controller.js'),
path.join(conf.paths.src, '/app/components/**/*.module.js'),
path.join(conf.paths.src, '/app/components/**/*.service.js'),
path.join(conf.paths.src, '/**/*.spec.js'),
path.join(conf.paths.src, '/**/*.html')
]);
}

module.exports = function(config) {

var configuration = {
files: listFiles(),
var configuration = {
files: listFiles(),

singleRun: true,
exclude: [
path.join(conf.paths.src,'app/components/chart/*.js')
],

autoWatch: false,
singleRun: true,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,

frameworks: ['jasmine', 'angular-filesort'],
frameworks: ['jasmine', 'angular-filesort'],

angularFilesort: {
whitelist: [path.join(conf.paths.src, '/**/!(*.html|*.spec|*.mock).js')]
},
angularFilesort: {
whitelist: [path.join(conf.paths.src, '/**/!(*.html|*.spec|*.mock).js')]
},

ngHtml2JsPreprocessor: {
stripPrefix: 'src/',
moduleName: 'ConsentManagement'
},
ngHtml2JsPreprocessor: {
stripPrefix: 'src/',
moduleName: 'ConsentManagement'
},

browsers : ['PhantomJS'],
browsers : ['PhantomJS'],

plugins : [
'karma-jasmine',
'karma-angular-filesort',
'karma-phantomjs-launcher',
'karma-coverage',
'karma-ng-html2js-preprocessor'
],

reporters: ['progress', 'coverage'],

coverageReporter : {
type : 'lcov',
dir : 'coverage/',
subdir: '.'
},

preprocessors: {
'src/**/*.html': ['ng-html2js'],
'src/app/**/*.controller.js': ['coverage']
}

plugins : [
'karma-phantomjs-launcher',
'karma-angular-filesort',
'karma-jasmine',
'karma-ng-html2js-preprocessor'
],

preprocessors: {
'src/**/*.html': ['ng-html2js']
}
};

// This block is needed to execute Chrome on Travis
// If you ever plan to use Chrome and Travis, you can keep it
// If not, you can safely remove it
// https://github.com/karma-runner/karma/issues/1144#issuecomment-53633076
if(configuration.browsers[0] === 'Chrome' && process.env.TRAVIS) {
configuration.customLaunchers = {
'chrome-travis-ci': {
base: 'Chrome',
flags: ['--no-sandbox']
}
};
configuration.browsers = ['chrome-travis-ci'];
}

config.set(configuration);
// This block is needed to execute Chrome on Travis
// If you ever plan to use Chrome and Travis, you can keep it
// If not, you can safely remove it
// https://github.com/karma-runner/karma/issues/1144#issuecomment-53633076
if(configuration.browsers[0] === 'Chrome' && process.env.TRAVIS) {
configuration.customLaunchers = {
'chrome-travis-ci': {
base: 'Chrome',
flags: ['--no-sandbox']
}
};
configuration.browsers = ['chrome-travis-ci'];
}

config.set(configuration);
};
110 changes: 57 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,59 @@
{
"name": "ConsentManagement",
"version": "0.0.0",
"dependencies": {},
"scripts": {
"test": "gulp test"
},
"devDependencies": {
"gulp": "~3.9.0",
"gulp-autoprefixer": "~2.3.1",
"gulp-angular-templatecache": "~1.6.0",
"del": "~1.2.0",
"lodash": "~3.9.3",
"gulp-csso": "~1.0.0",
"gulp-filter": "~2.0.2",
"gulp-flatten": "~0.0.4",
"gulp-jshint": "~1.11.0",
"gulp-load-plugins": "~0.10.0",
"gulp-size": "~1.2.1",
"gulp-uglify": "~1.2.0",
"gulp-useref": "~1.2.0",
"gulp-util": "~3.0.5",
"gulp-ng-annotate": "~1.0.0",
"gulp-replace": "~0.5.3",
"gulp-rename": "~1.2.2",
"gulp-rev": "~5.0.0",
"gulp-rev-replace": "~0.4.2",
"gulp-minify-html": "~1.0.3",
"gulp-inject": "~1.3.1",
"gulp-protractor": "~1.0.0",
"gulp-sourcemaps": "~1.5.2",
"gulp-ng-config": "~1.2.1",
"gulp-angular-filesort": "~1.1.1",
"main-bower-files": "~2.8.0",
"merge-stream": "~0.1.7",
"jshint-stylish": "~2.0.0",
"wiredep": "~2.2.2",
"karma": "~0.12.36",
"karma-jasmine": "~0.3.5",
"karma-phantomjs-launcher": "~0.2.0",
"karma-angular-filesort": "~0.1.0",
"karma-ng-html2js-preprocessor": "~0.1.2",
"concat-stream": "~1.5.0",
"require-dir": "~0.3.0",
"browser-sync": "~2.7.12",
"browser-sync-spa": "~1.0.2",
"http-proxy-middleware": "~0.0.5",
"chalk": "~1.0.0",
"uglify-save-license": "~0.4.1",
"wrench": "~1.5.8"
},
"engines": {
"node": ">=0.10.0"
}
"name": "ConsentManagement",
"version": "0.0.0",
"dependencies": {
"coveralls": "^2.11.9"
},
"scripts": {
"test": "gulp test"
},
"devDependencies": {
"browser-sync": "~2.7.12",
"browser-sync-spa": "~1.0.2",
"chalk": "~1.0.0",
"concat-stream": "~1.5.0",
"del": "~1.2.0",
"gulp": "~3.9.0",
"gulp-angular-filesort": "~1.1.1",
"gulp-angular-templatecache": "~1.6.0",
"gulp-autoprefixer": "~2.3.1",
"gulp-csso": "~1.0.0",
"gulp-filter": "~2.0.2",
"gulp-flatten": "~0.0.4",
"gulp-inject": "~1.3.1",
"gulp-jshint": "~1.11.0",
"gulp-load-plugins": "~0.10.0",
"gulp-minify-html": "~1.0.3",
"gulp-ng-annotate": "~1.0.0",
"gulp-ng-config": "~1.2.1",
"gulp-protractor": "~1.0.0",
"gulp-rename": "~1.2.2",
"gulp-replace": "~0.5.3",
"gulp-rev": "~5.0.0",
"gulp-rev-replace": "~0.4.2",
"gulp-size": "~1.2.1",
"gulp-sourcemaps": "~1.5.2",
"gulp-uglify": "~1.2.0",
"gulp-useref": "~1.2.0",
"gulp-util": "~3.0.5",
"http-proxy-middleware": "~0.0.5",
"jshint-stylish": "~2.0.0",
"karma": "~0.12.36",
"karma-angular-filesort": "~0.1.0",
"karma-coverage": "^0.5.5",
"karma-jasmine": "~0.3.5",
"karma-ng-html2js-preprocessor": "~0.1.2",
"karma-phantomjs-launcher": "^1.0.0",
"lodash": "~3.9.3",
"main-bower-files": "~2.8.0",
"merge-stream": "~0.1.7",
"phantomjs-prebuilt": "^2.1.7",
"require-dir": "~0.3.0",
"uglify-save-license": "~0.4.1",
"wiredep": "~2.2.2",
"wrench": "~1.5.8"
},
"engines": {
"node": ">=0.10.0"
}
}
25 changes: 21 additions & 4 deletions src/app/admin-console/admin-console.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
vm.downloadUrl = apiUrl + "dataset/sample";
vm.dULUnreviewedCases = 0;
vm.dARUnreviewedCases = 0;
vm.setTimeout = setTimeout;
vm.addOntology = addOntology;

init();

function init() {
function init() {
cmPendingCaseService.findDARUnReviewed(vm);
cmPendingCaseService.findConsentUnReviewed(vm);
}
Expand Down Expand Up @@ -71,11 +71,11 @@
});
}

function setTimeout() {
vm.setTimeout = function setTimeout() {
cmElectionService.isDataSetElectionOpen().$promise.then(function (data) {
if(data.open === true){
$scope.alert = {};
$scope.alert.title = "The new election timeout value can not be updated because there are opened elections.";
$scope.alert.title = "Data Owner election Timeout value can't be updated because there are open elections.";
}else{
$scope.alert = null;
}
Expand All @@ -97,9 +97,26 @@


});
};

function addOntology() {

var modalInstance = $modal.open({
animation: false,
templateUrl: 'app/modals/add-ontologies/add-ontologies.html',
controller: 'AddOntologyModal',
controllerAs: 'AddOntologyModal',
resolve: {
ontologyTypes: function (cmOntologyService) {
return cmOntologyService.getOntologyTypes();
}
}
});

modalInstance.result.then(function () {
$state.go('manage_ontologies');
}, function () {
});
}

}
Expand Down
Loading

0 comments on commit 7d22bda

Please sign in to comment.