From 09a9305f39bb6b104a6a91aba2a4ed34ab9862d6 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 15 Jan 2025 14:07:07 +0100 Subject: [PATCH] track script runner track compile general (optional to use) --- .../src/app/tabs/script-runner-ui.tsx | 6 ++---- .../scriptrunner/src/lib/script-runner-ui.tsx | 19 ++++++++++++++----- .../src/lib/compiler-container.tsx | 1 + 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/script-runner-ui.tsx b/apps/remix-ide/src/app/tabs/script-runner-ui.tsx index 7e108c71ca..dd79bc79e5 100644 --- a/apps/remix-ide/src/app/tabs/script-runner-ui.tsx +++ b/apps/remix-ide/src/app/tabs/script-runner-ui.tsx @@ -71,7 +71,6 @@ export class ScriptRunnerUIPlugin extends ViewPlugin { }) this.plugin.on('fileManager', 'fileSaved', async (file: string) => { - if (file === configFileName && this.enableCustomScriptRunner) { await this.loadCustomConfig() this.renderComponent() @@ -114,7 +113,8 @@ export class ScriptRunnerUIPlugin extends ViewPlugin { activateCustomScriptRunner={this.activateCustomScriptRunner.bind(this)} saveCustomConfig={this.saveCustomConfig.bind(this)} openCustomConfig={this.openCustomConfig.bind(this)} - loadScriptRunner={this.selectScriptRunner.bind(this)} /> + loadScriptRunner={this.selectScriptRunner.bind(this)} + /> ) } @@ -184,7 +184,6 @@ export class ScriptRunnerUIPlugin extends ViewPlugin { this.setIsLoading(config.name, false) this.renderComponent() return result - } async execute(script: string, filePath: string) { @@ -289,7 +288,6 @@ export class ScriptRunnerUIPlugin extends ViewPlugin { } } } - } async openCustomConfig() { diff --git a/libs/remix-ui/scriptrunner/src/lib/script-runner-ui.tsx b/libs/remix-ui/scriptrunner/src/lib/script-runner-ui.tsx index 52692be16f..a241f2713d 100644 --- a/libs/remix-ui/scriptrunner/src/lib/script-runner-ui.tsx +++ b/libs/remix-ui/scriptrunner/src/lib/script-runner-ui.tsx @@ -5,6 +5,7 @@ import { faCaretDown, faCaretRight, faCheck, faExclamationCircle, faRedoAlt, faT import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { CustomScriptRunner } from "./custom-script-runner"; import { CustomTooltip } from "@remix-ui/helper"; +const _paq = (window._paq = window._paq || []) // eslint-disable-line export interface ScriptRunnerUIProps { loadScriptRunner: (config: ProjectConfiguration) => void; @@ -62,12 +63,18 @@ export const ScriptRunnerUI = (props: ScriptRunnerUIProps) => { } {!config.isLoading && config.errorStatus && config.error && -
loadScriptRunner(config)} className="pointer px-2"> +
{ + loadScriptRunner(config) + _paq.push(['trackEvent', 'scriptRunnerPlugin', 'loadScriptRunnerConfig', config.name]) + }} + className="pointer px-2" + >
} {!config.isLoading && !config.errorStatus && !config.error &&
loadScriptRunner(config)} className="pointer px-2"> - {activeConfig && activeConfig.name !== config.name ? + { activeConfig && activeConfig.name !== config.name ? : } @@ -87,7 +94,9 @@ export const ScriptRunnerUI = (props: ScriptRunnerUIProps) => { ))} -
))} + +
)) + } {enableCustomScriptRunner && { publishedConfigurations={configurations.filter((config) => config.publish)} />} - ); -}; + ) +} diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 244e83b799..3396d89434 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -486,6 +486,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { compileIcon.current.classList.remove('remixui_spinningIcon') compileIcon.current.classList.remove('remixui_bouncingIcon') if (!state.autoCompile || (state.autoCompile && state.matomoAutocompileOnce)) { + _paq.push(['trackEvent', 'compiler', 'compiled', 'solCompilationFinishedTriggeredByUser') _paq.push(['trackEvent', 'compiler', 'compiled', 'with_config_file_' + state.useFileConfiguration]) _paq.push(['trackEvent', 'compiler', 'compiled', 'with_version_' + _retrieveVersion()]) if (state.autoCompile && state.matomoAutocompileOnce) {