Unverified Commit cd6c1c24 authored by Jerome Boucher's avatar Jerome Boucher
Browse files

fix/15334 : code refactoring

parent 4cc85803
Pipeline #10305 failed with stages
in 59 seconds
......@@ -146,4 +146,12 @@ interface serviceAccountInterface
* @return boolean Import with reset of table data or not
*/
public function createImport($data, $isReset);
/**
* @param string $serviceUri Uri to check privileges
*
* @action auth/serviceAccount/getAccountsByPrivilege
*
*/
public function readByRoute($serviceUri);
}
......@@ -82,13 +82,4 @@ interface schedulingInterface
* @action batchProcessing/scheduling/changeStatus
*/
public function updateChangestatus($schedulingId, $status);
/**
* List service Accounts available by scheduling
*
* @param string $schedulingId Scheduling Identifier
*
* @action batchProcessing/scheduling/getServiceAccountsByScheduling
*/
public function serviceAccountByScheduling($schedulingId);
}
......@@ -77,9 +77,6 @@ class scheduling
}
foreach ($scheduledTasks as $scheduledTask) {
if (isset($tasks[$scheduledTask->taskId])) {
$tasks[$scheduledTask->taskId]->schedulingId = $scheduledTask->schedulingId;
}
$scheduledTask->taskName = $tasks[$scheduledTask->taskId]->description;
$frequency = explode(';', $scheduledTask->frequency);
......
......@@ -16,7 +16,7 @@
<select class="form-control" id="taskId" name="taskId" title="Task name">
<option value="" disabled selected>Select a task</option>
<?merge tasks ?>
<option value="[?merge .taskId ?]" data-route="[?merge .route ?]" data-schedulingId="[?merge .schedulingId ?]"><?merge .description ?></option>
<option value="[?merge .taskId ?]" data-route="[?merge .route ?]"><?merge .description ?></option>
</select>
</div>
</div>
......@@ -372,8 +372,8 @@
$('#taskId').on('change', function () {
$('#serviceAccountId').val('');
var schedulingId = $('#taskId').find('option:selected').data('schedulingid');
TaskSchedulingForm.loadServiceAccounts(schedulingId);
var route = $('#taskId').find('option:selected').data('route');
TaskSchedulingForm.loadServiceAccounts(route);
});
// Week day selection color
......@@ -460,14 +460,13 @@
this.clear();
this.form.removeClass('hide');
this.changeFormPosition();
$('#modifyTask').removeClass('hide');
$('#addTask').addClass('hide');
this.form.find('[name="schedulingId"]').val(scheduling.schedulingId);
this.form.find('[name="taskId"]').val(scheduling.taskId);
this.form.find('[name="name"]').val(scheduling.name);
this.loadServiceAccounts(scheduling.schedulingId);
this.loadServiceAccounts($('#taskId').find('option:selected').data('route'));
this.form.find('[name="serviceAccountId"]').val(scheduling.executedBy);
// Freqency selector
......@@ -753,7 +752,7 @@
TaskList.unselect();
},
loadServiceAccounts: function(schedulingId) {
loadServiceAccounts: function(route) {
var serviceAccountSelect = $('#serviceAccountId');
serviceAccountSelect.empty();
......@@ -764,8 +763,8 @@
serviceAccountSelect.removeAttr('disabled');
$.ajax({
type : "GET",
url : "/serviceaccountsbyscheduling",
data : {'schedulingId' : schedulingId},
url : "/serviceaccountsbyroute",
data : {'serviceUri' : route},
dataType : 'json',
contentType : 'application/json',
success : function (response) {
......
......@@ -83,12 +83,12 @@ interface batchSchedulingInterface
/**
* List service accounts available by scheduling
*
* @param string $schedulingId scheduling identifier
* @param string $serviceUri url route to check right for
*
* @uses batchProcessing/scheduling/serviceAccountByScheduling
* @uses auth/serviceAccount/readByRoute
* @return batchProcessing/scheduling/listServiceAccounts
*/
public function readServiceaccountsbyscheduling($schedulingId);
public function readServiceaccountsbyroute($serviceUri);
/*******************LOG**********************/
......
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