From 7c8eb3b4d47274a0cc6eee58933891f8bfa3f977 Mon Sep 17 00:00:00 2001 From: Martin Eiber Date: Tue, 7 Jan 2025 14:56:54 +0100 Subject: [PATCH 1/2] Add mimeType to asset grid. --- src/Grid/Mapper/ColumnMapper.php | 1 + tests/Unit/Grid/Service/SystemColumnServiceTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Grid/Mapper/ColumnMapper.php b/src/Grid/Mapper/ColumnMapper.php index 54051277..462fead9 100644 --- a/src/Grid/Mapper/ColumnMapper.php +++ b/src/Grid/Mapper/ColumnMapper.php @@ -38,6 +38,7 @@ 'published' => 'boolean', 'classname' => 'string', 'index' => 'integer', + 'mimetype' => 'string', ]; public function getType(string $column): string diff --git a/tests/Unit/Grid/Service/SystemColumnServiceTest.php b/tests/Unit/Grid/Service/SystemColumnServiceTest.php index 86e93439..c4a745fc 100644 --- a/tests/Unit/Grid/Service/SystemColumnServiceTest.php +++ b/tests/Unit/Grid/Service/SystemColumnServiceTest.php @@ -39,6 +39,7 @@ public function testGetSystemColumnsForAssets(): void 'creationDate' => 'datetime', 'modificationDate' => 'datetime', 'size' => 'fileSize', + 'mimetype' => 'string', ], $systemColumnService->getSystemColumnsForAssets()); } From 47c65780539f2e176cc47849ecabd5fded968ebc Mon Sep 17 00:00:00 2001 From: Martin Eiber Date: Tue, 7 Jan 2025 15:05:36 +0100 Subject: [PATCH 2/2] Add Doc for predefined_columns --- doc/10_Extending_Studio/05_Grid.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/10_Extending_Studio/05_Grid.md b/doc/10_Extending_Studio/05_Grid.md index 4d036f53..3b3baab8 100644 --- a/doc/10_Extending_Studio/05_Grid.md +++ b/doc/10_Extending_Studio/05_Grid.md @@ -174,4 +174,20 @@ final readonly class MetadataCollector implements ColumnCollectorInterface ]; } } +``` + +### Predefined Columns +You can define what columns should be visible by default in the grid by modifying the `pimcore_studio_backend.grid.asset.predefined_columns` parameter in your `config.yaml` file. + +Example: +```yaml + +pimcore_studio_backend: + grid: + asset: + predefined_columns: + - key: id + group: system + - key: fullpath + group: system ``` \ No newline at end of file