Add user management

This commit is contained in:
2016-09-23 15:12:46 -04:00
parent 9f50a4635c
commit 0b5dde065a
53 changed files with 1046 additions and 690 deletions
@@ -13,7 +13,6 @@
}
}
controller.$inject = ['$scope'];
function controller($scope) {
var vm = this;
vm.query = {};
@@ -1,17 +1,15 @@
(function () {
window.app.factory('downloadSvc', downloadSvc);
window.app.factory('downloadSvc',
function($http) {
downloadSvc.$inject = ['$http'];
function downloadSvc($http) {
var svc = {
success: function(data, status, headers, config) {
var file = new Blob([data], { type: headers('Content-Type') });
var match = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(headers('Content-Disposition'));
saveAs(file, match[1]);
}
};
var svc = {
success: function (data, status, headers, config) {
var file = new Blob([data], { type: headers('Content-Type') });
var match = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(headers('Content-Disposition'));
saveAs(file, match[1]);
}
};
return svc;
}
return svc;
});
})();
+12 -13
View File
@@ -1,20 +1,19 @@
(function() {
'use strict';
window.app.directive('errorList', errorList);
function errorList() {
return {
scope: {
errors: "=",
editMsg: "="
},
templateUrl: '/utility/template/errorList.tmpl.cshtml',
controller: controller,
controllerAs: 'vm'
}
}
window.app.directive('errorList',
function() {
return {
scope: {
errors: "=",
editMsg: "="
},
templateUrl: '/utility/template/errorList.tmpl.cshtml',
controller: controller,
controllerAs: 'vm'
}
});
controller.$inject = ['$scope'];
function controller($scope) {
var vm = this;
vm.errors = $scope.errors;
@@ -1,30 +1,28 @@
(function () {
'use strict';
window.app.directive('formGroupValidation', formGroupValidation);
function formGroupValidation() {
return {
require: '^form',
replace: true,
transclude: true,
template:
'<div class="has-feedback" ng-class="vm.getValidationClass()">' +
'<ng-transclude></ng-transclude>' +
//'<input-validation-icons field="vm.field"></input-validation-icons>' +
'</div>',
scope: {
field: '@formGroupValidation'
},
controller: controller,
controllerAs: 'vm',
link: function (scope, element, attrs, formCtrl) {
scope.form = formCtrl;
window.app.directive('formGroupValidation',
function() {
return {
require: '^form',
replace: true,
transclude: true,
template:
'<div class="has-feedback" ng-class="vm.getValidationClass()">' +
'<ng-transclude></ng-transclude>' +
//'<input-validation-icons field="vm.field"></input-validation-icons>' +
'</div>',
scope: {
field: '@formGroupValidation'
},
controller: controller,
controllerAs: 'vm',
link: function(scope, element, attrs, formCtrl) {
scope.form = formCtrl;
}
}
}
}
});
controller.$inject = ['$scope'];
function controller($scope) {
var vm = this;
@@ -1,12 +1,11 @@
(function() {
window.app.filter('formatCases', formatCases);
window.app.filter('formatCases',
function() {
return function(qty) {
if (qty === '' || !isFinite(qty))
return '';
function formatCases() {
return function (qty) {
if (qty === '' || !isFinite(qty))
return '';
return '(' + qty + ' cs)';
}
}
return '(' + qty + ' cs)';
}
});
})();
@@ -1,10 +1,9 @@
(function () {
window.app.filter('hideZero', hideZero);
window.app.filter('hideZero',
function() {
return function(input) {
function hideZero() {
return function (input) {
return input > 0 ? input : '';
}
}
return input > 0 ? input : "";
}
});
})();
@@ -1,28 +1,26 @@
(function () {
'use strict';
window.app.directive('inputValidationIcons', inputValidationIcons);
function inputValidationIcons() {
return {
require: '^form',
scope: {
field: '='
},
template:
'<span ng-show="vm.canBeValidated() && vm.isValid()" ' +
'class="fa fa-2x fa-check-square form-control-feedback"></span>' +
'<span ng-show="vm.canBeValidated() && !vm.isValid()" ' +
'class="fa fa-2x fa-exclamation-triangle form-control-feedback"></span>',
controller: controller,
controllerAs: 'vm',
link: function (scope, element, attrs, formCtrl) {
scope.form = formCtrl;
window.app.directive('inputValidationIcons',
function() {
return {
require: '^form',
scope: {
field: '='
},
template:
'<span ng-show="vm.canBeValidated() && vm.isValid()" ' +
'class="fa fa-2x fa-check-square form-control-feedback"></span>' +
'<span ng-show="vm.canBeValidated() && !vm.isValid()" ' +
'class="fa fa-2x fa-exclamation-triangle form-control-feedback"></span>',
controller: controller,
controllerAs: 'vm',
link: function(scope, element, attrs, formCtrl) {
scope.form = formCtrl;
}
}
}
}
});
controller.$inject = ['$scope'];
function controller($scope) {
var vm = this;
@@ -1,35 +1,34 @@
(function() {
'use strict';
window.app.directive('monthQuery', monthQuery);
function monthQuery() {
return {
scope: {
queryFn: '='
},
templateUrl: '/utility/template/monthQuery.tmpl.cshtml',
controller: controller,
controllerAs: 'vm'
}
}
window.app.directive('monthQuery',
function() {
return {
scope: {
queryFn: '='
},
templateUrl: '/utility/template/monthQuery.tmpl.cshtml',
controller: controller,
controllerAs: 'vm'
}
});
controller.$inject = ['$scope'];
function controller($scope) {
var vm = this;
vm.query = {};
vm.submitting = false;
vm.errorMessages = [];
vm.submit = submit;
function submit() {
vm.submitting = true;
$scope.queryFn({ month: vm.query })
.error(function (data) {
vm.errorMessages = angular.copy(data.errorMessages, vm.errorMessages);
})
.finally(function () {
vm.submitting = false;
});
}
vm.submit =
function() {
vm.submitting = true;
$scope.queryFn({ month: vm.query })
.error(function(data) {
vm.errorMessages
= angular.copy(data.errorMessages, vm.errorMessages);
})
.finally(function() {
vm.submitting = false;
});
};
}
})();
@@ -1,46 +0,0 @@
(function () {
window.app.directive('mvcGrid', mvcGrid);
function mvcGrid() {
return {
scope: {
gridDataUrl: '@',
title: '@',
columns: '@?'
},
template:
'<div>' +
'<h4><i class="fa fa-pie-chart fa-fw"></i> {{vm.title}}</h4>' +
'<div>' +
'<p ng-if="vm.loading">Loading...</p>' +
'<div ng-if="!vm.loading" ui-grid="vm.gridOptions"></div>' +
'</div>' +
'</div>',
controllerAs: 'vm',
controller: controller
}
}
controller.$inject = ['$scope', '$http'];
function controller($scope, $http) {
var vm = this;
vm.gridOptions = {
enableHorizontalScrollbar: 0
}
vm.loading = true;
vm.title = $scope.title;
if ($scope.columns)
vm.gridOptions.columnDefs = angular.fromJson($scope.columns);
$http.post($scope.gridDataUrl)
.success(function (data) {
vm.gridOptions.data = data;
vm.loading = false;
});
}
})();
@@ -1,11 +1,10 @@
(function() {
window.app.filter('parseDate', parseDate);
window.app.filter("parseDate",
function() {
return function(input) {
if (typeof input != 'string' || input.indexOf("/Date") === -1) return input;
function parseDate() {
return function(input) {
if (typeof input != 'string' || input.indexOf('/Date') === -1) return input;
return new Date(parseInt(input.substr(6)));
}
}
return new Date(parseInt(input.substr(6)));
}
});
})();
+12 -13
View File
@@ -1,20 +1,19 @@
(function() {
'use strict';
window.app.directive('statusMessage', statusMessage);
function statusMessage() {
return {
scope: {
message: "=",
severity: "=?"
},
templateUrl: '/utility/template/statusMessage.tmpl.cshtml',
controller: controller,
controllerAs: 'vm'
}
}
window.app.directive('statusMessage',
function() {
return {
scope: {
message: "=",
severity: "=?"
},
templateUrl: '/utility/template/statusMessage.tmpl.cshtml',
controller: controller,
controllerAs: 'vm'
}
});
controller.$inject = ['$scope'];
function controller($scope) {
}
})();
+8 -9
View File
@@ -1,13 +1,12 @@
(function() {
window.app.filter('toUnits', toUnits);
window.app.filter('toUnits',
function() {
return function(caseQty, unitsPerCase) {
if (caseQty === "" || !isFinite(caseQty) || !isFinite(unitsPerCase))
return "";
function toUnits() {
return function (caseQty, unitsPerCase) {
if (caseQty === '' || !isFinite(caseQty) || !isFinite(unitsPerCase))
return '';
return caseQty * unitsPerCase;
}
}
return caseQty * unitsPerCase;
}
});
})();