feat(models) Add data models for Custom Home page project - Templates and Modules (#13911)

This commit is contained in:
Chris Collins 2025-07-01 19:22:23 -04:00 committed by GitHub
parent 1c34f96b6d
commit 7457319c0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 327 additions and 0 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}
}

View File

@ -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
}

View File

@ -25,4 +25,9 @@ record GlobalSettingsInfo {
"enabled": true
"columnPropagationEnabled": true
}
/**
* Global settings related to the home page for an instance
*/
homePage: optional GlobalHomePageSettings
}

View File

@ -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
}

View File

@ -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]
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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