Skip to content

Commit b5b0e5b

Browse files
committed
setting section update
1 parent 071765b commit b5b0e5b

File tree

6 files changed

+27
-41
lines changed

6 files changed

+27
-41
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"settings.useShowGasInEditorText": "Display gas estimates in editor",
1111
"settings.displayErrorsText": "Display errors in editor while typing",
1212
"settings.matomoAnalytics": "Enable Matomo Analytics. See",
13+
"settings.matomoPerfAnalytics": "Enable Matomo Performance Analytics",
1314
"settings.matomoAnalyticsTooltip": "We do not collect personally identifiable information (PII). The info is used to improve the site’s UX & UI.",
1415
"settings.enablePersonalModeText": " Enable Personal Mode for web3 provider",
1516
"settings.enablePersonalModeTooltip": "Transaction sent over Web3 will use the web3.personal API. Be sure the endpoint is opened before enabling it. This mode allows a user to provide a passphrase in the Remix interface without having to unlock the account. Although this is very convenient, you should completely trust the backend you are connected to (Geth, Parity, ...). Remix never persists any passphrase",

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default class SettingsTab extends ViewPlugin {
8080
config={state.config}
8181
editor={state.editor}
8282
_deps={state._deps}
83-
useMatomoAnalytics={state.useMatomoAnalytics}
83+
useMatomoPerfAnalytics={state.useMatomoPerfAnalytics}
8484
useCopilot={state.useCopilot}
8585
themeModule={state._deps.themeModule}
8686
localeModule={state._deps.localeModule}
@@ -132,11 +132,11 @@ export default class SettingsTab extends ViewPlugin {
132132
localStorage.setItem('matomo-perf-analytics-consent', Date.now().toString())
133133
this.useMatomoPerfAnalytics = isChecked
134134
if (!isChecked) {
135-
// revoke tracking consent , need to be updated
136-
_paq.push(['forgetConsentGiven']);
135+
// revoke tracking consent for performance data
136+
_paq.push(['forgetMatomoPerfConsentGiven'])
137137
} else {
138-
// user has given consent to process their data, need to be updated
139-
_paq.push(['setConsentGiven']);
138+
// user has given consent to process their performance data
139+
_paq.push(['setMatomoPerfConsentGiven'])
140140
}
141141
this.dispatch({
142142
...this

libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ const MatomoDialog = (props: MatomoDialogProps) => {
6767
}, [visible])
6868

6969
const handleAcceptAllClick = async () => {
70-
// user has given all consent to process their data
71-
_paq.push(['setConsentGiven'])
70+
_paq.push(['setConsentGiven']) // default consent to process their anonymous data
71+
_paq.push(['setMatomoPerfConsentGiven']) // user has given consent to process their performance data
7272
settings.updateMatomoAnalyticsChoice(true) // Enable Matomo Anonymous analytics
7373
settings.updateMatomoPerfAnalyticsChoice(true) // Enable Matomo Performance analytics
7474
settings.updateCopilotChoice(true) // Enable RemixAI copilot

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

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
copilotMaxNewToken,
1515
copilotTemperature,
1616
textWrapEventAction,
17-
useMatomoAnalytics,
17+
useMatomoPerfAnalytics,
1818
saveTokenToast,
1919
removeTokenToast,
2020
saveSwarmSettingsToast,
@@ -39,7 +39,7 @@ export interface RemixUiSettingsProps {
3939
config: any
4040
editor: any
4141
_deps: any
42-
useMatomoAnalytics: boolean
42+
useMatomoPerfAnalytics: boolean
4343
useCopilot: boolean
4444
themeModule: ThemeModule
4545
localeModule: LocaleModule
@@ -125,8 +125,8 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
125125
}, [themeName, state.message])
126126

127127
useEffect(() => {
128-
if (props.useMatomoAnalytics !== null) useMatomoAnalytics(props.config, props.useMatomoAnalytics, dispatch)
129-
}, [props.useMatomoAnalytics])
128+
if (props.useMatomoPerfAnalytics !== null) useMatomoPerfAnalytics(props.config, props.useMatomoPerfAnalytics, dispatch)
129+
}, [props.useMatomoPerfAnalytics])
130130

131131
const onchangeGenerateContractMetadata = (event) => {
132132
generateContractMetadat(props.config, event.target.checked, dispatch)
@@ -167,7 +167,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
167167
}
168168

169169
const onchangeMatomoAnalytics = (event) => {
170-
useMatomoAnalytics(props.config, event.target.checked, dispatch)
170+
useMatomoPerfAnalytics(props.config, event.target.checked, dispatch)
171171
}
172172

173173
const onchangeUseAutoComplete = (event) => {
@@ -197,7 +197,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
197197
const isMetadataChecked = props.config.get('settings/generate-contract-metadata') || false
198198
const isEditorWrapChecked = props.config.get('settings/text-wrap') || false
199199
const isPersonalChecked = props.config.get('settings/personal-mode') || false
200-
const isMatomoChecked = props.config.get('settings/matomo-analytics') || false
200+
const isMatomoChecked = props.config.get('settings/matomo-perf-analytics') || false
201201

202202
const isAutoCompleteChecked = props.config.get('settings/auto-completion') || false
203203
const isShowGasInEditorChecked = props.config.get('settings/show-gas') || false
@@ -315,25 +315,10 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
315315
</div>
316316
<div className="custom-control custom-checkbox mb-1">
317317
<input onChange={onchangeMatomoAnalytics} id="settingsMatomoAnalytics" type="checkbox" className="custom-control-input" checked={isMatomoChecked} />
318-
<label data-id="label-matomo-settings" className={`form-check-label custom-control-label align-middle ${getTextClass('settings/matomo-analytics')}`} htmlFor="settingsMatomoAnalytics">
318+
<label data-id="label-matomo-settings" className={`form-check-label custom-control-label align-middle ${getTextClass('settings/matomo-perf-analytics')}`} htmlFor="settingsMatomoAnalytics">
319319
<span>
320-
<FormattedMessage id="settings.matomoAnalytics" />
320+
<FormattedMessage id="settings.matomoPerfAnalytics" />
321321
</span>
322-
<a href="https://medium.com/remix-ide/help-us-improve-remix-ide-66ef69e14931" target="_blank">
323-
{' '}
324-
<FormattedMessage id="settings.analyticsInRemix" />
325-
</a>{' '}
326-
<span>&</span>{' '}
327-
<a target="_blank" href="https://matomo.org/free-software">
328-
Matomo
329-
</a>
330-
<CustomTooltip
331-
placement="auto"
332-
tooltipId="settings-tooltip-matomo"
333-
tooltipText={intl.formatMessage({ id: 'settings.matomoAnalyticsTooltip' })}
334-
>
335-
<i className="ml-1 far fa-info-circle"></i>
336-
</CustomTooltip>
337322
</label>
338323
</div>
339324
<div className="custom-control custom-checkbox mb-1">

libs/remix-ui/settings/src/lib/settingsAction.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ export const copilotTemperature = (config, checked, dispatch) => {
3939
dispatch({ type: 'copilot/suggest/temperature', payload: { isChecked: checked, textClass: checked ? textDark : textSecondary } })
4040
}
4141

42-
export const useMatomoAnalytics = (config, checked, dispatch) => {
43-
config.set('settings/matomo-analytics', checked)
44-
localStorage.setItem('matomo-analytics-consent', Date.now().toString())
45-
dispatch({ type: 'useMatomoAnalytics', payload: { isChecked: checked, textClass: checked ? textDark : textSecondary } })
42+
export const useMatomoPerfAnalytics = (config, checked, dispatch) => {
43+
config.set('settings/matomo-perf-analytics', checked)
44+
localStorage.setItem('matomo-perf-analytics-consent', Date.now().toString())
45+
dispatch({ type: 'useMatomoPerfAnalytics', payload: { isChecked: checked, textClass: checked ? textDark : textSecondary } })
4646
if (checked) {
47-
// user has given consent to process their data
48-
_paq.push(['setConsentGiven']);
47+
// user has given consent to process their performance data
48+
_paq.push(['setMatomoPerfConsentGiven'])
4949
} else {
50-
// revoke tracking consent
51-
_paq.push(['forgetConsentGiven']);
50+
// revoke tracking consent for performance data
51+
_paq.push(['forgetMatomoPerfConsentGiven'])
5252
}
5353
}
5454

libs/remix-ui/settings/src/lib/settingsReducer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const initialState = {
2323
textClass: textSecondary
2424
},
2525
{
26-
name: 'useMatomoAnalytics',
26+
name: 'useMatomoPerfAnalytics',
2727
isChecked: false,
2828
textClass: textSecondary
2929
},
@@ -107,9 +107,9 @@ export const settingReducer = (state, action) => {
107107
return {
108108
...state
109109
}
110-
case 'useMatomoAnalytics':
110+
case 'useMatomoPerfAnalytics':
111111
state.elementState.map(element => {
112-
if (element.name === 'useMatomoAnalytics') {
112+
if (element.name === 'useMatomoPerfAnalytics') {
113113
element.isChecked = action.payload.isChecked
114114
element.textClass = action.payload.textClass
115115
}

0 commit comments

Comments
 (0)