User profile editing and password
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
});
|
||||
|
||||
controller.$inject = ['$scope', 'inventorySvc', 'inventoryTypeSvc'];
|
||||
|
||||
function controller($scope, inventorySvc, inventoryTypeSvc) {
|
||||
var vm = this;
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
window.app.controller('InventoryListController',
|
||||
window.app.controller("InventoryListController",
|
||||
[
|
||||
"$uibModal", "inventorySvc", "downloadSvc",
|
||||
function($uibModal, inventorySvc, downloadSvc) {
|
||||
var vm = this;
|
||||
|
||||
@@ -9,15 +11,15 @@
|
||||
|
||||
vm.add = function() {
|
||||
$uibModal.open({
|
||||
template: '<inventory-add />',
|
||||
backdrop: 'static'
|
||||
template: "<inventory-add />",
|
||||
backdrop: "static"
|
||||
});
|
||||
};
|
||||
|
||||
vm.distribute = function() {
|
||||
$uibModal.open({
|
||||
template: '<inventory-distribute />',
|
||||
backdrop: 'static'
|
||||
template: "<inventory-distribute />",
|
||||
backdrop: "static"
|
||||
});
|
||||
};
|
||||
|
||||
@@ -25,5 +27,6 @@
|
||||
inventorySvc.exportInventory()
|
||||
.success(downloadSvc.success);
|
||||
};
|
||||
});
|
||||
}
|
||||
]);
|
||||
})();
|
||||
@@ -1,5 +1,7 @@
|
||||
(function() {
|
||||
window.app.factory('inventorySvc',
|
||||
window.app.factory("inventorySvc",
|
||||
[
|
||||
"$http", "$filter",
|
||||
function($http, $filter) {
|
||||
var inventories = [];
|
||||
|
||||
@@ -20,32 +22,32 @@
|
||||
return svc;
|
||||
|
||||
function loadInventories() {
|
||||
$http.post('/Inventory/All')
|
||||
$http.post("/Inventory/All")
|
||||
.success(function(data) {
|
||||
angular.copy(data, inventories);
|
||||
});
|
||||
}
|
||||
|
||||
function exportInventory() {
|
||||
return $http.post('/Inventory/Export', {}, { responseType: 'arraybuffer' });
|
||||
return $http.post("/Inventory/Export", {}, { responseType: "arraybuffer" });
|
||||
}
|
||||
|
||||
function add(inventory) {
|
||||
return $http.post('/Inventory/Add', inventory)
|
||||
return $http.post("/Inventory/Add", inventory)
|
||||
.success(function(inventory) {
|
||||
inventories.unshift(inventory);
|
||||
});
|
||||
}
|
||||
|
||||
function distribute(distribution) {
|
||||
return $http.post('/Inventory/Distribute', distribution)
|
||||
return $http.post("/Inventory/Distribute", distribution)
|
||||
.success(function(data) {
|
||||
angular.copy(data, inventories);
|
||||
});
|
||||
}
|
||||
|
||||
function update(existingInventory, updatedInventory) {
|
||||
return $http.post('/Inventory/Update', updatedInventory)
|
||||
return $http.post("/Inventory/Update", updatedInventory)
|
||||
.success(function(inventory) {
|
||||
angular.extend(existingInventory, inventory);
|
||||
});
|
||||
@@ -54,14 +56,14 @@
|
||||
// remove quantity from this inventory
|
||||
function remove(removeForm) {
|
||||
var existingInventory = get(removeForm.inventoryId);
|
||||
return $http.post('/Inventory/Remove', removeForm)
|
||||
return $http.post("/Inventory/Remove", removeForm)
|
||||
.success(function(data) {
|
||||
angular.copy(data, existingInventory);
|
||||
});
|
||||
}
|
||||
|
||||
function get(id) {
|
||||
var results = $filter('filter')(inventories, { id: id });
|
||||
var results = $filter("filter")(inventories, { id: id });
|
||||
if (results.length > 0)
|
||||
return results[0];
|
||||
return null;
|
||||
@@ -79,7 +81,8 @@
|
||||
}
|
||||
|
||||
function find(id) {
|
||||
return $http.post('/Inventory/Find', { id: id });
|
||||
return $http.post("/Inventory/Find", { id: id });
|
||||
}
|
||||
});
|
||||
}
|
||||
]);
|
||||
})();
|
||||
@@ -85,7 +85,7 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success">Add</button>
|
||||
<button class="btn btn-success" ng-disabled="vm.form.$invalid || vm.form.$pristine">Add</button>
|
||||
<button type="button" class="btn" ng-click="$dismiss()">Cancel</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success">Save</button>
|
||||
<button class="btn btn-success" ng-disabled="vm.form.$invalid || vm.form.$pristine">Save</button>
|
||||
<button type="button" class="btn" ng-click="$dismiss()">Cancel</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<inventory-info inventory="inventory"></inventory-info>
|
||||
<div class="modal-footer">
|
||||
<button ng-click="vm.removeInventory()" class="btn btn-sm pull-left"><i class="fa fa-minus-circle"></i> Remove Inventory</button>
|
||||
<button class="btn btn-success">Save</button>
|
||||
<button class="btn btn-success" ng-disabled="vm.form.$invalid || vm.form.$pristine">Save</button>
|
||||
<button type="button" class="btn" ng-click="$parent.$dismiss()">Cancel</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="inventory in vm.inventories">
|
||||
<tr ng-repeat="inventory in vm.inventories | filter:{name: ''}">
|
||||
<td>
|
||||
<a href="" ng-click="vm.edit(inventory)" title="Details"><i class="fa fa-edit"></i></a>
|
||||
</td>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success">Remove</button>
|
||||
<button class="btn btn-success" ng-disabled="vm.form.$invalid || vm.form.$pristine">Remove</button>
|
||||
<button type="button" class="btn" ng-click="$parent.$dismiss()">Cancel</button>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user