add Matomo trackEvent

pull/1342/head
yann300 3 years ago committed by davidzagi93@gmail.com
parent ff72f60634
commit 19250c6600
  1. 4
      apps/remix-ide/src/app/tabs/test-tab.js
  2. 3
      apps/remix-ide/src/blockchain/blockchain.js
  3. 9
      libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts
  4. 9
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -9,6 +9,8 @@ var Renderer = require('../ui/renderer')
var css = require('./styles/test-tab-styles')
var { UnitTestRunner } = require('@remix-project/remix-tests')
const _paq = window._paq = window._paq || []
const TestTabLogic = require('./testTab/testTab')
const profile = {
@ -230,6 +232,7 @@ module.exports = class TestTab extends ViewPlugin {
}
finalLogs = finalLogs + ' ' + formattedLog + '\n'
}
_paq.push(['trackEvent', 'solidityUnitTesting', 'hardhat', 'console.log'])
this.call('terminal', 'log', { type: 'info', value: finalLogs })
}
@ -569,6 +572,7 @@ module.exports = class TestTab extends ViewPlugin {
const tests = this.data.selectedTests
if (!tests) return
this.resultStatistics.hidden = tests.length === 0
_paq.push(['trackEvent', 'solidityUnitTesting', 'runTests'])
async.eachOfSeries(tests, (value, key, callback) => {
if (this.hasBeenStopped) return
this.runTest(value, callback)

@ -13,6 +13,8 @@ const { txFormat, txExecution, typeConversion, txListener: Txlistener, TxRunner,
const { txResultHelper: resultToRemixTx } = helpers
const packageJson = require('../../../../package.json')
const _paq = window._paq = window._paq || [] //eslint-disable-line
const profile = {
name: 'blockchain',
displayName: 'Blockchain',
@ -515,6 +517,7 @@ class Blockchain extends Plugin {
}
finalLogs = finalLogs + ' ' + formattedLog + '\n'
}
_paq.push(['trackEvent', 'udapp', 'hardhat', 'console.log'])
this.call('terminal', 'log', { type: 'info', value: finalLogs })
}
execResult = await this.web3().eth.getExecutionResultFromSimulator(txResult.transactionHash)

@ -10,6 +10,14 @@ const profile = {
methods: ['getCompilerState'],
version: packageJson.version
}
declare global {
interface Window {
_paq: any
}
}
const _paq = window._paq = window._paq || [] //eslint-disable-line
export class CompileTab extends Plugin {
public compiler
public optimize
@ -115,6 +123,7 @@ export class CompileTab extends Plugin {
`
const configFilePath = 'remix-compiler.config.js'
this.api.writeFile(configFilePath, fileContent)
_paq.push(['trackEvent', 'compiler', 'compileWithHardhat'])
this.call('hardhat', 'compile', configFilePath).then((result) => {
this.call('terminal', 'log', { type: 'info', value: result })
}).catch((error) => {

@ -11,6 +11,13 @@ import { OverlayTrigger, Tooltip } from 'react-bootstrap'// eslint-disable-line
const StaticAnalysisRunner = require('@remix-project/remix-analyzer').CodeAnalysis
const utils = remixLib.util
declare global {
interface Window {
_paq: any
}
}
const _paq = window._paq = window._paq || [] //eslint-disable-line
/* eslint-disable-next-line */
export interface RemixUiStaticAnalyserProps {
registry: any,
@ -154,6 +161,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const warningErrors = []
// Remix Analysis
_paq.push(['trackEvent', 'solidityStaticAnalyzer', 'analyzeWithRemixAnalyzer'])
runner.run(lastCompilationResult, categoryIndex, results => {
results.map((result) => {
let moduleName
@ -212,6 +220,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
props.analysisModule.call('solidity-logic', 'getCompilerState').then(async (compilerState) => {
const { currentVersion, optimize, evmVersion } = compilerState
props.analysisModule.call('terminal', 'log', { type: 'info', value: '[Slither Analysis]: Running...' })
_paq.push(['trackEvent', 'solidityStaticAnalyzer', 'analyzeWithSlither'])
props.analysisModule.call('slither', 'analyse', state.file, { currentVersion, optimize, evmVersion }).then(async (result) => {
if (result.status) {
props.analysisModule.call('terminal', 'log', { type: 'info', value: `[Slither Analysis]: Analysis Completed!! ${result.count} warnings found.` })

Loading…
Cancel
Save