mirror of
https://github.com/ansible/awx.git
synced 2026-03-10 05:59:28 -02:30
add support for select2 in scheduler form
This commit is contained in:
@@ -108,6 +108,8 @@ angular.module('AngularScheduler', ['underscore'])
|
|||||||
scope.schedulerEnd = scope.endOptions[0];
|
scope.schedulerEnd = scope.endOptions[0];
|
||||||
}
|
}
|
||||||
scope.sheduler_frequency_error = false;
|
scope.sheduler_frequency_error = false;
|
||||||
|
|
||||||
|
scope.$emit("updateSchedulerSelects");
|
||||||
};
|
};
|
||||||
|
|
||||||
scope.showCalendar = function(fld) {
|
scope.showCalendar = function(fld) {
|
||||||
|
|||||||
@@ -115,7 +115,8 @@
|
|||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.RepeatFrequencyOptions-spacedSelect {
|
.RepeatFrequencyOptions-spacedSelect,
|
||||||
|
.RepeatFrequencyOptions-spacedSelect ~ .select2 {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,3 +138,25 @@
|
|||||||
flex: initial;
|
flex: initial;
|
||||||
width: 100%;
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -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.$on("ScheduleFormCreated", function(e, scope) {
|
||||||
$scope.hideForm = false;
|
$scope.hideForm = false;
|
||||||
$scope = angular.extend($scope, scope);
|
$scope = angular.extend($scope, scope);
|
||||||
@@ -43,10 +43,69 @@ export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$s
|
|||||||
|
|
||||||
$scope.formCancel = function() {
|
$scope.formCancel = function() {
|
||||||
$state.go("^");
|
$state.go("^");
|
||||||
}
|
};
|
||||||
|
|
||||||
AddSchedule({
|
AddSchedule({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
callback: 'SchedulesRefresh'
|
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();
|
||||||
}];
|
}];
|
||||||
|
|||||||
@@ -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.$on("ScheduleFormCreated", function(e, scope) {
|
||||||
$scope.hideForm = false;
|
$scope.hideForm = false;
|
||||||
$scope = angular.extend($scope, scope);
|
$scope = angular.extend($scope, scope);
|
||||||
@@ -53,4 +53,63 @@ export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$
|
|||||||
id: parseInt($stateParams.schedule_id),
|
id: parseInt($stateParams.schedule_id),
|
||||||
callback: 'SchedulesRefresh'
|
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();
|
||||||
}];
|
}];
|
||||||
|
|||||||
Reference in New Issue
Block a user