codemirror insert

This commit is contained in:
2024-09-07 15:31:56 +03:00
parent 0cd4e08716
commit 02f8f5970a
8 changed files with 66 additions and 8 deletions
+2 -1
View File
@@ -27,7 +27,6 @@ class RecordController extends Controller
public function __construct(
private readonly RecordService $recordService,
private readonly AccountService $accountService,
private readonly AuthService $authService,
private readonly ChannelService $channelService,
private readonly Svelte $svelte,
private readonly Query $query,
@@ -61,10 +60,12 @@ class RecordController extends Controller
], $filter);
$skip = data_get($urlParams, "skip") ?? 0;
$limit = 30;
$records = [];
$graphArray = null;
$graph = $this->query
->filter($arguments)
->notLinked($request->input("notlinked") ?? "")
+1
View File
@@ -4,6 +4,7 @@ namespace Lucent\Query;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
use Lucent\Database\Database;
use Lucent\Query\BuilderConverter\BuilderConverter;
use Lucent\Query\Filter\AndFilter;
+3
View File
@@ -78,6 +78,7 @@ final class Query
// ->toArray();
$formattedRecords = $this->formatRecords($resultsRecordsUnique, $resultChildrenEdges, $resultParentEdges);
$this->reset();
return $formattedRecords;
@@ -94,7 +95,9 @@ final class Query
$queryRecords = collect($records)->map(function ($recordData) {
$record = Record::fromDB($recordData);
$record->data = $this->inputFormatter->fill($record->schema, $record->data);
$queryRecord = QueryRecord::fromRecord($record);
$queryRecord->isRoot = data_get($recordData, "isRoot") === true;
return $queryRecord;
+3
View File
@@ -16,8 +16,11 @@ class InputFormatter
public function fill(string $schemaName, RecordData $input): RecordData
{
$schema = $this->channelService->getSchema($schemaName)->get();
$data = $schema->fields->reduce(fn(array $carry, FieldInterface $field) => $field->format($input->toArray(), $carry), []);
return new RecordData($data);
}
+1
View File
@@ -18,6 +18,7 @@ class Markdown implements FieldInterface, RequiredInterface
public bool $required = false,
public bool $nullable = false,
public string $default = "",
public array $collections = [],
public string $help = "",
public ?int $min = null,
public ?int $max = null,