-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding analytics for run action button click & fixing certain states …
…for execution
- Loading branch information
1 parent
4c58a98
commit 8ec2d1c
Showing
7 changed files
with
119 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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 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 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
23 changes: 20 additions & 3 deletions
23
app/client/src/ce/PluginActionEditor/hooks/useHandleRunClick.ts
This file contains 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
35 changes: 35 additions & 0 deletions
35
app/client/src/ce/PluginActionEditor/utils/callRunActionAnalytics.ts
This file contains 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,35 @@ | ||
import type { Plugin } from "api/PluginApi"; | ||
import type { Datasource, EmbeddedRestDatasource } from "entities/Datasource"; | ||
import AnalyticsUtil from "ee/utils/AnalyticsUtil"; | ||
import type { Action } from "entities/Action"; | ||
import { type IDEType } from "ee/entities/IDE/constants"; | ||
|
||
function callRunActionAnalytics({ | ||
action, | ||
datasource, | ||
pageName, | ||
plugin, | ||
}: { | ||
action: Action; | ||
IDEType: IDEType; | ||
pageName: string; | ||
plugin: Plugin; | ||
datasource?: EmbeddedRestDatasource | Datasource; | ||
}) { | ||
const actionId = action.id; | ||
const actionName = action.name; | ||
const datasourceId = datasource?.id; | ||
const pluginName = plugin.name; | ||
const isMock = !!datasource?.isMock || false; // as mock db exists only for postgres and mongo plugins | ||
|
||
AnalyticsUtil.logEvent("RUN_ACTION_CLICK", { | ||
actionId, | ||
actionName, | ||
datasourceId, | ||
pageName, | ||
pluginName, | ||
isMock, | ||
}); | ||
} | ||
|
||
export { callRunActionAnalytics }; |
This file contains 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
1 change: 1 addition & 0 deletions
1
app/client/src/ee/PluginActionEditor/utils/callRunActionAnalytics.ts
This file contains 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 @@ | ||
export * from "ce/PluginActionEditor/utils/callRunActionAnalytics"; |