@lobb-js/studio 0.2.12 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}: Props = $props();
|
|
30
30
|
|
|
31
31
|
const ui_input =
|
|
32
|
-
ctx.meta.collections[collectionName].fields[fieldName].
|
|
32
|
+
ctx.meta.collections[collectionName].fields[fieldName].ui?.input;
|
|
33
33
|
const ui =
|
|
34
34
|
ctx.meta.collections[collectionName].fields[fieldName].ui;
|
|
35
35
|
const field = getField(fieldName, collectionName);
|
|
@@ -68,7 +68,7 @@ export function generateTransactionBody(collectionName, entry) {
|
|
|
68
68
|
function handleEntryRecursive(transactionBody, collectionName, entry, parentTransactionIndex) {
|
|
69
69
|
var _a;
|
|
70
70
|
var _b;
|
|
71
|
-
var parentCollectionName = parentTransactionIndex !== undefined ? transactionBody[parentTransactionIndex].collectionName : null;
|
|
71
|
+
var parentCollectionName = parentTransactionIndex !== undefined ? transactionBody[parentTransactionIndex].props.collectionName : null;
|
|
72
72
|
var foreignKeyFieldName = (_b = ctx.meta.relations.find(function (relation) { return relation.from.collection === collectionName && relation.to.collection === parentCollectionName; })) === null || _b === void 0 ? void 0 : _b.from.field;
|
|
73
73
|
var collectionFieldNames = Object.keys(ctx.meta.collections[collectionName].fields);
|
|
74
74
|
var payload = {};
|
|
@@ -87,9 +87,9 @@ export function generateTransactionBody(collectionName, entry) {
|
|
|
87
87
|
_a[foreignKeyFieldName] = payload[foreignKeyFieldName],
|
|
88
88
|
_a);
|
|
89
89
|
transactionBody.push({
|
|
90
|
-
collectionName: collectionName,
|
|
91
90
|
method: "updateMany",
|
|
92
91
|
props: {
|
|
92
|
+
collectionName: collectionName,
|
|
93
93
|
data: localPayload,
|
|
94
94
|
filter: { id: payload.id },
|
|
95
95
|
},
|
|
@@ -97,9 +97,8 @@ export function generateTransactionBody(collectionName, entry) {
|
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
99
|
transactionBody.push({
|
|
100
|
-
collectionName: collectionName,
|
|
101
100
|
method: "createOne",
|
|
102
|
-
props: { data: payload },
|
|
101
|
+
props: { collectionName: collectionName, data: payload },
|
|
103
102
|
});
|
|
104
103
|
}
|
|
105
104
|
var childrenRelations = ctx.meta.relations.filter(function (relation) { return relation.to.collection === collectionName; });
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
import DataTable from "../../dataTable/dataTable.svelte";
|
|
4
4
|
import SidebarTrigger from "../../sidebar/sidebarTrigger.svelte";
|
|
5
5
|
import { ctx } from "../../../store.svelte";
|
|
6
|
-
|
|
6
|
+
import Singletone from "../../singletone.svelte";
|
|
7
|
+
import { getExtensionUtils } from "../../../extensions/extensionUtils";
|
|
8
|
+
import ExtensionsComponents from "../../extensionsComponents.svelte";
|
|
7
9
|
|
|
8
10
|
let { collectionName } = $props();
|
|
9
11
|
let isSingletonCollection = $derived(ctx.meta.collections[collectionName].singleton);
|
|
@@ -13,6 +15,13 @@
|
|
|
13
15
|
|
|
14
16
|
<div bind:clientWidth={containerWidth} class="h-full">
|
|
15
17
|
{#if collectionName}
|
|
18
|
+
<!-- TODO: add support in here for the views for each collection view -->
|
|
19
|
+
<!-- {#if true}
|
|
20
|
+
<ExtensionsComponents
|
|
21
|
+
name="studio.listView"
|
|
22
|
+
utils={getExtensionUtils()}
|
|
23
|
+
></ExtensionsComponents>
|
|
24
|
+
{:else if isSingletonCollection} -->
|
|
16
25
|
{#if isSingletonCollection}
|
|
17
26
|
<Singletone collectionName={collectionName} />
|
|
18
27
|
{:else}
|