Skip to content

Commit 59ada7e

Browse files
authored
Merge branch 'master' into joe-patch-013
2 parents 0c47e34 + 7237872 commit 59ada7e

File tree

7 files changed

+30
-12
lines changed

7 files changed

+30
-12
lines changed

apps/remix-ide/src/app/tabs/locales/en/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
"settings.analyticsDescription": "Control how Remix uses AI and analytics to improve your experience.",
5858
"settings.aiDescription": "The Remix AI Assistant enhances your coding experience with smart suggestions and automated insights. Manage how AI interacts with your code and data.",
5959
"settings.servicesDescription": "Configure the settings for connected services, including Github, IPFS, Swarm, Sindri and Etherscan.",
60-
"settings.matomoAnalyticsNoCookies": "Matomo Analytics (no cookies)",
60+
"settings.matomoAnalyticsNoCookies": "Matomo Analytics (necessary, no cookies)",
6161
"settings.matomoAnalyticsNoCookiesDescription": "Help improve Remix with anonymous usage data.",
62-
"settings.matomoAnalyticsWithCookies": "Matomo Analytics (with cookies)",
62+
"settings.matomoAnalyticsWithCookies": "Matomo Performance Analytics (with cookies)",
6363
"settings.matomoAnalyticsWithCookiesDescription": "Enable tracking with cookies for more detailed insights.",
6464
"settings.aiCopilot": "AI Copilot",
6565
"settings.aiCopilotDescription": "AI Copilot assists with code suggestions and improvements.",

apps/remix-ide/src/app/tabs/settings-tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const _paq = (window._paq = window._paq || [])
1515
const profile = {
1616
name: 'settings',
1717
displayName: 'Settings',
18-
methods: ['get', 'updateCopilotChoice', 'getCopilotSetting'],
18+
methods: ['get', 'updateCopilotChoice', 'getCopilotSetting', 'updateMatomoPerfAnalyticsChoice'],
1919
events: [],
2020
icon: 'assets/img/settings.webp',
2121
description: 'Remix-IDE settings',

apps/remix-ide/src/app/tabs/web3-provider.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export class Web3ProviderModule extends Plugin {
5555
if (payload.method === 'eth_sendTransaction') {
5656
if (payload.params.length && !payload.params[0].to && message.result) {
5757
setTimeout(async () => {
58+
this.emit('transactionBroadcasted', message.result)
5859
const receipt = await this.tryTillReceiptAvailable(message.result)
5960
if (!receipt.contractAddress) {
6061
console.log('receipt available but contract address not present', receipt)

apps/remix-ide/src/blockchain/blockchain.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,29 @@ export class Blockchain extends Plugin {
797797
(_) => this.executionContext.currentblockGasLimit()
798798
)
799799

800+
const logTransaction = (txhash, origin) => {
801+
this.detectNetwork((error, network) => {
802+
console.log(`transaction sent: ${txhash}`, network)
803+
if (network && network.id) {
804+
_paq.push(['trackEvent', 'udapp', `sendTransaction-from-${origin}`, `${txhash}-${network.id}`])
805+
} else {
806+
try {
807+
const networkString = JSON.stringify(network)
808+
_paq.push(['trackEvent', 'udapp', `sendTransaction-from-${origin}`, `${txhash}-${networkString}`])
809+
} catch (e) {
810+
_paq.push(['trackEvent', 'udapp', `sendTransaction-from-${origin}`, `${txhash}-unknownnetwork`])
811+
}
812+
}
813+
})
814+
}
815+
816+
this.on('web3Provider', 'transactionBroadcasted', (txhash) => {
817+
logTransaction(txhash, 'plugin')
818+
})
819+
800820
web3Runner.event.register('transactionBroadcasted', (txhash, isUserOp) => {
801821
if (isUserOp) _paq.push(['trackEvent', 'udapp', 'safeSmartAccount', `txBroadcastedFromSmartAccount`])
822+
logTransaction(txhash, 'gui')
802823
this.executionContext.detectNetwork(async (error, network) => {
803824
if (error || !network) return
804825
if (network.name === 'VM') return

libs/remix-ui/settings/src/lib/remix-ui-settings.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,9 @@ const settingsSections: SettingsSection[] = [
9696
{ options: [{
9797
name: 'matomo-analytics',
9898
label: 'settings.matomoAnalyticsNoCookies',
99+
headerClass: 'text-secondary',
99100
type: 'toggle',
100101
description: 'settings.matomoAnalyticsNoCookiesDescription',
101-
footnote: {
102-
text: 'Learn more about analytics',
103-
link: 'https://matomo.org/',
104-
styleClass: 'text-primary'
105-
}
106102
}, {
107103
name: 'matomo-perf-analytics',
108104
label: 'settings.matomoAnalyticsWithCookies',

libs/remix-ui/settings/src/lib/settings-section.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,16 @@ export const SettingsSectionUI: React.FC<SettingsSectionUIProps> = ({ plugin, se
3939
const handleToggle = (name: string) => {
4040
if (state[name]) {
4141
const newValue = !state[name].value
42-
4342
dispatch({ type: 'SET_LOADING', payload: { name: name } })
4443
dispatch({ type: 'SET_VALUE', payload: { name: name, value: newValue } })
45-
// _paq.push(['disableCookies'])
4644
if (!newValue && formUIData[name]) {
4745
Object.keys(formUIData[name]).forEach((key) => {
4846
dispatch({ type: 'SET_VALUE', payload: { name: key, value: '' } })
4947
})
5048
dispatch({ type: 'SET_TOAST_MESSAGE', payload: { value: 'Credentials removed' } })
5149
}
5250
if (name === 'copilot/suggest/activate') plugin.emit('copilotChoiceUpdated', newValue)
51+
if (name === 'matomo-perf-analytics') plugin.call('settings', 'updateMatomoPerfAnalyticsChoice', newValue)
5352
if (name === 'text-wrap') plugin.emit('textWrapChoiceUpdated', newValue)
5453
} else {
5554
console.error('Setting does not exist: ', name)
@@ -94,15 +93,15 @@ export const SettingsSectionUI: React.FC<SettingsSectionUIProps> = ({ plugin, se
9493
return (
9594
<div className={`card border-0 rounded-0 ${isLastOption ? 'pt-3 pb-0' : isFirstOption ? 'border-bottom pb-3' : 'border-bottom py-3'}`} key={optionIndex}>
9695
<div className="d-flex align-items-center">
97-
<h5 data-id={`settingsTab${option.name}Label`} className={`${isDark ? 'text-white' : 'text-black'} m-0`}>
96+
<h5 data-id={`settingsTab${option.name}Label`} className={`${option.headerClass || (isDark ? 'text-white' : 'text-black')} m-0`}>
9897
<FormattedMessage id={option.label} />
9998
{option.labelIconTooltip ?
10099
<CustomTooltip tooltipText={<FormattedMessage id={option.labelIconTooltip} />}><i className={option.labelIcon}></i></CustomTooltip> :
101100
option.labelIcon && <i className={option.labelIcon}></i>
102101
}
103102
</h5>
104103
<div className="ms-auto">
105-
{option.type === 'toggle' && <ToggleSwitch id={option.name} isOn={toggleValue} onClick={() => handleToggle(option.name)} />}
104+
{option.type === 'toggle' && <ToggleSwitch id={option.name} isOn={toggleValue} onClick={() => handleToggle(option.name)} disabled = {option.name === "matomo-analytics" ? true : false}/>}
106105
{option.type === 'select' && <div style={{ minWidth: '110px' }}><SelectDropdown value={selectValue} options={option.selectOptions} name={option.name} dispatch={dispatch as any} /></div>}
107106
{option.type === 'button' && <button className="btn btn-secondary btn-sm" onClick={() => handleButtonClick(option.buttonOptions)}><FormattedMessage id={option.buttonOptions.label} /></button>}
108107
</div>

libs/remix-ui/settings/src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface SettingsSection {
4747
name: keyof SettingsState,
4848
label: string,
4949
labelIcon?: string,
50+
headerClass?: string,
5051
labelIconTooltip?: string,
5152
description?: string | JSX.Element,
5253
footnote?: {

0 commit comments

Comments
 (0)