From: Bill Erickson Date: Thu, 24 Oct 2013 19:04:38 +0000 (-0400) Subject: web staff : combine required services into a single egCoreMod module X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ab5d9285ee85479a74ea9aafa2ba16fae4df0ca1;p=evergreen%2Fequinox.git web staff : combine required services into a single egCoreMod module Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/t_base_js.tt2 b/Open-ILS/src/templates/staff/t_base_js.tt2 index de516d7d8d..9c900766fd 100644 --- a/Open-ILS/src/templates/staff/t_base_js.tt2 +++ b/Open-ILS/src/templates/staff/t_base_js.tt2 @@ -20,6 +20,7 @@ + diff --git a/Open-ILS/web/js/ui/default/staff/app.js b/Open-ILS/web/js/ui/default/staff/app.js index 332dfa0ec3..c7b0d1f459 100644 --- a/Open-ILS/web/js/ui/default/staff/app.js +++ b/Open-ILS/web/js/ui/default/staff/app.js @@ -4,7 +4,7 @@ * Splash Page */ -angular.module('egHome', ['ngRoute', 'egStartupMod', 'egAuthMod', 'egUiMod']) +angular.module('egHome', ['ngRoute', 'egCoreMod', 'egUiMod']) .config(function($routeProvider, $locationProvider) { console.log('config'); diff --git a/Open-ILS/web/js/ui/default/staff/navbar.js b/Open-ILS/web/js/ui/default/staff/navbar.js index d7fd4d2e89..1995c5c781 100644 --- a/Open-ILS/web/js/ui/default/staff/navbar.js +++ b/Open-ILS/web/js/ui/default/staff/navbar.js @@ -1,5 +1,5 @@ /** - * Free-floating controller which can be used by any app + * Free-floating controller which can be used by any app. */ function NavCtrl($scope, egStartup, egAuth) { @@ -36,3 +36,6 @@ function NavCtrl($scope, egStartup, egAuth) { } ); } + +// minify-safe dependency injection +NavCtrl.$inject = ['$scope', 'egStartup', 'egAuth']; diff --git a/Open-ILS/web/js/ui/default/staff/services/auth.js b/Open-ILS/web/js/ui/default/staff/services/auth.js index bf053e6c38..800ba73509 100644 --- a/Open-ILS/web/js/ui/default/staff/services/auth.js +++ b/Open-ILS/web/js/ui/default/staff/services/auth.js @@ -1,11 +1,11 @@ -/* Auth manager +/* Core Sevice - egAuth * * Angular cookies are still fairly primitive. * In particular, you can't set the path. * https://github.com/angular/angular.js/issues/1786 */ -angular.module('egAuthMod', ['ngCookies', 'egNetMod']) +angular.module('egCoreMod') .constant('EG_AUTH_COOKIE', 'ses') diff --git a/Open-ILS/web/js/ui/default/staff/services/core.js b/Open-ILS/web/js/ui/default/staff/services/core.js new file mode 100644 index 0000000000..d862450902 --- /dev/null +++ b/Open-ILS/web/js/ui/default/staff/services/core.js @@ -0,0 +1,6 @@ + +/** + * egCoreMod houses all of the services, etc. required by all pages + * for basic functionality. + */ +angular.module('egCoreMod', ['ngCookies']); diff --git a/Open-ILS/web/js/ui/default/staff/services/env.js b/Open-ILS/web/js/ui/default/staff/services/env.js index e79b520797..cd8cf8c01a 100644 --- a/Open-ILS/web/js/ui/default/staff/services/env.js +++ b/Open-ILS/web/js/ui/default/staff/services/env.js @@ -1,4 +1,6 @@ -/* +/** + * Core Service - egEnv + * * Data that we always want to load at startup goes here. * Requests are sents as a swarm of async calls. As each * returns, a pending-calls counter is decremented. Once @@ -6,7 +8,7 @@ * loadAll() is resolved. */ -angular.module('egEnvMod', ['egNetMod', 'egPCRUDMod']) +angular.module('egCoreMod') // env cache .factory('egEnvCache', ['$cacheFactory', diff --git a/Open-ILS/web/js/ui/default/staff/services/idl.js b/Open-ILS/web/js/ui/default/staff/services/idl.js index 9d9832da99..fbc3e7793a 100644 --- a/Open-ILS/web/js/ui/default/staff/services/idl.js +++ b/Open-ILS/web/js/ui/default/staff/services/idl.js @@ -1,4 +1,6 @@ /** + * Core Service - egIDL + * * IDL parser * usage: * var aou = new egIDL.aou(); @@ -12,7 +14,7 @@ * 2. we don't need to store array_position in /IDL2js since it * can be derived at parse time. Ditto saving space. */ -angular.module('egIDLMod', []) +angular.module('egCoreMod') .factory('egIDL', ['$window', function($window) { diff --git a/Open-ILS/web/js/ui/default/staff/services/net.js b/Open-ILS/web/js/ui/default/staff/services/net.js index b7cd337ba3..e17dbd8f6e 100644 --- a/Open-ILS/web/js/ui/default/staff/services/net.js +++ b/Open-ILS/web/js/ui/default/staff/services/net.js @@ -1,4 +1,6 @@ /** + * Core Service - egNet + * * Promise wrapper for OpenSRF network calls. * http://docs.angularjs.org/api/ng.$q * @@ -22,7 +24,8 @@ * ); */ -angular.module('egNetMod', []) +angular.module('egCoreMod') + .factory('egNet', function($q) { return { diff --git a/Open-ILS/web/js/ui/default/staff/services/org.js b/Open-ILS/web/js/ui/default/staff/services/org.js index 3941a5193f..a9b38fa290 100644 --- a/Open-ILS/web/js/ui/default/staff/services/org.js +++ b/Open-ILS/web/js/ui/default/staff/services/org.js @@ -1,4 +1,9 @@ -angular.module('egOrgMod', ['egEnvMod', 'egPCRUDMod']) +/** + * Core Service - egOrg + * + * TODO: more docs + */ +angular.module('egCoreMod') .factory('egOrg', ['egEnv', 'egAuth', 'egPCRUD', function(egEnv, egAuth, egPCRUD) { diff --git a/Open-ILS/web/js/ui/default/staff/services/pcrud.js b/Open-ILS/web/js/ui/default/staff/services/pcrud.js index 774f2523d6..7caec9ae35 100644 --- a/Open-ILS/web/js/ui/default/staff/services/pcrud.js +++ b/Open-ILS/web/js/ui/default/staff/services/pcrud.js @@ -1,4 +1,6 @@ /** + * Core Service - egPCRUD + * * PCRUD client. * * Factory for PCRUDContext objects with pass-through service-level API. @@ -40,7 +42,7 @@ * } * ); */ -angular.module('egPCRUDMod', []) +angular.module('egCoreMod') // env fetcher .factory('egPCRUD', ['$q', 'egAuth', 'egIDL', function($q, egAuth, egIDL) { diff --git a/Open-ILS/web/js/ui/default/staff/services/startup.js b/Open-ILS/web/js/ui/default/staff/services/startup.js index adcb416425..dee9e3c7b6 100644 --- a/Open-ILS/web/js/ui/default/staff/services/startup.js +++ b/Open-ILS/web/js/ui/default/staff/services/startup.js @@ -1,4 +1,6 @@ /** + * Core Service - egStartup + * * Coordinates all startup routines and consolidates them into * a single startup promise. Startup can be launched from multiple * controllers, etc., but only one startup routine will be run. @@ -9,7 +11,7 @@ * async data is arrived. */ -angular.module('egStartupMod', ['egIDLMod', 'egAuthMod', 'egEnvMod']) +angular.module('egCoreMod') .factory('egStartupCache', ['$cacheFactory', function($cacheFactory) { diff --git a/Open-ILS/web/js/ui/default/staff/services/user.js b/Open-ILS/web/js/ui/default/staff/services/user.js index 1503448ade..ea7aae8ce1 100644 --- a/Open-ILS/web/js/ui/default/staff/services/user.js +++ b/Open-ILS/web/js/ui/default/staff/services/user.js @@ -1,7 +1,7 @@ /** Service for fetching fleshed user objects. * The last user retrieved is kept in the local cache */ -angular.module('egUserMod', ['egNetMod', 'egAuthMod']) +angular.module('egUserMod', ['egCoreMod']) .factory('egUserCache', ['$cacheFactory', function($cacheFactory) {