query rewrite

This commit is contained in:
2024-03-30 13:42:38 +02:00
parent b4521e92b8
commit 0e19c38f23
91 changed files with 1051 additions and 852 deletions
+14 -14
View File
@@ -5,6 +5,7 @@
import Table from "./Table.svelte";
import {getContext} from "svelte";
import Grid from "./Grid.svelte";
import Tools from "./tools/Tools.svelte";
const axios = getContext("axios");
export let schema;
@@ -53,20 +54,19 @@
{#if selected.length > 0 && !inModal && isWritable}
<ActionsOnSelected {schema} {selected} {filter}/>
{:else}
<!-- <Tools-->
<!-- bind:schema-->
<!-- bind:records-->
<!-- {systemFields}-->
<!-- {sortParam}-->
<!-- {sortField}-->
<!-- {operators}-->
<!-- {filter}-->
<!-- {graph}-->
<!-- {inModal}-->
<!-- {modalUrl}-->
<!-- {isWritable}-->
<!-- on:refresh={refresh}-->
<!-- />-->
<Tools
bind:schema
bind:records
{systemFields}
{sortParam}
{sortField}
{operators}
{filter}
{inModal}
{modalUrl}
{isWritable}
on:refresh={refresh}
/>
{/if}
{#if schema.type === "collection"}
@@ -10,7 +10,7 @@
export let value;
export let inModal;
export let modalUrl;
export let graph;
export let records
let filter = {
label: "",
@@ -51,13 +51,13 @@
}
const filterRecord = extractFilterRecord(graph, value);
const filterRecord = extractFilterRecord(records, value);
function extractFilterRecord(graph, value) {
function extractFilterRecord(records, value) {
if (!filter.isReference) {
return null;
}
return graph.records.find(r => r.id === value);
return records.find(r => r.id === value);
}
function removeFilter(k) {
+2 -3
View File
@@ -18,7 +18,6 @@
export let modalUrl;
export let isWritable;
export let records;
export let graph;
export let systemFields = [];
// export let visibleFields = [];
@@ -37,7 +36,7 @@
if (inModal) {
dispatch("refresh", url);
} else {
window.location = url;
window.location.href = url;
}
}
@@ -152,7 +151,7 @@
value={v}
{inModal}
{modalUrl}
{graph}
{records}
on:refresh
/>
{/each}