-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(search-bar): Add consent flow to Ask Seer #95406
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
Open
nsdeschenes
wants to merge
28
commits into
master
Choose a base branch
from
nd/AIML-704/feat-add-consent-flow-to-trace-ask-seer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+447
−165
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
fdc20f3
:necktie: Update SpansTabWrapper to use new useTraceExploreAiQuerySet…
nsdeschenes 9bde3de
:necktie: Update SpanTabSearchSection to conditionally enable AI sear…
nsdeschenes 2261496
:necktie: Conditionally call trace explorer ai setup endpoint and mov…
nsdeschenes e671acb
:necktie: Add in new createAskSeerConsentItem function
nsdeschenes b16e566
:fire: Remove genAIConsent field as its not needed
nsdeschenes cc247ca
:necktie: Update enableAISearch logic in SearchQueryBuilderProvider t…
nsdeschenes 6efa20c
:necktie: Move all AskSeer related items into askSeer.tsx
nsdeschenes 884eb10
:necktie: Add consent_accepted action to ai_query_interface analytics
nsdeschenes dc1edcf
:necktie: Add gaveSeerConsentRef to SearchQueryBuilderContext
nsdeschenes cb8e640
:necktie: Ignore ask-seer-consent when freeText onOptionSelected call…
nsdeschenes 02c78b8
:necktie: Add ask-seer-consent items to lists
nsdeschenes 67ec4ac
:white_check_mark: Update search query builder tests
nsdeschenes bec4db5
:necktie: Add in AskSeerConsent flow to askSeer.tsx
nsdeschenes b80b69e
:white_check_mark: Add in tests for askSeer
nsdeschenes fbfcd52
:necktie: Move acknowledgement mutation into it's own custom hook
nsdeschenes ee0894d
:necktie: Conditionally add options to hidden items to resolve disall…
nsdeschenes f69c2ef
:necktie: Utilize acknowledgement hook when selecting ask seer option…
nsdeschenes 27152e9
:necktie: Grab consent status directly in context and pass down
nsdeschenes b23f876
:necktie: Move disable option logic directly onto react event listeners
nsdeschenes 631bc6f
:necktie: Check if query is fetching using query key
nsdeschenes d3013d0
:bug: Remove extra array layering
nsdeschenes d3e242f
:necktie: Enable query only if AI features are enabled
nsdeschenes 3c6942f
:truck: Move seer acknowledgement mutation into it's own file
nsdeschenes 32bcc5b
:bug: Fix import issue
nsdeschenes b5c2e48
:white_check_mark: Fix tests
nsdeschenes 4eb8681
:white_check_mark: Move all tests to index.spec.tsx
nsdeschenes 6cdaf88
:necktie: Remove onClick handler, and move to using theme spacing
nsdeschenes bb15ff3
:white_check_mark: Fix up broken test ... in an interesting way
nsdeschenes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
static/app/components/events/autofix/useSeerAcknowledgeMutation.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {promptsUpdate} from 'sentry/actionCreators/prompts'; | ||
import {useMutation, useQueryClient} from 'sentry/utils/queryClient'; | ||
import useApi from 'sentry/utils/useApi'; | ||
import useOrganization from 'sentry/utils/useOrganization'; | ||
|
||
export const setupCheckQueryKey = (orgSlug: string) => | ||
`/organizations/${orgSlug}/seer/setup-check/`; | ||
|
||
export function useSeerAcknowledgeMutation() { | ||
const api = useApi(); | ||
const queryClient = useQueryClient(); | ||
const organization = useOrganization(); | ||
|
||
const {mutate, isPending, isError} = useMutation({ | ||
mutationKey: [setupCheckQueryKey(organization.slug)], | ||
mutationFn: () => { | ||
return promptsUpdate(api, { | ||
organization, | ||
feature: 'seer_autofix_setup_acknowledged', | ||
status: 'dismissed', | ||
}); | ||
}, | ||
onSuccess: () => { | ||
queryClient.invalidateQueries({ | ||
queryKey: [setupCheckQueryKey(organization.slug)], | ||
}); | ||
}, | ||
}); | ||
|
||
return {mutate, isPending, isError}; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you disabling to prevent the click here from propagating to the option?
In other areas, I've added stopPropagation to the necessary handlers to prevent the click from going through:
sentry/static/app/components/searchQueryBuilder/tokens/filter/valueCombobox.tsx
Lines 501 to 505 in 119d3f3
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. The reason why this is needed is because of the logic that lives inside these lines: https://github.com/getsentry/sentry/blob/nd/AIML-704/feat-add-consent-flow-to-trace-ask-seer/static/app/components/searchQueryBuilder/tokens/filterKeyListBox/useFilterKeyListBox.tsx#L388-L404, there doesn't seem to be any way to access the event in this handler, so can't call
stopPropagation
, there it would seemAs the
onClick
handler inaskSeer.tsx
isn't used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can still add
onMouseUp={e => e.stopPropagation()}
(and others if necessary) to the<TooltipSubExternalLink>
though right? That would prevent the option from being selected when you click the linkThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No that doesn't work annoyingly, it's still triggering the option via
useFilterKeyListBox