mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix(vscode): add hasParameters and installationMethodName to install telemetry
This commit is contained in:
@@ -18,7 +18,11 @@ interface ScopeOption {
|
||||
interface Props {
|
||||
item: MarketplaceItem
|
||||
onClose: () => void
|
||||
onInstallResult: (success: boolean, scope: "project" | "global") => void
|
||||
onInstallResult: (
|
||||
success: boolean,
|
||||
scope: "project" | "global",
|
||||
extra?: { hasParameters?: boolean; installationMethodName?: string },
|
||||
) => void
|
||||
}
|
||||
|
||||
export const InstallModal = (props: Props) => {
|
||||
@@ -77,7 +81,10 @@ export const InstallModal = (props: Props) => {
|
||||
if (msg.type === "marketplaceInstallResult" && msg.slug === props.item.id) {
|
||||
setInstalling(false)
|
||||
setResult({ success: msg.success, error: msg.error })
|
||||
props.onInstallResult(msg.success, scope().value)
|
||||
props.onInstallResult(msg.success, scope().value, {
|
||||
hasParameters: Object.keys(params()).length > 0,
|
||||
installationMethodName: method()?.name,
|
||||
})
|
||||
}
|
||||
})
|
||||
onCleanup(unsub)
|
||||
|
||||
@@ -92,13 +92,15 @@ export const MarketplaceView = () => {
|
||||
<InstallModal
|
||||
item={item}
|
||||
onClose={() => dialog.close()}
|
||||
onInstallResult={(success, scope) => {
|
||||
onInstallResult={(success, scope, extra) => {
|
||||
if (success) {
|
||||
telemetry("Marketplace Item Installed", {
|
||||
itemId: item.id,
|
||||
itemType: item.type,
|
||||
itemName: item.name,
|
||||
target: scope,
|
||||
...(extra?.hasParameters && { hasParameters: true }),
|
||||
...(extra?.installationMethodName && { installationMethodName: extra.installationMethodName }),
|
||||
})
|
||||
dialog.close()
|
||||
fetchData()
|
||||
|
||||
Reference in New Issue
Block a user