Modal stays open when renaming an inventory via the bottom toolbar [SCI-8613] ()

* Initialize rename and duplicate inventory models [SCI-8613]
This commit is contained in:
Soufiane 2023-06-06 15:18:21 +02:00 committed by GitHub
parent 8d1803211e
commit ad0418947c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,19 @@
animateSpinner(null, false);
ShareModal.init();
}
if (['rename-repo-modal', 'copy-repo-modal'].includes($(this).attr('id'))) {
$(this).find('form')
.on('ajax:success', function(_e, data) {
if (data.url) {
window.location = data.url;
} else {
window.location.reload();
}
})
.on('ajax:error', function(_e, data) {
$(this).renderFormErrors('repository', data.responseJSON);
});
}
$(this).find('.selectpicker').selectpicker();
})
.on('hidden.bs.modal', function() {