wip create/edit

This commit is contained in:
2024-10-02 18:58:30 +03:00
parent 4389dba49d
commit b8c5f82e47
13 changed files with 183 additions and 12 deletions
+2 -1
View File
@@ -13,10 +13,11 @@
<div class=" mt-4" style="margin-bottom:150px;position:relative;">
<x-lucent::tabs :schema="$schema" :createMode="$createMode"></x-lucent::tabs>
</div>
<form id="record-form">
@foreach($schema->fields as $field)
@include("lucent::records-editor.fields", ["field" => $field])
@endforeach
</form>
</div>
@endsection
@@ -1,7 +1,9 @@
@php
$references = $graph->edges
->filter(fn($edge) => $edge->field === $field->name && $edge->source === $record->id)
->map(fn($edge) => $graph->records->firstWhere("id", $edge->target));
// $references = $graph->edges
// ->filter(fn($edge) => $edge->field === $field->name && $edge->source === $record->id)
// ->map(fn($edge) => $graph->records->firstWhere("id", $edge->target));
//
$references = collect([]);
$collectionSchemas = $schemas->whereIn("name",$field->collections);
@endphp
@@ -4,6 +4,7 @@
@else
<input
type="text"
name="{{$field->name}}"
id="{{$id}}"
value="{{$value}}"
class="form-control {{!empty($errorMessage) ? "is-invalid" : "" }}"
@@ -37,6 +37,7 @@
</div>
@if($createMode)
<button
id="record-create-button"
class="button primary btn-spinner"
>
<span
@@ -48,6 +49,7 @@
</button>
@else
<button
id="record-save-button"
type="button"
class="button primary ms-2 btn btn-primary btn-spinner"
>