csv render title

This commit is contained in:
2024-12-18 13:02:09 +02:00
parent 9d5d4dd930
commit 232fcc8845
4 changed files with 10 additions and 7 deletions
+2 -1
View File
@@ -14,7 +14,8 @@
"intervention/image": "^2.7",
"phpoption/phpoption": "^1.9",
"spatie/image-optimizer": "^1.6",
"staudenmeir/laravel-cte": "^1.0"
"staudenmeir/laravel-cte": "^1.0",
"mustache/mustache": "^2.14"
},
"require-dev": {
Generated
+3 -3
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "71cf4c1de3d614ce2f9607763bf5687f",
"content-hash": "e8fb1bee28ad339453d50110f7fea2f5",
"packages": [
{
"name": "brick/math",
@@ -5729,8 +5729,8 @@
"ext-zip": "*",
"ext-sqlite3": "*",
"ext-imagick": "*",
"php": "^8.3",
"ext-pdo": "*"
"ext-pdo": "*",
"php": "^8.3"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"
+4 -2
View File
@@ -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("::");
+1 -1
View File
@@ -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,