mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
AC-301,AC-316 Initialize scope keys in both list generator and form generator.
This commit is contained in:
parent
fa8a697024
commit
b904dd2ae5
@ -30,7 +30,7 @@ function Authenticate($window, $scope, $rootScope, $location, Authorization, Tog
|
||||
$scope.sessionExpired = false;
|
||||
}
|
||||
|
||||
$rootScope.userLoggedIn = false; //hide the logout link. if you got here, your logged out.
|
||||
$rootScope.userLoggedIn = false; //hide the logout link. if you got here, you're logged out.
|
||||
//gets set back to true by Authorization.setToken().
|
||||
|
||||
$('#login-password').bind('keypress', function(e) {
|
||||
|
@ -5,9 +5,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
angular.module('AuthService', ['ngCookies', 'OrganizationFormDefinition'])
|
||||
.factory('Authorization', ['$http', '$rootScope', '$location', '$cookieStore', 'OrganizationForm',
|
||||
function($http, $rootScope, $location, $cookieStore, OrganizationForm) {
|
||||
angular.module('AuthService', ['ngCookies'])
|
||||
.factory('Authorization', ['$http', '$rootScope', '$location', '$cookieStore', function($http, $rootScope, $location, $cookieStore) {
|
||||
return {
|
||||
setToken: function(token) {
|
||||
// set the session cookie
|
||||
@ -73,13 +72,6 @@ angular.module('AuthService', ['ngCookies', 'OrganizationFormDefinition'])
|
||||
scope.$destroy();
|
||||
$rootScope.$destroy();
|
||||
|
||||
// Reset the scope for organizations. No matter what we have tried, nothing seems
|
||||
// to clear the scope fast enough to prevent prior user's content from displaying
|
||||
$rootScope['organizations'] = null;
|
||||
for (var set in OrganizationForm.related) {
|
||||
$rootScope[set] = null;
|
||||
}
|
||||
|
||||
$cookieStore.remove('accordions');
|
||||
$cookieStore.remove('token');
|
||||
$cookieStore.remove('token_expire');
|
||||
|
@ -52,6 +52,14 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
||||
this.scope = element.scope(); // Set scope specific to the element we're compiling, avoids circular reference
|
||||
// From here use 'scope' to manipulate the form, as the form is not in '$scope'
|
||||
$compile(element)(this.scope);
|
||||
|
||||
// Reset the scope to prevent displaying old data from our last visit to this form
|
||||
for (var fld in form.fields) {
|
||||
this.scope[fld] = null;
|
||||
}
|
||||
for (var set in form.related) {
|
||||
this.scope[set] = null;
|
||||
}
|
||||
|
||||
if ( ((!options.modal) && options.related) || this.form.forceListeners ) {
|
||||
this.addListeners();
|
||||
|
@ -79,6 +79,10 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
||||
// From here use 'scope' to manipulate the form, as the form is not in '$scope'
|
||||
$compile(element)(this.scope);
|
||||
|
||||
// Reset the scope to prevent displaying old data from our last visit to this list
|
||||
this.scope[list.name] = null;
|
||||
this.scope[list.iterator] = null;
|
||||
|
||||
if (options.mode == 'lookup') {
|
||||
// options should include {hdr: <dialog header>, action: <function...> }
|
||||
this.scope.lookupHeader = options.hdr;
|
||||
|
Loading…
Reference in New Issue
Block a user