From e5532362da408f472619a9bef1631fc4bce1ff52 Mon Sep 17 00:00:00 2001 From: Hoang Pham Date: Thu, 27 Jun 2024 16:58:33 +0700 Subject: [PATCH 1/3] feat: support excalidraw file Signed-off-by: Hoang Pham --- core/img/filetypes/whiteboard.svg | 1 + core/js/mimetype.js | 1 + core/js/mimetypelist.js | 2 + lib/private/Repair/RepairMimeTypes.php | 126 ++++++++++++++---- resources/config/mimetypealiases.dist.json | 1 + resources/config/mimetypemapping.dist.json | 1 + .../core/js/mimetypelist.js | 2 + .../mimetypeListModified/core/signature.json | 4 +- 8 files changed, 111 insertions(+), 27 deletions(-) create mode 100644 core/img/filetypes/whiteboard.svg diff --git a/core/img/filetypes/whiteboard.svg b/core/img/filetypes/whiteboard.svg new file mode 100644 index 0000000000000..a5f1e1d88883b --- /dev/null +++ b/core/img/filetypes/whiteboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/core/js/mimetype.js b/core/js/mimetype.js index 13a7ba6f6e53a..58f5575598cff 100644 --- a/core/js/mimetype.js +++ b/core/js/mimetype.js @@ -77,6 +77,7 @@ OC.MimeType = { while (mimeType in OC.MimeTypeList.aliases) { mimeType = OC.MimeTypeList.aliases[mimeType]; } + if (mimeType in OC.MimeType._mimeTypeIcons) { return OC.MimeType._mimeTypeIcons[mimeType]; } diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js index 7caeaa72f90b4..ee40a20877371 100644 --- a/core/js/mimetypelist.js +++ b/core/js/mimetypelist.js @@ -26,6 +26,7 @@ OC.MimeTypeList={ "application/postscript": "image", "application/rss+xml": "application/xml", "application/vnd.android.package-archive": "package/x-generic", + "application/vnd.excalidraw+json": "whiteboard", "application/vnd.lotus-wordpro": "x-office/document", "application/vnd.garmin.tcx+xml": "location", "application/vnd.google-earth.kml+xml": "location", @@ -141,6 +142,7 @@ OC.MimeTypeList={ "text-code", "text-vcard", "video", + "whiteboard", "x-office-document", "x-office-drawing", "x-office-form", diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 6ed8b8f28bd7d..37a6d14cd6161 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -34,6 +34,8 @@ namespace OC\Repair; use OC\Migration\NullOutput; +use OCP\DB\Exception; +use OCP\DB\IResult; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IConfig; use OCP\IDBConnection; @@ -45,7 +47,7 @@ class RepairMimeTypes implements IRepairStep { private int $changeCount = 0; /** @var int */ - protected $folderMimeTypeId; + protected int $folderMimeTypeId; public function __construct( protected IConfig $config, @@ -53,15 +55,19 @@ public function __construct( ) { } - public function getName() { + public function getName(): string { return 'Repair mime types'; } - private function updateMimetypes($updatedMimetypes) { + /** + * @throws Exception + */ + private function updateMimetypes($updatedMimetypes): IResult|int|null { if ($this->dryRun) { $this->changeCount += count($updatedMimetypes); - return; + return null; } + $query = $this->connection->getQueryBuilder(); $query->select('id') ->from('mimetypes') @@ -109,7 +115,21 @@ private function updateMimetypes($updatedMimetypes) { return $count; } - private function introduceAsciidocType() { + /** + * @throws Exception + */ + private function introduceExcalidrawType(): IResult|int|null { + $updatedMimetypes = [ + 'excalidraw' => 'application/vnd.excalidraw+json', + ]; + + return $this->updateMimetypes($updatedMimetypes); + } + + /** + * @throws Exception + */ + private function introduceAsciidocType(): IResult|int|null { $updatedMimetypes = [ 'adoc' => 'text/asciidoc', 'asciidoc' => 'text/asciidoc', @@ -118,7 +138,10 @@ private function introduceAsciidocType() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceImageTypes() { + /** + * @throws Exception + */ + private function introduceImageTypes(): IResult|int|null { $updatedMimetypes = [ 'jp2' => 'image/jp2', 'webp' => 'image/webp', @@ -127,7 +150,10 @@ private function introduceImageTypes() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceWindowsProgramTypes() { + /** + * @throws Exception + */ + private function introduceWindowsProgramTypes(): IResult|int|null { $updatedMimetypes = [ 'htaccess' => 'text/plain', 'bat' => 'application/x-msdos-program', @@ -137,7 +163,10 @@ private function introduceWindowsProgramTypes() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceLocationTypes() { + /** + * @throws Exception + */ + private function introduceLocationTypes(): IResult|int|null { $updatedMimetypes = [ 'gpx' => 'application/gpx+xml', 'kml' => 'application/vnd.google-earth.kml+xml', @@ -148,7 +177,10 @@ private function introduceLocationTypes() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceInternetShortcutTypes() { + /** + * @throws Exception + */ + private function introduceInternetShortcutTypes(): IResult|int|null { $updatedMimetypes = [ 'url' => 'application/internet-shortcut', 'webloc' => 'application/internet-shortcut' @@ -157,7 +189,10 @@ private function introduceInternetShortcutTypes() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceStreamingTypes() { + /** + * @throws Exception + */ + private function introduceStreamingTypes(): IResult|int|null { $updatedMimetypes = [ 'm3u' => 'audio/mpegurl', 'm3u8' => 'audio/mpegurl', @@ -167,7 +202,10 @@ private function introduceStreamingTypes() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceVisioTypes() { + /** + * @throws Exception + */ + private function introduceVisioTypes(): IResult|int|null { $updatedMimetypes = [ 'vsdm' => 'application/vnd.visio', 'vsdx' => 'application/vnd.visio', @@ -180,7 +218,10 @@ private function introduceVisioTypes() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceComicbookTypes() { + /** + * @throws Exception + */ + private function introduceComicbookTypes(): IResult|int|null { $updatedMimetypes = [ 'cb7' => 'application/comicbook+7z', 'cba' => 'application/comicbook+ace', @@ -193,7 +234,10 @@ private function introduceComicbookTypes() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceOpenDocumentTemplates() { + /** + * @throws Exception + */ + private function introduceOpenDocumentTemplates(): IResult|int|null { $updatedMimetypes = [ 'ott' => 'application/vnd.oasis.opendocument.text-template', 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', @@ -204,7 +248,10 @@ private function introduceOpenDocumentTemplates() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceFlatOpenDocumentType() { + /** + * @throws Exception + */ + private function introduceFlatOpenDocumentType(): IResult|int|null { $updatedMimetypes = [ "fodt" => "application/vnd.oasis.opendocument.text-flat-xml", "fods" => "application/vnd.oasis.opendocument.spreadsheet-flat-xml", @@ -215,7 +262,10 @@ private function introduceFlatOpenDocumentType() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceOrgModeType() { + /** + * @throws Exception + */ + private function introduceOrgModeType(): IResult|int|null { $updatedMimetypes = [ 'org' => 'text/org' ]; @@ -223,7 +273,10 @@ private function introduceOrgModeType() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceOnlyofficeFormType() { + /** + * @throws Exception + */ + private function introduceOnlyofficeFormType(): IResult|int|null { $updatedMimetypes = [ "oform" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform", "docxf" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf", @@ -232,7 +285,10 @@ private function introduceOnlyofficeFormType() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceEnhancedMetafileFormatType() { + /** + * @throws Exception + */ + private function introduceEnhancedMetafileFormatType(): IResult|int|null { $updatedMimetypes = [ 'emf' => 'image/emf', ]; @@ -240,7 +296,10 @@ private function introduceEnhancedMetafileFormatType() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceEmlAndMsgFormatType() { + /** + * @throws Exception + */ + private function introduceEmlAndMsgFormatType(): IResult|int|null { $updatedMimetypes = [ 'eml' => 'message/rfc822', 'msg' => 'application/vnd.ms-outlook', @@ -249,7 +308,10 @@ private function introduceEmlAndMsgFormatType() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceAacAudioType() { + /** + * @throws Exception + */ + private function introduceAacAudioType(): IResult|int|null { $updatedMimetypes = [ 'aac' => 'audio/aac', ]; @@ -257,7 +319,10 @@ private function introduceAacAudioType() { return $this->updateMimetypes($updatedMimetypes); } - private function introduceReStructuredTextFormatType() { + /** + * @throws Exception + */ + private function introduceReStructuredTextFormatType(): IResult|int|null { $updatedMimetypes = [ 'rst' => 'text/x-rst', ]; @@ -265,6 +330,9 @@ private function introduceReStructuredTextFormatType() { return $this->updateMimetypes($updatedMimetypes); } + /** + * @throws Exception + */ public function migrationsAvailable(): bool { $this->dryRun = true; $this->run(new NullOutput()); @@ -273,17 +341,21 @@ public function migrationsAvailable(): bool { } private function getMimeTypeVersion(): string { - $mimeVersion = $this->config->getAppValue('files', 'mimetype_version', ''); - if ($mimeVersion) { - return $mimeVersion; + $serverVersion = $this->config->getSystemValueString('version', '0.0.0'); + // 29.0.0.10 is the last version with a mimetype migration before it was moved to a separate version number + if (version_compare($serverVersion, '29.0.0.10', '>')) { + return $this->config->getAppValue('files', 'mimetype_version', '29.0.0.10'); } - return $this->config->getSystemValueString('version', '0.0.0'); + + return $serverVersion; } /** * Fix mime types + * + * @throws Exception */ - public function run(IOutput $out) { + public function run(IOutput $out): void { $serverVersion = $this->config->getSystemValueString('version', '0.0.0'); $mimeTypeVersion = $this->getMimeTypeVersion(); @@ -354,6 +426,10 @@ public function run(IOutput $out) { $out->info('Fixed ReStructured Text mime type'); } + if (version_compare($mimeTypeVersion, '30.0.0.0', '<') && $this->introduceExcalidrawType()) { + $out->info('Fixed Excalidraw mime type'); + } + if (!$this->dryRun) { $this->config->setAppValue('files', 'mimetype_version', $serverVersion); } diff --git a/resources/config/mimetypealiases.dist.json b/resources/config/mimetypealiases.dist.json index 40144878465dc..6fe7db76318e9 100644 --- a/resources/config/mimetypealiases.dist.json +++ b/resources/config/mimetypealiases.dist.json @@ -26,6 +26,7 @@ "application/postscript": "image", "application/rss+xml": "application/xml", "application/vnd.android.package-archive": "package/x-generic", + "application/vnd.excalidraw+json": "whiteboard", "application/vnd.lotus-wordpro": "x-office/document", "application/vnd.garmin.tcx+xml": "location", "application/vnd.google-earth.kml+xml": "location", diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json index 3ff4c3c78ad64..49f2a1ea21f93 100644 --- a/resources/config/mimetypemapping.dist.json +++ b/resources/config/mimetypemapping.dist.json @@ -59,6 +59,7 @@ "eps": ["application/postscript"], "epub": ["application/epub+zip"], "erf": ["image/x-dcraw"], + "excalidraw": ["application/vnd.excalidraw+json"], "exe": ["application/x-ms-dos-executable"], "fb2": ["application/x-fictionbook+xml", "text/plain"], "flac": ["audio/flac"], diff --git a/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js b/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js index 8221d01a68254..25448c5b576f0 100644 --- a/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js +++ b/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js @@ -26,6 +26,7 @@ OC.MimeTypeList={ "application/postscript": "image", "application/rss+xml": "application/xml", "application/vnd.android.package-archive": "package/x-generic", + "application/vnd.excalidraw+json": "whiteboard", "application/vnd.lotus-wordpro": "x-office/document", "application/vnd.garmin.tcx+xml": "location", "application/vnd.google-earth.kml+xml": "location", @@ -142,6 +143,7 @@ OC.MimeTypeList={ "text-code", "text-vcard", "video", + "whiteboard", "x-office-document", "x-office-drawing", "x-office-form", diff --git a/tests/data/integritycheck/mimetypeListModified/core/signature.json b/tests/data/integritycheck/mimetypeListModified/core/signature.json index 0f6ca137cdc27..bea0a2647b822 100644 --- a/tests/data/integritycheck/mimetypeListModified/core/signature.json +++ b/tests/data/integritycheck/mimetypeListModified/core/signature.json @@ -1,7 +1,7 @@ { "hashes": { - "core\/js\/mimetypelist.js": "c5cc5239ea67d5f09ef49b72929205be7684c7fc7c829637cb57963bfa5a3e9ec96aec97f2935cbe7c14e96c3294f3caa25829277e691e6b494dff4be50bdb21" + "core\/js\/mimetypelist.js": "507bb72181a0213598eaa03dbb6f7290b367e06b706aa15873a921c491980a13165c9858924d9b4b478b8444e92bb5e4169f5f971d184b77a63c3fcc5b3acf59" }, - "signature": "RCyHmaoLXr0NfqTWDM8xUhe2LsRwF2QMIGyDT9f4dShnyCO5VCApYbu6IzgiBVOAP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A4rtl?= Date: Thu, 13 Jun 2024 09:36:06 +0200 Subject: [PATCH 2/3] fix: Adapt icon color to new default for mime icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- core/img/filetypes/whiteboard.svg | 2 +- core/js/mimetypelist.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/img/filetypes/whiteboard.svg b/core/img/filetypes/whiteboard.svg index a5f1e1d88883b..0febec18004da 100644 --- a/core/img/filetypes/whiteboard.svg +++ b/core/img/filetypes/whiteboard.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js index ee40a20877371..3becf6e37d380 100644 --- a/core/js/mimetypelist.js +++ b/core/js/mimetypelist.js @@ -142,7 +142,7 @@ OC.MimeTypeList={ "text-code", "text-vcard", "video", - "whiteboard", + "whiteboard", "x-office-document", "x-office-drawing", "x-office-form", From d06e5d41d9b02c6907378261ee822ba708041532 Mon Sep 17 00:00:00 2001 From: Hoang Pham Date: Thu, 25 Jul 2024 16:30:00 +0700 Subject: [PATCH 3/3] feat: support excalidraw file Signed-off-by: Hoang Pham --- apps/files/appinfo/info.xml | 2 +- lib/private/Repair/RepairMimeTypes.php | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml index c6b5fe304ab95..22cc4552e0688 100644 --- a/apps/files/appinfo/info.xml +++ b/apps/files/appinfo/info.xml @@ -5,7 +5,7 @@ Files File Management File Management - 2.1.0 + 2.1.1 agpl John Molakvoæ Robin Appelman diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 37a6d14cd6161..2b3d96ef79f18 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -341,13 +341,11 @@ public function migrationsAvailable(): bool { } private function getMimeTypeVersion(): string { - $serverVersion = $this->config->getSystemValueString('version', '0.0.0'); - // 29.0.0.10 is the last version with a mimetype migration before it was moved to a separate version number - if (version_compare($serverVersion, '29.0.0.10', '>')) { - return $this->config->getAppValue('files', 'mimetype_version', '29.0.0.10'); + $mimeVersion = $this->config->getAppValue('files', 'mimetype_version', ''); + if ($mimeVersion) { + return $mimeVersion; } - - return $serverVersion; + return $this->config->getSystemValueString('version', '0.0.0'); } /**