diff --git a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java index 8390a34e93..6206548c2d 100644 --- a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java +++ b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java @@ -314,15 +314,7 @@ import com.linkedin.datahub.graphql.types.view.DataHubViewType; import com.linkedin.entity.client.EntityClient; import com.linkedin.entity.client.SystemEntityClient; import com.linkedin.metadata.client.UsageStatsJavaClient; -import com.linkedin.metadata.config.ChromeExtensionConfiguration; -import com.linkedin.metadata.config.DataHubConfiguration; -import com.linkedin.metadata.config.GraphQLConfiguration; -import com.linkedin.metadata.config.HomePageConfiguration; -import com.linkedin.metadata.config.IngestionConfiguration; -import com.linkedin.metadata.config.SearchBarConfiguration; -import com.linkedin.metadata.config.TestsConfiguration; -import com.linkedin.metadata.config.ViewsConfiguration; -import com.linkedin.metadata.config.VisualConfiguration; +import com.linkedin.metadata.config.*; import com.linkedin.metadata.config.telemetry.TelemetryConfiguration; import com.linkedin.metadata.connection.ConnectionService; import com.linkedin.metadata.entity.EntityService; @@ -433,6 +425,7 @@ public class GmsGraphQLEngine { private final DataHubConfiguration datahubConfiguration; private final ViewsConfiguration viewsConfiguration; private final SearchBarConfiguration searchBarConfiguration; + private final SearchCardConfiguration searchCardConfiguration; private final HomePageConfiguration homePageConfiguration; private final ChromeExtensionConfiguration chromeExtensionConfiguration; @@ -567,6 +560,7 @@ public class GmsGraphQLEngine { this.datahubConfiguration = args.datahubConfiguration; this.viewsConfiguration = args.viewsConfiguration; this.searchBarConfiguration = args.searchBarConfiguration; + this.searchCardConfiguration = args.searchCardConfiguration; this.homePageConfiguration = args.homePageConfiguration; this.featureFlags = args.featureFlags; this.chromeExtensionConfiguration = args.chromeExtensionConfiguration; @@ -972,6 +966,7 @@ public class GmsGraphQLEngine { this.datahubConfiguration, this.viewsConfiguration, this.searchBarConfiguration, + this.searchCardConfiguration, this.homePageConfiguration, this.featureFlags, this.chromeExtensionConfiguration, diff --git a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngineArgs.java b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngineArgs.java index c04b685d41..cccc9f89f0 100644 --- a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngineArgs.java +++ b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngineArgs.java @@ -13,15 +13,7 @@ import com.linkedin.datahub.graphql.featureflags.FeatureFlags; import com.linkedin.entity.client.EntityClient; import com.linkedin.entity.client.SystemEntityClient; import com.linkedin.metadata.client.UsageStatsJavaClient; -import com.linkedin.metadata.config.ChromeExtensionConfiguration; -import com.linkedin.metadata.config.DataHubConfiguration; -import com.linkedin.metadata.config.GraphQLConfiguration; -import com.linkedin.metadata.config.HomePageConfiguration; -import com.linkedin.metadata.config.IngestionConfiguration; -import com.linkedin.metadata.config.SearchBarConfiguration; -import com.linkedin.metadata.config.TestsConfiguration; -import com.linkedin.metadata.config.ViewsConfiguration; -import com.linkedin.metadata.config.VisualConfiguration; +import com.linkedin.metadata.config.*; import com.linkedin.metadata.config.telemetry.TelemetryConfiguration; import com.linkedin.metadata.connection.ConnectionService; import com.linkedin.metadata.entity.EntityService; @@ -77,6 +69,7 @@ public class GmsGraphQLEngineArgs { DataHubConfiguration datahubConfiguration; ViewsConfiguration viewsConfiguration; SearchBarConfiguration searchBarConfiguration; + SearchCardConfiguration searchCardConfiguration; HomePageConfiguration homePageConfiguration; SiblingGraphService siblingGraphService; GroupService groupService; diff --git a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/resolvers/config/AppConfigResolver.java b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/resolvers/config/AppConfigResolver.java index 80f4a7b001..24a4fb8cf7 100644 --- a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/resolvers/config/AppConfigResolver.java +++ b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/resolvers/config/AppConfigResolver.java @@ -4,40 +4,11 @@ import com.datahub.authentication.AuthenticationConfiguration; import com.datahub.authorization.AuthorizationConfiguration; import com.linkedin.datahub.graphql.QueryContext; import com.linkedin.datahub.graphql.featureflags.FeatureFlags; -import com.linkedin.datahub.graphql.generated.AnalyticsConfig; -import com.linkedin.datahub.graphql.generated.AppConfig; +import com.linkedin.datahub.graphql.generated.*; import com.linkedin.datahub.graphql.generated.ApplicationConfig; -import com.linkedin.datahub.graphql.generated.AuthConfig; -import com.linkedin.datahub.graphql.generated.ChromeExtensionConfig; import com.linkedin.datahub.graphql.generated.EntityProfileConfig; -import com.linkedin.datahub.graphql.generated.EntityProfilesConfig; -import com.linkedin.datahub.graphql.generated.EntityType; -import com.linkedin.datahub.graphql.generated.FeatureFlagsConfig; -import com.linkedin.datahub.graphql.generated.HomePageConfig; -import com.linkedin.datahub.graphql.generated.IdentityManagementConfig; -import com.linkedin.datahub.graphql.generated.LineageConfig; -import com.linkedin.datahub.graphql.generated.ManagedIngestionConfig; -import com.linkedin.datahub.graphql.generated.PersonalSidebarSection; -import com.linkedin.datahub.graphql.generated.PoliciesConfig; -import com.linkedin.datahub.graphql.generated.Privilege; import com.linkedin.datahub.graphql.generated.QueriesTabConfig; -import com.linkedin.datahub.graphql.generated.ResourcePrivileges; -import com.linkedin.datahub.graphql.generated.SearchBarAPI; -import com.linkedin.datahub.graphql.generated.SearchBarConfig; -import com.linkedin.datahub.graphql.generated.SearchResultsVisualConfig; -import com.linkedin.datahub.graphql.generated.TelemetryConfig; -import com.linkedin.datahub.graphql.generated.TestsConfig; -import com.linkedin.datahub.graphql.generated.ThemeConfig; -import com.linkedin.datahub.graphql.generated.ViewsConfig; -import com.linkedin.datahub.graphql.generated.VisualConfig; -import com.linkedin.metadata.config.ChromeExtensionConfiguration; -import com.linkedin.metadata.config.DataHubConfiguration; -import com.linkedin.metadata.config.HomePageConfiguration; -import com.linkedin.metadata.config.IngestionConfiguration; -import com.linkedin.metadata.config.SearchBarConfiguration; -import com.linkedin.metadata.config.TestsConfiguration; -import com.linkedin.metadata.config.ViewsConfiguration; -import com.linkedin.metadata.config.VisualConfiguration; +import com.linkedin.metadata.config.*; import com.linkedin.metadata.config.telemetry.TelemetryConfiguration; import com.linkedin.metadata.service.SettingsService; import com.linkedin.metadata.version.GitVersion; @@ -64,6 +35,7 @@ public class AppConfigResolver implements DataFetcher { + let processingContent = content; + + if (clearMarkdown) { + processingContent = removeMarkdown(processingContent); + } + + return processingContent; + }, [content, clearMarkdown]); + + return ( + + {processedContent} + + ); +} diff --git a/datahub-web-react/src/app/previewV2/DefaultPreviewCard.tsx b/datahub-web-react/src/app/previewV2/DefaultPreviewCard.tsx index 080671a401..a923e37623 100644 --- a/datahub-web-react/src/app/previewV2/DefaultPreviewCard.tsx +++ b/datahub-web-react/src/app/previewV2/DefaultPreviewCard.tsx @@ -4,6 +4,7 @@ import React, { ReactNode } from 'react'; import styled from 'styled-components'; import { useEntityContext, useEntityData } from '@app/entity/shared/EntityContext'; +import { removeMarkdown } from '@app/entity/shared/components/styled/StripMarkdownText'; import { GenericEntityProperties } from '@app/entity/shared/types'; import { EntityMenuActions, PreviewType } from '@app/entityV2/Entity'; import { EntityMenuItems } from '@app/entityV2/shared/EntityDropdown/EntityMenuActions'; @@ -15,6 +16,7 @@ import { GlossaryPreviewCardDecoration } from '@app/entityV2/shared/containers/p import { PopularityTier } from '@app/entityV2/shared/containers/profile/sidebar/shared/utils'; import ViewInPlatform from '@app/entityV2/shared/externalUrl/ViewInPlatform'; import CompactMarkdownViewer from '@app/entityV2/shared/tabs/Documentation/components/CompactMarkdownViewer'; +import ShortMarkdownViewer from '@app/entityV2/shared/tabs/Documentation/components/ShortMarkdownViewer'; import { DashboardLastUpdatedMs, DatasetLastUpdatedMs } from '@app/entityV2/shared/utils'; import ColoredBackgroundPlatformIconGroup from '@app/previewV2/ColoredBackgroundPlatformIconGroup'; import { CompactView } from '@app/previewV2/CompactView'; @@ -24,6 +26,7 @@ import EntityHeader from '@app/previewV2/EntityHeader'; import { ActionsAndStatusSection } from '@app/previewV2/shared'; import { useRemoveDataProductAssets, useRemoveDomainAssets, useRemoveGlossaryTermAssets } from '@app/previewV2/utils'; import { useSearchContext } from '@app/search/context/SearchContext'; +import { useAppConfig } from '@app/useAppConfig'; import { useEntityRegistryV2 } from '@app/useEntityRegistry'; import DataProcessInstanceInfo from '@src/app/preview/DataProcessInstanceInfo'; @@ -105,8 +108,15 @@ const InsightIconContainer = styled.span` margin-right: 4px; `; -const Documentation = styled.div` +const DocumentationTopMarginWrapper = styled.div` margin-top: 8px; +`; + +const ShortDocumentation = styled(DocumentationTopMarginWrapper)` + width: 100%; +`; + +const Documentation = styled(DocumentationTopMarginWrapper)` max-height: 300px; overflow-y: auto; `; @@ -218,6 +228,15 @@ export default function DefaultPreviewCard({ }: Props) { const entityRegistry = useEntityRegistryV2(); const supportedCapabilities = entityRegistry.getSupportedEntityCapabilities(entityType); + const { config } = useAppConfig(); + + const shouldShowRedesignedDescription = config.searchCardConfig.showDescription; + const shouldShowDescriptionsForSearch = + previewType === PreviewType.SEARCH && config.searchCardConfig.showDescription; + const shouldShowDescription = + previewType === PreviewType.HOVER_CARD || + ENTITY_TYPES_WITH_DESCRIPTION_PREVIEW.has(entityType) || + shouldShowDescriptionsForSearch; // sometimes these lists will be rendered inside an entity container (for example, in the case of impact analysis) // in those cases, we may want to enrich the preview w/ context about the container entity @@ -311,13 +330,17 @@ export default function DefaultPreviewCard({ entityTitleWidth={previewType === PreviewType.HOVER_CARD ? 150 : 200} /> - {(previewType === PreviewType.HOVER_CARD || - ENTITY_TYPES_WITH_DESCRIPTION_PREVIEW.has(entityType)) && - description ? ( - - - - ) : null} + {shouldShowDescription && + !!description && + (shouldShowRedesignedDescription ? ( + + + + ) : ( + + + + ))} {shouldShowDPIinfo && ( diff --git a/datahub-web-react/src/appConfigContext.tsx b/datahub-web-react/src/appConfigContext.tsx index 562c147f30..675e32dec6 100644 --- a/datahub-web-react/src/appConfigContext.tsx +++ b/datahub-web-react/src/appConfigContext.tsx @@ -47,6 +47,9 @@ export const DEFAULT_APP_CONFIG = { searchBarConfig: { apiVariant: SearchBarApi.AutocompleteForMultiple, }, + searchCardConfig: { + showDescription: false, + }, homePageConfig: { firstInPersonalSidebar: PersonalSidebarSection.YourAssets, }, diff --git a/datahub-web-react/src/graphql/app.graphql b/datahub-web-react/src/graphql/app.graphql index f9c1c71b3e..d45f2dfbea 100644 --- a/datahub-web-react/src/graphql/app.graphql +++ b/datahub-web-react/src/graphql/app.graphql @@ -69,6 +69,9 @@ query appConfig { searchBarConfig { apiVariant } + searchCardConfig { + showDescription + } homePageConfig { firstInPersonalSidebar } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/system_info/collectors/PropertiesCollectorConfigurationTest.java b/metadata-io/src/test/java/com/linkedin/metadata/system_info/collectors/PropertiesCollectorConfigurationTest.java index dc736f610c..1ec62876f7 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/system_info/collectors/PropertiesCollectorConfigurationTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/system_info/collectors/PropertiesCollectorConfigurationTest.java @@ -751,6 +751,7 @@ public class PropertiesCollectorConfigurationTest extends AbstractTestNGSpringCo "platformAnalytics.usageExport.usageEventTypes", "platformAnalytics.usageExport.userFilters", "searchBar.apiVariant", + "searchCard.showDescription", "searchService.cache.hazelcast.serviceName", "searchService.cache.hazelcast.service-dns-timeout", "searchService.cache.hazelcast.kubernetes-api-retries", diff --git a/metadata-service/configuration/src/main/java/com/linkedin/metadata/config/DataHubAppConfiguration.java b/metadata-service/configuration/src/main/java/com/linkedin/metadata/config/DataHubAppConfiguration.java index c022fae077..a56649d504 100644 --- a/metadata-service/configuration/src/main/java/com/linkedin/metadata/config/DataHubAppConfiguration.java +++ b/metadata-service/configuration/src/main/java/com/linkedin/metadata/config/DataHubAppConfiguration.java @@ -37,6 +37,9 @@ public class DataHubAppConfiguration { /** Search bar related configs */ private SearchBarConfiguration searchBar; + /** Search card related configs */ + private SearchCardConfiguration searchCard; + /** Home page related configs */ private HomePageConfiguration homePage; diff --git a/metadata-service/configuration/src/main/java/com/linkedin/metadata/config/SearchCardConfiguration.java b/metadata-service/configuration/src/main/java/com/linkedin/metadata/config/SearchCardConfiguration.java new file mode 100644 index 0000000000..d0f67f7076 --- /dev/null +++ b/metadata-service/configuration/src/main/java/com/linkedin/metadata/config/SearchCardConfiguration.java @@ -0,0 +1,10 @@ +package com.linkedin.metadata.config; + +import lombok.Data; + +/** POJO representing the "searchCard" configuration block in application.yaml.on.yml */ +@Data +public class SearchCardConfiguration { + /** If turned on, show the description in search card */ + public Boolean showDescription; +} diff --git a/metadata-service/configuration/src/main/resources/application.yaml b/metadata-service/configuration/src/main/resources/application.yaml index 86131e0a7d..e5ddf45317 100644 --- a/metadata-service/configuration/src/main/resources/application.yaml +++ b/metadata-service/configuration/src/main/resources/application.yaml @@ -744,6 +744,9 @@ views: searchBar: apiVariant: ${SEARCH_BAR_API_VARIANT:AUTOCOMPLETE_FOR_MULTIPLE} +searchCard: + showDescription: ${SEARCH_CARD_SHOW_DESCRIPTION:false} + homePage: firstInPersonalSidebar: ${FIRST_IN_PERSONAL_SIDEBAR:YOUR_ASSETS} diff --git a/metadata-service/factories/src/main/java/com/linkedin/gms/factory/graphql/GraphQLEngineFactory.java b/metadata-service/factories/src/main/java/com/linkedin/gms/factory/graphql/GraphQLEngineFactory.java index 9d2b31df88..c89165538b 100644 --- a/metadata-service/factories/src/main/java/com/linkedin/gms/factory/graphql/GraphQLEngineFactory.java +++ b/metadata-service/factories/src/main/java/com/linkedin/gms/factory/graphql/GraphQLEngineFactory.java @@ -257,6 +257,7 @@ public class GraphQLEngineFactory { args.setDatahubConfiguration(configProvider.getDatahub()); args.setViewsConfiguration(configProvider.getViews()); args.setSearchBarConfiguration(configProvider.getSearchBar()); + args.setSearchCardConfiguration(configProvider.getSearchCard()); args.setHomePageConfiguration(configProvider.getHomePage()); args.setSiblingGraphService(siblingGraphService); args.setGroupService(groupService);