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

fix(ui) Properly get display name when downloading search results #12720

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
};

export const transformGenericEntityPropertiesToCsvRow = (
entityRegistry: EntityRegistry,

Check warning on line 36 in datahub-web-react/src/app/entity/shared/components/styled/search/downloadAsCsvUtil.ts

View check run for this annotation

Codecov / codecov/patch

datahub-web-react/src/app/entity/shared/components/styled/search/downloadAsCsvUtil.ts#L36

Added line #L36 was not covered by tests
properties: GenericEntityProperties | null,
entityUrl: string,
result: SearchResultInterface,
Expand All @@ -41,11 +42,11 @@
// urn
properties?.urn || '',
// name
properties?.name || '',
entityRegistry.getDisplayName(result.entity.type, result.entity) || properties?.name || '',

Check warning on line 45 in datahub-web-react/src/app/entity/shared/components/styled/search/downloadAsCsvUtil.ts

View check run for this annotation

Codecov / codecov/patch

datahub-web-react/src/app/entity/shared/components/styled/search/downloadAsCsvUtil.ts#L45

Added line #L45 was not covered by tests
// type
result.entity.type || '',
// description
properties?.properties?.description || '',
properties?.properties?.description || properties?.editableProperties?.description || '',

Check warning on line 49 in datahub-web-react/src/app/entity/shared/components/styled/search/downloadAsCsvUtil.ts

View check run for this annotation

Codecov / codecov/patch

datahub-web-react/src/app/entity/shared/components/styled/search/downloadAsCsvUtil.ts#L49

Added line #L49 was not covered by tests
// user owners
properties?.ownership?.owners
?.filter((owner) => owner.owner.type === EntityType.CorpUser)
Expand Down Expand Up @@ -98,6 +99,6 @@
return results.map((result) => {
const genericEntityProperties = entityRegistry.getGenericEntityProperties(result.entity.type, result.entity);
const entityUrl = entityRegistry.getEntityUrl(result.entity.type, result.entity.urn);
return transformGenericEntityPropertiesToCsvRow(genericEntityProperties, entityUrl, result);
return transformGenericEntityPropertiesToCsvRow(entityRegistry, genericEntityProperties, entityUrl, result);

Check warning on line 102 in datahub-web-react/src/app/entity/shared/components/styled/search/downloadAsCsvUtil.ts

View check run for this annotation

Codecov / codecov/patch

datahub-web-react/src/app/entity/shared/components/styled/search/downloadAsCsvUtil.ts#L102

Added line #L102 was not covered by tests
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
};

export const transformGenericEntityPropertiesToCsvRow = (
entityRegistry: EntityRegistry,

Check warning on line 36 in datahub-web-react/src/app/entityV2/shared/components/styled/search/downloadAsCsvUtil.ts

View check run for this annotation

Codecov / codecov/patch

datahub-web-react/src/app/entityV2/shared/components/styled/search/downloadAsCsvUtil.ts#L36

Added line #L36 was not covered by tests
properties: GenericEntityProperties | null,
entityUrl: string,
result: SearchResultInterface,
Expand All @@ -41,7 +42,7 @@
// urn
properties?.urn || '',
// name
properties?.name || '',
entityRegistry.getDisplayName(result.entity.type, result.entity) || properties?.name || '',

Check warning on line 45 in datahub-web-react/src/app/entityV2/shared/components/styled/search/downloadAsCsvUtil.ts

View check run for this annotation

Codecov / codecov/patch

datahub-web-react/src/app/entityV2/shared/components/styled/search/downloadAsCsvUtil.ts#L45

Added line #L45 was not covered by tests
// type
result.entity.type || '',
// description
Expand Down Expand Up @@ -98,6 +99,6 @@
return results.map((result) => {
const genericEntityProperties = entityRegistry.getGenericEntityProperties(result.entity.type, result.entity);
const entityUrl = entityRegistry.getEntityUrl(result.entity.type, result.entity.urn);
return transformGenericEntityPropertiesToCsvRow(genericEntityProperties, entityUrl, result);
return transformGenericEntityPropertiesToCsvRow(entityRegistry, genericEntityProperties, entityUrl, result);

Check warning on line 102 in datahub-web-react/src/app/entityV2/shared/components/styled/search/downloadAsCsvUtil.ts

View check run for this annotation

Codecov / codecov/patch

datahub-web-react/src/app/entityV2/shared/components/styled/search/downloadAsCsvUtil.ts#L102

Added line #L102 was not covered by tests
});
};
Loading