mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
AC-301,AC-316 Initialize scope keys in both list generator and form generator.
This commit is contained in:
@@ -30,7 +30,7 @@ function Authenticate($window, $scope, $rootScope, $location, Authorization, Tog
|
|||||||
$scope.sessionExpired = false;
|
$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().
|
//gets set back to true by Authorization.setToken().
|
||||||
|
|
||||||
$('#login-password').bind('keypress', function(e) {
|
$('#login-password').bind('keypress', function(e) {
|
||||||
|
|||||||
@@ -5,9 +5,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
angular.module('AuthService', ['ngCookies', 'OrganizationFormDefinition'])
|
angular.module('AuthService', ['ngCookies'])
|
||||||
.factory('Authorization', ['$http', '$rootScope', '$location', '$cookieStore', 'OrganizationForm',
|
.factory('Authorization', ['$http', '$rootScope', '$location', '$cookieStore', function($http, $rootScope, $location, $cookieStore) {
|
||||||
function($http, $rootScope, $location, $cookieStore, OrganizationForm) {
|
|
||||||
return {
|
return {
|
||||||
setToken: function(token) {
|
setToken: function(token) {
|
||||||
// set the session cookie
|
// set the session cookie
|
||||||
@@ -73,13 +72,6 @@ angular.module('AuthService', ['ngCookies', 'OrganizationFormDefinition'])
|
|||||||
scope.$destroy();
|
scope.$destroy();
|
||||||
$rootScope.$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('accordions');
|
||||||
$cookieStore.remove('token');
|
$cookieStore.remove('token');
|
||||||
$cookieStore.remove('token_expire');
|
$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
|
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'
|
// From here use 'scope' to manipulate the form, as the form is not in '$scope'
|
||||||
$compile(element)(this.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 ) {
|
if ( ((!options.modal) && options.related) || this.form.forceListeners ) {
|
||||||
this.addListeners();
|
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'
|
// From here use 'scope' to manipulate the form, as the form is not in '$scope'
|
||||||
$compile(element)(this.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') {
|
if (options.mode == 'lookup') {
|
||||||
// options should include {hdr: <dialog header>, action: <function...> }
|
// options should include {hdr: <dialog header>, action: <function...> }
|
||||||
this.scope.lookupHeader = options.hdr;
|
this.scope.lookupHeader = options.hdr;
|
||||||
|
|||||||
Reference in New Issue
Block a user