From bf8a2a1c7ab07048f57aac8368965aaecf9e9a50 Mon Sep 17 00:00:00 2001 From: Alex Rothberg Date: Fri, 20 Dec 2024 06:48:06 -0500 Subject: [PATCH] Handle mime-type as system column. (#803) * Handle mime-type as system column. * width --- public/js/pimcore/asset/helpers/grid.js | 5 +++++ src/Service/GridData/Asset.php | 1 + 2 files changed, 6 insertions(+) diff --git a/public/js/pimcore/asset/helpers/grid.js b/public/js/pimcore/asset/helpers/grid.js index 9ba14089e2..11b3d69260 100644 --- a/public/js/pimcore/asset/helpers/grid.js +++ b/public/js/pimcore/asset/helpers/grid.js @@ -253,6 +253,11 @@ pimcore.asset.helpers.grid = Class.create({ text: t(field.label), width: this.getColumnWidth(field, 130), locked: this.getColumnLock(field), sortable: true, dataIndex: field.key, filter: {type: 'list', options: ['image', 'text', 'audio', 'video', 'document', 'archive', 'unknown']} }); + } else if (key == "mimetype") { + gridColumns.push({ + text: t(field.label), sortable: true, dataIndex: field.key, editable: false, + width: this.getColumnWidth(field, 210), locked: this.getColumnLock(field), filter: 'string', renderer: Ext.util.Format.htmlEncode + }); } else { gridColumns.push({ text: t(field.label), width: this.getColumnWidth(field, 130), locked: this.getColumnLock(field), sortable: true, diff --git a/src/Service/GridData/Asset.php b/src/Service/GridData/Asset.php index 344be0d3f4..818dc68243 100644 --- a/src/Service/GridData/Asset.php +++ b/src/Service/GridData/Asset.php @@ -37,6 +37,7 @@ public static function getData(Model\Asset $asset, array $fields = null, string 'id' => $asset->getId(), 'id~system' => $asset->getId(), 'type~system' => $asset->getType(), + 'mimetype~system' => $asset->getMimeType(), 'fullpath~system' => $asset->getRealFullPath(), 'filename~system' => $asset->getKey(), 'creationDate~system' => $asset->getCreationDate(),