Removing the edit display columns modal as it was very specific and a little confusing, these are defaulted now anyway like internal tables.
This commit is contained in:
parent
3e82abd88e
commit
2d2d342a8c
|
@ -15,12 +15,10 @@
|
||||||
import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte"
|
import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte"
|
||||||
import CreateEditRelationship from "components/backend/Datasources/CreateEditRelationship.svelte"
|
import CreateEditRelationship from "components/backend/Datasources/CreateEditRelationship.svelte"
|
||||||
import CreateExternalTableModal from "./modals/CreateExternalTableModal.svelte"
|
import CreateExternalTableModal from "./modals/CreateExternalTableModal.svelte"
|
||||||
import DisplayColumnModal from "./modals/EditDisplayColumnsModal.svelte"
|
|
||||||
import ICONS from "components/backend/DatasourceNavigator/icons"
|
import ICONS from "components/backend/DatasourceNavigator/icons"
|
||||||
import { capitalise } from "helpers"
|
import { capitalise } from "helpers"
|
||||||
|
|
||||||
let relationshipModal
|
let relationshipModal
|
||||||
let displayColumnModal
|
|
||||||
let createExternalTableModal
|
let createExternalTableModal
|
||||||
let selectedFromRelationship, selectedToRelationship
|
let selectedFromRelationship, selectedToRelationship
|
||||||
|
|
||||||
|
@ -113,10 +111,6 @@
|
||||||
relationshipModal.show()
|
relationshipModal.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
function openDisplayColumnModal() {
|
|
||||||
displayColumnModal.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
function createNewTable() {
|
function createNewTable() {
|
||||||
createExternalTableModal.show()
|
createExternalTableModal.show()
|
||||||
}
|
}
|
||||||
|
@ -133,10 +127,6 @@
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal bind:this={displayColumnModal}>
|
|
||||||
<DisplayColumnModal {datasource} {plusTables} save={saveDatasource} />
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<Modal bind:this={createExternalTableModal}>
|
<Modal bind:this={createExternalTableModal}>
|
||||||
<CreateExternalTableModal {datasource} />
|
<CreateExternalTableModal {datasource} />
|
||||||
</Modal>
|
</Modal>
|
||||||
|
@ -174,16 +164,6 @@
|
||||||
<div class="query-header">
|
<div class="query-header">
|
||||||
<Heading size="S">Tables</Heading>
|
<Heading size="S">Tables</Heading>
|
||||||
<div class="table-buttons">
|
<div class="table-buttons">
|
||||||
{#if plusTables && plusTables.length !== 0}
|
|
||||||
<ActionButton
|
|
||||||
size="S"
|
|
||||||
quiet
|
|
||||||
icon="ColumnSettings"
|
|
||||||
on:click={openDisplayColumnModal}
|
|
||||||
>
|
|
||||||
Update display columns
|
|
||||||
</ActionButton>
|
|
||||||
{/if}
|
|
||||||
<div>
|
<div>
|
||||||
<ActionButton
|
<ActionButton
|
||||||
size="S"
|
size="S"
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
<script>
|
|
||||||
import { ModalContent, Select, Body } from "@budibase/bbui"
|
|
||||||
import { tables } from "stores/backend"
|
|
||||||
|
|
||||||
export let datasource
|
|
||||||
export let plusTables
|
|
||||||
export let save
|
|
||||||
|
|
||||||
async function saveDisplayColumns() {
|
|
||||||
// be explicit about copying over
|
|
||||||
for (let table of plusTables) {
|
|
||||||
datasource.entities[table.name].primaryDisplay = table.primaryDisplay
|
|
||||||
}
|
|
||||||
save()
|
|
||||||
await tables.fetch()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getColumnOptions(table) {
|
|
||||||
if (!table || !table.schema) {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
return Object.entries(table.schema)
|
|
||||||
.filter(field => field[1].type !== "link")
|
|
||||||
.map(([fieldName]) => fieldName)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<ModalContent
|
|
||||||
title="Edit display columns"
|
|
||||||
confirmText="Save"
|
|
||||||
onConfirm={saveDisplayColumns}
|
|
||||||
>
|
|
||||||
<Body
|
|
||||||
>Select the columns that will be shown when displaying relationships.</Body
|
|
||||||
>
|
|
||||||
{#each plusTables as table}
|
|
||||||
<Select
|
|
||||||
label={table.name}
|
|
||||||
options={getColumnOptions(table)}
|
|
||||||
bind:value={table.primaryDisplay}
|
|
||||||
/>
|
|
||||||
{/each}
|
|
||||||
</ModalContent>
|
|
Loading…
Reference in New Issue