fix: snippet usage analytics (#7946)
This commit is contained in:
parent
d9d6d00106
commit
964d58747a
|
|
@ -302,7 +302,8 @@ export default function SnippetDescription({ item }: { item: Snippet }) {
|
|||
),
|
||||
},
|
||||
];
|
||||
if (template && args && args.length > 0) {
|
||||
const replaceableArgs = (args || []).filter((arg) => !arg.placeholder);
|
||||
if (template && replaceableArgs && replaceableArgs.length > 0) {
|
||||
tabs.push({
|
||||
key: "Customize",
|
||||
title: "Customize",
|
||||
|
|
@ -319,7 +320,7 @@ export default function SnippetDescription({ item }: { item: Snippet }) {
|
|||
</div>
|
||||
</div>
|
||||
<div className="snippet-group">
|
||||
{args.map((arg: SnippetArgument) => (
|
||||
{replaceableArgs.map((arg: SnippetArgument) => (
|
||||
<div
|
||||
className="argument"
|
||||
key={arg.name}
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ function GlobalSearch() {
|
|||
const setCategory = useCallback(
|
||||
(category: SearchCategory) => {
|
||||
if (isSnippet(category)) {
|
||||
AnalyticsUtil.logEvent("SNIPPET_CATEGORY_CLICK");
|
||||
AnalyticsUtil.logEvent("SNIPPET_LOOKUP");
|
||||
}
|
||||
dispatch(setGlobalSearchFilterContext({ category: category }));
|
||||
},
|
||||
|
|
|
|||
|
|
@ -103,8 +103,10 @@ export const getSnippetFilterLabel = (state: AppState, label: string) => {
|
|||
};
|
||||
|
||||
export type SnippetArgument = {
|
||||
identifier: string;
|
||||
name: string;
|
||||
type: ValidationTypes;
|
||||
placeholder?: boolean;
|
||||
};
|
||||
|
||||
export type SearchCategory = {
|
||||
|
|
|
|||
|
|
@ -887,7 +887,8 @@ function* executeCommandSaga(actionPayload: ReduxAction<SlashCommandPayload>) {
|
|||
: SnippetAction.COPY, //Set insertSnippet to true only if values
|
||||
}),
|
||||
);
|
||||
const effectRaceResult = yield race({
|
||||
AnalyticsUtil.logEvent("SNIPPET_LOOKUP");
|
||||
const effectRaceResult: { failure: any; success: any } = yield race({
|
||||
failure: take(ReduxActionTypes.CANCEL_SNIPPET),
|
||||
success: take(ReduxActionTypes.INSERT_SNIPPET),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ export type EventName =
|
|||
| "SNIPPET_EXECUTE"
|
||||
| "SNIPPET_FILTER"
|
||||
| "SNIPPET_COPIED"
|
||||
| "SNIPPET_CATEGORY_CLICK"
|
||||
| "SNIPPET_LOOKUP"
|
||||
| "SIGNPOSTING_SKIP"
|
||||
| "SIGNPOSTING_CREATE_DATASOURCE_CLICK"
|
||||
| "SIGNPOSTING_CREATE_QUERY_CLICK"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user