From f4a4e467ebf0ff5ff931d5579f040847b22c7816 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 19 Apr 2024 11:12:47 -0700 Subject: [PATCH] Update S3File Record to allow SVG file uploads and sets the iconf type for files that aren't bitmaps. --- docs/change-log.md | 1 + ving/record/records/S3File.mjs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/change-log.md b/docs/change-log.md index ee939ca5..4f690459 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -6,6 +6,7 @@ outline: deep ## 2024-04-19 * Fixed a problem where the default values set by a parent on child records wasn't being respected. * Update lambda file upload function to handle CSV files and other file types by returning the file size. +* Update S3File Record to allow SVG file uploads and sets the iconf type for files that aren't bitmaps. ## 2024-04-18 * Cast result of sum() and avg() to number. diff --git a/ving/record/records/S3File.mjs b/ving/record/records/S3File.mjs index 0bd38b1f..2af0f4a7 100644 --- a/ving/record/records/S3File.mjs +++ b/ving/record/records/S3File.mjs @@ -221,6 +221,12 @@ export class S3FileRecord extends VingRecord { self.set('icon', 'thumbnail'); delete metadata.thumbnail; } + else if (self.get('extension') == 'svg') { + self.set('icon', 'self'); + } + else { + self.set('icon', 'extension'); + } if (metadata.sizeInBytes) { self.set('sizeInBytes', metadata.sizeInBytes); delete metadata.sizeInBytes;