Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(propagation): UI for rendering propagated column documentation #11047

Conversation

jjoyce0510
Copy link
Collaborator

@jjoyce0510 jjoyce0510 commented Jul 31, 2024

Summary

In this PR we add support for rendering propagated column documentation.

Screenshot 2024-07-30 at 6 07 42 PM

Checklist

  • The PR conforms to DataHub's [Contributing Guideline](https://github.com/datahub
    Screenshot 2024-07-30 at 6 07 42 PM
    -project/datahub/blob/master/docs/CONTRIBUTING.md) (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

Summary by CodeRabbit

  • New Features

    • Enhanced SchemaDescriptionField to display propagation details and source information.
    • Introduced PropagationDetails and PropagationEntityLink components for improved user interface related to data propagation.
    • Added a propagatedDescription prop in the DescriptionModal for displaying additional description information.
    • Updated Feature component to visually indicate DataHub-only options with a new tag.
    • Enabled the "Asset Level Propagation" feature for user accessibility.
  • Bug Fixes

    • Streamlined rendering logic for field descriptions to improve clarity.
  • Tests

    • Added Cypress end-to-end tests for verifying UI elements related to data propagation.

@github-actions github-actions bot added product PR or Issue related to the DataHub UI/UX smoke_test Contains changes related to smoke tests labels Jul 31, 2024
Copy link
Contributor

coderabbitai bot commented Jul 31, 2024

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update significantly enhances the functionality and clarity of various components in the data hub application. Key improvements include the introduction of new properties for better contextual information, restructuring rendering logic for more efficient display, and adding utility functions to streamline data handling. Overall, these changes contribute to a more user-friendly experience and improve code maintainability.

Changes

Files Change Summary
SchemaDescriptionField.tsx, DescriptionModal.tsx, FieldDescription.tsx Enhanced components with new props (isPropagated, sourceDetail, propagatedDescription) to improve context and clarity around data descriptions and propagation details.
PropagationDetails.tsx, PropagationEntityLink.tsx, PropagationIcon.tsx Introduced new components for displaying propagation details, including styled icons and links to enhance user navigation and understanding of entity relationships.
utils.ts, getFieldDescriptionDetails.ts, useGetEntities.ts Added utility functions to manage and retrieve propagation details and entities more efficiently, improving code modularity and readability.
useDescriptionRenderer.tsx Refactored rendering logic to streamline the process of displaying schema field descriptions using the new utility function for better maintainability.
docPropagation.js Implemented a new Cypress test for UI validation of propagation indicators, enhancing automated checks for critical UI elements.
Feature.tsx, Features.tsx Updated UI rendering and functionality for settings options, including a new DataHubOnlyTag for feature clarity and enabled the "Asset Level Propagation" feature.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant DescriptionField
    participant PropagationDetails
    participant EntityLink

    User->>UI: Request dataset schema
    UI->>DescriptionField: Render description
    DescriptionField->>PropagationDetails: Check for propagation
    PropagationDetails-->>DescriptionField: Return propagation info
    DescriptionField->>EntityLink: Generate entity links
    EntityLink-->>UI: Display linked entities
    UI-->>User: Show updated schema with propagation details
Loading

🐇 Hopping through the code, oh what a sight,
New props and details, making it bright!
With links and icons, so clear and so neat,
Our data's now lively, quite a treat!
Let's celebrate changes, both big and small,
In the data hub garden, we’re having a ball! 🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Outside diff range, codebase verification and nitpick comments (3)
datahub-web-react/src/app/entity/shared/propagation/PropagationIcon.tsx (2)

1-3: Ensure consistent import order.

To improve readability, consider grouping the imports by third-party libraries and local files.

import styled from 'styled-components';
import { ThunderboltFilled } from '@ant-design/icons';
+import { REDESIGN_COLORS } from '../constants';

5-14: Avoid hardcoding colors.

Instead of hardcoding the color value, consider using a constant or a theme.

-        color: #a7c7fa;
+        color: ${REDESIGN_COLORS.LIGHT_BLUE};
smoke-test/tests/cypress/cypress/e2e/actions/docPropagation.js (1)

1-1: Consider using a more descriptive test ID.

Using a more descriptive test ID can improve readability and maintainability.

-const testId = '[data-testid="docPropagationIndicator"]';
+const docPropagationIndicatorTestId = '[data-testid="docPropagationIndicator"]';
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a3c7ede and 08bcea4.

Files selected for processing (12)
  • datahub-web-react/src/app/entity/dataset/profile/schema/components/SchemaDescriptionField.tsx (6 hunks)
  • datahub-web-react/src/app/entity/shared/components/legacy/DescriptionModal.tsx (2 hunks)
  • datahub-web-react/src/app/entity/shared/propagation/PropagationDetails.tsx (1 hunks)
  • datahub-web-react/src/app/entity/shared/propagation/PropagationEntityLink.tsx (1 hunks)
  • datahub-web-react/src/app/entity/shared/propagation/PropagationIcon.tsx (1 hunks)
  • datahub-web-react/src/app/entity/shared/propagation/utils.ts (1 hunks)
  • datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/components/SchemaFieldDrawer/FieldDescription.tsx (4 hunks)
  • datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/utils/getFieldDescriptionDetails.ts (1 hunks)
  • datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/utils/useDescriptionRenderer.tsx (4 hunks)
  • datahub-web-react/src/app/entity/shared/useGetEntities.ts (1 hunks)
  • smoke-test/tests/cypress/cypress/e2e/actions/docPropagation.js (1 hunks)
  • smoke-test/tests/cypress/data.json (17 hunks)
Additional comments not posted (35)
datahub-web-react/src/app/entity/shared/propagation/PropagationIcon.tsx (1)

16-22: LGTM!

The PropagateThunderboltFilled component is well-defined and uses the REDESIGN_COLORS constant for color.

smoke-test/tests/cypress/cypress/e2e/actions/docPropagation.js (1)

3-25: LGTM!

The Cypress test is well-structured and covers the necessary steps to verify the docPropagation feature.

datahub-web-react/src/app/entity/shared/propagation/utils.ts (1)

9-11: Ensure proper error handling for useGetEntities.

Consider handling cases where useGetEntities might fail or return unexpected results.

Ensure that useGetEntities handles errors gracefully and returns a valid result.

datahub-web-react/src/app/entity/shared/propagation/PropagationEntityLink.tsx (2)

26-27: Ensure proper error handling for useEntityRegistry.

Consider handling cases where useEntityRegistry might fail or return unexpected results.

Ensure that useEntityRegistry handles errors gracefully and returns a valid result.


36-42: Ensure proper URL encoding and display name assignment.

Consider handling cases where getEntityUrl or getDisplayName might fail or return unexpected results.

Ensure that getEntityUrl and getDisplayName handle errors gracefully and return valid results.

datahub-web-react/src/app/entity/shared/propagation/PropagationDetails.tsx (7)

1-8: Imports look good.

The imported modules and components are appropriate for the functionality described.


10-27: Styled components are well-defined.

The styled components PopoverWrapper, PopoverTitle, and PopoverDescription are defined with appropriate styles.


29-31: Interface definition looks good.

The Props interface correctly defines the expected props for the PropagationDetails component.


33-38: Usage of usePropagationDetails looks good.

The custom hook usePropagationDetails is used appropriately to extract propagation details from sourceDetail.


40-40: Handle null or non-propagated source details gracefully.

The early return ensures that the component does not render if sourceDetail is null or not propagated.


42-59: Popover content rendering is well-structured.

The popoverContent variable conditionally renders content based on the presence of originEntity and viaEntity.


61-74: Component rendering logic looks good.

The Popover component is used appropriately to display the propagated description with a custom title and content.

datahub-web-react/src/app/entity/shared/components/legacy/DescriptionModal.tsx (7)

Line range hint 1-7:
Imports look good.

The imported modules and components are appropriate for the functionality described.


Line range hint 9-24:
Styled components are well-defined.

The styled components FormLabel, StyledEditor, StyledViewer, and OriginalDocumentation are defined with appropriate styles.


25-34: Interface definition looks good.

The Props interface correctly defines the expected props for the UpdateDescriptionModal component, including the new propagatedDescription prop.


36-44: Component props usage looks good.

The UpdateDescriptionModal component correctly uses the new propagatedDescription prop along with other existing props.


Line range hint 46-49:
State initialization logic looks good.

The component initializes the state updatedDesc based on the provided description or original prop.


Line range hint 51-60:
Modal rendering logic looks good.

The Modal component is used appropriately to display the update description modal with custom footer buttons.


Line range hint 62-90:
Conditional rendering of descriptions is well-implemented.

The component conditionally renders the StyledEditor, OriginalDocumentation for original description, and OriginalDocumentation for propagated description based on the provided props.

datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/utils/useDescriptionRenderer.tsx (5)

Line range hint 1-9:
Imports look good.

The imported modules and components are appropriate for the functionality described.


Line range hint 11-23:
Function setup looks good.

The useDescriptionRenderer function initializes several hooks and utilities appropriately.


25-27: Editable field info extraction looks good.

The function correctly extracts the editable field info from the provided editableSchemaMetadata.


28-33: Usage of getFieldDescriptionDetails looks good.

The function correctly uses getFieldDescriptionDetails to extract the displayed description, propagation status, and source detail.


Line range hint 35-66:
Description rendering logic is well-implemented.

The function correctly sanitizes the description and handles the expanded rows state. The DescriptionField component is used appropriately to render the description with the extracted details.

datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/components/SchemaFieldDrawer/FieldDescription.tsx (5)

9-10: New imports approved.

The new imports getFieldDescriptionDetails and PropagationDetails are necessary for the added functionality.


25-30: Styled component update approved.

The addition of gap and align-items properties to the DescriptionWrapper styled component enhances the layout.


100-110: Conditional rendering update approved.

The update to conditionally display PropagationDetails based on isPropagated enhances the user experience by avoiding clutter when propagation is not applicable.


132-132: UpdateDescriptionModal update approved.

The addition of propagatedDescription to the UpdateDescriptionModal component enhances functionality by providing additional context.


83-88: Utility function usage approved.

The usage of getFieldDescriptionDetails to derive displayedDescription, isPropagated, sourceDetail, and propagatedDescription centralizes the logic and improves code clarity.

Verify the implementation of getFieldDescriptionDetails to ensure it correctly handles the logic.

Verification successful

Utility function implementation verified.

The getFieldDescriptionDetails function correctly processes the schemaFieldEntity and editableFieldInfo to derive the necessary details. The logic for determining displayedDescription, isPropagated, sourceDetail, and propagatedDescription is appropriately handled.

  • File: datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/utils/getFieldDescriptionDetails.ts
  • Lines: 9-25
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation of `getFieldDescriptionDetails`.

# Test: Search for the function implementation. Expect: Correct handling of description logic.
ast-grep --lang typescript --pattern $'function getFieldDescriptionDetails($_) {
  $$$
}'

Length of output: 2633

datahub-web-react/src/app/entity/dataset/profile/schema/components/SchemaDescriptionField.tsx (4)

8-9: New imports approved.

The new imports StringMapEntry and PropagationDetails are necessary for the added functionality.


33-36: Styled component addition approved.

The addition of the DescriptionWrapper styled component enhances the layout by aligning propagation details with the description text.


115-116: New properties in Props type approved.

The addition of isPropagated and sourceDetail properties to the Props type enhances functionality by allowing the component to convey additional information regarding data propagation.


198-220: Conditional rendering update approved.

The update to conditionally display PropagationDetails based on isPropagated enhances the user experience by providing more contextual information.

smoke-test/tests/cypress/data.json (2)

99-103: Formatting adjustments approved.

The formatting adjustments enhance the readability of the JSON by expanding the "tags" arrays.

Also applies to: 144-148, 257-263, 418-423, 563-567, 743-747, 1040-1044, 1262-1266, 1316-1320, 1373-1377, 1416-1420, 1462-1466, 1512-1516, 1578-1582, 1819-1823, 1850-1854


2208-2217: New entry for schema field documentation approved.

The new entry is correctly formatted and provides necessary metadata regarding schema field documentation.

Comment on lines +16 to +17
const { data } = useGetEntitiesQuery({ variables: { urns: verifiedUrns }, skip: !verifiedUrns.length });
return (data?.entities || []) as Entity[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure error handling for GraphQL query.

Consider adding error handling for the useGetEntitiesQuery to handle potential errors gracefully.

    const { data, error } = useGetEntitiesQuery({ variables: { urns: verifiedUrns }, skip: !verifiedUrns.length });
    if (error) {
        console.error('Failed to fetch entities:', error);
        return [];
    }
    return (data?.entities || []) as Entity[];
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { data } = useGetEntitiesQuery({ variables: { urns: verifiedUrns }, skip: !verifiedUrns.length });
return (data?.entities || []) as Entity[];
const { data, error } = useGetEntitiesQuery({ variables: { urns: verifiedUrns }, skip: !verifiedUrns.length });
if (error) {
console.error('Failed to fetch entities:', error);
return [];
}
return (data?.entities || []) as Entity[];

Comment on lines +5 to +14
export function useGetEntities(urns: string[]): Entity[] {
const [verifiedUrns, setVerifiedUrns] = useState<string[]>([]);

useEffect(() => {
urns.forEach((urn) => {
if (urn.startsWith('urn:li:') && !verifiedUrns.includes(urn)) {
setVerifiedUrns((prevUrns) => [...prevUrns, urn]);
}
});
}, [urns, verifiedUrns]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize URN verification logic.

The current logic verifies URNs on every render, which can be optimized by using a Set to track verified URNs.

export function useGetEntities(urns: string[]): Entity[] {
    const [verifiedUrns, setVerifiedUrns] = useState<Set<string>>(new Set());

    useEffect(() => {
        urns.forEach((urn) => {
            if (urn.startsWith('urn:li:') && !verifiedUrns.has(urn)) {
                setVerifiedUrns((prevUrns) => new Set(prevUrns).add(urn));
            }
        });
    }, [urns, verifiedUrns]);

    const { data } = useGetEntitiesQuery({ variables: { urns: Array.from(verifiedUrns) }, skip: !verifiedUrns.size });
    return (data?.entities || []) as Entity[];
}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function useGetEntities(urns: string[]): Entity[] {
const [verifiedUrns, setVerifiedUrns] = useState<string[]>([]);
useEffect(() => {
urns.forEach((urn) => {
if (urn.startsWith('urn:li:') && !verifiedUrns.includes(urn)) {
setVerifiedUrns((prevUrns) => [...prevUrns, urn]);
}
});
}, [urns, verifiedUrns]);
export function useGetEntities(urns: string[]): Entity[] {
const [verifiedUrns, setVerifiedUrns] = useState<Set<string>>(new Set());
useEffect(() => {
urns.forEach((urn) => {
if (urn.startsWith('urn:li:') && !verifiedUrns.has(urn)) {
setVerifiedUrns((prevUrns) => new Set(prevUrns).add(urn));
}
});
}, [urns, verifiedUrns]);
const { data } = useGetEntitiesQuery({ variables: { urns: Array.from(verifiedUrns) }, skip: !verifiedUrns.size });
return (data?.entities || []) as Entity[];
}

Comment on lines +4 to +7
export function usePropagationDetails(sourceDetail?: StringMapEntry[] | null) {
const isPropagated = !!sourceDetail?.find((mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true');
const originEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'origin')?.value || '';
const viaEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'via')?.value || '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider handling edge cases for sourceDetail.

Ensure that sourceDetail is properly validated to avoid potential issues with find operations.

-  const isPropagated = !!sourceDetail?.find((mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true');
-  const originEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'origin')?.value || '';
-  const viaEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'via')?.value || '';
+  const isPropagated = sourceDetail?.some((mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true') ?? false;
+  const originEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'origin')?.value ?? '';
+  const viaEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'via')?.value ?? '';
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function usePropagationDetails(sourceDetail?: StringMapEntry[] | null) {
const isPropagated = !!sourceDetail?.find((mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true');
const originEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'origin')?.value || '';
const viaEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'via')?.value || '';
export function usePropagationDetails(sourceDetail?: StringMapEntry[] | null) {
const isPropagated = sourceDetail?.some((mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true') ?? false;
const originEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'origin')?.value ?? '';
const viaEntityUrn = sourceDetail?.find((mapEntry) => mapEntry.key === 'via')?.value ?? '';

Comment on lines +18 to +19
const displayedDescription =
editableFieldInfo?.description || documentation?.documentation || defaultDescription || '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize the displayedDescription assignment.

The assignment of displayedDescription can be optimized by using nullish coalescing to handle default values.

-  const displayedDescription =
-      editableFieldInfo?.description || documentation?.documentation || defaultDescription || '';
+  const displayedDescription = editableFieldInfo?.description ?? documentation?.documentation ?? defaultDescription ?? '';
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const displayedDescription =
editableFieldInfo?.description || documentation?.documentation || defaultDescription || '';
const displayedDescription = editableFieldInfo?.description ?? documentation?.documentation ?? defaultDescription ?? '';

Comment on lines +9 to +16
export function getFieldDescriptionDetails({ schemaFieldEntity, editableFieldInfo, defaultDescription }: Props) {
const documentation = schemaFieldEntity?.documentation?.documentations?.[0];
const isUsingDocumentationAspect = !editableFieldInfo?.description && !!documentation;
const isPropagated =
isUsingDocumentationAspect &&
!!documentation?.attribution?.sourceDetail?.find(
(mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true',
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider handling edge cases for schemaFieldEntity and editableFieldInfo.

Ensure that schemaFieldEntity and editableFieldInfo are properly validated to avoid potential issues with find operations.

-  const isPropagated =
-      isUsingDocumentationAspect &&
-      !!documentation?.attribution?.sourceDetail?.find(
-          (mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true',
-      );
+  const isPropagated = isUsingDocumentationAspect &&
+      documentation?.attribution?.sourceDetail?.some(
+          (mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true'
+      ) ?? false;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function getFieldDescriptionDetails({ schemaFieldEntity, editableFieldInfo, defaultDescription }: Props) {
const documentation = schemaFieldEntity?.documentation?.documentations?.[0];
const isUsingDocumentationAspect = !editableFieldInfo?.description && !!documentation;
const isPropagated =
isUsingDocumentationAspect &&
!!documentation?.attribution?.sourceDetail?.find(
(mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true',
);
export function getFieldDescriptionDetails({ schemaFieldEntity, editableFieldInfo, defaultDescription }: Props) {
const documentation = schemaFieldEntity?.documentation?.documentations?.[0];
const isUsingDocumentationAspect = !editableFieldInfo?.description && !!documentation;
const isPropagated = isUsingDocumentationAspect &&
documentation?.attribution?.sourceDetail?.some(
(mapEntry) => mapEntry.key === 'propagated' && mapEntry.value === 'true'
) ?? false;

Comment on lines +29 to +31
const isSchemaField = entity.type === EntityType.SchemaField;
const baseEntity = isSchemaField ? (entity as SchemaFieldEntity).parent : entity;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize the entity type check and assignment.

The entity type check and assignment can be optimized for better readability and performance.

-  const isSchemaField = entity.type === EntityType.SchemaField;
-  const baseEntity = isSchemaField ? (entity as SchemaFieldEntity).parent : entity;
+  const baseEntity = entity.type === EntityType.SchemaField ? (entity as SchemaFieldEntity).parent : entity;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const isSchemaField = entity.type === EntityType.SchemaField;
const baseEntity = isSchemaField ? (entity as SchemaFieldEntity).parent : entity;
const baseEntity = entity.type === EntityType.SchemaField ? (entity as SchemaFieldEntity).parent : entity;

John Joyce added 2 commits July 30, 2024 20:42
…eover' into jj--propagation-doc-action-ui-takeover
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 08bcea4 and 2773e04.

Files selected for processing (3)
  • datahub-web-react/src/app/settings/features/Feature.tsx (2 hunks)
  • datahub-web-react/src/app/settings/features/Features.tsx (1 hunks)
  • smoke-test/tests/cypress/cypress/e2e/actions/docPropagation.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • smoke-test/tests/cypress/cypress/e2e/actions/docPropagation.js
Additional comments not posted (2)
datahub-web-react/src/app/settings/features/Features.tsx (1)

82-82: LGTM! But verify the impact on user experience.

The change to isAvailable: true for the "Asset Level Propagation" feature is approved.

However, ensure that this change positively impacts the user experience and does not introduce any unexpected behaviors.

datahub-web-react/src/app/settings/features/Feature.tsx (1)

162-178: LGTM! But verify the impact on the user interface.

The addition of the DataHubOnlyTag for settings options is approved.

However, ensure that this change positively impacts the user interface and provides the intended context to the users.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2773e04 and 3b3ef05.

Files selected for processing (1)
  • smoke-test/tests/cypress/cypress/e2e/actions/docPropagation.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • smoke-test/tests/cypress/cypress/e2e/actions/docPropagation.js

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3b3ef05 and 0598921.

Files selected for processing (1)
  • datahub-web-react/src/app/entity/shared/components/legacy/DescriptionModal.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • datahub-web-react/src/app/entity/shared/components/legacy/DescriptionModal.tsx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0598921 and c1da3d7.

Files selected for processing (3)
  • datahub-web-react/src/app/entity/shared/propagation/PropagationDetails.tsx (1 hunks)
  • datahub-web-react/src/app/entity/shared/propagation/PropagationEntityLink.tsx (1 hunks)
  • datahub-web-react/src/app/lineage/LineageExplorer.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • datahub-web-react/src/app/lineage/LineageExplorer.tsx
Files skipped from review as they are similar to previous changes (2)
  • datahub-web-react/src/app/entity/shared/propagation/PropagationDetails.tsx
  • datahub-web-react/src/app/entity/shared/propagation/PropagationEntityLink.tsx

John Joyce added 2 commits August 19, 2024 17:22
@jjoyce0510 jjoyce0510 merged commit 7d08ee2 into datahub-project:master Aug 20, 2024
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX smoke_test Contains changes related to smoke tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants