From 7457319c0a2e01664dc60f1ac26a9bbafde8ac8d Mon Sep 17 00:00:00 2001 From: Chris Collins Date: Tue, 1 Jul 2025 19:22:23 -0400 Subject: [PATCH] feat(models) Add data models for Custom Home page project - Templates and Modules (#13911) --- .../identity/CorpUserHomePageSettings.pdl | 13 ++++ .../linkedin/identity/CorpUserSettings.pdl | 5 ++ .../metadata/key/DataHubPageModuleKey.pdl | 14 +++++ .../metadata/key/DataHubPageTemplateKey.pdl | 14 +++++ .../module/DataHubPageModuleParams.pdl | 22 +++++++ .../module/DataHubPageModuleProperties.pdl | 60 +++++++++++++++++++ .../linkedin/module/DataHubPageModuleType.pdl | 35 +++++++++++ .../module/DataHubPageModuleVisibility.pdl | 23 +++++++ .../global/GlobalHomePageSettings.pdl | 13 ++++ .../settings/global/GlobalSettingsInfo.pdl | 5 ++ .../DataHubPageTemplateProperties.pdl | 58 ++++++++++++++++++ .../template/DataHubPageTemplateRow.pdl | 13 ++++ .../template/DataHubPageTemplateSurface.pdl | 19 ++++++ .../DataHubPageTemplateVisibility.pdl | 23 +++++++ .../src/main/resources/entity-registry.yml | 10 ++++ 15 files changed, 327 insertions(+) create mode 100644 metadata-models/src/main/pegasus/com/linkedin/identity/CorpUserHomePageSettings.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/metadata/key/DataHubPageModuleKey.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/metadata/key/DataHubPageTemplateKey.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleParams.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleProperties.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleType.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleVisibility.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/settings/global/GlobalHomePageSettings.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateProperties.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateRow.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateSurface.pdl create mode 100644 metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateVisibility.pdl diff --git a/metadata-models/src/main/pegasus/com/linkedin/identity/CorpUserHomePageSettings.pdl b/metadata-models/src/main/pegasus/com/linkedin/identity/CorpUserHomePageSettings.pdl new file mode 100644 index 0000000000..9f772aa2ff --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/identity/CorpUserHomePageSettings.pdl @@ -0,0 +1,13 @@ +namespace com.linkedin.identity + +import com.linkedin.common.Urn + +/** + * Settings related to the home page for a user + */ +record CorpUserHomePageSettings { + /** + * The page template that will be rendered in the UI by default for this user + */ + pageTemplate: Urn +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/identity/CorpUserSettings.pdl b/metadata-models/src/main/pegasus/com/linkedin/identity/CorpUserSettings.pdl index 18b2850073..0831034182 100644 --- a/metadata-models/src/main/pegasus/com/linkedin/identity/CorpUserSettings.pdl +++ b/metadata-models/src/main/pegasus/com/linkedin/identity/CorpUserSettings.pdl @@ -23,4 +23,9 @@ record CorpUserSettings { * Notification settings for a user */ notificationSettings: optional NotificationSettings + + /** + * Settings related to the home page for a user + */ + homePage: optional CorpUserHomePageSettings } diff --git a/metadata-models/src/main/pegasus/com/linkedin/metadata/key/DataHubPageModuleKey.pdl b/metadata-models/src/main/pegasus/com/linkedin/metadata/key/DataHubPageModuleKey.pdl new file mode 100644 index 0000000000..1f72401800 --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/metadata/key/DataHubPageModuleKey.pdl @@ -0,0 +1,14 @@ +namespace com.linkedin.metadata.key + +/** + * Key for a DataHubPageModule + */ +@Aspect = { + "name": "dataHubPageModuleKey", +} +record DataHubPageModuleKey { + /** + * Unique id for the module. + */ + id: string +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/metadata/key/DataHubPageTemplateKey.pdl b/metadata-models/src/main/pegasus/com/linkedin/metadata/key/DataHubPageTemplateKey.pdl new file mode 100644 index 0000000000..0104da9ed1 --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/metadata/key/DataHubPageTemplateKey.pdl @@ -0,0 +1,14 @@ +namespace com.linkedin.metadata.key + +/** + * Key for a DataHubPageTemplate + */ +@Aspect = { + "name": "dataHubPageTemplateKey", +} +record DataHubPageTemplateKey { + /** + * Unique id for the template. + */ + id: string +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleParams.pdl b/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleParams.pdl new file mode 100644 index 0000000000..02d5017556 --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleParams.pdl @@ -0,0 +1,22 @@ +namespace com.linkedin.module + +import com.linkedin.common.Urn + +/** + * The specific parameters stored for a module + */ +record DataHubPageModuleParams { + /** + * The params required if the module is type LINK + */ + linkParams: optional record LinkModuleParams { + linkUrn: Urn + } + + /** + * The params required if the module is type RICH_TEXT + */ + richTextParams: optional record RichTextModuleParams { + content: string + } +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleProperties.pdl b/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleProperties.pdl new file mode 100644 index 0000000000..8ad5be303c --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleProperties.pdl @@ -0,0 +1,60 @@ +namespace com.linkedin.module + +import com.linkedin.common.AuditStamp + +/** + * The main properties of a DataHub page module + */ +@Aspect = { + "name": "dataHubPageModuleProperties" +} +record DataHubPageModuleProperties { + /** + * The display name of this module + */ + name: string + + /** + * The type of this module - the purpose it serves + */ + @Searchable = { + "fieldType": "KEYWORD" + } + type: DataHubPageModuleType + + /** + * Info about the visibility of this module + */ + visibility: DataHubPageModuleVisibility + + /** + * The specific parameters stored for this module + */ + params: DataHubPageModuleParams + + /** + * Audit stamp for when and by whom this template was created + */ + @Searchable = { + "/time": { + "fieldType": "DATETIME", + "fieldName": "createdAt" + }, + "/actor": { + "fieldType": "URN", + "fieldName": "createdBy" + } + } + created: AuditStamp + + /** + * Audit stamp for when and by whom this template was last updated + */ + @Searchable = { + "/time": { + "fieldType": "DATETIME", + "fieldName": "lastModifiedAt" + } + } + lastModified: AuditStamp +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleType.pdl b/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleType.pdl new file mode 100644 index 0000000000..f84e87d305 --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleType.pdl @@ -0,0 +1,35 @@ +namespace com.linkedin.module + +/** + * Enum containing the types of page modules that there are + */ +enum DataHubPageModuleType { + /** + * Link type module + */ + LINK + /** + * Module containing rich text to be rendered + */ + RICH_TEXT + /** + * A module with a collection of assets + */ + ASSET_COLLECTION + /** + * A module displaying a hierarchy to navigate + */ + HIERARCHY + /** + * Module displaying assets owned by a user + */ + OWNED_ASSETS + /** + * Module displaying assets subscribed to by a given user + */ + SUBSCRIBED_ASSETS + /** + * Module displaying the top domains + */ + DOMAINS +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleVisibility.pdl b/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleVisibility.pdl new file mode 100644 index 0000000000..d57a01fdc4 --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/module/DataHubPageModuleVisibility.pdl @@ -0,0 +1,23 @@ +namespace com.linkedin.module + +/** + * Info about the visibility of this module + */ +record DataHubPageModuleVisibility { + /** + * Audit stamp for when and by whom this module was created + */ + @Searchable = { + "fieldType": "KEYWORD" + } + scope: enum PageModuleScope { + /** + * This module is used for individual use only + */ + PERSONAL + /** + * This module is discoverable and can be used by any user on the platform + */ + GLOBAL + } +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/settings/global/GlobalHomePageSettings.pdl b/metadata-models/src/main/pegasus/com/linkedin/settings/global/GlobalHomePageSettings.pdl new file mode 100644 index 0000000000..37edb9b697 --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/settings/global/GlobalHomePageSettings.pdl @@ -0,0 +1,13 @@ +namespace com.linkedin.settings.global + +import com.linkedin.common.Urn + +/** + * Global settings related to the home page for an instance + */ +record GlobalHomePageSettings { + /** + * The urn that will be rendered in the UI by default for all users + */ + defaultTemplate: Urn +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/settings/global/GlobalSettingsInfo.pdl b/metadata-models/src/main/pegasus/com/linkedin/settings/global/GlobalSettingsInfo.pdl index 6c6f4d0036..2c59534da1 100644 --- a/metadata-models/src/main/pegasus/com/linkedin/settings/global/GlobalSettingsInfo.pdl +++ b/metadata-models/src/main/pegasus/com/linkedin/settings/global/GlobalSettingsInfo.pdl @@ -25,4 +25,9 @@ record GlobalSettingsInfo { "enabled": true "columnPropagationEnabled": true } + + /** + * Global settings related to the home page for an instance + */ + homePage: optional GlobalHomePageSettings } \ No newline at end of file diff --git a/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateProperties.pdl b/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateProperties.pdl new file mode 100644 index 0000000000..4912fed1ee --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateProperties.pdl @@ -0,0 +1,58 @@ +namespace com.linkedin.template + +import com.linkedin.common.AuditStamp + +/** + * The main properties of a DataHub page template + */ +@Aspect = { + "name": "dataHubPageTemplateProperties" +} +record DataHubPageTemplateProperties { + /** + * The rows of modules contained in this template + */ + @Relationship = { + "/*/modules/*": { + "name": "ContainedIn", + "entityTypes": [ "module" ] + } + } + rows: array[DataHubPageTemplateRow] + + /** + * Info about the surface area of the product that this template is deployed in + */ + surface: DataHubPageTemplateSurface + + /** + * Info about the visibility of this template + */ + visibility: DataHubPageTemplateVisibility + + /** + * Audit stamp for when and by whom this template was created + */ + @Searchable = { + "/time": { + "fieldType": "DATETIME", + "fieldName": "createdAt" + }, + "/actor": { + "fieldType": "URN", + "fieldName": "createdBy" + } + } + created: AuditStamp + + /** + * Audit stamp for when and by whom this template was last updated + */ + @Searchable = { + "/time": { + "fieldType": "DATETIME", + "fieldName": "lastModifiedAt" + } + } + lastModified: AuditStamp +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateRow.pdl b/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateRow.pdl new file mode 100644 index 0000000000..2bf5efa892 --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateRow.pdl @@ -0,0 +1,13 @@ +namespace com.linkedin.template + +import com.linkedin.common.Urn + +/** + * A row of modules contained in a template + */ +record DataHubPageTemplateRow { + /** + * The modules that exist in this template row + */ + modules: array[Urn] +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateSurface.pdl b/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateSurface.pdl new file mode 100644 index 0000000000..315b8d9ae1 --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateSurface.pdl @@ -0,0 +1,19 @@ +namespace com.linkedin.template + +/** + * Info about the surface area of the product that this template is deployed in + */ +record DataHubPageTemplateSurface { + /** + * Where exactly is this template being used + */ + @Searchable = { + "fieldType": "KEYWORD" + } + surfaceType: enum PageTemplateSurfaceType { + /** + * This template applies to what to display on the home page for users. + */ + HOME_PAGE + } +} diff --git a/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateVisibility.pdl b/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateVisibility.pdl new file mode 100644 index 0000000000..4babcdf854 --- /dev/null +++ b/metadata-models/src/main/pegasus/com/linkedin/template/DataHubPageTemplateVisibility.pdl @@ -0,0 +1,23 @@ +namespace com.linkedin.template + +/** + * Info about the visibility of this template + */ +record DataHubPageTemplateVisibility { + /** + * The scope of this template and who can use/see it + */ + @Searchable = { + "fieldType": "KEYWORD" + } + scope: enum PageTemplateScope { + /** + * This template is used for individual use only + */ + PERSONAL + /** + * This template is used across users + */ + GLOBAL + } +} diff --git a/metadata-models/src/main/resources/entity-registry.yml b/metadata-models/src/main/resources/entity-registry.yml index 0dd6135e0d..28a2b1ef84 100644 --- a/metadata-models/src/main/resources/entity-registry.yml +++ b/metadata-models/src/main/resources/entity-registry.yml @@ -679,6 +679,16 @@ entities: - formInfo - dynamicFormAssignment - ownership + - name: dataHubPageTemplate + category: core + keyAspect: dataHubPageTemplateKey + aspects: + - dataHubPageTemplateProperties + - name: dataHubPageModule + category: core + keyAspect: dataHubPageModuleKey + aspects: + - dataHubPageModuleProperties - name: dataHubConnection category: internal keyAspect: dataHubConnectionKey