Skip to content

Commit

Permalink
Release 0.6.4
Browse files Browse the repository at this point in the history
Merge pull request #175 from vrlkacha/0.6.4-nd
  • Loading branch information
vrlk authored Jul 13, 2016
2 parents cbfab5e + fd73bee commit 00d846d
Show file tree
Hide file tree
Showing 47 changed files with 4,313 additions and 1,093 deletions.
38 changes: 38 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"version": "0.1.0",
"configurations": [
{
"name": "Automint Electron App",
"type": "node",
"program": "${workspaceRoot}/src/main.js",
"stopOnEntry": false,
"args": [],
"runtimeExecutable": "/usr/local/bin/electron",
"runtimeArgs": [
".",
"--enable-logging"
],
"cwd": "${workspaceRoot}/src",
"request": "launch",
"env": {},
"externalConsole": false,
"sourceMaps": false,
"outDir": null
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"sourceMaps": false,
"outDir": null
},
{
"name": "Chrome Debugger",
"type": "chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true
}
]
}
10 changes: 10 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "electron",
"isShellCommand": true,
"args": [
"src"
]
}
8 changes: 4 additions & 4 deletions pkg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
},
"devDependencies": {
"del": "^2.2.0",
"electron-builder": "^3.25.0",
"electron-builder": "^5.11.1",
"electron-prebuilt": "^1.1.3",
"gulp": "^3.9.1",
"gulp-clean-css": "^2.0.6",
"gulp-htmlmin": "^1.3.0",
"gulp-imagemin": "^2.4.0",
"gulp-htmlmin": "^2.0.0",
"gulp-imagemin": "^3.0.1",
"gulp-jsonminify": "^1.0.0",
"gulp-minify-inline": "^0.2.0",
"gulp-size": "^2.1.0",
"gulp-uglify": "^1.5.3",
"imagemin-pngquant": "^4.2.2",
"imagemin-pngquant": "^5.0.0",
"main-bower-files": "^2.13.0",
"rimraf": "^2.5.2",
"run-sequence": "^1.1.5"
Expand Down
7 changes: 4 additions & 3 deletions src/app/app.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Closure for root level controllers
* @author ndkcha
* @since 0.4.1
* @version 0.6.1
* @version 0.6.4
*/

/// <reference path="../typings/main.d.ts" />
Expand Down Expand Up @@ -40,7 +40,7 @@
}

function gps(res) {
if (res.enabled == false) {
if (!res || res.enabled == false) {
unlock();
skip = true;
return;
Expand Down Expand Up @@ -83,11 +83,12 @@
}

function openHelpWindow() {
console.log(ammHelp);
ammHelp.openHelpWindow();
}

function gps(res) {
if (res == undefined)
return;
$rootScope.isPasscodeEnabled = res.enabled;
}

Expand Down
21 changes: 2 additions & 19 deletions src/app/app.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Closure for root level directives
* @author ndkcha
* @since 0.4.1
* @version 0.6.1
* @version 0.6.4
*/

/// <reference path="../typings/main.d.ts" />
Expand All @@ -12,27 +12,10 @@
.directive('pageTitle', PageTitleDirective)
.directive('amDropFiles', amDropFilesDirective)
.directive('amUploadFiles', amUploadFilesDirective)
.directive('amOnEnter', OnEnterDirective)
.directive('amOffsetFromTop', OffsetFromTopDirective);
.directive('amOnEnter', OnEnterDirective);

PageTitleDirective.$inject = ['$rootScope', '$timeout'];

function OffsetFromTopDirective() {
return {
restrict: 'A',
scope: {
callback: '&amOffsetFromTop'
},
link: link
}

function link(scope, elem, attr) {
var callbackFunction = scope.callback();

callbackFunction(elem);
}
}

function OnEnterDirective() {
return onEnter;

Expand Down
99 changes: 94 additions & 5 deletions src/app/app.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Closure for root level service
* @author ndkcha
* @since 0.4.1
* @version 0.6.1
* @version 0.6.4
*/

/// <reference path="../typings/main.d.ts" />
Expand Down Expand Up @@ -49,7 +49,7 @@
pdbCache.setDatabase(constants.pdb_cache);

// check and create views
ccViews();
manageDbVersions().then(ccViews).catch(ccViews);

// listen to changes in local db
OnCustomerDbChanged();
Expand All @@ -60,6 +60,91 @@
// syncDb();
}

function manageDbVersions() {
var tracker = $q.defer();
isSettingsId().then(getSettingsDoc).catch(failure);
return tracker.promise;

function getSettingsDoc(res) {
pdbConfig.get(sVm.docIds.settings).then(getSettingsObject).catch(writeSettingsObject);
}

function getSettingsObject(res) {
if (!res.dbversion)
res.dbversion = 0;
switch (res.dbversion) {
case 0:
applyPatch1().then(proceed).catch(proceed);
break;
}

function proceed(res) {
res.dbversion = constants.db_version;
pdbConfig.save(res).then(success).catch(failure);
}
}

function writeSettingsObject(err) {
var doc = {
_id: utils.generateUUID('sttngs'),
creator: sVm.username,
dbversion: constants.db_version
}
applyPatch1().then(proceed).catch(proceed);

function proceed(res) {
pdbConfig.save(doc).then(success).catch(failure);
}
}

function success(res) {
tracker.resolve(res);
}

function failure(err) {
tracker.reject(err);
}
}

function applyPatch1() {
var tracker = $q.defer();
pdbCustomers.getAll().then(success).catch(failure);
return tracker.promise;

function success(res) {
var customers = [];
res.rows.forEach(iterateRows);
pdbCustomers.saveAll(customers).then(saveSuccess).catch(failure);

function iterateRows(row) {
if (row.doc && row.doc.user && row.doc.user.vehicles) {
Object.keys(row.doc.user.vehicles).forEach(iterateVehicles);
customers.push(row.doc);
}

function iterateVehicles(vId) {
if (row.doc.user.vehicles[vId].services)
Object.keys(row.doc.user.vehicles[vId].services).forEach(iterateServices);

function iterateServices(sId) {
if (row.doc.user.vehicles[vId].services[sId].status == 'billed')
row.doc.user.vehicles[vId].services[sId].status = 'due';
if (row.doc.user.vehicles[vId].services[sId].state == undefined || row.doc.user.vehicles[vId].services[sId].state == '')
row.doc.user.vehicles[vId].services[sId].state = 'Bill';
}
}
}
}

function saveSuccess(res) {
tracker.resolve(res);
}

function failure(err) {
tracker.reject(err);
}
}

function ccViews(force) {
// service module

Expand Down Expand Up @@ -105,9 +190,11 @@
vhcl_reg: vehicle.reg,
vhcl_manuf: vehicle.manuf,
vhcl_model: vehicle.model,
vhcl_nextdue: vehicle.nextdue,
srvc_date: service.date,
srvc_cost: service.cost,
srvc_status: service.status
srvc_status: service.status,
srvc_state: service.state
};
}
}
Expand All @@ -116,7 +203,7 @@
}

function failure(err) {
console.log(err);
console.warn(err);
}
}

Expand Down Expand Up @@ -190,9 +277,11 @@
vhcl_reg: vehicle.reg,
vhcl_manuf: vehicle.manuf,
vhcl_model: vehicle.model,
vhcl_nextdue: vehicle.nextdue,
srvc_date: service.date,
srvc_cost: service.cost,
srvc_status: service.status
srvc_status: service.status,
srvc_state: service.state
};
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/app/app.states.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Closure for state definitions and mappings to template files
* @author ndkcha
* @since 0.4.1
* @version 0.6.1
* @version 0.6.4
*/

/// <reference path="../typings/main.d.ts" />
Expand Down Expand Up @@ -105,7 +105,8 @@
controllerAs: 'vm',
params: {
id: undefined,
openTab: undefined
openTab: undefined,
fromState: undefined
},
resolve: {
deps: ['$ocLazyLoad', loadCuUIDeps]
Expand Down Expand Up @@ -413,6 +414,7 @@
return $ocLazyLoad.load([
'material-datatable',
'google-chart',
'app/components/dashboard/dashboard.controller-deps.js',
'app/components/dashboard/dashboard.controller.js',
'app/components/dashboard/dashboard.factory.js'
]);
Expand Down Expand Up @@ -480,6 +482,7 @@
function loadSeRADeps($ocLazyLoad) {
return $ocLazyLoad.load([
'material-datatable',
'app/components/services/tmpl/dialog_timefilter.controller.js',
'app/components/services/services-viewall.controller.js'
])
}
Expand All @@ -497,6 +500,7 @@
'app/components/settings/settings-importdata.service.js',
'app/components/settings/settings-invoices.factory.js',
'app/components/settings/settings-servicetax.factory.js',
'app/components/settings/settings.factory.js',
'assets/js/jquery.csv.min.js'
])
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/appbar/headerView.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div style="box-shadow: 0px 1px 3px 1px #E0E0E0; z-index: 999; height: 1px; width: 100%; position: absolute"></div>
<md-toolbar class="md-default am-headerbar-shadow" style="background: #FFF;">
<div class="md-toolbar-tools">
<md-button aria-label="Go Back" ng-click="headerVm.toggleSideNavbar()" hide-gt-md>
<md-button class="md-icon-button" aria-label="Go Back" ng-click="headerVm.toggleSideNavbar()" hide-gt-md>
<md-icon style="color: #424242">menu</md-icon>
</md-button>
<div layout="column" layout-align="center center" flex>
Expand Down
Loading

0 comments on commit 00d846d

Please sign in to comment.