From 4ade498c6c52def84c72142553a73b40211773f4 Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Fri, 12 Feb 2016 11:08:47 -0500 Subject: [PATCH 01/13] #646 add pagination support to setup > organizations, pass orgCount as pageSize, handle case where a 2nd page might be visible for an unusually high # of orgs, fix breadcrumb shown in organization.edit state --- awx/ui/client/src/app.js | 4 ++ .../client/src/controllers/Organizations.js | 52 ++++++++++++++++--- awx/ui/client/src/partials/organizations.html | 4 +- 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index c0b72d9dcf..7c60dc2e80 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -613,6 +613,10 @@ var tower = angular.module('Tower', [ data: { activityStreamId: 'organization_id' }, + ncyBreadcrumb: { + parent: "organizations", + label: "EDIT {{name}}" + }, resolve: { features: ['FeaturesService', function(FeaturesService) { return FeaturesService.get(); diff --git a/awx/ui/client/src/controllers/Organizations.js b/awx/ui/client/src/controllers/Organizations.js index c4966d257c..976e056722 100644 --- a/awx/ui/client/src/controllers/Organizations.js +++ b/awx/ui/client/src/controllers/Organizations.js @@ -12,13 +12,38 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, - $log, Rest, Alert, Prompt, ClearScope, ProcessErrors, GetBasePath, Wait, - $state) { + $log, $compile, Rest, PaginateWidget, PaginateInit, SearchInit, OrganizationList, Alert, Prompt, ClearScope, ProcessErrors, GetBasePath, Wait, + Stream, $state) { ClearScope(); - var defaultUrl = GetBasePath('organizations'); + var defaultUrl = GetBasePath('organizations'), + list = OrganizationList, + pageSize = $scope.orgCount; + PaginateInit({ + scope: $scope, + list: list, + url: defaultUrl, + pageSize: pageSize, + }); + SearchInit({ + scope: $scope, + list: list, + url: defaultUrl, + }); + + $scope.search(list.iterator); + + $scope.PaginateWidget = PaginateWidget({ + iterator: list.iterator, + set: 'organizations' + }); + + var paginationContainer = $('#pagination-container'); + paginationContainer.html($scope.PaginateWidget); + $compile(paginationContainer.contents())($scope) + var parseCardData = function (cards) { return cards.map(function (card) { var val = {}; @@ -111,6 +136,10 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, $('#prompt-modal').modal('hide'); }); + $scope.showActivity = function () { + Stream({ scope: $scope }); + }; + $scope.addOrganization = function () { $state.transitionTo('organizations.add'); }; @@ -150,9 +179,9 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, } OrganizationsList.$inject = ['$stateParams', '$scope', '$rootScope', - '$location', '$log', 'Rest', 'Alert', 'Prompt', 'ClearScope', + '$location', '$log', '$compile', 'Rest', 'PaginateWidget', 'PaginateInit', 'SearchInit', 'OrganizationList', 'Alert', 'Prompt', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'Wait', - '$state' + 'Stream', '$state' ]; @@ -167,6 +196,7 @@ export function OrganizationsAdd($scope, $rootScope, $compile, $location, $log, form = OrganizationForm, base = $location.path().replace(/^\//, '').split('/')[0]; + generator.inject(form, { mode: 'add', related: false, scope: $scope}); generator.reset(); @@ -213,7 +243,7 @@ OrganizationsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, OrganizationForm, GenerateForm, Rest, Alert, ProcessErrors, RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, - Wait, $state) { + Wait, Stream, $state) { ClearScope(); @@ -302,6 +332,12 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, }); }; + $scope.showActivity = function () { + Stream({ + scope: $scope + }); + }; + $scope.formCancel = function () { $scope.$emit("ReloadOrganzationCards"); $scope.$emit("ShowOrgListHeader"); @@ -353,5 +389,5 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, OrganizationsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'OrganizationForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', - 'ClearScope', 'GetBasePath', 'Wait', '$state' -]; + 'ClearScope', 'GetBasePath', 'Wait', 'Stream', '$state' +]; \ No newline at end of file diff --git a/awx/ui/client/src/partials/organizations.html b/awx/ui/client/src/partials/organizations.html index b59c4c675c..c04044ac94 100644 --- a/awx/ui/client/src/partials/organizations.html +++ b/awx/ui/client/src/partials/organizations.html @@ -57,4 +57,6 @@ - +
+
+ \ No newline at end of file From 4558b880a0af2448d74f2ff90a9b14dd5457318e Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Fri, 12 Feb 2016 11:26:33 -0500 Subject: [PATCH 02/13] remove Stream dependencies --- awx/ui/client/src/controllers/Organizations.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/awx/ui/client/src/controllers/Organizations.js b/awx/ui/client/src/controllers/Organizations.js index 976e056722..bf308dfc1c 100644 --- a/awx/ui/client/src/controllers/Organizations.js +++ b/awx/ui/client/src/controllers/Organizations.js @@ -13,7 +13,7 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, $log, $compile, Rest, PaginateWidget, PaginateInit, SearchInit, OrganizationList, Alert, Prompt, ClearScope, ProcessErrors, GetBasePath, Wait, - Stream, $state) { + $state) { ClearScope(); @@ -136,9 +136,7 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, $('#prompt-modal').modal('hide'); }); - $scope.showActivity = function () { - Stream({ scope: $scope }); - }; + $scope.addOrganization = function () { $state.transitionTo('organizations.add'); @@ -181,7 +179,7 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, OrganizationsList.$inject = ['$stateParams', '$scope', '$rootScope', '$location', '$log', '$compile', 'Rest', 'PaginateWidget', 'PaginateInit', 'SearchInit', 'OrganizationList', 'Alert', 'Prompt', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'Wait', - 'Stream', '$state' + '$state' ]; @@ -243,7 +241,7 @@ OrganizationsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, OrganizationForm, GenerateForm, Rest, Alert, ProcessErrors, RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, - Wait, Stream, $state) { + Wait, $state) { ClearScope(); @@ -332,12 +330,6 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, }); }; - $scope.showActivity = function () { - Stream({ - scope: $scope - }); - }; - $scope.formCancel = function () { $scope.$emit("ReloadOrganzationCards"); $scope.$emit("ShowOrgListHeader"); @@ -389,5 +381,5 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, OrganizationsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'OrganizationForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', - 'ClearScope', 'GetBasePath', 'Wait', 'Stream', '$state' + 'ClearScope', 'GetBasePath', 'Wait', '$state' ]; \ No newline at end of file From 2c432ee974a4b6433e967dbce5bbaade9705e443 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 12 Feb 2016 11:55:26 -0500 Subject: [PATCH 03/13] fix scheduler name border color issues --- awx/ui/client/legacy-styles/ansible-ui.less | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index a9c4e6fc85..47eacf7f81 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -630,6 +630,14 @@ dd { box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 5px rgba(255, 88, 80, 0.6); } + .form-control.ng-dirty.ng-pristine { + border-color: #e1e1e1; + box-shadow: none; + } + + .form-control.ng-dirty.ng-pristine:focus { + border-color: #1678c4; + } /* For some reason TB 3 RC1 does not provide an input-mini */ .input-mini { @@ -2018,3 +2026,11 @@ button.dropdown-toggle, .list-actions button, .list-actions .checkbox-inline { margin-top: 10px; } + +.select2-container--disabled,.select2-container--disabled .select2-selection--single{ + cursor: not-allowed !important; +} + +.select2-container--disabled { + opacity: .35; +} From 6283f8715d1674afb177a1299c4d144476ec20f2 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 12 Feb 2016 11:56:12 -0500 Subject: [PATCH 04/13] fixed icon colors for form elements with buttons --- awx/ui/client/legacy-styles/forms.less | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 8c3de00020..bc2c6fe284 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -191,8 +191,13 @@ cursor: pointer!important; } +.Form-inputButton { + border-color: #e1e1e1; + color: #b7b7b7; +} + .Form-numberInputButton{ - color: @field-label!important; + color: @default-icon!important; font-size: 14px; } From e7cf1ce0212930a45c655883cb141f34ab3bc2c0 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 12 Feb 2016 11:57:40 -0500 Subject: [PATCH 05/13] add support for select2 in scheduler form --- .../lib/angular-scheduler.js | 2 + .../repeatFrequencyOptions.block.less | 25 +++++++- .../src/scheduler/schedulerAdd.controller.js | 63 ++++++++++++++++++- .../src/scheduler/schedulerEdit.controller.js | 61 +++++++++++++++++- 4 files changed, 147 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js b/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js index 7ed581a09f..4f4d49e358 100644 --- a/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js +++ b/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js @@ -108,6 +108,8 @@ angular.module('AngularScheduler', ['underscore']) scope.schedulerEnd = scope.endOptions[0]; } scope.sheduler_frequency_error = false; + + scope.$emit("updateSchedulerSelects"); }; scope.showCalendar = function(fld) { diff --git a/awx/ui/client/src/scheduler/repeatFrequencyOptions.block.less b/awx/ui/client/src/scheduler/repeatFrequencyOptions.block.less index 956ad9e3ce..703b1d719d 100644 --- a/awx/ui/client/src/scheduler/repeatFrequencyOptions.block.less +++ b/awx/ui/client/src/scheduler/repeatFrequencyOptions.block.less @@ -115,7 +115,8 @@ margin-top: 2px; } -.RepeatFrequencyOptions-spacedSelect { +.RepeatFrequencyOptions-spacedSelect, +.RepeatFrequencyOptions-spacedSelect ~ .select2 { margin-bottom: 10px; } @@ -137,3 +138,25 @@ flex: initial; width: 100%; } + +.RepeatFrequencyOptions-nameBorderErrorFix { + border-color: #ff5850 !important; +} + +.RepeatFrequencyOptions-inputGroup { + display: flex; + justify-content: space-between; +} + +.RepeatFrequencyOptions-inputGroup--thirds > .select2 { + width: ~"calc(33% - 3px)" !important; +} + +.RepeatFrequencyOptions-inputGroup--halves > .select2 { + width: ~"calc(50% - 3px)" !important; +} + +.RepeatFrequencyOptions-inputGroup--halvesWithNumber > .select2 { + width: ~"calc(50% - 3px)" !important; + margin-right: 7px; +} diff --git a/awx/ui/client/src/scheduler/schedulerAdd.controller.js b/awx/ui/client/src/scheduler/schedulerAdd.controller.js index a6eb3e12be..a37362b6b4 100644 --- a/awx/ui/client/src/scheduler/schedulerAdd.controller.js +++ b/awx/ui/client/src/scheduler/schedulerAdd.controller.js @@ -1,4 +1,4 @@ -export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$scope', '$rootScope', function($compile, $state, $stateParams, AddSchedule, Wait, $scope, $rootScope) { +export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$scope', '$rootScope', 'CreateSelect2', function($compile, $state, $stateParams, AddSchedule, Wait, $scope, $rootScope, CreateSelect2) { $scope.$on("ScheduleFormCreated", function(e, scope) { $scope.hideForm = false; $scope = angular.extend($scope, scope); @@ -43,10 +43,69 @@ export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$s $scope.formCancel = function() { $state.go("^"); - } + }; AddSchedule({ scope: $scope, callback: 'SchedulesRefresh' }); + + var callSelect2 = function() { + CreateSelect2({ + element: '#schedulerTimeZone', + multiple: false + }); + + CreateSelect2({ + element: '#schedulerFrequency', + multiple: false + }); + + CreateSelect2({ + element: '#monthlyWeekDay', + multiple: false + }); + + CreateSelect2({ + element: '#monthlyOccurrence', + multiple: false + }); + + CreateSelect2({ + element: '#monthlyOccurrence', + multiple: false + }); + + CreateSelect2({ + element: '#yearlyMonth', + multiple: false + }); + + CreateSelect2({ + element: '#yearlyWeekDay', + multiple: false + }); + + CreateSelect2({ + element: '#yearlyOccurrence', + multiple: false + }); + + CreateSelect2({ + element: '#yearlyOtherMonth', + multiple: false + }); + + CreateSelect2({ + element: '#schedulerEnd', + multiple: false + }); + }; + + $scope.$on("updateSchedulerSelects", function() { + callSelect2(); + console.log("select2 is called"); + }); + + callSelect2(); }]; diff --git a/awx/ui/client/src/scheduler/schedulerEdit.controller.js b/awx/ui/client/src/scheduler/schedulerEdit.controller.js index 82d9fa26e4..96646bfff0 100644 --- a/awx/ui/client/src/scheduler/schedulerEdit.controller.js +++ b/awx/ui/client/src/scheduler/schedulerEdit.controller.js @@ -1,4 +1,4 @@ -export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$scope', '$rootScope', function($compile, $state, $stateParams, EditSchedule, Wait, $scope, $rootScope) { +export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$scope', '$rootScope', 'CreateSelect2', function($compile, $state, $stateParams, EditSchedule, Wait, $scope, $rootScope, CreateSelect2) { $scope.$on("ScheduleFormCreated", function(e, scope) { $scope.hideForm = false; $scope = angular.extend($scope, scope); @@ -53,4 +53,63 @@ export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$ id: parseInt($stateParams.schedule_id), callback: 'SchedulesRefresh' }); + + var callSelect2 = function() { + CreateSelect2({ + element: '#schedulerTimeZone', + multiple: false + }); + + CreateSelect2({ + element: '#schedulerFrequency', + multiple: false + }); + + CreateSelect2({ + element: '#monthlyWeekDay', + multiple: false + }); + + CreateSelect2({ + element: '#monthlyOccurrence', + multiple: false + }); + + CreateSelect2({ + element: '#monthlyOccurrence', + multiple: false + }); + + CreateSelect2({ + element: '#yearlyMonth', + multiple: false + }); + + CreateSelect2({ + element: '#yearlyWeekDay', + multiple: false + }); + + CreateSelect2({ + element: '#yearlyOccurrence', + multiple: false + }); + + CreateSelect2({ + element: '#yearlyOtherMonth', + multiple: false + }); + + CreateSelect2({ + element: '#schedulerEnd', + multiple: false + }); + }; + + $scope.$on("updateSchedulerSelects", function() { + callSelect2(); + console.log("select2 is called"); + }); + + callSelect2(); }]; From 37c97c968dba0afbe0c25a5932c62b799961ba9a Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 12 Feb 2016 11:58:50 -0500 Subject: [PATCH 06/13] fix number spinner input issues with scheduler --- .../lib/angular-scheduler.js | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js b/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js index 4f4d49e358..cbf6ec80e0 100644 --- a/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js +++ b/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js @@ -996,7 +996,11 @@ angular.module('AngularScheduler', ['underscore']) .filter('schZeroPad', [ function() { return function (n, pad) { var str = (Math.pow(10,pad) + '').replace(/^1/,'') + (n + '').trim(); - return str.substr(str.length - pad); + if (str.substr(str.length - pad) === 'll') { + return undefined; + } else { + return str.substr(str.length - pad); + } }; }]) @@ -1052,6 +1056,10 @@ angular.module('AngularScheduler', ['underscore']) return { require: 'ngModel', link: function(scope, element, attr, ctrl) { + if (element.attr("ng-model").indexOf("$parent") > -1) { + scope = scope.$parent; + attr.ngModel = attr.ngModel.split("$parent.")[1]; + } // Add jquerui spinner to 'spinner' type input var form = attr.schSpinner, zeroPad = attr.zeroPad, @@ -1076,16 +1084,25 @@ angular.module('AngularScheduler', ['underscore']) }); }, 100); }, + icons: { + down: "Form-numberInputButton fa fa-angle-down", + up: "Form-numberInputButton fa fa-angle-up" + }, spin: function() { - scope[form].$setDirty(); - ctrl.$dirty = true; - ctrl.$pristine = false; + if (scope[form][attr.ngModel]) { + scope[form][attr.ngModel].$setDirty(); + scope[form][attr.ngModel].$dirty = true; + scope[form][attr.ngModel].$pristine = false; + } if (!scope.$$phase) { scope.$digest(); } } }); + $('.ui-icon').text(''); + $(".ui-icon").removeClass('ui-icon ui-icon-triangle-1-n ui-icon-triangle-1-s'); + $(element).on("click", function () { $(element).select(); }); From f8550a478b1d7ab0571e904849dd219f7254e16a Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 12 Feb 2016 11:59:39 -0500 Subject: [PATCH 07/13] make saving a schedule send you back to the list route --- awx/ui/client/src/helpers/Schedules.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/helpers/Schedules.js b/awx/ui/client/src/helpers/Schedules.js index f73a7ee042..0924170311 100644 --- a/awx/ui/client/src/helpers/Schedules.js +++ b/awx/ui/client/src/helpers/Schedules.js @@ -55,9 +55,9 @@ export default }]) .factory('EditSchedule', ['SchedulerInit', 'ShowSchedulerModal', 'Wait', - 'Rest', 'ProcessErrors', 'GetBasePath', 'SchedulePost', + 'Rest', 'ProcessErrors', 'GetBasePath', 'SchedulePost', '$state', function(SchedulerInit, ShowSchedulerModal, Wait, Rest, ProcessErrors, - GetBasePath, SchedulePost) { + GetBasePath, SchedulePost, $state) { return function(params) { var scope = params.scope, id = params.id, @@ -171,6 +171,7 @@ export default if (callback) { scope.$emit(callback, data); } + $state.go("^"); }); scope.saveSchedule = function() { @@ -208,8 +209,8 @@ export default }]) .factory('AddSchedule', ['$location', '$stateParams', 'SchedulerInit', 'ShowSchedulerModal', 'Wait', 'GetBasePath', 'Empty', - 'SchedulePost', - function($location, $stateParams, SchedulerInit, ShowSchedulerModal, Wait, GetBasePath, Empty, SchedulePost) { + 'SchedulePost', '$state', + function($location, $stateParams, SchedulerInit, ShowSchedulerModal, Wait, GetBasePath, Empty, SchedulePost, $state) { return function(params) { var scope = params.scope, callback= params.callback, @@ -280,6 +281,7 @@ export default if (callback) { scope.$emit(callback, data); } + $state.go("^"); }); scope.saveSchedule = function() { From 8ad62b666978c1735f8196c7ffc6c8ae1aff569a Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 12 Feb 2016 12:00:26 -0500 Subject: [PATCH 08/13] fixed layout issues with form scheduler --- .../src/scheduler/schedulerForm.partial.html | 187 ++++++++++-------- .../src/scheduler/schedulertime.block.less | 2 +- 2 files changed, 109 insertions(+), 80 deletions(-) diff --git a/awx/ui/client/src/scheduler/schedulerForm.partial.html b/awx/ui/client/src/scheduler/schedulerForm.partial.html index af503a49ce..29ce37a2f5 100644 --- a/awx/ui/client/src/scheduler/schedulerForm.partial.html +++ b/awx/ui/client/src/scheduler/schedulerForm.partial.html @@ -12,7 +12,7 @@
@@ -22,13 +22,15 @@
+ ng-show="scheduler_form_new.$dirty && scheduler_form_new.schedulerName.$error.required"> A schedule name is required.
@@ -40,9 +42,10 @@ (mm/dd/yyyy) -
+
+ *
- - +
+ + +
The day must be between 1 and 31. @@ -300,6 +316,7 @@
- - - + + + +
@@ -435,12 +461,13 @@ RepeatFrequencyOptions-formGroup" ng-if="schedulerEnd && schedulerEnd.value == 'after'">
+ ng-if="schedulerEnd && schedulerEnd.value == 'on'"> -
+
+ ng-change="$parent.resetError('scheduler_endDt_error')"> -
@@ -291,7 +294,7 @@ ng-model="$parent.yearlyMonth" ng-options="m.name for m in months" ng-disabled="yearlyRepeatOption != 'month'" - class="form-control input-sm + class="MakeSelect2 form-control input-sm RepeatFrequencyOptions-spacedSelect" > @@ -335,7 +338,8 @@ ng-model="$parent.yearlyOccurrence" ng-options="o.name for o in occurrences" ng-disabled="yearlyRepeatOption != 'other'" - class="form-control input-sm + class="MakeSelect2 + form-control input-sm RepeatFrequencyOptions-spacedSelect RepeatFrequencyOptions-yearlyOccurence RepeatFrequencyOptions-thirdSelect" @@ -346,7 +350,8 @@ ng-model="$parent.yearlyWeekDay" ng-options="w.name for w in weekdays" ng-disabled="yearlyRepeatOption != 'other'" - class="form-control input-sm + class="MakeSelect2 + form-control input-sm RepeatFrequencyOptions-spacedSelect RepeatFrequencyOptions-thirdSelect" > @@ -356,7 +361,8 @@ ng-model="$parent.yearlyOtherMonth" ng-options="m.name for m in months" ng-disabled="yearlyRepeatOption != 'other'" - class="form-control input-sm + class="MakeSelect2 + form-control input-sm RepeatFrequencyOptions-thirdSelect">
@@ -451,7 +457,8 @@ ng-model="$parent.schedulerEnd" ng-options="e.name for e in endOptions" required - class="form-control input-sm" + class="MakeSelect2 + form-control input-sm" ng-change="schedulerEndChange()">
From 33e84d03ef55daabbec3af99edf612a629c441db Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 16 Feb 2016 09:58:05 -0500 Subject: [PATCH 12/13] add job_template related list to inventory endpoint --- awx/api/serializers.py | 1 + awx/api/urls.py | 1 + awx/api/views.py | 14 ++++++++++++++ 3 files changed, 16 insertions(+) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 572e690ce6..491e76ddb7 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -953,6 +953,7 @@ class InventorySerializer(BaseSerializerWithVariables): tree = reverse('api:inventory_tree_view', args=(obj.pk,)), inventory_sources = reverse('api:inventory_inventory_sources_list', args=(obj.pk,)), activity_stream = reverse('api:inventory_activity_stream_list', args=(obj.pk,)), + job_templates = reverse('api:inventory_job_template_list', args=(obj.pk,)), scan_job_templates = reverse('api:inventory_scan_job_template_list', args=(obj.pk,)), ad_hoc_commands = reverse('api:inventory_ad_hoc_commands_list', args=(obj.pk,)), #single_fact = reverse('api:inventory_single_fact_view', args=(obj.pk,)), diff --git a/awx/api/urls.py b/awx/api/urls.py index 2b3a93d852..efee8c4cdd 100644 --- a/awx/api/urls.py +++ b/awx/api/urls.py @@ -73,6 +73,7 @@ inventory_urls = patterns('awx.api.views', url(r'^(?P[0-9]+)/tree/$', 'inventory_tree_view'), url(r'^(?P[0-9]+)/inventory_sources/$', 'inventory_inventory_sources_list'), url(r'^(?P[0-9]+)/activity_stream/$', 'inventory_activity_stream_list'), + url(r'^(?P[0-9]+)/job_templates/$', 'inventory_job_template_list'), url(r'^(?P[0-9]+)/scan_job_templates/$', 'inventory_scan_job_template_list'), url(r'^(?P[0-9]+)/ad_hoc_commands/$', 'inventory_ad_hoc_commands_list'), #url(r'^(?P[0-9]+)/single_fact/$', 'inventory_single_fact_view'), diff --git a/awx/api/views.py b/awx/api/views.py index 9a41e779ea..c9b6bb23f4 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -1111,6 +1111,20 @@ class InventoryActivityStreamList(SubListAPIView): qs = self.request.user.get_queryset(self.model) return qs.filter(Q(inventory=parent) | Q(host__in=parent.hosts.all()) | Q(group__in=parent.groups.all())) +class InventoryJobTemplateList(SubListAPIView): + + model = JobTemplate + serializer_class = JobTemplateSerializer + parent_model = Inventory + relationship = 'jobtemplates' + new_in_300 = True + + def get_queryset(self): + parent = self.get_parent_object() + self.check_parent_access(parent) + qs = self.request.user.get_queryset(self.model) + return qs.filter(inventory=parent) + class InventoryScanJobTemplateList(SubListAPIView): model = JobTemplate From 64341719770be1b5cb0cc8b5631aacb2775920c9 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 16 Feb 2016 13:51:16 -0500 Subject: [PATCH 13/13] add -y to ansible ppa adding --- tools/docker-compose/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker-compose/Dockerfile b/tools/docker-compose/Dockerfile index b4a25a78cc..d7acaa5375 100644 --- a/tools/docker-compose/Dockerfile +++ b/tools/docker-compose/Dockerfile @@ -5,7 +5,7 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 RUN apt-get update && apt-get install -y software-properties-common python-software-properties curl -RUN add-apt-repository -y ppa:chris-lea/redis-server; add-apt-repository -y ppa:chris-lea/zeromq; add-apt-repository -y ppa:chris-lea/node.js; add-apt-repository ppa:ansible/ansible +RUN add-apt-repository -y ppa:chris-lea/redis-server; add-apt-repository -y ppa:chris-lea/zeromq; add-apt-repository -y ppa:chris-lea/node.js; add-apt-repository -y ppa:ansible/ansible RUN curl -sL https://deb.nodesource.com/setup_0.12 | bash - RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && apt-key adv --fetch-keys http://www.postgresql.org/media/keys/ACCC4CF8.asc RUN echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list && echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | tee /etc/apt/sources.list.d/postgres-9.4.list