|
|
@ -1,27 +1,17 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { onMount } from "svelte" |
|
|
|
|
|
import { |
|
|
import { |
|
|
Input, |
|
|
Input, |
|
|
TextArea, |
|
|
|
|
|
Button, |
|
|
Button, |
|
|
Select, |
|
|
Select, |
|
|
Toggle, |
|
|
Toggle, |
|
|
Label, |
|
|
|
|
|
} from "@budibase/bbui" |
|
|
} from "@budibase/bbui" |
|
|
import { cloneDeep, merge } from "lodash/fp" |
|
|
import { cloneDeep } from "lodash/fp" |
|
|
import { store, backendUiStore } from "builderStore" |
|
|
import { backendUiStore } from "builderStore" |
|
|
import { FIELDS } from "constants/backend" |
|
|
import { FIELDS } from "constants/backend" |
|
|
import { notifier } from "builderStore/store/notifications" |
|
|
import { notifier } from "builderStore/store/notifications" |
|
|
import ButtonGroup from "components/common/ButtonGroup.svelte" |
|
|
|
|
|
import NumberBox from "components/common/NumberBox.svelte" |
|
|
|
|
|
import ValuesList from "components/common/ValuesList.svelte" |
|
|
import ValuesList from "components/common/ValuesList.svelte" |
|
|
import ErrorsBox from "components/common/ErrorsBox.svelte" |
|
|
|
|
|
import Checkbox from "components/common/Checkbox.svelte" |
|
|
|
|
|
import ActionButton from "components/common/ActionButton.svelte" |
|
|
|
|
|
import DatePicker from "components/common/DatePicker.svelte" |
|
|
import DatePicker from "components/common/DatePicker.svelte" |
|
|
import LinkedRowSelector from "components/common/LinkedRowSelector.svelte" |
|
|
|
|
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte" |
|
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte" |
|
|
import * as api from "../api" |
|
|
|
|
|
|
|
|
|
|
|
let fieldDefinitions = cloneDeep(FIELDS) |
|
|
let fieldDefinitions = cloneDeep(FIELDS) |
|
|
|
|
|
|
|
|
@ -63,11 +53,10 @@ |
|
|
} else { |
|
|
} else { |
|
|
backendUiStore.actions.tables.deleteField(field) |
|
|
backendUiStore.actions.tables.deleteField(field) |
|
|
notifier.success("Column deleted") |
|
|
notifier.success("Column deleted") |
|
|
|
|
|
hideDeleteDialog() |
|
|
} |
|
|
} |
|
|
onClosed() |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleFieldConstraints(event) { |
|
|
function handleFieldConstraints(event) { |
|
|
const { type, constraints } = fieldDefinitions[ |
|
|
const { type, constraints } = fieldDefinitions[ |
|
|
event.target.value.toUpperCase() |
|
|
event.target.value.toUpperCase() |
|
|
@ -91,8 +80,12 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function confirmDelete() { |
|
|
function confirmDelete() { |
|
|
onClosed() |
|
|
|
|
|
confirmDeleteDialog.show() |
|
|
confirmDeleteDialog.show() |
|
|
|
|
|
onClosed() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function hideDeleteDialog() { |
|
|
|
|
|
confirmDeleteDialog.hide() |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
@ -168,9 +161,9 @@ |
|
|
{/if} |
|
|
{/if} |
|
|
<footer> |
|
|
<footer> |
|
|
{#if originalName} |
|
|
{#if originalName} |
|
|
<Button secondary on:click={onClosed}>Cancel</Button> |
|
|
<Button red on:click={confirmDelete}>Delete Column</Button> |
|
|
{/if} |
|
|
{/if} |
|
|
<Button red on:click={confirmDelete}>Delete Column</Button> |
|
|
<Button secondary on:click={onClosed}>Cancel</Button> |
|
|
<Button primary on:click={saveColumn}>Save Column</Button> |
|
|
<Button primary on:click={saveColumn}>Save Column</Button> |
|
|
</footer> |
|
|
</footer> |
|
|
</div> |
|
|
</div> |
|
|
@ -179,11 +172,11 @@ |
|
|
body={`Are you sure you wish to delete this column? Your data will be deleted and this action cannot be undone.`} |
|
|
body={`Are you sure you wish to delete this column? Your data will be deleted and this action cannot be undone.`} |
|
|
okText="Delete Column" |
|
|
okText="Delete Column" |
|
|
onOk={deleteColumn} |
|
|
onOk={deleteColumn} |
|
|
|
|
|
onCancel={hideDeleteDialog} |
|
|
title="Confirm Delete" /> |
|
|
title="Confirm Delete" /> |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|
.actions { |
|
|
.actions { |
|
|
/* padding: var(--spacing-xl); */ |
|
|
|
|
|
display: grid; |
|
|
display: grid; |
|
|
grid-gap: var(--spacing-xl); |
|
|
grid-gap: var(--spacing-xl); |
|
|
min-width: 400px; |
|
|
min-width: 400px; |
|
|
|