From f0bbf498dacf14e7348617010d00bb7f8efed1ef Mon Sep 17 00:00:00 2001 From: Julianna Apicella <42875581+juliannaeapicella@users.noreply.github.com> Date: Thu, 16 May 2024 14:59:08 -0400 Subject: [PATCH] feat(hub-common): add isHubHome prop (#1518) --- packages/common/src/core/types/IHubSite.ts | 5 +++++ packages/common/src/sites/_internal/computeProps.ts | 1 + packages/common/src/sites/_internal/getPropertyMap.ts | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/packages/common/src/core/types/IHubSite.ts b/packages/common/src/core/types/IHubSite.ts index 49c2b60972b..4105235cef4 100644 --- a/packages/common/src/core/types/IHubSite.ts +++ b/packages/common/src/core/types/IHubSite.ts @@ -79,6 +79,11 @@ export interface IHubSite /** Legacy teams - list of ids */ legacyTeams: string[]; + + /** + * True when the site is a "Hub Home" site + */ + isHubHome: boolean; } export type IHubSiteEditor = IHubItemEntityEditor & { diff --git a/packages/common/src/sites/_internal/computeProps.ts b/packages/common/src/sites/_internal/computeProps.ts index 37cde97acd8..5bf919e0f50 100644 --- a/packages/common/src/sites/_internal/computeProps.ts +++ b/packages/common/src/sites/_internal/computeProps.ts @@ -42,6 +42,7 @@ export function computeProps( site.updatedDate = new Date(model.item.modified); site.updatedDateSource = "item.modified"; site.isDiscussable = isDiscussable(site); + /** * Features that can be disabled by the entity owner */ diff --git a/packages/common/src/sites/_internal/getPropertyMap.ts b/packages/common/src/sites/_internal/getPropertyMap.ts index dcb20d89d2c..92bb1ab9620 100644 --- a/packages/common/src/sites/_internal/getPropertyMap.ts +++ b/packages/common/src/sites/_internal/getPropertyMap.ts @@ -66,6 +66,10 @@ export function getPropertyMap(): IPropertyMap[] { entityKey: "legacyTeams", storeKey: "item.properties.teams", }); + map.push({ + entityKey: "isHubHome", + storeKey: "item.properties.isHubHome", + }); map.push({ entityKey: "catalog", storeKey: "data.catalog" }); map.push({