From ced7e41fe6af97a5ed4a7638d5f6e106260d5b66 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 9 Jul 2024 21:26:52 +0200 Subject: [PATCH] feat: Add support for DefaultFields.Keywords in ContentTypeValidator #467 --- src/constants/DefaultFields.ts | 3 ++- .../components/ContentType/ContentTypeValidator.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/constants/DefaultFields.ts b/src/constants/DefaultFields.ts index eb4f3c45..a0168682 100644 --- a/src/constants/DefaultFields.ts +++ b/src/constants/DefaultFields.ts @@ -5,5 +5,6 @@ export const DefaultFields = { Title: `title`, Slug: `slug`, Type: `type`, - ContentType: `fmContentType` + ContentType: `fmContentType`, + Keywords: `keywords` }; diff --git a/src/panelWebView/components/ContentType/ContentTypeValidator.tsx b/src/panelWebView/components/ContentType/ContentTypeValidator.tsx index 96649bf8..36dbbb96 100644 --- a/src/panelWebView/components/ContentType/ContentTypeValidator.tsx +++ b/src/panelWebView/components/ContentType/ContentTypeValidator.tsx @@ -8,13 +8,14 @@ import { IMetadata } from '../Metadata'; import * as l10n from '@vscode/l10n'; import { LocalizationKey } from '../../../localization'; import { VSCodeLabel } from '../VSCode'; +import { DefaultFields } from '../../../constants'; export interface IContentTypeValidatorProps { fields: Field[]; metadata: IMetadata; } -const fieldsToIgnore = [`filePath`, `articleDetails`, `slug`, `keywords`, `type`]; +const fieldsToIgnore = [`filePath`, `articleDetails`, DefaultFields.Slug, DefaultFields.Keywords, DefaultFields.Type, DefaultFields.ContentType]; export const ContentTypeValidator: React.FunctionComponent = ({ fields,