Skip to content

Commit

Permalink
feat(analytics): Add page number to SearchResultClickEvent analytics …
Browse files Browse the repository at this point in the history
…event (#11151)
  • Loading branch information
filipe-caetano-ovo authored Aug 20, 2024
1 parent 8f7642b commit f15a7fe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions datahub-web-react/src/app/analytics/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export interface SearchResultClickEvent extends BaseEvent {
entityTypeFilter?: EntityType;
index: number;
total: number;
pageNumber: number;
}

export interface SearchFiltersClearAllEvent extends BaseEvent {
Expand Down
3 changes: 3 additions & 0 deletions datahub-web-react/src/app/search/SearchResultList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type Props = {
selectedEntities: EntityAndType[];
setSelectedEntities: (entities: EntityAndType[]) => any;
suggestions: SearchSuggestion[];
pageNumber: number;
};

export const SearchResultList = ({
Expand All @@ -73,6 +74,7 @@ export const SearchResultList = ({
selectedEntities,
setSelectedEntities,
suggestions,
pageNumber,
}: Props) => {
const entityRegistry = useEntityRegistry();
const selectedEntityUrns = selectedEntities.map((entity) => entity.urn);
Expand All @@ -86,6 +88,7 @@ export const SearchResultList = ({
entityType: result.entity.type,
index,
total: totalResultCount,
pageNumber,
});
};

Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/app/search/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export const SearchResults = ({
selectedEntities={selectedEntities}
setSelectedEntities={setSelectedEntities}
suggestions={suggestions}
pageNumber={page}
/>
{totalResults > 0 && (
<PaginationControlContainer id="search-pagination">
Expand Down
2 changes: 1 addition & 1 deletion docs/developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Use [gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.ht
./gradlew build
```

Note that the above will also run run tests and a number of validations which makes the process considerably slower.
Note that the above will also run tests and a number of validations which makes the process considerably slower.

We suggest partially compiling DataHub according to your needs:

Expand Down

0 comments on commit f15a7fe

Please sign in to comment.