Unverified Commit 4a26aa89 authored by Jerome Boucher's avatar Jerome Boucher
Browse files

select current service value on schedulin screen load

parent ef202f1d
Pipeline #10436 failed with stages
in 52 seconds
......@@ -236,7 +236,7 @@
<input type="number" min="1" class="form-control" name="frequencyNumber" value="1">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span id="frequencyUnit" data-value="M">minute(s)</span>
<span id="frequencyUnit" data-value="M">minute(s)</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right">
......@@ -393,7 +393,7 @@
} else {
$('#lastDayInfo').addClass('hide');
}
}
}
});
......@@ -427,7 +427,7 @@
$("#addParameters").on("click", function() {
TaskSchedulingForm.addParameters();
});
// Save task
$('#addTask, #modifyTask').on('click', function() {
TaskSchedulingForm.saveTask($(this));
......@@ -437,7 +437,7 @@
$("#schedulingForm").on('click', '.removeParameters', function() {
$(this).closest('li').remove();
});
// Cancel form
$('#cancelSchedule').on('click', function(event) {
event.preventDefault();
......@@ -545,7 +545,7 @@
let scheduling = this.serialize();
let type = 'POST';
let url = '/batchProcessing/scheduling';
if( !this.checkSchedulingValues(scheduling)) {
gritter.show($('#empty_text').html(),false);
return;
......@@ -571,7 +571,7 @@
} else {
TaskList.update(scheduling);
}
TaskSchedulingForm.clear();
}
},
......@@ -635,7 +635,7 @@
.addClass('fa fa-times fa-fw')
.html("&nbsp;")
.appendTo(a);
parameterInput.val('');
},
......@@ -649,15 +649,15 @@
scheduling.taskName = this.form.find('[name="taskId"] option:selected').text();
scheduling.startMinutes = this.form.find('[name="startMinutes"]').val();
scheduling.startHours = this.form.find('[name="startHours"]').val();
if (this.form.find('.parametersList').find('li').length != 0) {
scheduling.parameters = [];
this.form.find('.parametersList').find('li').each(function() {
scheduling.parameters.push($(this).attr('parameters'));
});
}
if ($(".active").find(".statusSpan").find(".toggle").hasClass("off")) {
scheduling.status = "paused";
} else {
......@@ -754,6 +754,7 @@
loadServiceAccounts: function(route) {
var serviceAccountSelect = $('#serviceAccountId');
var executedBy = $('#taskList a.active').data('json').executedBy;
serviceAccountSelect.empty();
if ($('#taskId').length == 0 || $('#taskId') == '') {
......@@ -769,10 +770,18 @@
contentType : 'application/json',
success : function (response) {
$.each(response.serviceAccounts, function() {
serviceAccountSelect.append($('<option/>', {
value : this.accountId,
text : this.displayName
}));
if (this.accountId == executedBy) {
serviceAccountSelect.append($('<option/>', {
value : this.accountId,
text : this.displayName,
selected :'selected'
}));
} else {
serviceAccountSelect.append($('<option/>', {
value : this.accountId,
text : this.displayName
}));
}
})
},
error : function(response) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment