From 5344c66f45cfefd90205e0725e0c5222516577c4 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 13 Jan 2017 11:50:27 -0500 Subject: [PATCH 1/3] Only show groups with a dynamic inventory source in the workflow editor --- awx/ui/client/src/lists/InventorySources.js | 8 ++++++-- awx/ui/client/src/shared/generator-helpers.js | 6 ++++++ awx/ui/client/src/templates/main.js | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/lists/InventorySources.js b/awx/ui/client/src/lists/InventorySources.js index 127352c72b..0b822b516c 100644 --- a/awx/ui/client/src/lists/InventorySources.js +++ b/awx/ui/client/src/lists/InventorySources.js @@ -18,9 +18,13 @@ export default fields: { name: { - key: true, label: 'Name', - columnClass: 'col-md-11' + ngBind: 'inventory_source.summary_fields.group.name', + columnClass: 'col-md-11', + simpleTip: { + awToolTip: "Inventory: {{inventory_source.summary_fields.inventory.name}}", + dataPlacement: "top" + } } }, diff --git a/awx/ui/client/src/shared/generator-helpers.js b/awx/ui/client/src/shared/generator-helpers.js index e6d517b7f0..34978cdf5e 100644 --- a/awx/ui/client/src/shared/generator-helpers.js +++ b/awx/ui/client/src/shared/generator-helpers.js @@ -591,6 +591,9 @@ angular.module('GeneratorHelpers', [systemStatus.name]) } } else { + if(field.simpleTip) { + html += ``; + } // Add icon: if (field.ngShowIcon) { html += " "; @@ -615,6 +618,9 @@ angular.module('GeneratorHelpers', [systemStatus.name]) if (field.text) { html += field.text; } + if(field.simpleTip) { + html += ``; + } } if (list.name === 'hosts' || list.name === 'groups') { diff --git a/awx/ui/client/src/templates/main.js b/awx/ui/client/src/templates/main.js index e925b2e9f6..d712faa3d8 100644 --- a/awx/ui/client/src/templates/main.js +++ b/awx/ui/client/src/templates/main.js @@ -103,7 +103,8 @@ angular.module('templates', [surveyMaker.name, templatesList.name, jobTemplatesA }, inventory_source_search: { value: { - page_size: '5' + page_size: '5', + not__source: '' }, squash: true, dynamic: true From eaf68004d4972028ad26f2adc323f55a746aeb87 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 13 Jan 2017 11:58:48 -0500 Subject: [PATCH 2/3] Fixed unit test failure --- awx/ui/tests/spec/workflows/workflow-add.controller-test.js | 4 ++++ 1 file changed, 4 insertions(+) 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 e4ec2d6562..d59b21543f 100644 --- a/awx/ui/tests/spec/workflows/workflow-add.controller-test.js +++ b/awx/ui/tests/spec/workflows/workflow-add.controller-test.js @@ -84,6 +84,10 @@ describe('Controller: WorkflowAdd', () => { .whenGET('/api') .respond(200, ''); + httpBackend + .whenGET('/static/languages/en_US.json') + .respond(200, ''); + TemplatesService.getLabelOptions = jasmine.createSpy('getLabelOptions').and.returnValue(getLabelsDeferred.promise); TemplatesService.createWorkflowJobTemplate = jasmine.createSpy('createWorkflowJobTemplate').and.returnValue(createWorkflowJobTemplateDeferred.promise); From 1f40569a32a62ff2fb3ca85146fc214f0f5f13e1 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 13 Jan 2017 13:07:36 -0500 Subject: [PATCH 3/3] Changed backend mock to /static regex to catch all static requests and return 200 --- awx/ui/tests/spec/workflows/workflow-add.controller-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 d59b21543f..57e9e6ca6c 100644 --- a/awx/ui/tests/spec/workflows/workflow-add.controller-test.js +++ b/awx/ui/tests/spec/workflows/workflow-add.controller-test.js @@ -84,9 +84,9 @@ describe('Controller: WorkflowAdd', () => { .whenGET('/api') .respond(200, ''); - httpBackend - .whenGET('/static/languages/en_US.json') - .respond(200, ''); + $httpBackend + .whenGET(/\/static\/*/) + .respond(200, {}); TemplatesService.getLabelOptions = jasmine.createSpy('getLabelOptions').and.returnValue(getLabelsDeferred.promise); TemplatesService.createWorkflowJobTemplate = jasmine.createSpy('createWorkflowJobTemplate').and.returnValue(createWorkflowJobTemplateDeferred.promise);