Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ Internal application used to administer specific support tasks related to the To

## Installation

To install npm and bower dependencies run:
To install npm dependencies run:

> npm install

Bower is set to run as a npm postinstall script.

## Configuration

The configuration is provided in `config.json` in the base directory.
Expand Down Expand Up @@ -64,13 +62,12 @@ Before executing the end-to-end (e2e) protractor tests, these environment variab

### Install global dependencies

```npm install -g gulp@3.8.10 bower```
```npm install -g gulp@3.8.10```

### Install project dependencies

```
npm install
bower install
```

### Start the Application
Expand Down
69 changes: 0 additions & 69 deletions bower.json

This file was deleted.

1 change: 0 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- 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:
Expand Down
40 changes: 40 additions & 0 deletions gulp/browserify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
var gulp = require('gulp');

var paths = gulp.paths;

var browserify = require('browserify');
var uglify = require('gulp-uglify');
var buffer = require('vinyl-buffer');
var source = require('vinyl-source-stream');
var gutil = require('gulp-util');
var fs = require('fs');

gulp.task('browserify', ['styles'], function () {

var cssFilePath = paths.tmp + '/serve/app/bundle.css';

//delete file if exist
if (fs.existsSync(cssFilePath)) {
fs.unlinkSync(cssFilePath);
}

browserify('./src/index.js')
.transform(require('browserify-css'), {
rootDir: 'src',
onFlush: function (options, done) {
fs.appendFileSync(cssFilePath, options.data);

// Do not embed CSS into a JavaScript bundle
done(null);
}
})
.bundle()
.on('error', function (e) {
gutil.log("Browserify Error", gutil.colors.red(e.message))
})
//Pass desired output filename to vinyl-source-stream
.pipe(source('bundle.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest(paths.tmp + '/serve/app'));
});
11 changes: 7 additions & 4 deletions gulp/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var gulp = require('gulp');
var paths = gulp.paths;

var $ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del']
pattern: ['gulp-*', 'uglify-save-license', 'del']
});

gulp.task('partials', function () {
Expand Down Expand Up @@ -46,7 +46,7 @@ gulp.task('html', ['inject', 'partials'], function () {
.pipe($.uglify({preserveComments: $.uglifySaveLicense}))
.pipe(jsFilter.restore())
.pipe(cssFilter)
.pipe($.replace('../bootstrap/fonts', 'fonts'))
.pipe($.replace(/\.?\.?\/node_modules\/\w+-?\/?\w+\/fonts\/?/g, '../fonts/'))
.pipe($.csso())
.pipe(cssFilter.restore())
.pipe(assets.restore())
Expand All @@ -69,15 +69,18 @@ gulp.task('images', function () {
});

gulp.task('fonts', function () {
return gulp.src($.mainBowerFiles())
return gulp.src([
"node_modules/bootstrap/dist/fonts/*.{eot,svg,ttf,woff}",
"node_modules/footable/css/fonts/*.{eot,svg,ttf,woff}"
])
.pipe($.filter('**/*.{eot,svg,ttf,woff}'))
.pipe($.flatten())
.pipe(gulp.dest(paths.dist + '/fonts/'))
.pipe(gulp.dest(paths.dist + '/styles/fonts/'));
});

gulp.task('fontawesome', function () {
return gulp.src('bower_components/font-awesome/fonts/*.{eot,svg,ttf,woff}')
return gulp.src('node_modules/font-awesome/fonts/*.{eot,svg,ttf,woff}')
.pipe(gulp.dest(paths.dist + '/fonts/'));
});

Expand Down
9 changes: 1 addition & 8 deletions gulp/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ var paths = gulp.paths;

var $ = require('gulp-load-plugins')();

var wiredep = require('wiredep').stream;

gulp.task('inject', ['styles'], function () {
gulp.task('inject', ['browserify'], function () {

var injectStyles = gulp.src([
paths.tmp + '/serve/{app,components}/**/*.css',
Expand All @@ -26,15 +25,9 @@ gulp.task('inject', ['styles'], function () {
addRootSlash: false
};

var wiredepOptions = {
directory: 'bower_components',
exclude: [/bootstrap\.js/, /bootstrap\.css/, /bootstrap\.css/, /foundation\.css/]
};

return gulp.src(paths.src + '/*.html')
.pipe($.inject(injectStyles, injectOptions))
.pipe($.inject(injectScripts, injectOptions))
.pipe(wiredep(wiredepOptions))
.pipe(gulp.dest(paths.tmp + '/serve'));

});
2 changes: 1 addition & 1 deletion gulp/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function browserSyncInit(baseDir, files, browser) {
var routes = null;
if(baseDir === paths.src || (util.isArray(baseDir) && baseDir.indexOf(paths.src) !== -1)) {
routes = {
'/bower_components': 'bower_components'
'/node_modules': 'node_modules'
};
}

Expand Down
2 changes: 1 addition & 1 deletion gulp/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gulp.task('styles', function () {

var lessOptions = {
paths: [
'bower_components',
'node_modules',
paths.src + '/app',
paths.src + '/components'
]
Expand Down
2 changes: 1 addition & 1 deletion gulp/unit-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var paths = gulp.paths;

function runTests (singleRun, done) {
var bowerDeps = wiredep({
directory: 'bower_components',
directory: 'node_modules',
exclude: ['bootstrap-sass-official'],
dependencies: true,
devDependencies: true
Expand Down
4 changes: 3 additions & 1 deletion gulp/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ var paths = gulp.paths;
gulp.task('watch', ['inject'], function () {
gulp.watch([
paths.src + '/*.html',
paths.src + '/*.css',
paths.src + '/*.js',
paths.src + '/{app,components}/**/*.less',
paths.src + '/{app,components}/**/*.js',
'bower.json'
'package.json'
], ['inject']);
});
45 changes: 40 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
{
"name": "support-admin-app",
"version": "2.3.0",
"dependencies": {},
"dependencies": {
"pace-js": "~1.0.2",
"angular": "~1.4.4",
"angular-animate": "~1.4.4",
"angular-ui-bootstrap": "~2.5.0",
"angular-clipboard": "~1.2.1",
"angular-cookies": "~1.4.4",
"angular-footable": "~0.0.3",
"angular-jwt": "~0.0.9",
"angular-moment": "~1.0.0-beta.3",
"angular-resource": "~1.4.4",
"angular-sanitize": "~1.4.4",
"angular-storage": "~0.0.11",
"angular-touch": "~1.4.4",
"angular-bootstrap-multiselect": "git+https://github.com/bentorfs/angular-bootstrap-multiselect.git#master",
"angular-ui-router": "~0.2.13",
"auth0-angular": "~4.0.4",
"auth0-js": "~6.4.2",
"auth0-lock": "~7.6.2",
"bootstrap": "~3.3.5",
"bootstrap-ui-datetime-picker": "^2.4.0",
"font-awesome": "~4.3.0",
"footable": "~2.0.3",
"icheck": "1.0.2",
"jquery": "~2.1.1",
"lodash": "~4.2.0",
"metismenu": "~2.0.2",
"moment": "~2.11.2",
"moment-timezone": "~0.5.0",
"ng-file-model": "~0.0.4"
},
"devDependencies": {
"bower": "~1.8.0",
"brfs": "1.4.3",
"browser-sync": "~2.18.8",
"browserify": "^9.0.3",
"browserify-css": "0.10.1",
"browserify-shim": "^3.8.10",
"chalk": "~0.5.1",
"del": "~2.2.2",
"ejsify": "1.0.0",
"gulp": "~3.8.10",
"gulp-angular-filesort": "~1.0.4",
"gulp-angular-templatecache": "~1.4.2",
Expand Down Expand Up @@ -35,17 +69,18 @@
"jasmine-core": "^2.5.2",
"jshint": "~2.9.4",
"jshint-stylish": "~1.0.0",
"main-bower-files": "~2.13.1",
"protractor": "~5.1.1",
"require-dir": "~0.1.0",
"uglify-save-license": "~0.4.1",
"wiredep": "~4.0.0"
"vinyl-buffer": "1.0.0",
"vinyl-source-stream": "1.1.0",
"wiredep": "~4.0.0",
"angular-mocks": "~1.4.4"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"postinstall": "bower install --config.interactive=false",
"clean": "gulp clean",
"build": "gulp build",
"start": "gulp publish",
Expand Down
35 changes: 34 additions & 1 deletion src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ angular.module('supportAdminApp', [
'app.constants',
'angular-clipboard',
'ng-file-model',
'ui.multiselect',
'btorfs.multiselect',
'ui.bootstrap.datetimepicker',
'angularMoment',
'angular-jwt'])
Expand Down Expand Up @@ -270,6 +270,39 @@ angular.module('supportAdminApp', [
data: { pageTitle: 'Edit Client' },
resolve: { auth: authenticate }
})
.state('index.groups', {
abstract: true,
url: '/groups',
templateUrl: 'app/groups/groups.html',
data: { pageTitle: 'Groups' },
controller: 'permissionmanagement.GroupsController'
})
.state('index.groups.list', {
url: '/list',
templateUrl: 'app/groups/groups.list.html',
controller: 'permissionmanagement.GroupsListController',
resolve: { auth: authenticate }
})
.state('index.groupmembers', {
abstract: true,
url: '/groupmembers/:groupId',
templateUrl: 'app/groupmembers/groupmembers.html',
data: { pageTitle: 'Group Members' },
controller: 'permissionmanagement.GroupMembersController'
})
.state('index.groupmembers.list', {
url: '/list',
templateUrl: 'app/groupmembers/groupmembers.list.html',
controller: 'permissionmanagement.GroupMembersListController',
resolve: { auth: authenticate }
})
.state('index.groupmembers.new', {
url: '/new',
templateUrl: 'app/groupmembers/groupmembers.new.html',
controller: 'permissionmanagement.GroupMembersNewController',
data: { pageTitle: 'Add Group Members' },
resolve: { auth: authenticate }
})
.state('index.billingaccounts', {
abstract: true,
url: '/billingaccounts',
Expand Down
19 changes: 19 additions & 0 deletions src/app/groupmembers/groupmembers.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

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

/**
* The parent controller for the groupmembers states
*/
module.controller('permissionmanagement.GroupMembersController', ['$scope', 'AuthService', '$state',
function ($scope, $authService, $state) {
$scope.$state = $state;

/**
* Validate the user authentication
*/
$scope.authorized = function() {
return $authService.isLoggedIn();
};
}
]);
Loading