Skip to content

Commit

Permalink
various changes
Browse files Browse the repository at this point in the history
  • Loading branch information
edencoder committed Apr 9, 2020
1 parent 5ede20d commit 2e1ae9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
26 changes: 9 additions & 17 deletions bundles/grid/helpers/grid.js → bundles/grid/helpers/grid.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Require local class dependencies
const xl = require('excel4node');
const uuid = require('uuid');
const Helper = require('helper');
const moment = require('moment');
const toText = require('html-to-text');
const dotProp = require('dot-prop');
const json2csv = require('json2csv');
import xl from 'excel4node';
import uuid from 'uuid';
import Helper from 'helper';
import moment from 'moment';
import toText from 'html-to-text';
import dotProp from 'dot-prop';
import json2csv from 'json2csv';


// require models
Expand All @@ -14,7 +14,7 @@ const Grid = model('grid');
/**
* Create Grid Helper class
*/
class GridHelper extends Helper {
export default class GridHelper extends Helper {
/**
* Construct Grid Helper class
*
Expand Down Expand Up @@ -148,7 +148,6 @@ class GridHelper extends Helper {
['where', 'match', 'eq', 'ne', 'or', 'and', 'elem', 'in', 'nin', 'gt', 'lt', 'gte', 'lte'].forEach((method) => {
// Create new function
this[method] = (...args) => {
// Set where
// eslint-disable-next-line no-return-assign
return this.__query = this.__query[method](...args);
};
Expand Down Expand Up @@ -799,11 +798,4 @@ class GridHelper extends Helper {
// returns true if object
return (item && typeof item === 'object' && !Array.isArray(item));
}
}

/**
* Export new Grid Helper instance
*
* @type {GridHelper}
*/
module.exports = GridHelper;
}
12 changes: 3 additions & 9 deletions bundles/grid/models/grid.js → bundles/grid/models/grid.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

// import dependencies
const Model = require('model');
import Model from 'model';

/**
* create user class
*/
class Grid extends Model {
export default class Grid extends Model {
/**
* sanitises placement
*
Expand All @@ -17,10 +17,4 @@ class Grid extends Model {
id : this.get('_id') ? this.get('_id').toString() : null,
};
}
}

/**
* export user class
* @type {user}
*/
module.exports = Grid;
}
2 changes: 1 addition & 1 deletion bundles/grid/public/js/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Events = require('events');
const dotProp = require('dot-prop');

// Require live model
const EdenModel = require('model/public/js/model');
const EdenModel = require('sync/public/js/model');

/**
* create grid store
Expand Down

0 comments on commit 2e1ae9f

Please sign in to comment.