Skip to content

Commit 2c73076

Browse files
committed
👔 Add in new createAskSeerConsentItem function
1 parent e75f6cd commit 2c73076

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

static/app/components/searchQueryBuilder/askSeer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled from '@emotion/styled';
33
import {space} from 'sentry/styles/space';
44

55
export const ASK_SEER_ITEM_KEY = 'ask_seer';
6+
export const ASK_SEER_CONSENT_ITEM_KEY = 'ask_seer_consent';
67

78
export const AskSeerPane = styled('div')`
89
grid-area: seer;

static/app/components/searchQueryBuilder/tokens/filterKeyListBox/types.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,19 @@ export interface AskSeerItem extends SelectOptionWithKey<string> {
5353
value: string;
5454
}
5555

56+
export interface AskSeerConsentItem extends SelectOptionWithKey<string> {
57+
type: 'ask-seer-consent';
58+
value: string;
59+
}
60+
5661
export type SearchKeyItem =
5762
| KeySectionItem
5863
| KeyItem
5964
| RawSearchItem
6065
| FilterValueItem
6166
| RawSearchFilterValueItem
62-
| AskSeerItem;
67+
| AskSeerItem
68+
| AskSeerConsentItem;
6369

6470
export type FilterKeyItem =
6571
| KeyItem
@@ -69,7 +75,8 @@ export type FilterKeyItem =
6975
| RawSearchItem
7076
| FilterValueItem
7177
| RawSearchFilterValueItem
72-
| AskSeerItem;
78+
| AskSeerItem
79+
| AskSeerConsentItem;
7380

7481
export type Section = {
7582
label: ReactNode;

static/app/components/searchQueryBuilder/tokens/filterKeyListBox/utils.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import styled from '@emotion/styled';
22

33
import {getEscapedKey} from 'sentry/components/core/compactSelect/utils';
4-
import {ASK_SEER_ITEM_KEY} from 'sentry/components/searchQueryBuilder/askSeer';
4+
import {
5+
ASK_SEER_CONSENT_ITEM_KEY,
6+
ASK_SEER_ITEM_KEY,
7+
} from 'sentry/components/searchQueryBuilder/askSeer';
58
import {FormattedQuery} from 'sentry/components/searchQueryBuilder/formattedQuery';
69
import {KeyDescription} from 'sentry/components/searchQueryBuilder/tokens/filterKeyListBox/keyDescription';
710
import type {
11+
AskSeerConsentItem,
812
AskSeerItem,
913
FilterValueItem,
1014
KeyItem,
@@ -211,6 +215,17 @@ export function createAskSeerItem(): AskSeerItem {
211215
};
212216
}
213217

218+
export function createAskSeerConsentItem(): AskSeerConsentItem {
219+
return {
220+
key: getEscapedKey(ASK_SEER_CONSENT_ITEM_KEY),
221+
value: ASK_SEER_CONSENT_ITEM_KEY,
222+
textValue: 'Enable Gen AI',
223+
type: 'ask-seer-consent' as const,
224+
label: t('Enable Gen AI'),
225+
hideCheck: true,
226+
};
227+
}
228+
214229
const SearchItemLabel = styled('div')`
215230
color: ${p => p.theme.subText};
216231
white-space: nowrap;

0 commit comments

Comments
 (0)