Merge pull request #7126 from jaredevantabor/tower-string-audit

removing more references to "Tower" in the code base
This commit is contained in:
Jared Tabor
2017-07-19 09:28:35 -07:00
committed by GitHub
28 changed files with 45 additions and 38 deletions

View File

@@ -276,7 +276,7 @@ i:active,
opacity: 0; opacity: 0;
} }
#configure-tower-dialog, #configure-schedules-form-container { #configure-dialog, #configure-schedules-form-container {
display: none; display: none;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;

View File

@@ -8,8 +8,8 @@
import route from './about.route'; import route from './about.route';
export default export default
angular.module('aboutTower', []) angular.module('about', [])
.controller('aboutTower', controller) .controller('about', controller)
.run(['$stateExtender', function($stateExtender){ .run(['$stateExtender', function($stateExtender){
$stateExtender.addState(route); $stateExtender.addState(route);
}]); }]);

View File

@@ -76,7 +76,7 @@ import '../lib/models';
import '../lib/services'; import '../lib/services';
import '../features'; import '../features';
var tower = angular.module('Tower', [ var awApp = angular.module('awApp', [
// how to add CommonJS / AMD third-party dependencies: // how to add CommonJS / AMD third-party dependencies:
// 1. npm install --save package-name // 1. npm install --save package-name
// 2. add package name to ./grunt-tasks/webpack.vendorFiles // 2. add package name to ./grunt-tasks/webpack.vendorFiles
@@ -227,6 +227,10 @@ var tower = angular.module('Tower', [
$rootScope.breadcrumb = {}; $rootScope.breadcrumb = {};
$rootScope.BRAND_NAME = AppStrings.get('BRAND_NAME'); $rootScope.BRAND_NAME = AppStrings.get('BRAND_NAME');
$rootScope.tabTitle = `Ansible ${$rootScope.BRAND_NAME}`;
$rootScope.$watch('$state.current.ncyBreadcrumbLabel', function(title) {
$rootScope.tabTitle = `Ansible ${$rootScope.BRAND_NAME} ${title || ""}`;
});
function activateTab() { function activateTab() {
// Make the correct tab active // Make the correct tab active
@@ -276,6 +280,8 @@ var tower = angular.module('Tower', [
$rootScope.crumbCache = []; $rootScope.crumbCache = [];
$rootScope.$on("$stateChangeStart", function (event, next) { $rootScope.$on("$stateChangeStart", function (event, next) {
// let current_title = $rootScope.$state.current.ncyBreadcrumbLabel || "";
// $rootScope.tabTitle = `Ansible ${$rootScope.BRAND_NAME} ${current_title}`;
// Remove any lingering intervals // Remove any lingering intervals
// except on jobResults.* states // except on jobResults.* states
var jobResultStates = [ var jobResultStates = [
@@ -455,4 +461,4 @@ var tower = angular.module('Tower', [
} }
]); ]);
export default tower; export default awApp;

View File

@@ -65,7 +65,7 @@ export default
}) })
.error(function (data, status) { .error(function (data, status) {
Wait('stop'); Wait('stop');
// TODO: hopefully this conditional error handling will to away in a future version of tower. The reason why we cannot // TODO: hopefully this conditional error handling will to away in a future versions. The reason why we cannot
// simply pass this error to ProcessErrors is because it will actually match the form element 'ssh_key_unlock' and show // simply pass this error to ProcessErrors is because it will actually match the form element 'ssh_key_unlock' and show
// the error there. The ssh_key_unlock field is not shown when the kind of credential is gce/azure and as a result the // the error there. The ssh_key_unlock field is not shown when the kind of credential is gce/azure and as a result the
// error is never shown. In the future, the API will hopefully either behave or respond differently. // error is never shown. In the future, the API will hopefully either behave or respond differently.

View File

@@ -8,4 +8,4 @@ import footerDirective from './footer.directive';
export default export default
angular.module('footer', []) angular.module('footer', [])
.directive('towerFooter', footerDirective); .directive('customFooter', footerDirective);

View File

@@ -32,7 +32,7 @@
* that with the login form. Doing this each time the controller is instantiated insures the form is clean and not pre-populated with a prior user's username and password. * that with the login form. Doing this each time the controller is instantiated insures the form is clean and not pre-populated with a prior user's username and password.
* *
* Just before the release of 2.0 a bug was discovered where clicking logout and then immediately clicking login without providing a username and password would successfully log * Just before the release of 2.0 a bug was discovered where clicking logout and then immediately clicking login without providing a username and password would successfully log
* the user back into Tower. Implementing the above approach fixed this, forcing a new username/password to be entered each time the login dialog appears. * the user back into the app. Implementing the above approach fixed this, forcing a new username/password to be entered each time the login dialog appears.
* *
* #Login Workflow * #Login Workflow
* *
@@ -44,7 +44,7 @@
* - Get user informaton by calling Authorization.getUser() - sends a GET request to /api/v2/me * - Get user informaton by calling Authorization.getUser() - sends a GET request to /api/v2/me
* - Store user information in the session cookie by calling Authorization.setUser(). * - Store user information in the session cookie by calling Authorization.setUser().
* - Get the license by calling ConfigService.getConfig() - sends a GET request to /api/vi/config * - Get the license by calling ConfigService.getConfig() - sends a GET request to /api/vi/config
* - Stores the license object in memory by calling CheckLicense.test(). This adds the version and a tested flag to the license object. The tested flag is initially set to false. Additionally, the pendoService and FeaturesService are called to initiate the other startup services of Tower * - Stores the license object in memory by calling CheckLicense.test(). This adds the version and a tested flag to the license object. The tested flag is initially set to false. Additionally, the pendoService and FeaturesService are called to initiate the other startup services
* *
* Note that there is a session timer kept on the server side as well as the client side. Each time an API request is made, app.js calls * Note that there is a session timer kept on the server side as well as the client side. Each time an API request is made, app.js calls
* Timer.isExpired(). This verifies the UI does not think the session is expired, and if not, moves the expiration time into the future. The number of * Timer.isExpired(). This verifies the UI does not think the session is expired, and if not, moves the expiration time into the future. The number of

View File

@@ -42,7 +42,7 @@ export default
// Cancel // Cancel
scope.cancelConfigure = function () { scope.cancelConfigure = function () {
try { try {
$('#configure-tower-dialog').dialog('close'); $('#configure-dialog').dialog('close');
$("#configure-save-button").remove(); $("#configure-save-button").remove();
} }
catch(e) { catch(e) {
@@ -131,7 +131,7 @@ export default
.success(function(data) { .success(function(data) {
Wait('stop'); Wait('stop');
$("#prompt-for-days-facts").dialog("close"); $("#prompt-for-days-facts").dialog("close");
$("#configure-tower-dialog").dialog('close'); $("#configure-dialog").dialog('close');
$state.go('managementJobStdout', {id: data.system_job}, {reload:true}); $state.go('managementJobStdout', {id: data.system_job}, {reload:true});
}) })
.error(function(data, status) { .error(function(data, status) {
@@ -151,7 +151,7 @@ export default
scope.removePromptForDays(); scope.removePromptForDays();
} }
scope.removePromptForDays = scope.$on('PromptForDaysFacts', function() { scope.removePromptForDays = scope.$on('PromptForDaysFacts', function() {
// $('#configure-tower-dialog').dialog('close'); // $('#configure-dialog').dialog('close');
$('#prompt-for-days-facts').show(); $('#prompt-for-days-facts').show();
$('#prompt-for-days-facts').dialog('open'); $('#prompt-for-days-facts').dialog('open');
CreateSelect2({ CreateSelect2({
@@ -221,7 +221,7 @@ export default
.success(function(data) { .success(function(data) {
Wait('stop'); Wait('stop');
$("#prompt-for-days").dialog("close"); $("#prompt-for-days").dialog("close");
// $("#configure-tower-dialog").dialog('close'); // $("#configure-dialog").dialog('close');
$state.go('managementJobStdout', {id: data.system_job}, {reload:true}); $state.go('managementJobStdout', {id: data.system_job}, {reload:true});
}) })
.error(function(data, status) { .error(function(data, status) {
@@ -241,7 +241,7 @@ export default
scope.removePromptForDays(); scope.removePromptForDays();
} }
scope.removePromptForDays = scope.$on('PromptForDays', function() { scope.removePromptForDays = scope.$on('PromptForDays', function() {
// $('#configure-tower-dialog').dialog('close'); // $('#configure-dialog').dialog('close');
$('#prompt-for-days').show(); $('#prompt-for-days').show();
$('#prompt-for-days').dialog('open'); $('#prompt-for-days').dialog('open');
Wait('stop'); Wait('stop');

View File

@@ -98,7 +98,7 @@ export default
str = `ws-${data.group_name}-${data.ad_hoc_command}`; str = `ws-${data.group_name}-${data.ad_hoc_command}`;
} }
else if(data.group_name==="control"){ else if(data.group_name==="control"){
// As of Tower v. 3.1.0, there is only 1 "control" // As of v. 3.1.0, there is only 1 "control"
// message, which is for expiring the session if the // message, which is for expiring the session if the
// session limit is breached. // session limit is breached.
$log.debug(data.reason); $log.debug(data.reason);

View File

@@ -13,6 +13,7 @@ function loadFactTemplate(factTemplate, fact) {
} }
} }
FactTemplate.prototype.render = function(factData) { FactTemplate.prototype.render = function(factData) {
if (_.isUndefined(factData) || _.isEmpty(factData)) { if (_.isUndefined(factData) || _.isEmpty(factData)) {

View File

@@ -1,11 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
{% load i18n %} {% load i18n %}
<html lang="en" ng-app="Tower"> <html lang="en" ng-app="awApp">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>{% trans 'Ansible Tower' %}</title> <title ng-bind="tabTitle"></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="{{ STATIC_URL }}assets/custom-theme/jquery-ui-1.10.3.custom.min.css" /> <link rel="stylesheet" href="{{ STATIC_URL }}assets/custom-theme/jquery-ui-1.10.3.custom.min.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}assets/ansible-bootstrap.min.css" /> <link rel="stylesheet" href="{{ STATIC_URL }}assets/ansible-bootstrap.min.css" />
@@ -166,7 +166,7 @@
<p>{% trans 'working...' %}</p> <p>{% trans 'working...' %}</p>
</div> </div>
</div> </div>
<tower-footer></tower-footer> <custom-footer></custom-footer>
</body> </body>
</html> </html>

View File

@@ -10,7 +10,7 @@ import low_insights_json from './data/low.insights-data.js';
describe('Service: InsightsService', () => { describe('Service: InsightsService', () => {
let InsightsService; let InsightsService;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(angular.mock.inject(( _InsightsService_) => { beforeEach(angular.mock.inject(( _InsightsService_) => {
InsightsService = _InsightsService_; InsightsService = _InsightsService_;

View File

@@ -5,7 +5,7 @@ describe('Service: InventoriesService', () => {
let Rest, let Rest,
InventoriesService; InventoriesService;
beforeEach(angular.mock.module('Tower'), ($provide)=>{ beforeEach(angular.mock.module('awApp'), ($provide)=>{
$provide.value('Rest', Rest); $provide.value('Rest', Rest);
}); });
beforeEach(angular.mock.module('inventoryManage')); beforeEach(angular.mock.module('inventoryManage'));

View File

@@ -196,7 +196,7 @@ describe('Controller: jobResultsController', () => {
}); });
}); });
describe('getTowerLinks()', () => { describe('getLinks()', () => {
beforeEach(() => { beforeEach(() => {
jobData.related = { jobData.related = {
"created_by": "api/v2/users/12", "created_by": "api/v2/users/12",
@@ -225,7 +225,7 @@ describe('Controller: jobResultsController', () => {
}); });
}); });
describe('getTowerLabels()', () => { describe('getLabels()', () => {
beforeEach(() => { beforeEach(() => {
jobDataOptions.actions.GET = { jobDataOptions.actions.GET = {
status: { status: {

View File

@@ -3,7 +3,7 @@
describe('jobResultsService', () => { describe('jobResultsService', () => {
let jobResultsService; let jobResultsService;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(angular.mock.inject(( _jobResultsService_) => { beforeEach(angular.mock.inject(( _jobResultsService_) => {
jobResultsService = _jobResultsService_; jobResultsService = _jobResultsService_;

View File

@@ -4,7 +4,7 @@ describe('parseStdoutService', () => {
let parseStdoutService, let parseStdoutService,
log; log;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(angular.mock.module('jobResults',($provide) => { beforeEach(angular.mock.module('jobResults',($provide) => {
log = jasmine.createSpyObj('$log', [ log = jasmine.createSpyObj('$log', [

View File

@@ -8,7 +8,7 @@ describe('Controller: LicenseController', () => {
ProcessErrors, ProcessErrors,
config; config;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(angular.mock.module('license', ($provide) => { beforeEach(angular.mock.module('license', ($provide) => {
ConfigService = jasmine.createSpyObj('ConfigService', [ ConfigService = jasmine.createSpyObj('ConfigService', [
'getConfig', 'getConfig',

View File

@@ -3,7 +3,7 @@
describe('Filter: append', () => { describe('Filter: append', () => {
var filter; var filter;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(function(){ beforeEach(function(){
inject(function($injector){ inject(function($injector){

View File

@@ -3,7 +3,7 @@
describe('Filter: capitalize', () => { describe('Filter: capitalize', () => {
var filter; var filter;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(function(){ beforeEach(function(){
inject(function($injector){ inject(function($injector){

View File

@@ -3,7 +3,7 @@
describe('Filter: formatEpoch', () => { describe('Filter: formatEpoch', () => {
var filter; var filter;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(function(){ beforeEach(function(){
inject(function($injector){ inject(function($injector){

View File

@@ -3,7 +3,7 @@
describe('Filter: isEmpty', () => { describe('Filter: isEmpty', () => {
var filter; var filter;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(function(){ beforeEach(function(){
inject(function($injector){ inject(function($injector){

View File

@@ -3,7 +3,7 @@
describe('Filter: longDate', () => { describe('Filter: longDate', () => {
var filter; var filter;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(function(){ beforeEach(function(){
inject(function($injector){ inject(function($injector){

View File

@@ -3,7 +3,7 @@
describe('Filter: prepend', () => { describe('Filter: prepend', () => {
var filter; var filter;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(function(){ beforeEach(function(){
inject(function($injector){ inject(function($injector){

View File

@@ -3,7 +3,7 @@
describe('Filter: sanitize', () => { describe('Filter: sanitize', () => {
var filter; var filter;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(function(){ beforeEach(function(){
inject(function($injector){ inject(function($injector){

View File

@@ -6,7 +6,7 @@ describe('Service: QuerySet', () => {
Authorization, Authorization,
SmartSearchService; SmartSearchService;
beforeEach(angular.mock.module('Tower', ($provide) =>{ beforeEach(angular.mock.module('awApp', ($provide) =>{
// @todo: improve app source / write testing utilities for interim // @todo: improve app source / write testing utilities for interim
// we don't want to be concerned with this provision in every test that involves the Rest module // we don't want to be concerned with this provision in every test that involves the Rest module
Authorization = { Authorization = {

View File

@@ -3,7 +3,7 @@
describe('Service: SmartSearch', () => { describe('Service: SmartSearch', () => {
let SmartSearchService; let SmartSearchService;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(angular.mock.module('SmartSearchModule')); beforeEach(angular.mock.module('SmartSearchModule'));

View File

@@ -18,7 +18,7 @@ describe('Controller: TemplatesList', () => {
deleteJobTemplateDeferred, deleteJobTemplateDeferred,
Dataset; Dataset;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(angular.mock.module('templates', ($provide) => { beforeEach(angular.mock.module('templates', ($provide) => {
state = jasmine.createSpyObj('state', [ state = jasmine.createSpyObj('state', [

View File

@@ -18,7 +18,7 @@ describe('Controller: WorkflowAdd', () => {
ToJSON, ToJSON,
availableLabels; availableLabels;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(angular.mock.module('RestServices')); beforeEach(angular.mock.module('RestServices'));
beforeEach(angular.mock.module('templates', ($provide) => { beforeEach(angular.mock.module('templates', ($provide) => {

View File

@@ -8,7 +8,7 @@ describe('Controller: WorkflowMaker', () => {
q, q,
getWorkflowJobTemplateNodesDeferred; getWorkflowJobTemplateNodesDeferred;
beforeEach(angular.mock.module('Tower')); beforeEach(angular.mock.module('awApp'));
beforeEach(angular.mock.module('templates', () => { beforeEach(angular.mock.module('templates', () => {
TemplatesService = { TemplatesService = {