From 09888d565783de9cfcb10153ad041b97e0300203 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 16 Jun 2022 11:41:54 +0200 Subject: [PATCH] #291 - Hierarchy field support --- .../components/Contents/Item.tsx | 7 ++ .../TaxonomyView/TaxonomyLookup.tsx | 2 +- src/helpers/ContentType.ts | 30 ++++++++- src/helpers/TaxonomyHelper.ts | 64 +++++++++++++------ 4 files changed, 82 insertions(+), 21 deletions(-) diff --git a/src/dashboardWebView/components/Contents/Item.tsx b/src/dashboardWebView/components/Contents/Item.tsx index f6b24415..6fa68cd0 100644 --- a/src/dashboardWebView/components/Contents/Item.tsx +++ b/src/dashboardWebView/components/Contents/Item.tsx @@ -30,6 +30,13 @@ export const Item: React.FunctionComponent = ({ fmFilePath, date, ti } const tagField = settings.dashboardState.contents.tags; + + if (tagField === "tags") { + return pageData.fmTags; + } else if (tagField === "categories") { + return pageData.fmCategories; + } + const tagsValue = pageData[tagField] || []; if (Array.isArray(tagsValue)) { diff --git a/src/dashboardWebView/components/TaxonomyView/TaxonomyLookup.tsx b/src/dashboardWebView/components/TaxonomyView/TaxonomyLookup.tsx index ea917c48..c37b304d 100644 --- a/src/dashboardWebView/components/TaxonomyView/TaxonomyLookup.tsx +++ b/src/dashboardWebView/components/TaxonomyView/TaxonomyLookup.tsx @@ -51,7 +51,7 @@ export const TaxonomyLookup: React.FunctionComponent = ({ if (taxonomy === "tags" || taxonomy === "categories") { return (