UX - ConfirmOrgDeletion cancel event reflection in datatable

ref #16
This commit is contained in:
2021-01-15 22:49:16 +01:00
parent 83f19a7572
commit 84a9cf069a
3 changed files with 45 additions and 37 deletions

View File

@@ -19,7 +19,13 @@
);
</script>
<ConfirmOrgDeletion bind:modal_open bind:delete_org />
<ConfirmOrgDeletion
on:cancelDelete={(event) => {
modal_open = false;
active_deletes[event.detail.id] = false;
}}
bind:modal_open
bind:delete_org />
{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANISATION:GET')}
{#await promise}
<div
@@ -116,20 +122,20 @@
Delete</button>
<button
on:click={() => {
RunnerOrganisationService.runnerOrganisationControllerRemove(o.id, false)
.then((resp) => {
current_organizations = current_organizations.filter((obj) => obj.id !== o.id);
Toastify({
text: 'Organization deleted',
duration: 500,
backgroundColor:
'linear-gradient(to right, #00b09b, #96c93d)',
}).showToast();
})
.catch((err) => {
modal_open = true;
delete_org = o;
});
// RunnerOrganisationService.runnerOrganisationControllerRemove(o.id, false)
// .then((resp) => {
// current_organizations = current_organizations.filter((obj) => obj.id !== o.id);
// Toastify({
// text: 'Organization deleted',
// duration: 500,
// backgroundColor:
// 'linear-gradient(to right, #00b09b, #96c93d)',
// }).showToast();
// })
// .catch((err) => {
modal_open = true;
delete_org = o;
// });
}}
tabindex="0"
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">Confirm