Normalized inventory list/form. This was the way it used to be

This commit is contained in:
Michael Abashian
2017-04-06 16:49:09 -04:00
committed by Jared Tabor
parent 2e177598c2
commit 54a92b5b5e
4 changed files with 17 additions and 17 deletions

View File

@@ -11,7 +11,7 @@
*/ */
function InventoriesAdd($scope, $location, function InventoriesAdd($scope, $location,
GenerateForm, InventoriesForm, rbacUiControlService, Rest, Alert, ProcessErrors, GenerateForm, InventoryForm, rbacUiControlService, Rest, Alert, ProcessErrors,
ClearScope, GetBasePath, ParseTypeChange, Wait, ToJSON, ClearScope, GetBasePath, ParseTypeChange, Wait, ToJSON,
$state) { $state) {
@@ -34,7 +34,7 @@ function InventoriesAdd($scope, $location,
// Inject dynamic view // Inject dynamic view
var defaultUrl = GetBasePath('inventory'), var defaultUrl = GetBasePath('inventory'),
form = InventoriesForm; form = InventoryForm;
init(); init();
@@ -98,7 +98,7 @@ function InventoriesAdd($scope, $location,
} }
export default ['$scope', '$location', export default ['$scope', '$location',
'GenerateForm', 'InventoriesForm', 'rbacUiControlService', 'Rest', 'Alert', 'GenerateForm', 'InventoryForm', 'rbacUiControlService', 'Rest', 'Alert',
'ProcessErrors', 'ClearScope', 'GetBasePath', 'ParseTypeChange', 'ProcessErrors', 'ClearScope', 'GetBasePath', 'ParseTypeChange',
'Wait', 'ToJSON', '$state', InventoriesAdd 'Wait', 'ToJSON', '$state', InventoriesAdd
]; ];

View File

@@ -11,13 +11,13 @@
*/ */
function InventoriesEdit($scope, $location, function InventoriesEdit($scope, $location,
$stateParams, InventoriesForm, Rest, ProcessErrors, $stateParams, InventoryForm, Rest, ProcessErrors,
ClearScope, GetBasePath, ParseTypeChange, Wait, ToJSON, ClearScope, GetBasePath, ParseTypeChange, Wait, ToJSON,
ParseVariableString, $state, OrgAdminLookup) { ParseVariableString, $state, OrgAdminLookup) {
// Inject dynamic view // Inject dynamic view
var defaultUrl = GetBasePath('inventory'), var defaultUrl = GetBasePath('inventory'),
form = InventoriesForm, form = InventoryForm,
inventory_id = $stateParams.inventory_id, inventory_id = $stateParams.inventory_id,
master = {}, master = {},
fld, json_data, data; fld, json_data, data;
@@ -129,7 +129,7 @@ function InventoriesEdit($scope, $location,
} }
export default ['$scope', '$location', export default ['$scope', '$location',
'$stateParams', 'InventoriesForm', 'Rest', '$stateParams', 'InventoryForm', 'Rest',
'ProcessErrors', 'ClearScope', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ProcessErrors', 'ClearScope', 'GetBasePath', 'ParseTypeChange', 'Wait',
'ToJSON', 'ParseVariableString', 'ToJSON', 'ParseVariableString',
'$state', 'OrgAdminLookup', InventoriesEdit, '$state', 'OrgAdminLookup', InventoriesEdit,

View File

@@ -11,10 +11,10 @@
*/ */
function InventoriesList($scope, $rootScope, $location, function InventoriesList($scope, $rootScope, $location,
$compile, $filter, Rest, InventoriesList, Prompt, $compile, $filter, Rest, InventoryList, Prompt,
ProcessErrors, GetBasePath, Wait, Find, Empty, $state, rbacUiControlService, Dataset) { ProcessErrors, GetBasePath, Wait, Find, Empty, $state, rbacUiControlService, Dataset) {
let list = InventoriesList, let list = InventoryList,
defaultUrl = GetBasePath('inventory'); defaultUrl = GetBasePath('inventory');
init(); init();
@@ -303,6 +303,6 @@ function InventoriesList($scope, $rootScope, $location,
} }
export default ['$scope', '$rootScope', '$location', export default ['$scope', '$rootScope', '$location',
'$compile', '$filter', 'Rest', 'InventoriesList', '$compile', '$filter', 'Rest', 'InventoryList',
'Prompt', 'ProcessErrors', 'GetBasePath', 'Wait', 'Find', 'Empty', '$state', 'rbacUiControlService', 'Dataset', InventoriesList 'Prompt', 'ProcessErrors', 'GetBasePath', 'Wait', 'Find', 'Empty', '$state', 'rbacUiControlService', 'Dataset', InventoriesList
]; ];

View File

@@ -10,8 +10,8 @@ import inventoryEdit from './edit/main';
import inventoryList from './list/main'; import inventoryList from './list/main';
import { templateUrl } from '../shared/template-url/template-url.factory'; import { templateUrl } from '../shared/template-url/template-url.factory';
import { N_ } from '../i18n'; import { N_ } from '../i18n';
import InventoriesList from './inventory.list'; import InventoryList from './inventory.list';
import InventoriesForm from './inventory.form'; import InventoryForm from './inventory.form';
export default export default
angular.module('inventory', [ angular.module('inventory', [
host.name, host.name,
@@ -19,8 +19,8 @@ angular.module('inventory', [
inventoryEdit.name, inventoryEdit.name,
inventoryList.name inventoryList.name
]) ])
.factory('InventoriesForm', InventoriesForm) .factory('InventoryForm', InventoryForm)
.factory('InventoriesList', InventoriesList) .factory('InventoryList', InventoryList)
.config(['$stateProvider', 'stateDefinitionsProvider', .config(['$stateProvider', 'stateDefinitionsProvider',
function($stateProvider, stateDefinitionsProvider) { function($stateProvider, stateDefinitionsProvider) {
// When stateDefinition.lazyLoad() resolves, states matching name.** or /url** will be de-registered and replaced with resolved states // When stateDefinition.lazyLoad() resolves, states matching name.** or /url** will be de-registered and replaced with resolved states
@@ -33,8 +33,8 @@ angular.module('inventory', [
lazyLoad: () => stateDefinitions.generateTree({ lazyLoad: () => stateDefinitions.generateTree({
parent: 'inventories', // top-most node in the generated tree (will replace this state definition) parent: 'inventories', // top-most node in the generated tree (will replace this state definition)
modes: ['add', 'edit'], modes: ['add', 'edit'],
list: 'InventoriesList', list: 'InventoryList',
form: 'InventoriesForm', form: 'InventoryForm',
controllers: { controllers: {
list: 'InventoryListController', list: 'InventoryListController',
add: 'InventoryAddController', add: 'InventoryAddController',
@@ -51,9 +51,9 @@ angular.module('inventory', [
templateUrl: templateUrl('inventories/inventories') templateUrl: templateUrl('inventories/inventories')
}, },
'list@inventories': { 'list@inventories': {
templateProvider: function(InventoriesList, generateList) { templateProvider: function(InventoryList, generateList) {
let html = generateList.build({ let html = generateList.build({
list: InventoriesList, list: InventoryList,
mode: 'edit' mode: 'edit'
}); });
return html; return html;