query records
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script>
|
||||
import ChannelLayout from "../../layouts/ChannelLayout.svelte";
|
||||
import { post } from "../../modules/remote";
|
||||
import { getApp } from "../../app";
|
||||
import Table from "./Table.svelte";
|
||||
@@ -8,7 +9,7 @@
|
||||
// import Pagination from "./pagination/Pagination.svelte";
|
||||
// import ActionsOnSelected from "./ActionsOnSelected.svelte";
|
||||
// import Table from "./Table.svelte";
|
||||
let { channel, data } = $props();
|
||||
let { channel, user, data } = $props();
|
||||
let newRecordName = $state("");
|
||||
const app = getApp();
|
||||
// export let schema;
|
||||
@@ -68,25 +69,27 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="">
|
||||
<div class={inModal ? "mt-0" : "mt-5"}>
|
||||
<h3 class="header-normal mb-5">
|
||||
{data.schema.name}
|
||||
</h3>
|
||||
<details style="max-width: 400px;">
|
||||
<summary>New Record</summary>
|
||||
<form onsubmit={handleRecordCreate}>
|
||||
<fieldset>
|
||||
<input
|
||||
bind:value={newRecordName}
|
||||
placeholder="Record title"
|
||||
required
|
||||
/>
|
||||
</fieldset>
|
||||
<button type="submit">Create</button>
|
||||
</form>
|
||||
</details>
|
||||
<!-- {#if selected.length > 0 && !inModal && isWritable}
|
||||
<ChannelLayout {body} {channel} schemas={data.schemas} {user}></ChannelLayout>
|
||||
{#snippet body()}
|
||||
<div class="">
|
||||
<div class={inModal ? "mt-0" : "mt-5"}>
|
||||
<h3 class="header-normal mb-5">
|
||||
{data.schema.name}
|
||||
</h3>
|
||||
<details style="max-width: 400px;">
|
||||
<summary>New Record</summary>
|
||||
<form onsubmit={handleRecordCreate}>
|
||||
<fieldset>
|
||||
<input
|
||||
bind:value={newRecordName}
|
||||
placeholder="Record title"
|
||||
required
|
||||
/>
|
||||
</fieldset>
|
||||
<button type="submit">Create</button>
|
||||
</form>
|
||||
</details>
|
||||
<!-- {#if selected.length > 0 && !inModal && isWritable}
|
||||
<ActionsOnSelected {schema} {selected} {filter}/>
|
||||
{:else}
|
||||
<Tools
|
||||
@@ -105,10 +108,10 @@
|
||||
/>
|
||||
{/if}
|
||||
-->
|
||||
<Tools fields={data.fields}></Tools>
|
||||
<Table records={data.records} fields={data.fields}></Table>
|
||||
</div>
|
||||
<!--
|
||||
<Tools fields={data.fields}></Tools>
|
||||
<Table records={data.records} fields={data.fields}></Table>
|
||||
</div>
|
||||
<!--
|
||||
<Pagination
|
||||
{limit}
|
||||
{skip}
|
||||
@@ -117,4 +120,5 @@
|
||||
{inModal}
|
||||
{modalUrl}
|
||||
/> -->
|
||||
</div>
|
||||
</div>
|
||||
{/snippet}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
></Checkbox> -->
|
||||
|
||||
<a
|
||||
href="{app.url('records')}{qRecord.record.id}"
|
||||
href="{app.url('records/')}{qRecord.record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
>
|
||||
<!-- {#if record.status === "draft"}
|
||||
@@ -96,6 +96,12 @@
|
||||
<td>
|
||||
{qRecord.data.find((f) => f.fieldId === field.id)
|
||||
?.value}
|
||||
|
||||
<ul>
|
||||
{#each qRecord.children.filter((e) => e.edge.fieldId === field.id) as child}
|
||||
<li>{child.recordPreview.title}</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</td>
|
||||
{/each}
|
||||
<!-- <RecordRow
|
||||
|
||||
Reference in New Issue
Block a user