From f7f186e6766c68b2b415f3a6c7cfe884c6a50b6d Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 17 Jul 2017 16:48:45 -0700 Subject: [PATCH 1/2] removing more references to "Tower" in the code base --- awx/ui/client/legacy-styles/ansible-ui.less | 2 +- awx/ui/client/src/about/main.js | 6 +++--- awx/ui/client/src/app.js | 4 ++-- .../factories/credential-form-save.factory.js | 2 +- awx/ui/client/src/footer/main.js | 2 +- .../src/login/loginModal/loginModal.controller.js | 4 ++-- .../client/src/management-jobs/card/card.controller.js | 10 +++++----- awx/ui/client/src/shared/socket/socket.service.js | 2 +- awx/ui/templates/ui/index.html | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index 46957217e0..1521516ced 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -276,7 +276,7 @@ i:active, opacity: 0; } -#configure-tower-dialog, #configure-schedules-form-container { +#configure-dialog, #configure-schedules-form-container { display: none; overflow-x: hidden; overflow-y: auto; diff --git a/awx/ui/client/src/about/main.js b/awx/ui/client/src/about/main.js index 87b9237140..8ef9d54b63 100644 --- a/awx/ui/client/src/about/main.js +++ b/awx/ui/client/src/about/main.js @@ -8,8 +8,8 @@ import route from './about.route'; export default - angular.module('aboutTower', []) - .controller('aboutTower', controller) + angular.module('about', []) + .controller('about', controller) .run(['$stateExtender', function($stateExtender){ $stateExtender.addState(route); - }]); \ No newline at end of file + }]); diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index dcc9500834..4bec42100b 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -77,7 +77,7 @@ import '../lib/models'; import '../lib/services'; import '../features'; -var tower = angular.module('Tower', [ +var app = angular.module('app', [ // how to add CommonJS / AMD third-party dependencies: // 1. npm install --save package-name // 2. add package name to ./grunt-tasks/webpack.vendorFiles @@ -460,4 +460,4 @@ var tower = angular.module('Tower', [ } ]); -export default tower; +export default app; diff --git a/awx/ui/client/src/credentials/factories/credential-form-save.factory.js b/awx/ui/client/src/credentials/factories/credential-form-save.factory.js index bdd4fe8c30..ec47648497 100644 --- a/awx/ui/client/src/credentials/factories/credential-form-save.factory.js +++ b/awx/ui/client/src/credentials/factories/credential-form-save.factory.js @@ -65,7 +65,7 @@ export default }) .error(function (data, status) { 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 // 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. diff --git a/awx/ui/client/src/footer/main.js b/awx/ui/client/src/footer/main.js index 1bbd6a10c0..1bb909cf34 100644 --- a/awx/ui/client/src/footer/main.js +++ b/awx/ui/client/src/footer/main.js @@ -8,4 +8,4 @@ import footerDirective from './footer.directive'; export default angular.module('footer', []) - .directive('towerFooter', footerDirective); + .directive('customFooter', footerDirective); diff --git a/awx/ui/client/src/login/loginModal/loginModal.controller.js b/awx/ui/client/src/login/loginModal/loginModal.controller.js index 037a823a4e..8bc8c86413 100644 --- a/awx/ui/client/src/login/loginModal/loginModal.controller.js +++ b/awx/ui/client/src/login/loginModal/loginModal.controller.js @@ -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. * * 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 * @@ -44,7 +44,7 @@ * - 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(). * - 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 * 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 diff --git a/awx/ui/client/src/management-jobs/card/card.controller.js b/awx/ui/client/src/management-jobs/card/card.controller.js index 9d8347b452..ce94245d9a 100644 --- a/awx/ui/client/src/management-jobs/card/card.controller.js +++ b/awx/ui/client/src/management-jobs/card/card.controller.js @@ -42,7 +42,7 @@ export default // Cancel scope.cancelConfigure = function () { try { - $('#configure-tower-dialog').dialog('close'); + $('#configure-dialog').dialog('close'); $("#configure-save-button").remove(); } catch(e) { @@ -131,7 +131,7 @@ export default .success(function(data) { Wait('stop'); $("#prompt-for-days-facts").dialog("close"); - $("#configure-tower-dialog").dialog('close'); + $("#configure-dialog").dialog('close'); $state.go('managementJobStdout', {id: data.system_job}, {reload:true}); }) .error(function(data, status) { @@ -151,7 +151,7 @@ export default scope.removePromptForDays(); } scope.removePromptForDays = scope.$on('PromptForDaysFacts', function() { - // $('#configure-tower-dialog').dialog('close'); + // $('#configure-dialog').dialog('close'); $('#prompt-for-days-facts').show(); $('#prompt-for-days-facts').dialog('open'); CreateSelect2({ @@ -221,7 +221,7 @@ export default .success(function(data) { Wait('stop'); $("#prompt-for-days").dialog("close"); - // $("#configure-tower-dialog").dialog('close'); + // $("#configure-dialog").dialog('close'); $state.go('managementJobStdout', {id: data.system_job}, {reload:true}); }) .error(function(data, status) { @@ -241,7 +241,7 @@ export default scope.removePromptForDays(); } scope.removePromptForDays = scope.$on('PromptForDays', function() { - // $('#configure-tower-dialog').dialog('close'); + // $('#configure-dialog').dialog('close'); $('#prompt-for-days').show(); $('#prompt-for-days').dialog('open'); Wait('stop'); diff --git a/awx/ui/client/src/shared/socket/socket.service.js b/awx/ui/client/src/shared/socket/socket.service.js index bd166291b8..d7fe283391 100644 --- a/awx/ui/client/src/shared/socket/socket.service.js +++ b/awx/ui/client/src/shared/socket/socket.service.js @@ -98,7 +98,7 @@ export default str = `ws-${data.group_name}-${data.ad_hoc_command}`; } 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 // session limit is breached. $log.debug(data.reason); diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index 64255fd1a2..7afc8043df 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -1,6 +1,6 @@ {% load i18n %} - + @@ -173,7 +173,7 @@

{% trans 'working...' %}

- + From 80111c2091152f4673f6d3e0bd1f61edec10f5e4 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 18 Jul 2017 14:43:37 -0700 Subject: [PATCH 2/2] fixing tests --- awx/ui/client/src/app.js | 10 ++++++++-- .../src/system-tracking/compare-facts/fact-template.js | 1 + awx/ui/templates/ui/index.html | 4 ++-- .../spec/inventories/insights/insights.service-test.js | 2 +- .../manage/inventory-manage.service-test.js | 2 +- .../spec/job-results/job-results.controller-test.js | 4 ++-- .../tests/spec/job-results/job-results.service-test.js | 2 +- .../spec/job-results/parse-stdout.service-test.js | 2 +- awx/ui/tests/spec/license/license.controller-test.js | 2 +- awx/ui/tests/spec/shared/filters/append.filter-test.js | 2 +- .../spec/shared/filters/capitalize.filter-test.js | 2 +- .../spec/shared/filters/format-epoch.filter-test.js | 2 +- .../tests/spec/shared/filters/is-empty.filter-test.js | 2 +- .../tests/spec/shared/filters/long-date.filter-test.js | 2 +- .../tests/spec/shared/filters/prepend.filter-test.js | 2 +- .../spec/shared/filters/xss-sanitizer.filter-test.js | 2 +- .../tests/spec/smart-search/queryset.service-test.js | 2 +- .../spec/smart-search/smart-search.service-test.js | 2 +- .../spec/templates/templates-list.controller-test.js | 2 +- .../spec/workflows/workflow-add.controller-test.js | 2 +- .../spec/workflows/workflow-maker.controller-test.js | 2 +- 21 files changed, 30 insertions(+), 23 deletions(-) diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index 4bec42100b..a641d3932f 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -77,7 +77,7 @@ import '../lib/models'; import '../lib/services'; import '../features'; -var app = angular.module('app', [ +var awApp = angular.module('awApp', [ // how to add CommonJS / AMD third-party dependencies: // 1. npm install --save package-name // 2. add package name to ./grunt-tasks/webpack.vendorFiles @@ -232,6 +232,10 @@ var app = angular.module('app', [ $rootScope.breadcrumb = {}; $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() { // Make the correct tab active @@ -281,6 +285,8 @@ var app = angular.module('app', [ $rootScope.crumbCache = []; $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 // except on jobResults.* states var jobResultStates = [ @@ -460,4 +466,4 @@ var app = angular.module('app', [ } ]); -export default app; +export default awApp; diff --git a/awx/ui/client/src/system-tracking/compare-facts/fact-template.js b/awx/ui/client/src/system-tracking/compare-facts/fact-template.js index 506e893f2c..dcb666ee9a 100644 --- a/awx/ui/client/src/system-tracking/compare-facts/fact-template.js +++ b/awx/ui/client/src/system-tracking/compare-facts/fact-template.js @@ -13,6 +13,7 @@ function loadFactTemplate(factTemplate, fact) { } } + FactTemplate.prototype.render = function(factData) { if (_.isUndefined(factData) || _.isEmpty(factData)) { diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index 7afc8043df..1dbd60d3e0 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -1,11 +1,11 @@ {% load i18n %} - + - {% trans 'Ansible Tower' %} + diff --git a/awx/ui/tests/spec/inventories/insights/insights.service-test.js b/awx/ui/tests/spec/inventories/insights/insights.service-test.js index 4a8091b6bf..93024a86b9 100644 --- a/awx/ui/tests/spec/inventories/insights/insights.service-test.js +++ b/awx/ui/tests/spec/inventories/insights/insights.service-test.js @@ -10,7 +10,7 @@ import low_insights_json from './data/low.insights-data.js'; describe('Service: InsightsService', () => { let InsightsService; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(angular.mock.inject(( _InsightsService_) => { InsightsService = _InsightsService_; diff --git a/awx/ui/tests/spec/inventories/manage/inventory-manage.service-test.js b/awx/ui/tests/spec/inventories/manage/inventory-manage.service-test.js index 21afbec8d2..c72e49c32e 100644 --- a/awx/ui/tests/spec/inventories/manage/inventory-manage.service-test.js +++ b/awx/ui/tests/spec/inventories/manage/inventory-manage.service-test.js @@ -5,7 +5,7 @@ describe('Service: InventoriesService', () => { let Rest, InventoriesService; - beforeEach(angular.mock.module('Tower'), ($provide)=>{ + beforeEach(angular.mock.module('awApp'), ($provide)=>{ $provide.value('Rest', Rest); }); beforeEach(angular.mock.module('inventoryManage')); diff --git a/awx/ui/tests/spec/job-results/job-results.controller-test.js b/awx/ui/tests/spec/job-results/job-results.controller-test.js index f616d642cb..af3aeeae34 100644 --- a/awx/ui/tests/spec/job-results/job-results.controller-test.js +++ b/awx/ui/tests/spec/job-results/job-results.controller-test.js @@ -196,7 +196,7 @@ describe('Controller: jobResultsController', () => { }); }); - describe('getTowerLinks()', () => { + describe('getLinks()', () => { beforeEach(() => { jobData.related = { "created_by": "api/v2/users/12", @@ -225,7 +225,7 @@ describe('Controller: jobResultsController', () => { }); }); - describe('getTowerLabels()', () => { + describe('getLabels()', () => { beforeEach(() => { jobDataOptions.actions.GET = { status: { diff --git a/awx/ui/tests/spec/job-results/job-results.service-test.js b/awx/ui/tests/spec/job-results/job-results.service-test.js index 85cc0e526f..1219f2e450 100644 --- a/awx/ui/tests/spec/job-results/job-results.service-test.js +++ b/awx/ui/tests/spec/job-results/job-results.service-test.js @@ -3,7 +3,7 @@ describe('jobResultsService', () => { let jobResultsService; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(angular.mock.inject(( _jobResultsService_) => { jobResultsService = _jobResultsService_; diff --git a/awx/ui/tests/spec/job-results/parse-stdout.service-test.js b/awx/ui/tests/spec/job-results/parse-stdout.service-test.js index ab2249c101..80268a16d9 100644 --- a/awx/ui/tests/spec/job-results/parse-stdout.service-test.js +++ b/awx/ui/tests/spec/job-results/parse-stdout.service-test.js @@ -4,7 +4,7 @@ describe('parseStdoutService', () => { let parseStdoutService, log; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(angular.mock.module('jobResults',($provide) => { log = jasmine.createSpyObj('$log', [ diff --git a/awx/ui/tests/spec/license/license.controller-test.js b/awx/ui/tests/spec/license/license.controller-test.js index d2bde80536..eb013776b4 100644 --- a/awx/ui/tests/spec/license/license.controller-test.js +++ b/awx/ui/tests/spec/license/license.controller-test.js @@ -8,7 +8,7 @@ describe('Controller: LicenseController', () => { ProcessErrors, config; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(angular.mock.module('license', ($provide) => { ConfigService = jasmine.createSpyObj('ConfigService', [ 'getConfig', diff --git a/awx/ui/tests/spec/shared/filters/append.filter-test.js b/awx/ui/tests/spec/shared/filters/append.filter-test.js index f8a1ddcd47..b687797aef 100644 --- a/awx/ui/tests/spec/shared/filters/append.filter-test.js +++ b/awx/ui/tests/spec/shared/filters/append.filter-test.js @@ -3,7 +3,7 @@ describe('Filter: append', () => { var filter; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(function(){ inject(function($injector){ diff --git a/awx/ui/tests/spec/shared/filters/capitalize.filter-test.js b/awx/ui/tests/spec/shared/filters/capitalize.filter-test.js index d0f939c480..671385ce4a 100644 --- a/awx/ui/tests/spec/shared/filters/capitalize.filter-test.js +++ b/awx/ui/tests/spec/shared/filters/capitalize.filter-test.js @@ -3,7 +3,7 @@ describe('Filter: capitalize', () => { var filter; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(function(){ inject(function($injector){ diff --git a/awx/ui/tests/spec/shared/filters/format-epoch.filter-test.js b/awx/ui/tests/spec/shared/filters/format-epoch.filter-test.js index f3456f4b7d..5b6d54d285 100644 --- a/awx/ui/tests/spec/shared/filters/format-epoch.filter-test.js +++ b/awx/ui/tests/spec/shared/filters/format-epoch.filter-test.js @@ -3,7 +3,7 @@ describe('Filter: formatEpoch', () => { var filter; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(function(){ inject(function($injector){ diff --git a/awx/ui/tests/spec/shared/filters/is-empty.filter-test.js b/awx/ui/tests/spec/shared/filters/is-empty.filter-test.js index bbb156bf48..db6c87ea2a 100644 --- a/awx/ui/tests/spec/shared/filters/is-empty.filter-test.js +++ b/awx/ui/tests/spec/shared/filters/is-empty.filter-test.js @@ -3,7 +3,7 @@ describe('Filter: isEmpty', () => { var filter; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(function(){ inject(function($injector){ diff --git a/awx/ui/tests/spec/shared/filters/long-date.filter-test.js b/awx/ui/tests/spec/shared/filters/long-date.filter-test.js index a0e222c586..3bd3857f7a 100644 --- a/awx/ui/tests/spec/shared/filters/long-date.filter-test.js +++ b/awx/ui/tests/spec/shared/filters/long-date.filter-test.js @@ -3,7 +3,7 @@ describe('Filter: longDate', () => { var filter; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(function(){ inject(function($injector){ diff --git a/awx/ui/tests/spec/shared/filters/prepend.filter-test.js b/awx/ui/tests/spec/shared/filters/prepend.filter-test.js index f22c077ecd..424b023fe8 100644 --- a/awx/ui/tests/spec/shared/filters/prepend.filter-test.js +++ b/awx/ui/tests/spec/shared/filters/prepend.filter-test.js @@ -3,7 +3,7 @@ describe('Filter: prepend', () => { var filter; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(function(){ inject(function($injector){ diff --git a/awx/ui/tests/spec/shared/filters/xss-sanitizer.filter-test.js b/awx/ui/tests/spec/shared/filters/xss-sanitizer.filter-test.js index 88cb3458e1..2f4db9df83 100644 --- a/awx/ui/tests/spec/shared/filters/xss-sanitizer.filter-test.js +++ b/awx/ui/tests/spec/shared/filters/xss-sanitizer.filter-test.js @@ -3,7 +3,7 @@ describe('Filter: sanitize', () => { var filter; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(function(){ inject(function($injector){ diff --git a/awx/ui/tests/spec/smart-search/queryset.service-test.js b/awx/ui/tests/spec/smart-search/queryset.service-test.js index 4ac549a9f0..bd1f5ae833 100644 --- a/awx/ui/tests/spec/smart-search/queryset.service-test.js +++ b/awx/ui/tests/spec/smart-search/queryset.service-test.js @@ -6,7 +6,7 @@ describe('Service: QuerySet', () => { Authorization, SmartSearchService; - beforeEach(angular.mock.module('Tower', ($provide) =>{ + beforeEach(angular.mock.module('awApp', ($provide) =>{ // @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 Authorization = { diff --git a/awx/ui/tests/spec/smart-search/smart-search.service-test.js b/awx/ui/tests/spec/smart-search/smart-search.service-test.js index 0170a6d9ff..13af06e51c 100644 --- a/awx/ui/tests/spec/smart-search/smart-search.service-test.js +++ b/awx/ui/tests/spec/smart-search/smart-search.service-test.js @@ -3,7 +3,7 @@ describe('Service: SmartSearch', () => { let SmartSearchService; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(angular.mock.module('SmartSearchModule')); diff --git a/awx/ui/tests/spec/templates/templates-list.controller-test.js b/awx/ui/tests/spec/templates/templates-list.controller-test.js index d620e39d6f..a13514b706 100644 --- a/awx/ui/tests/spec/templates/templates-list.controller-test.js +++ b/awx/ui/tests/spec/templates/templates-list.controller-test.js @@ -18,7 +18,7 @@ describe('Controller: TemplatesList', () => { deleteJobTemplateDeferred, Dataset; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(angular.mock.module('templates', ($provide) => { state = jasmine.createSpyObj('state', [ diff --git a/awx/ui/tests/spec/workflows/workflow-add.controller-test.js b/awx/ui/tests/spec/workflows/workflow-add.controller-test.js index 7884f4c0a7..0f7e588227 100644 --- a/awx/ui/tests/spec/workflows/workflow-add.controller-test.js +++ b/awx/ui/tests/spec/workflows/workflow-add.controller-test.js @@ -18,7 +18,7 @@ describe('Controller: WorkflowAdd', () => { ToJSON, availableLabels; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(angular.mock.module('RestServices')); beforeEach(angular.mock.module('templates', ($provide) => { diff --git a/awx/ui/tests/spec/workflows/workflow-maker.controller-test.js b/awx/ui/tests/spec/workflows/workflow-maker.controller-test.js index d4062bbaba..58e5db8abf 100644 --- a/awx/ui/tests/spec/workflows/workflow-maker.controller-test.js +++ b/awx/ui/tests/spec/workflows/workflow-maker.controller-test.js @@ -8,7 +8,7 @@ describe('Controller: WorkflowMaker', () => { q, getWorkflowJobTemplateNodesDeferred; - beforeEach(angular.mock.module('Tower')); + beforeEach(angular.mock.module('awApp')); beforeEach(angular.mock.module('templates', () => { TemplatesService = {