Changeset View
Changeset View
Standalone View
Standalone View
assets/src/bundles/save/index.js
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | <div class="custom-control custom-checkbox swhid-option"> | ||||
<label class="custom-control-label font-weight-normal" for="swh-save-requests-user-filter"> | <label class="custom-control-label font-weight-normal" for="swh-save-requests-user-filter"> | ||||
show only your own requests | show only your own requests | ||||
</label> | </label> | ||||
</div> | </div> | ||||
`; | `; | ||||
export function initOriginSave() { | export function initOriginSave() { | ||||
$(document).ready(async() => { | $(document).ready(() => { | ||||
$.fn.dataTable.ext.errMode = 'none'; | $.fn.dataTable.ext.errMode = 'none'; | ||||
const response = await fetch(Urls.origin_save_types_list()); | |||||
const data = await response.json(); | |||||
for (const originType of data) { | |||||
$('#swh-input-visit-type').append(`<option value="${originType}">${originType}</option>`); | |||||
} | |||||
// set git as the default value as before | // set git as the default value as before | ||||
$('#swh-input-visit-type').val('git'); | $('#swh-input-visit-type').val('git'); | ||||
saveRequestsTable = $('#swh-origin-save-requests') | saveRequestsTable = $('#swh-origin-save-requests') | ||||
.on('error.dt', (e, settings, techNote, message) => { | .on('error.dt', (e, settings, techNote, message) => { | ||||
$('#swh-origin-save-request-list-error').text('An error occurred while retrieving the save requests list'); | $('#swh-origin-save-request-list-error').text('An error occurred while retrieving the save requests list'); | ||||
console.log(message); | console.log(message); | ||||
}) | }) | ||||
▲ Show 20 Lines • Show All 432 Lines • Show Last 20 Lines |