csv render title
This commit is contained in:
@@ -20,6 +20,7 @@ use Lucent\Schema\System;
|
||||
use Lucent\Schema\Ui\Reference;
|
||||
use Lucent\Schema\Validator\ValidatorException;
|
||||
use Lucent\Svelte\Svelte;
|
||||
use Lucent\ViewModel\ViewModel;
|
||||
use function Lucent\Response\fail;
|
||||
use function Lucent\Response\ok;
|
||||
|
||||
@@ -32,7 +33,8 @@ class RecordController extends Controller
|
||||
private readonly Svelte $svelte,
|
||||
private readonly Query $query,
|
||||
private readonly Manager $recordManager,
|
||||
private readonly OperatorRegistry $operatorRegistry
|
||||
private readonly OperatorRegistry $operatorRegistry,
|
||||
private readonly ViewModel $viewModel,
|
||||
)
|
||||
{
|
||||
}
|
||||
@@ -176,7 +178,7 @@ class RecordController extends Controller
|
||||
$c[] = "";
|
||||
}elseif (count($fieldRecords) === 1){
|
||||
$c[] = data_get($fieldRecords,"0.id");
|
||||
$c[] = data_get($fieldRecords,"0.data.name");
|
||||
$c[] = $this->viewModel->getRecordName($fieldRecords[0]);
|
||||
}else{
|
||||
$c[] = collect($fieldRecords)->pluck("id")->join("::");
|
||||
$c[] = collect($fieldRecords)->pluck("data.name")->join("::");
|
||||
|
||||
@@ -21,7 +21,7 @@ class ViewModel
|
||||
public function getRecordName(QueryRecord $record): string
|
||||
{
|
||||
$schema = $this->channelService->getSchema($record->schema)->get();
|
||||
if (empty($schema->titleTemplate)) {
|
||||
if (empty($schema->cardTitle)) {
|
||||
$title = match (get_class($schema)) {
|
||||
CollectionSchema::class => $record->data[$schema->fields->filter(fn(FieldInterface $f) => $f->info->name === "text")->first()->name],
|
||||
FilesSchema::class => $record->_file->path,
|
||||
|
||||
Reference in New Issue
Block a user