convert delete modal to new type
This commit is contained in:
parent
0d4c05c588
commit
09edd6ba3e
|
@ -33,6 +33,17 @@
|
|||
)
|
||||
}
|
||||
|
||||
const deleteRecord = async row => {
|
||||
open(
|
||||
DeleteRecordModal,
|
||||
{
|
||||
onClosed: close,
|
||||
record: await selectRecord(row),
|
||||
},
|
||||
{ styleContent: { padding: "0" } }
|
||||
)
|
||||
}
|
||||
|
||||
async function selectRecord(record) {
|
||||
return await api.loadRecord(record.key, {
|
||||
appname: $store.appname,
|
||||
|
@ -154,8 +165,7 @@
|
|||
<li>
|
||||
<div
|
||||
on:click={() => {
|
||||
selectRecord(row)
|
||||
backendUiStore.actions.modals.show('DELETE_RECORD')
|
||||
deleteRecord(row)
|
||||
}}>
|
||||
Delete
|
||||
</div>
|
||||
|
|
|
@ -4,18 +4,16 @@
|
|||
import * as api from "../api"
|
||||
|
||||
export let record
|
||||
export let onClosed
|
||||
|
||||
$: currentAppInfo = {
|
||||
appname: $store.appname,
|
||||
instanceId: $backendUiStore.selectedDatabase.id,
|
||||
}
|
||||
|
||||
function onClosed() {
|
||||
backendUiStore.actions.modals.hide()
|
||||
}
|
||||
</script>
|
||||
|
||||
<section>
|
||||
<div class="content">
|
||||
<heading>
|
||||
<i class="ri-information-line alert" />
|
||||
<h4 class="budibase__title--4">Delete Record</h4>
|
||||
|
@ -24,6 +22,7 @@
|
|||
Are you sure you want to delete this record? All of your data will be
|
||||
permanently removed. This action cannot be undone.
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<ActionButton on:click={onClosed}>Cancel</ActionButton>
|
||||
<ActionButton
|
||||
|
@ -47,18 +46,17 @@
|
|||
|
||||
.modal-actions {
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: #fafafa;
|
||||
border-top: 1px solid #ccc;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.content {
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin: 0 0 0 10px;
|
||||
|
|
|
@ -28,25 +28,17 @@
|
|||
backendUiStore.actions.modals.hide()
|
||||
}
|
||||
|
||||
$: recordOpen = $backendUiStore.visibleModal === "RECORD"
|
||||
$: modelOpen = $backendUiStore.visibleModal === "MODEL"
|
||||
$: viewOpen = $backendUiStore.visibleModal === "VIEW"
|
||||
$: deleteRecordOpen = $backendUiStore.visibleModal === "DELETE_RECORD"
|
||||
</script>
|
||||
|
||||
<!-- <Modal isOpen={!!$backendUiStore.visibleModal} {onClosed}>
|
||||
{#if recordOpen}
|
||||
<CreateEditRecordModal record={selectedRecord} {onClosed} />
|
||||
{/if}
|
||||
{#if modelOpen}
|
||||
<CreateEditModelModal {onClosed} />
|
||||
{/if}
|
||||
{#if viewOpen}
|
||||
<CreateEditViewModal {onClosed} />
|
||||
{/if}
|
||||
{#if deleteRecordOpen}
|
||||
<DeleteRecordModal record={selectedRecord} {onClosed} />
|
||||
{/if}
|
||||
</Modal> -->
|
||||
|
||||
<div class="root">
|
||||
|
|
Loading…
Reference in New Issue