diff --git a/app/client/src/components/editorComponents/GlobalSearch/SnippetsDescription.tsx b/app/client/src/components/editorComponents/GlobalSearch/SnippetsDescription.tsx index 1c35274d3c..abe5cc1b51 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/SnippetsDescription.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/SnippetsDescription.tsx @@ -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 }) {
- {args.map((arg: SnippetArgument) => ( + {replaceableArgs.map((arg: SnippetArgument) => (
{ if (isSnippet(category)) { - AnalyticsUtil.logEvent("SNIPPET_CATEGORY_CLICK"); + AnalyticsUtil.logEvent("SNIPPET_LOOKUP"); } dispatch(setGlobalSearchFilterContext({ category: category })); }, diff --git a/app/client/src/components/editorComponents/GlobalSearch/utils.tsx b/app/client/src/components/editorComponents/GlobalSearch/utils.tsx index 4cdb1e2c39..fafd0c2949 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/utils.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/utils.tsx @@ -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 = { diff --git a/app/client/src/sagas/ActionSagas.ts b/app/client/src/sagas/ActionSagas.ts index 24d54d578c..26504f187f 100644 --- a/app/client/src/sagas/ActionSagas.ts +++ b/app/client/src/sagas/ActionSagas.ts @@ -887,7 +887,8 @@ function* executeCommandSaga(actionPayload: ReduxAction) { : 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), }); diff --git a/app/client/src/utils/AnalyticsUtil.tsx b/app/client/src/utils/AnalyticsUtil.tsx index 91fad978e3..a064aa7c44 100644 --- a/app/client/src/utils/AnalyticsUtil.tsx +++ b/app/client/src/utils/AnalyticsUtil.tsx @@ -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"