From 463455121e3b3ea499ebbf036e7e4cca75653933 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 13 Jul 2022 10:04:52 +0200 Subject: [PATCH 1/3] Improve media cards --- CHANGELOG.md | 14 ++++++++++++++ .../components/Media/Item.tsx | 19 ++++++++++++++----- .../components/Media/Media.tsx | 4 ++-- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7182976f..312f9f5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Change Log +## [8.1.0] - 2022-xx-xx + +### ✨ New features + +### 🎨 Enhancements + +- Fix `PSD` media card icon image + +### ⚡️ Optimizations + +### 🐞 Fixes + +- Fix missing clipboard icon for the media card action + ## [8.0.0] - 2022-07-11 - [Release notes](https://beta.frontmatter.codes/updates/v8.0.0) ### ✨ New Features diff --git a/src/dashboardWebView/components/Media/Item.tsx b/src/dashboardWebView/components/Media/Item.tsx index 66d4eeb1..7b5cbbe8 100644 --- a/src/dashboardWebView/components/Media/Item.tsx +++ b/src/dashboardWebView/components/Media/Item.tsx @@ -248,7 +248,7 @@ export const Item: React.FunctionComponent = ({media}: React.PropsWi }, [media]); const isImageFile = useMemo(() => { - if (media.mimeType?.startsWith("image/")) { + if (media.mimeType?.startsWith("image/") && !media.mimeType?.startsWith("image/vnd.adobe.photoshop")) { return true; } return false; @@ -258,12 +258,13 @@ export const Item: React.FunctionComponent = ({media}: React.PropsWi const path = media.fsPath; const extension = path.split('.').pop(); + let icon = ; + console.log(media); + if (isImageFile) { return ; } - let icon = ; - if (isVideoFile) { icon = ; } @@ -384,7 +385,11 @@ export const Item: React.FunctionComponent = ({media}: React.PropsWi Edit metadata} + title={( +
+ Edit metadata +
+ )} onClick={updateMetadata} /> @@ -409,7 +414,11 @@ export const Item: React.FunctionComponent = ({media}: React.PropsWi ) : ( <> + Copy media path + + )} onClick={copyToClipboard} /> { customScriptActions() } diff --git a/src/dashboardWebView/components/Media/Media.tsx b/src/dashboardWebView/components/Media/Media.tsx index 0e1cb602..141fa1ac 100644 --- a/src/dashboardWebView/components/Media/Media.tsx +++ b/src/dashboardWebView/components/Media/Media.tsx @@ -139,9 +139,9 @@ export const Media: React.FunctionComponent = (props: React.PropsWi } { - contentFolders && contentFolders.length > 0 && contentFolders.map(group => ( + contentFolders && contentFolders.length > 0 && contentFolders.map((group, idx) => ( group.folders && group.folders.length > 0 && ( -
+

Content folder: {group.title}

From 149703a5dfd31bed3cec58555445a701d2982a2e Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 13 Jul 2022 13:52:06 +0200 Subject: [PATCH 2/3] Fix for tags rendering on content cards --- CHANGELOG.md | 12 +++--------- .../components/Contents/Item.tsx | 17 ++++++++++------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 312f9f5a..02c288dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,12 @@ # Change Log -## [8.1.0] - 2022-xx-xx - -### ✨ New features - -### 🎨 Enhancements - -- Fix `PSD` media card icon image - -### ⚡️ Optimizations +## [8.0.1] - 2022-07-13 ### 🐞 Fixes +- Fix `PSD` media card icon image - Fix missing clipboard icon for the media card action +- Fix in tags rendering on content cards ## [8.0.0] - 2022-07-11 - [Release notes](https://beta.frontmatter.codes/updates/v8.0.0) diff --git a/src/dashboardWebView/components/Contents/Item.tsx b/src/dashboardWebView/components/Contents/Item.tsx index 6fa68cd0..0991241d 100644 --- a/src/dashboardWebView/components/Contents/Item.tsx +++ b/src/dashboardWebView/components/Contents/Item.tsx @@ -30,20 +30,23 @@ export const Item: React.FunctionComponent = ({ fmFilePath, date, ti } const tagField = settings.dashboardState.contents.tags; + let tagsValue = []; if (tagField === "tags") { - return pageData.fmTags; + tagsValue = pageData.fmTags; } else if (tagField === "categories") { - return pageData.fmCategories; + tagsValue = pageData.fmCategories; + } else { + tagsValue = pageData[tagField] || []; } - const tagsValue = pageData[tagField] || []; - - if (Array.isArray(tagsValue)) { + if (typeof tagsValue === "string") { + return [tagsValue]; + } else if (Array.isArray(tagsValue)) { return tagsValue; } - return [tagsValue]; + return []; }, [settings, pageData]); if (view === DashboardViewType.Grid) { @@ -119,4 +122,4 @@ export const Item: React.FunctionComponent = ({ fmFilePath, date, ti } return null; -}; +}; \ No newline at end of file From 9fcc231a7a471637ec8c2d5b78a9d5c69d05dbd6 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 13 Jul 2022 13:52:14 +0200 Subject: [PATCH 3/3] 8.0.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a7838275..f716d25e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-front-matter-beta", - "version": "8.0.0", + "version": "8.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-front-matter-beta", - "version": "8.0.0", + "version": "8.0.1", "license": "MIT", "dependencies": { "node-fetch": "^2.6.7" diff --git a/package.json b/package.json index d5eb730c..b71f0c93 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Front Matter", "description": "Front Matter is a CMS that runs within Visual Studio Code. It gives you the power and control of a full-blown CMS while also providing you the flexibility and speed of the static site generator of your choice like: Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...", "icon": "assets/frontmatter-teal-128x128.png", - "version": "8.0.0", + "version": "8.0.1", "preview": false, "publisher": "eliostruyf", "galleryBanner": {