diff --git a/.github/workflows/publish-datahub-jars.yml b/.github/workflows/publish-datahub-jars.yml index eb57c29e151ae6..5aec66bc33bb67 100644 --- a/.github/workflows/publish-datahub-jars.yml +++ b/.github/workflows/publish-datahub-jars.yml @@ -196,3 +196,52 @@ jobs: echo signingKey=$SIGNING_KEY >> gradle.properties ./gradlew -PreleaseVersion=${{ needs.setup.outputs.tag }} :metadata-integration:java:custom-plugin-lib:publish ./gradlew :metadata-integration:java:custom-plugin-lib:closeAndReleaseRepository --info + publish-java8: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + needs: ["check-secret", "setup"] + if: ${{ needs.check-secret.outputs.publish-enabled == 'true' }} + steps: + - uses: acryldata/sane-checkout-action@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: 17 + - uses: gradle/actions/setup-gradle@v3 + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + cache: "pip" + - name: checkout upstream repo + run: | + git remote add upstream https://github.com/datahub-project/datahub.git + git fetch upstream --tags --force --filter=tree:0 + - name: publish datahub-client jar snapshot + if: ${{ github.event_name != 'release' }} + env: + RELEASE_USERNAME: ${{ secrets.RELEASE_USERNAME }} + RELEASE_PASSWORD: ${{ secrets.RELEASE_PASSWORD }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + run: | + echo signingKey=$SIGNING_KEY >> gradle.properties + ./gradlew :metadata-integration:java:datahub-client:printVersion -PjavaClassVersionDefault=8 -ParchiveAppendix=java8 + ./gradlew :metadata-integration:java:datahub-client:publish -PjavaClassVersionDefault=8 -ParchiveAppendix=java8 + - name: release datahub-client jar + if: ${{ github.event_name == 'release' }} + env: + RELEASE_USERNAME: ${{ secrets.RELEASE_USERNAME }} + RELEASE_PASSWORD: ${{ secrets.RELEASE_PASSWORD }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + run: | + echo signingKey=$SIGNING_KEY >> gradle.properties + ./gradlew -PreleaseVersion=${{ needs.setup.outputs.tag }} :metadata-integration:java:datahub-client:publish -PjavaClassVersionDefault=8 -ParchiveAppendix=java8 + ./gradlew :metadata-integration:java:datahub-client:closeAndReleaseRepository --info -PjavaClassVersionDefault=8 -ParchiveAppendix=java8 \ No newline at end of file diff --git a/datahub-web-react/src/App.tsx b/datahub-web-react/src/App.tsx index 2fdd7c8ed68004..81f137417f1f8a 100644 --- a/datahub-web-react/src/App.tsx +++ b/datahub-web-react/src/App.tsx @@ -79,7 +79,7 @@ export const InnerApp: React.VFC = () => { - {useCustomTheme().theme?.content.title} + {useCustomTheme().theme?.content?.title} diff --git a/datahub-web-react/src/app/AdminConsole.tsx b/datahub-web-react/src/app/AdminConsole.tsx index f6395a3bd3cb8a..a79575c3d88d78 100644 --- a/datahub-web-react/src/app/AdminConsole.tsx +++ b/datahub-web-react/src/app/AdminConsole.tsx @@ -37,8 +37,8 @@ export const AdminConsole = (): JSX.Element => { const [adminConsoleOpen, setAdminConsoleOpen] = useState(false); const { config } = useAppConfig(); - const isAnalyticsEnabled = config?.analyticsConfig.enabled; - const isPoliciesEnabled = config?.policiesConfig.enabled; + const isAnalyticsEnabled = config?.analyticsConfig?.enabled; + const isPoliciesEnabled = config?.policiesConfig?.enabled; const showAnalytics = (isAnalyticsEnabled && me && me?.platformPrivileges?.viewAnalytics) || false; const showPolicyBuilder = (isPoliciesEnabled && me && me?.platformPrivileges?.managePolicies) || false; diff --git a/datahub-web-react/src/app/analyticsDashboard/components/AnalyticsPage.tsx b/datahub-web-react/src/app/analyticsDashboard/components/AnalyticsPage.tsx index bf0e5af2427bbb..f139ef7368a74d 100644 --- a/datahub-web-react/src/app/analyticsDashboard/components/AnalyticsPage.tsx +++ b/datahub-web-react/src/app/analyticsDashboard/components/AnalyticsPage.tsx @@ -121,11 +121,11 @@ export const AnalyticsPage = () => { placeholder="Select a domain" onChange={onDomainChange} filterOption={(input, option) => - option?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 + option?.children?.toLowerCase()?.indexOf(input.toLowerCase()) >= 0 } > All - {domainData?.listDomains?.domains.map((domainChoice) => ( + {domainData?.listDomains?.domains?.map((domainChoice) => ( {domainChoice?.properties?.name} diff --git a/datahub-web-react/src/app/domain/nestedDomains/domainNavigator/DomainNode.tsx b/datahub-web-react/src/app/domain/nestedDomains/domainNavigator/DomainNode.tsx index bf70bd043fd4a1..82977eff4f95bc 100644 --- a/datahub-web-react/src/app/domain/nestedDomains/domainNavigator/DomainNode.tsx +++ b/datahub-web-react/src/app/domain/nestedDomains/domainNavigator/DomainNode.tsx @@ -83,7 +83,7 @@ export default function DomainNode({ domain, numDomainChildren, domainUrnToHide, const hasDomainChildren = useHasDomainChildren({ domainUrn: domain.urn, numDomainChildren }); const shouldAutoOpen = useMemo( - () => !isInSelectMode && entityData?.parentDomains?.domains.some((parent) => parent.urn === domain.urn), + () => !isInSelectMode && entityData?.parentDomains?.domains?.some((parent) => parent.urn === domain.urn), [isInSelectMode, entityData, domain.urn], ); diff --git a/datahub-web-react/src/app/embed/lookup/useGetEntityByUrl.ts b/datahub-web-react/src/app/embed/lookup/useGetEntityByUrl.ts index f11a3a02b43448..49136c39fd2424 100644 --- a/datahub-web-react/src/app/embed/lookup/useGetEntityByUrl.ts +++ b/datahub-web-react/src/app/embed/lookup/useGetEntityByUrl.ts @@ -31,7 +31,7 @@ const useGetEntityByUrl = (externalUrl: string) => { const getLookupData = () => { if (!data) return {} as const; - const entities = data.searchAcrossEntities?.searchResults.map((result) => result.entity) ?? []; + const entities = data.searchAcrossEntities?.searchResults?.map((result) => result.entity) ?? []; const notFound = entities.length === 0; const foundMultiple = entities.length > 1; const entity = entities.length === 1 ? entities[0] : null; diff --git a/datahub-web-react/src/app/entity/businessAttribute/profile/BusinessAttributeRelatedEntity.tsx b/datahub-web-react/src/app/entity/businessAttribute/profile/BusinessAttributeRelatedEntity.tsx index 46d9d4ea51d245..a73b36d6922279 100644 --- a/datahub-web-react/src/app/entity/businessAttribute/profile/BusinessAttributeRelatedEntity.tsx +++ b/datahub-web-react/src/app/entity/businessAttribute/profile/BusinessAttributeRelatedEntity.tsx @@ -18,7 +18,7 @@ export default function BusinessAttributeRelatedEntity() { ]) || []; - entityData?.isAChildren?.relationships.forEach((businessAttribute) => { + entityData?.isAChildren?.relationships?.forEach((businessAttribute) => { const childUrn = businessAttribute.entity?.urn; if (childUrn) { diff --git a/datahub-web-react/src/app/entity/chart/ChartEntity.tsx b/datahub-web-react/src/app/entity/chart/ChartEntity.tsx index 70fe8a5e7c7c23..b20116f615556d 100644 --- a/datahub-web-react/src/app/entity/chart/ChartEntity.tsx +++ b/datahub-web-react/src/app/entity/chart/ChartEntity.tsx @@ -142,9 +142,9 @@ export class ChartEntity implements Entity { component: EmbedTab, display: { visible: (_, chart: GetChartQuery) => - !!chart?.chart?.embed?.renderUrl && chart?.chart?.platform.urn === LOOKER_URN, + !!chart?.chart?.embed?.renderUrl && chart?.chart?.platform?.urn === LOOKER_URN, enabled: (_, chart: GetChartQuery) => - !!chart?.chart?.embed?.renderUrl && chart?.chart?.platform.urn === LOOKER_URN, + !!chart?.chart?.embed?.renderUrl && chart?.chart?.platform?.urn === LOOKER_URN, }, }, { @@ -170,7 +170,7 @@ export class ChartEntity implements Entity { name: 'Incidents', component: IncidentTab, getDynamicName: (_, chart) => { - const activeIncidentCount = chart?.chart?.activeIncidents.total; + const activeIncidentCount = chart?.chart?.activeIncidents?.total; return `Incidents${(activeIncidentCount && ` (${activeIncidentCount})`) || ''}`; }, }, diff --git a/datahub-web-react/src/app/entity/dashboard/DashboardEntity.tsx b/datahub-web-react/src/app/entity/dashboard/DashboardEntity.tsx index 7d0275f60435a9..c35b1f90ee9c00 100644 --- a/datahub-web-react/src/app/entity/dashboard/DashboardEntity.tsx +++ b/datahub-web-react/src/app/entity/dashboard/DashboardEntity.tsx @@ -149,10 +149,10 @@ export class DashboardEntity implements Entity { display: { visible: (_, dashboard: GetDashboardQuery) => !!dashboard?.dashboard?.embed?.renderUrl && - dashboard?.dashboard?.platform.urn === LOOKER_URN, + dashboard?.dashboard?.platform?.urn === LOOKER_URN, enabled: (_, dashboard: GetDashboardQuery) => !!dashboard?.dashboard?.embed?.renderUrl && - dashboard?.dashboard?.platform.urn === LOOKER_URN, + dashboard?.dashboard?.platform?.urn === LOOKER_URN, }, }, { @@ -170,7 +170,7 @@ export class DashboardEntity implements Entity { name: 'Incidents', component: IncidentTab, getDynamicName: (_, dashboard) => { - const activeIncidentCount = dashboard?.dashboard?.activeIncidents.total; + const activeIncidentCount = dashboard?.dashboard?.activeIncidents?.total; return `Incidents${(activeIncidentCount && ` (${activeIncidentCount})`) || ''}`; }, }, diff --git a/datahub-web-react/src/app/entity/dataFlow/DataFlowEntity.tsx b/datahub-web-react/src/app/entity/dataFlow/DataFlowEntity.tsx index 42555a0dd3f37d..3c03dfb65ccbcd 100644 --- a/datahub-web-react/src/app/entity/dataFlow/DataFlowEntity.tsx +++ b/datahub-web-react/src/app/entity/dataFlow/DataFlowEntity.tsx @@ -92,7 +92,7 @@ export class DataFlowEntity implements Entity { name: 'Incidents', component: IncidentTab, getDynamicName: (_, dataFlow) => { - const activeIncidentCount = dataFlow?.dataFlow?.activeIncidents.total; + const activeIncidentCount = dataFlow?.dataFlow?.activeIncidents?.total; return `Incidents${(activeIncidentCount && ` (${activeIncidentCount})`) || ''}`; }, }, diff --git a/datahub-web-react/src/app/entity/dataJob/DataJobEntity.tsx b/datahub-web-react/src/app/entity/dataJob/DataJobEntity.tsx index 503acf7652dfa6..5b1aaeaef76d5b 100644 --- a/datahub-web-react/src/app/entity/dataJob/DataJobEntity.tsx +++ b/datahub-web-react/src/app/entity/dataJob/DataJobEntity.tsx @@ -112,7 +112,7 @@ export class DataJobEntity implements Entity { name: 'Incidents', component: IncidentTab, getDynamicName: (_, dataJob) => { - const activeIncidentCount = dataJob?.dataJob?.activeIncidents.total; + const activeIncidentCount = dataJob?.dataJob?.activeIncidents?.total; return `Incidents${(activeIncidentCount && ` (${activeIncidentCount})`) || ''}`; }, }, diff --git a/datahub-web-react/src/app/entity/dataJob/tabs/RunsTab.tsx b/datahub-web-react/src/app/entity/dataJob/tabs/RunsTab.tsx index 5cd621719ce8fd..f00e3402c8ed4c 100644 --- a/datahub-web-react/src/app/entity/dataJob/tabs/RunsTab.tsx +++ b/datahub-web-react/src/app/entity/dataJob/tabs/RunsTab.tsx @@ -129,8 +129,8 @@ export const RunsTab = () => { name: run?.name, status: run?.state?.[0]?.status, resultType: run?.state?.[0]?.result?.resultType, - inputs: run?.inputs?.relationships.map((relationship) => relationship.entity), - outputs: run?.outputs?.relationships.map((relationship) => relationship.entity), + inputs: run?.inputs?.relationships?.map((relationship) => relationship.entity), + outputs: run?.outputs?.relationships?.map((relationship) => relationship.entity), externalUrl: run?.externalUrl, })); if (loading) { diff --git a/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx b/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx index 35ed3ffcc4c532..abf8e732c47d61 100644 --- a/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx +++ b/datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx @@ -217,7 +217,7 @@ export class DatasetEntity implements Entity { name: 'Incidents', component: IncidentTab, getDynamicName: (_, dataset) => { - const activeIncidentCount = dataset?.dataset?.activeIncidents.total; + const activeIncidentCount = dataset?.dataset?.activeIncidents?.total; return `Incidents${(activeIncidentCount && ` (${activeIncidentCount})`) || ''}`; }, }, diff --git a/datahub-web-react/src/app/entity/dataset/profile/OperationsTab.tsx b/datahub-web-react/src/app/entity/dataset/profile/OperationsTab.tsx index 78ec334f071ba4..d3371d3790d028 100644 --- a/datahub-web-react/src/app/entity/dataset/profile/OperationsTab.tsx +++ b/datahub-web-react/src/app/entity/dataset/profile/OperationsTab.tsx @@ -195,8 +195,8 @@ export const OperationsTab = () => { status: run?.state?.[0]?.status, resultType: run?.state?.[0]?.result?.resultType, duration: run?.state?.[0]?.durationMillis, - inputs: run?.inputs?.relationships.map((relationship) => relationship.entity), - outputs: run?.outputs?.relationships.map((relationship) => relationship.entity), + inputs: run?.inputs?.relationships?.map((relationship) => relationship.entity), + outputs: run?.outputs?.relationships?.map((relationship) => relationship.entity), externalUrl: run?.externalUrl, parentTemplate: run?.parentTemplate?.relationships?.[0]?.entity, })); diff --git a/datahub-web-react/src/app/entity/dataset/profile/schema/utils/schemaTitleRenderer.tsx b/datahub-web-react/src/app/entity/dataset/profile/schema/utils/schemaTitleRenderer.tsx index 3d03b6306454d8..fdd03622fc0e19 100644 --- a/datahub-web-react/src/app/entity/dataset/profile/schema/utils/schemaTitleRenderer.tsx +++ b/datahub-web-react/src/app/entity/dataset/profile/schema/utils/schemaTitleRenderer.tsx @@ -69,7 +69,7 @@ export default function useSchemaTitleRenderer( ?.filter( (constraint) => (constraint?.sourceFields?.filter( - (sourceField) => sourceField?.fieldPath.trim() === fieldPath.trim(), + (sourceField) => sourceField?.fieldPath?.trim() === fieldPath.trim(), ).length || 0) > 0, ) .map((constraint) => ( diff --git a/datahub-web-react/src/app/entity/dataset/profile/schema/utils/utils.ts b/datahub-web-react/src/app/entity/dataset/profile/schema/utils/utils.ts index 51cb8ab0245196..9d719ae25e2bed 100644 --- a/datahub-web-react/src/app/entity/dataset/profile/schema/utils/utils.ts +++ b/datahub-web-react/src/app/entity/dataset/profile/schema/utils/utils.ts @@ -37,7 +37,7 @@ export function convertEditableSchemaMetadataForUpdate( ): EditableSchemaMetadataUpdate { return { editableSchemaFieldInfo: - editableSchemaMetadata?.editableSchemaFieldInfo.map((editableSchemaFieldInfo) => ({ + editableSchemaMetadata?.editableSchemaFieldInfo?.map((editableSchemaFieldInfo) => ({ fieldPath: editableSchemaFieldInfo?.fieldPath, description: editableSchemaFieldInfo?.description, globalTags: { tags: convertTagsForUpdate(editableSchemaFieldInfo?.globalTags?.tags || []) }, diff --git a/datahub-web-react/src/app/entity/domain/DataProductsTab/DataProductsTab.tsx b/datahub-web-react/src/app/entity/domain/DataProductsTab/DataProductsTab.tsx index c834597e41a6d5..15cc99127f3500 100644 --- a/datahub-web-react/src/app/entity/domain/DataProductsTab/DataProductsTab.tsx +++ b/datahub-web-react/src/app/entity/domain/DataProductsTab/DataProductsTab.tsx @@ -70,7 +70,7 @@ export default function DataProductsTab() { }, }); const totalResults = data?.searchAcrossEntities?.total || 0; - const searchResults = data?.searchAcrossEntities?.searchResults.map((r) => r.entity) || []; + const searchResults = data?.searchAcrossEntities?.searchResults?.map((r) => r.entity) || []; const dataProducts = [...createdDataProducts, ...searchResults]; const displayedDataProducts = dataProducts .map( diff --git a/datahub-web-react/src/app/entity/glossaryTerm/profile/AddRelatedTermsModal.tsx b/datahub-web-react/src/app/entity/glossaryTerm/profile/AddRelatedTermsModal.tsx index a609dc4cca599d..9131af265a7516 100644 --- a/datahub-web-react/src/app/entity/glossaryTerm/profile/AddRelatedTermsModal.tsx +++ b/datahub-web-react/src/app/entity/glossaryTerm/profile/AddRelatedTermsModal.tsx @@ -104,7 +104,10 @@ function AddRelatedTermsModal(props: Props) { const newUrns = [...selectedUrns, urn]; setSelectedUrns(newUrns); const selectedSearchOption = tagSearchOptions.find((option) => option.props.value === urn); - setSelectedTerms([...selectedTerms, { urn, component: }]); + setSelectedTerms([ + ...selectedTerms, + { urn, component: }, + ]); }; // When a Tag or term search result is deselected, remove the urn from the Owners diff --git a/datahub-web-react/src/app/entity/glossaryTerm/profile/GlossaryRelatedEntity.tsx b/datahub-web-react/src/app/entity/glossaryTerm/profile/GlossaryRelatedEntity.tsx index 098e97e526fd84..6959fc082f7346 100644 --- a/datahub-web-react/src/app/entity/glossaryTerm/profile/GlossaryRelatedEntity.tsx +++ b/datahub-web-react/src/app/entity/glossaryTerm/profile/GlossaryRelatedEntity.tsx @@ -22,7 +22,7 @@ export default function GlossaryRelatedEntity() { ]) || []; - entityData?.isAChildren?.relationships.forEach((term) => { + entityData?.isAChildren?.relationships?.forEach((term) => { const childUrn = term.entity?.urn; if (childUrn) { diff --git a/datahub-web-react/src/app/entity/mlFeatureTable/profile/Sources.tsx b/datahub-web-react/src/app/entity/mlFeatureTable/profile/Sources.tsx index eb114e9774e294..56c0fcbb602003 100644 --- a/datahub-web-react/src/app/entity/mlFeatureTable/profile/Sources.tsx +++ b/datahub-web-react/src/app/entity/mlFeatureTable/profile/Sources.tsx @@ -35,14 +35,14 @@ export default function SourcesView() { features?.reduce((accumulator: Array, feature) => { if (feature.__typename === 'MLFeature' && feature.properties?.sources) { // eslint-disable-next-line array-callback-return - feature.properties?.sources.map((source: Dataset | null) => { + feature.properties?.sources?.map((source: Dataset | null) => { if (source && accumulator.findIndex((dataset) => dataset.urn === source?.urn) === -1) { accumulator.push(source); } }); } else if (feature.__typename === 'MLPrimaryKey' && feature.properties?.sources) { // eslint-disable-next-line array-callback-return - feature.properties?.sources.map((source: Dataset | null) => { + feature.properties?.sources?.map((source: Dataset | null) => { if (source && accumulator.findIndex((dataset) => dataset.urn === source?.urn) === -1) { accumulator.push(source); } diff --git a/datahub-web-react/src/app/entity/mlModel/profile/MlModelFeaturesTab.tsx b/datahub-web-react/src/app/entity/mlModel/profile/MlModelFeaturesTab.tsx index b8dc64793c2256..7fd719177d1516 100644 --- a/datahub-web-react/src/app/entity/mlModel/profile/MlModelFeaturesTab.tsx +++ b/datahub-web-react/src/app/entity/mlModel/profile/MlModelFeaturesTab.tsx @@ -9,7 +9,7 @@ export default function MlModelFeaturesTab() { const entity = useBaseEntity() as GetMlModelQuery; const model = entity && entity.mlModel; - const features = model?.features?.relationships.map((relationship) => relationship.entity) as Array< + const features = model?.features?.relationships?.map((relationship) => relationship.entity) as Array< MlFeature | MlPrimaryKey >; diff --git a/datahub-web-react/src/app/entity/ownership/OwnershipList.tsx b/datahub-web-react/src/app/entity/ownership/OwnershipList.tsx index 8d6e109d2bca36..3d7904a5c55052 100644 --- a/datahub-web-react/src/app/entity/ownership/OwnershipList.tsx +++ b/datahub-web-react/src/app/entity/ownership/OwnershipList.tsx @@ -64,7 +64,7 @@ export const OwnershipList = () => { }); const totalOwnershipTypes = data?.listOwnershipTypes?.total || 0; const ownershipTypes = - data?.listOwnershipTypes?.ownershipTypes.filter((type) => type.urn !== 'urn:li:ownershipType:none') || []; + data?.listOwnershipTypes?.ownershipTypes?.filter((type) => type.urn !== 'urn:li:ownershipType:none') || []; const onClickCreateOwnershipType = () => { setShowOwnershipBuilder(true); diff --git a/datahub-web-react/src/app/entity/shared/EntityDropdown/DomainParentSelect.tsx b/datahub-web-react/src/app/entity/shared/EntityDropdown/DomainParentSelect.tsx index d43b04ec11a165..1e918757e46192 100644 --- a/datahub-web-react/src/app/entity/shared/EntityDropdown/DomainParentSelect.tsx +++ b/datahub-web-react/src/app/entity/shared/EntityDropdown/DomainParentSelect.tsx @@ -23,7 +23,7 @@ export function filterResultsForMove(entity: Domain, entityUrn: string) { return ( entity.urn !== entityUrn && entity.__typename === 'Domain' && - !entity.parentDomains?.domains.some((node) => node.urn === entityUrn) + !entity.parentDomains?.domains?.some((node) => node.urn === entityUrn) ); } diff --git a/datahub-web-react/src/app/entity/shared/EntityDropdown/NodeParentSelect.tsx b/datahub-web-react/src/app/entity/shared/EntityDropdown/NodeParentSelect.tsx index 7227354a465695..3746c5f6b95f82 100644 --- a/datahub-web-react/src/app/entity/shared/EntityDropdown/NodeParentSelect.tsx +++ b/datahub-web-react/src/app/entity/shared/EntityDropdown/NodeParentSelect.tsx @@ -22,7 +22,7 @@ export function filterResultsForMove(entity: GlossaryNode, entityUrn: string) { return ( entity.urn !== entityUrn && entity.__typename === 'GlossaryNode' && - !entity.parentNodes?.nodes.some((node) => node.urn === entityUrn) + !entity.parentNodes?.nodes?.some((node) => node.urn === entityUrn) ); } diff --git a/datahub-web-react/src/app/entity/shared/EntityDropdown/useHandleMoveDomainComplete.ts b/datahub-web-react/src/app/entity/shared/EntityDropdown/useHandleMoveDomainComplete.ts index 81f19331e18b77..2d9c346e18d5b4 100644 --- a/datahub-web-react/src/app/entity/shared/EntityDropdown/useHandleMoveDomainComplete.ts +++ b/datahub-web-react/src/app/entity/shared/EntityDropdown/useHandleMoveDomainComplete.ts @@ -13,7 +13,7 @@ export function useHandleMoveDomainComplete() { if (!entityData) return; const domain = entityData as Domain; - const oldParentUrn = domain.parentDomains?.domains.length ? domain.parentDomains.domains[0].urn : undefined; + const oldParentUrn = domain.parentDomains?.domains?.length ? domain.parentDomains.domains[0].urn : undefined; analytics.event({ type: EventType.MoveDomainEvent, diff --git a/datahub-web-react/src/app/entity/shared/__tests__/siblingsUtils.test.ts b/datahub-web-react/src/app/entity/shared/__tests__/siblingsUtils.test.ts index 00e89e5943c176..f3b857ab2ef3be 100644 --- a/datahub-web-react/src/app/entity/shared/__tests__/siblingsUtils.test.ts +++ b/datahub-web-react/src/app/entity/shared/__tests__/siblingsUtils.test.ts @@ -203,10 +203,10 @@ describe('siblingUtils', () => { // merges schema metadata properly by fieldPath expect(combinedData.dataset.schemaMetadata?.fields).toHaveLength(4); - expect(combinedData.dataset.schemaMetadata?.fields[0].fieldPath).toEqual('new_one'); - expect(combinedData.dataset.schemaMetadata?.fields[1].fieldPath).toEqual('DUPLICATE_FIELD'); - expect(combinedData.dataset.schemaMetadata?.fields[2].fieldPath).toEqual('user_id'); - expect(combinedData.dataset.schemaMetadata?.fields[3].fieldPath).toEqual('user_name'); + expect(combinedData.dataset.schemaMetadata?.fields[0]?.fieldPath).toEqual('new_one'); + expect(combinedData.dataset.schemaMetadata?.fields[1]?.fieldPath).toEqual('DUPLICATE_FIELD'); + expect(combinedData.dataset.schemaMetadata?.fields[2]?.fieldPath).toEqual('user_id'); + expect(combinedData.dataset.schemaMetadata?.fields[3]?.fieldPath).toEqual('user_name'); // will overwrite string properties w/ primary expect(combinedData.dataset.editableProperties.description).toEqual('secondary description'); diff --git a/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/CreateERModelRelationModal.tsx b/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/CreateERModelRelationModal.tsx index ea40fb71818033..de22daeeedd817 100644 --- a/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/CreateERModelRelationModal.tsx +++ b/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/CreateERModelRelationModal.tsx @@ -241,9 +241,9 @@ export const CreateERModelRelationModal = ({ }; const table1NameBusiness = getDatasetName(table1Dataset); - const table1NameTech = table1Dataset?.name || table1Dataset?.urn.split(',').at(1) || ''; + const table1NameTech = table1Dataset?.name || table1Dataset?.urn?.split(',').at(1) || ''; const table2NameBusiness = getDatasetName(table2Dataset); - const table2NameTech = table2Dataset?.name || table2Dataset?.urn.split(',').at(1) || ''; + const table2NameTech = table2Dataset?.name || table2Dataset?.urn?.split(',').at(1) || ''; const handleAdd = () => { const newData: ERModelRelationDataType = { diff --git a/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/ERModelRelationUtils.tsx b/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/ERModelRelationUtils.tsx index e7a242daa5121a..0eb198aec48033 100644 --- a/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/ERModelRelationUtils.tsx +++ b/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/ERModelRelationUtils.tsx @@ -68,6 +68,6 @@ export function getDatasetName(datainput: any): string { datainput?.editableProperties?.name || datainput?.properties?.name || datainput?.name || - datainput?.urn.split(',').at(1) + datainput?.urn?.split(',').at(1) ); } diff --git a/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/EditableCell.tsx b/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/EditableCell.tsx index a190d9090cc8c4..4320aacd53e4af 100644 --- a/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/EditableCell.tsx +++ b/datahub-web-react/src/app/entity/shared/components/styled/ERModelRelationship/EditableCell.tsx @@ -53,7 +53,7 @@ export const EditableCell = ({