mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
refactor login folder to be a little cleaner
This commit is contained in:
parent
5b87eeb515
commit
1de977b4c5
17
awx/ui/client/src/login/authenticationServices/main.js
Normal file
17
awx/ui/client/src/login/authenticationServices/main.js
Normal file
@ -0,0 +1,17 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import authenticationService from './authentication.service';
|
||||
import checkAccess from './checkAccess.factory';
|
||||
import isAdmin from './isAdmin.factory';
|
||||
import timer from './timer.factory';
|
||||
|
||||
export default
|
||||
angular.module('authentication', [])
|
||||
.factory('Authorization', authenticationService)
|
||||
.factory('CheckAccess', checkAccess)
|
||||
.factory('IsAdmin', isAdmin)
|
||||
.factory('Timer', timer);
|
||||
@ -9,8 +9,7 @@ import {templateUrl} from '../shared/template-url/template-url.factory';
|
||||
export default {
|
||||
name: 'signIn',
|
||||
route: '/login',
|
||||
templateUrl: templateUrl('login/loginScreen'), //templateUrl('management-jobs/schedule/schedule'),
|
||||
// controller: 'authenticationController',
|
||||
templateUrl: templateUrl('login/loginBackDrop'),
|
||||
resolve: {
|
||||
features: ['FeaturesService', function(FeaturesService) {
|
||||
return FeaturesService.get();
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
import authenticationController from './authentication.controller';
|
||||
import authenticationController from './loginModal.controller';
|
||||
|
||||
/* jshint unused: vars */
|
||||
export default
|
||||
@ -13,7 +13,7 @@ export default
|
||||
restrict: 'E',
|
||||
scope: true,
|
||||
controller: authenticationController,
|
||||
templateUrl: templateUrl('login/loginModal'),
|
||||
templateUrl: templateUrl('login/loginModal/loginModal'),
|
||||
link: function(scope, element, attrs) {
|
||||
// Display the login dialog
|
||||
$('#login-modal').modal({
|
||||
13
awx/ui/client/src/login/loginModal/main.js
Normal file
13
awx/ui/client/src/login/loginModal/main.js
Normal file
@ -0,0 +1,13 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import thirdPartySignOn from './thirdPartySignOn/main';
|
||||
|
||||
import loginModalDirective from './loginModal.directive';
|
||||
|
||||
export default
|
||||
angular.module('loginModal', [thirdPartySignOn.name])
|
||||
.directive('loginModal', loginModalDirective);
|
||||
11
awx/ui/client/src/login/loginModal/thirdPartySignOn/main.js
Normal file
11
awx/ui/client/src/login/loginModal/thirdPartySignOn/main.js
Normal file
@ -0,0 +1,11 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import thirdPartySignOnDirective from './thirdPartySignOn.directive';
|
||||
|
||||
export default
|
||||
angular.module('thirdPartySignOn', [])
|
||||
.directive('thirdPartySignOn', thirdPartySignOnDirective);
|
||||
@ -12,7 +12,7 @@ export default
|
||||
restrict: 'E',
|
||||
scope: true,
|
||||
// controller: authenticationController,
|
||||
templateUrl: templateUrl('login/thirdPartySignOn'),
|
||||
templateUrl: templateUrl('login/loginModal/thirdPartySignOn/thirdPartySignOn'),
|
||||
link: function(scope, element, attrs) {
|
||||
// these vars will be set programatically once
|
||||
// api stuff lands
|
||||
@ -13,7 +13,7 @@ export default {
|
||||
Authorization.logout();
|
||||
$location.path('/login');
|
||||
}],
|
||||
templateUrl: '/static/partials/blank.html', //templateUrl('management-jobs/schedule/schedule'),
|
||||
templateUrl: '/static/partials/blank.html',
|
||||
resolve: {
|
||||
features: ['FeaturesService', function(FeaturesService) {
|
||||
return FeaturesService.get();
|
||||
|
||||
@ -4,29 +4,19 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import authenticationService from './authentication.service';
|
||||
import checkAccess from './checkAccess.factory';
|
||||
import isAdmin from './isAdmin.factory';
|
||||
import timer from './timer.factory';
|
||||
import authentication from './authenticationServices/main';
|
||||
import loginModal from './loginModal/main';
|
||||
|
||||
import loginRoute from './login.route';
|
||||
import logoutRoute from './logout.route';
|
||||
import loginModalDirective from './loginModal.directive';
|
||||
import thirdPartySignOnDirective from './thirdPartySignOn.directive';
|
||||
|
||||
export default
|
||||
angular.module('login', [
|
||||
])
|
||||
.factory('Authorization', authenticationService)
|
||||
.factory('CheckAccess', checkAccess)
|
||||
.factory('IsAdmin', isAdmin)
|
||||
.factory('Timer', timer)
|
||||
.directive('loginModal', loginModalDirective)
|
||||
.directive('thirdPartySignOn', thirdPartySignOnDirective)
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
var url = loginRoute.route;
|
||||
delete loginRoute.route;
|
||||
$routeProvider.when(url, loginRoute);
|
||||
url = logoutRoute.route;
|
||||
delete logoutRoute.route;
|
||||
$routeProvider.when(url, logoutRoute);
|
||||
}]);
|
||||
angular.module('login', [authentication.name, loginModal.name])
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
var url = loginRoute.route;
|
||||
delete loginRoute.route;
|
||||
$routeProvider.when(url, loginRoute);
|
||||
url = logoutRoute.route;
|
||||
delete logoutRoute.route;
|
||||
$routeProvider.when(url, logoutRoute);
|
||||
}]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user