Skip to content

Commit

Permalink
Merge pull request #566 from jniles/refactor-lib-database
Browse files Browse the repository at this point in the history
(refactor) lib/db.js into es6 classes
  • Loading branch information
sfount authored Jul 18, 2016
2 parents 189659f + 9e1fca9 commit 28db945
Show file tree
Hide file tree
Showing 9 changed files with 344 additions and 280 deletions.
10 changes: 4 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ const gulpif = require('gulp-if');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const cssnano = require('gulp-cssnano');
const flatten = require('gulp-flatten');
const path = require('path');
const iife = require('gulp-iife');
const rimraf = require('rimraf');
const gutil = require('gulp-util');
Expand Down Expand Up @@ -123,7 +121,7 @@ var paths = {
* and writes them to the /bin/client/ folder. There are tasks to do
* the following:
* - [client-minify-css] minify (via css nano) the css
* - [client-compile-js] minify (via uglify) the clientside js code
* - [client-compile-js] minify (via uglify) the client-side js code
* - [client-lint-i18n] compares translation files for missing values
* - [client-mv-static] moves the static files (html, img) to the client
* folder
Expand Down Expand Up @@ -152,7 +150,7 @@ gulp.task('client-compile-vendor', function () {
});


// minify the client css styles via minifycss
// minify the client css styles via cssnano
// writes output to style.min.css
gulp.task('client-minify-css', function () {
return gulp.src(paths.client.css)
Expand All @@ -174,7 +172,7 @@ gulp.task('client-vendor-build-bootstrap', function () {
* This build process should compile the latest bhima less definition with the
* latest vendor files
* - move less file to bootstrap vendor folder
* - compile with lessc
* - compile with less
* - copy CSS into static file folder
*/

Expand Down Expand Up @@ -225,7 +223,7 @@ gulp.task('build-client', function () {
gulp.start('client-compile-js', 'client-compile-vendor', 'client-minify-css', 'client-mv-vendor-style', 'client-vendor-build-bootstrap', 'client-mv-static', 'notify-lint-process');
});

// Lint client code seperately from build process
// Lint client code separately from build process
// TODO Processes for linting server code - requires uncategorised commit update
gulp.task('lint', function () {
gulp.start('client-lint-js', 'client-lint-i18n');
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.1.1",
"gulp-flatten": "^0.3.0",
"gulp-if": "^2.0.0",
"gulp-iife": "^0.3.0",
"gulp-less": "^3.0.3",
Expand Down
5 changes: 0 additions & 5 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*
* @requires config/express
* @requires config/routes
* @requires db
* @requires PluginManager
*
* @license GPL-2.0
Expand All @@ -30,7 +29,6 @@ const fs = require('fs');
const https = require('https');
const express = require('express');
const winston = require('winston');
const db = require('./lib/db');

let app = express();

Expand Down Expand Up @@ -121,9 +119,6 @@ configureEnvironmentVariables();
configureLogger();
configureServer();

// configure the database for use within the application
db.initialise();

// Configure application middleware stack, inject authentication session
require('./config/express').configure(app);

Expand Down
6 changes: 3 additions & 3 deletions server/controllers/finance/cashboxes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ exports.currencies = currencies;
* to filter results appropriately.
*/
function list(req, res, next) {
let possibleConditions = ['project_id', 'is_auxiliary'],
providedConditions = Object.keys(req.query),
conditions = [];
const possibleConditions = ['project_id', 'is_auxiliary'];
const providedConditions = Object.keys(req.query);
const conditions = [];

let sql =
'SELECT id, label FROM cash_box ';
Expand Down
249 changes: 0 additions & 249 deletions server/lib/db.js

This file was deleted.

Loading

0 comments on commit 28db945

Please sign in to comment.