diff --git a/src/DataObject/Controller/Grid/GetAvailableColumnsController.php b/src/DataObject/Controller/Grid/GetAvailableColumnsController.php index 2855d17f..bf091464 100644 --- a/src/DataObject/Controller/Grid/GetAvailableColumnsController.php +++ b/src/DataObject/Controller/Grid/GetAvailableColumnsController.php @@ -59,7 +59,7 @@ public function __construct( )] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Get( - path: self::PREFIX . '/data-object/grid/available-columns/{classId}/folderId', + path: self::PREFIX . '/data-object/grid/available-columns/{classId}/{folderId}', operationId: 'data_object_get_available_grid_columns', description: 'data_object_get_available_grid_columns_description', summary: 'data_object_get_available_grid_columns_summary', diff --git a/src/Grid/Column/Collector/Asset/MetadataCollector.php b/src/Grid/Column/Collector/Asset/MetadataCollector.php index 7d8d98b1..cb84864e 100644 --- a/src/Grid/Column/Collector/Asset/MetadataCollector.php +++ b/src/Grid/Column/Collector/Asset/MetadataCollector.php @@ -67,6 +67,7 @@ private function getDefaultMetadata(): array group: 'default_metadata', sortable: true, editable: true, + exportable: true, localizable: true, locale: null, type: 'metadata.input', @@ -99,6 +100,7 @@ private function getPredefinedMetadata(array $availableColumnDefinitions): array group: 'predefined_metadata', sortable: $availableColumnDefinitions[$type]->isSortable(), editable: true, + exportable: $availableColumnDefinitions[$type]->isExportable(), localizable: true, locale: null, type: $type, diff --git a/src/Grid/Column/Collector/Asset/SystemFieldCollector.php b/src/Grid/Column/Collector/Asset/SystemFieldCollector.php index a64da2b5..36d43439 100644 --- a/src/Grid/Column/Collector/Asset/SystemFieldCollector.php +++ b/src/Grid/Column/Collector/Asset/SystemFieldCollector.php @@ -59,6 +59,7 @@ public function getColumnConfigurations(array $availableColumnDefinitions): arra group: $this->getTypeName(), sortable: $availableColumnDefinitions[$type]->isSortable(), editable: false, + exportable: $availableColumnDefinitions[$type]->isExportable(), localizable: false, locale: null, type: $availableColumnDefinitions[$type]->getType(), diff --git a/src/Grid/Column/Collector/DataObject/SystemFieldCollector.php b/src/Grid/Column/Collector/DataObject/SystemFieldCollector.php index c21abe06..588d7b60 100644 --- a/src/Grid/Column/Collector/DataObject/SystemFieldCollector.php +++ b/src/Grid/Column/Collector/DataObject/SystemFieldCollector.php @@ -58,6 +58,7 @@ public function getColumnConfigurations(array $availableColumnDefinitions): arra group: $this->getTypeName(), sortable: $availableColumnDefinitions[$type]->isSortable(), editable: false, + exportable: $availableColumnDefinitions[$type]->isExportable(), localizable: false, locale: null, type: $availableColumnDefinitions[$type]->getType(), diff --git a/src/Grid/Schema/ColumnConfiguration.php b/src/Grid/Schema/ColumnConfiguration.php index bc7e4913..0d7493f6 100644 --- a/src/Grid/Schema/ColumnConfiguration.php +++ b/src/Grid/Schema/ColumnConfiguration.php @@ -44,6 +44,8 @@ public function __construct( private readonly bool $sortable, #[Property(description: 'Editable', type: 'boolean', example: false)] private readonly bool $editable, + #[Property(description: 'Exportable', type: 'boolean', example: false)] + private readonly bool $exportable, #[Property(description: 'Localizable', type: 'boolean', example: false)] private readonly bool $localizable, #[Property(description: 'Locale', type: 'string', example: 'en')] @@ -82,6 +84,11 @@ public function isEditable(): bool return $this->editable; } + public function isExportable(): bool + { + return $this->exportable; + } + public function isLocalizable(): bool { return $this->localizable; diff --git a/src/Grid/Service/ColumnConfigurationService.php b/src/Grid/Service/ColumnConfigurationService.php index de145ed1..28b46791 100644 --- a/src/Grid/Service/ColumnConfigurationService.php +++ b/src/Grid/Service/ColumnConfigurationService.php @@ -105,6 +105,7 @@ public function buildColumnConfiguration(ColumnFieldDefinition $definition): Col group: $definition->getGroup(), sortable: true, editable: !$fieldDefinition->getNoteditable(), + exportable: true, localizable: $definition->isLocalized(), locale: null, type: 'dataobject.' . $fieldDefinition->getFieldType(), diff --git a/src/Grid/Service/GridService.php b/src/Grid/Service/GridService.php index d44c9dc3..10efba92 100644 --- a/src/Grid/Service/GridService.php +++ b/src/Grid/Service/GridService.php @@ -147,7 +147,7 @@ public function getConfigurationFromArray(array $config, bool $isExport = false) $columns = []; foreach ($config as $column) { if ($isExport && !$this->isExportable($column['type'])) { - throw new InvalidArgumentException('Column type is not exportable'); + continue; } try {