From ad2d9c7dd1b14489dd82ef25066eeb93b35695fe Mon Sep 17 00:00:00 2001 From: Jose Javier Vega Date: Fri, 15 Mar 2024 11:58:11 -0600 Subject: [PATCH] Sync ContentInstance interface across packages #6530 (#95) --- packages/content/src/utils.ts | 3 +++ packages/models/src/ContentInstance.ts | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/content/src/utils.ts b/packages/content/src/utils.ts index 569d187..f172da9 100644 --- a/packages/content/src/utils.ts +++ b/packages/content/src/utils.ts @@ -137,6 +137,9 @@ export function parseProps( // Should never happen but just in case the value is not numeric, rollback to original string if (isNaN(parsedValue)) parsedValue = value; break; + case 'placeInNav': + parsedValue = value === 'true'; + break; } // @ts-ignore parsed.craftercms[propName] = parsedValue; diff --git a/packages/models/src/ContentInstance.ts b/packages/models/src/ContentInstance.ts index 0748cf8..13f4b05 100644 --- a/packages/models/src/ContentInstance.ts +++ b/packages/models/src/ContentInstance.ts @@ -16,15 +16,16 @@ export interface ContentInstance { craftercms: { - id: string - path: string - label: string // "Internal name" - dateCreated: string - dateModified: string - contentTypeId: string - orderInNav?: number // For pages only - disabled: boolean - sourceMap?: { [path: string]: string } // path: contentTypeId + id: string; + path: string | null; + label: string; // Internal name + dateCreated: string; + dateModified: string; + contentTypeId: string; + sourceMap?: Record; // { fieldId: path } + disabled: boolean; + orderInNav?: number; + placeInNav?: boolean; } [prop: string]: any }