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(react): update search result has result counts for each entities that has result #2991

Merged
merged 14 commits into from
Aug 2, 2021

Conversation

topwebtek7
Copy link
Contributor

@topwebtek7 topwebtek7 commented Jul 29, 2021

Checklist

  • The PR conforms to DataHub's Contributing Guideline (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)

image

@@ -6,7 +6,7 @@ import { useGetUserQuery } from '../graphql/user.generated';
* Fetch a CorpUser object corresponding to the currently authenticated user.
*/
export function useGetAuthenticatedUser() {
const userUrn = Cookies.get(CLIENT_AUTH_COOKIE);
const userUrn = process.env.JEST_WORKER_ID !== undefined ? 'urn:li:corpuser:1' : Cookies.get(CLIENT_AUTH_COOKIE);
Copy link
Contributor

Choose a reason for hiding this comment

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

let's not include anything related to tests in this method- if you need to mock this it should be mocked in the test file itself.

Comment on lines 162 to 164
<StyledNumberInTab>{` (${countFormatter(
resultCounts[type] || 0,
)})`}</StyledNumberInTab>
Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove the parentheses now that the text is gray

Comment on lines +100 to +104
analytics.event({
type: EventType.SearchResultsViewEvent,
query,
total: resultCount,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

please move the analytics event into its own useEffect- it is a bit confusing that this is a side effect of the use memo

Copy link
Contributor

@gabe-lyons gabe-lyons left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

LGTM!

@shirshanka shirshanka merged commit 25e8e8f into datahub-project:master Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants