Skip to content

Commit a4cdf06

Browse files
authored
MV3: simple telemetry (#820)
1 parent 775b8ff commit a4cdf06

33 files changed

+6688
-7653
lines changed

.github/workflows/test-extension-manifest-v2.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ jobs:
1919
cache: 'npm'
2020
node-version: '18'
2121
cache-dependency-path: ./extension-manifest-v2/package-lock.json
22-
- name: Install Dependencies
22+
- name: Install dependencies in libs
23+
run: npm ci
24+
working-directory: libs
25+
- name: Install dependencies in ui
26+
run: npm ci
27+
working-directory: ui
28+
- name: Install dependencies
2329
run: |
2430
npm ci
2531
- name: Build Licenses

.github/workflows/test-extension-manifest-v3.yml

+9
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,14 @@ jobs:
1919
node-version: '18'
2020
cache: 'npm'
2121
cache-dependency-path: ./extension-manifest-v3/package-lock.json
22+
- name: Install dependencies in libs
23+
run: npm ci
24+
working-directory: libs
25+
- name: Install dependencies in ui
26+
run: npm ci
27+
working-directory: ui
28+
- name: Install dependencies
29+
run: |
30+
npm ci
2231
- run: npm ci --ignore-scripts
2332
- run: npm test

ui/.gitignore .gitignore

File renamed without changes.

ui/.prettierrc .prettierrc

File renamed without changes.

extension-manifest-v2/app/panel-android/actions/settingsActions.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export function selectItem({ actionData }) {
127127
export function exportSettings({ state }) {
128128
return sendMessageInPromise('getAndroidSettingsForExport').then((result) => {
129129
const { needsReload } = state;
130-
const settings_last_exported = Number((new Date()).getTime());
130+
const settings_last_exported = Date.now();
131131
const exportResultText = `${t('settings_export_success')} ${moment(settings_last_exported).format('LLL')}`;
132132

133133
_saveToFile(result);
@@ -146,7 +146,7 @@ export function exportSettings({ state }) {
146146
export function importSettingsNative({ actionData, state }) {
147147
return new Promise((resolve) => {
148148
const { needsReload } = state;
149-
const settings_last_imported = Number((new Date()).getTime());
149+
const settings_last_imported = Date.now();
150150
const importResultText = `${t('settings_import_success')} ${moment(settings_last_imported).format('LLL')}`;
151151

152152
_importFromFile(actionData).then((settings) => {
@@ -156,7 +156,7 @@ export function importSettingsNative({ actionData, state }) {
156156
imported_settings.alert_bubble_timeout = Math.min(30, imported_settings.alert_bubble_timeout);
157157
}
158158

159-
imported_settings.settings_last_imported = Number((new Date()).getTime());
159+
imported_settings.settings_last_imported = Date.now();
160160
imported_settings.importResultText = `${t('settings_import_success')} ${moment(imported_settings.settings_last_imported).format('LLL')}`;
161161
imported_settings.actionSuccess = true;
162162

extension-manifest-v2/app/panel/reducers/settings.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const _exportSettings = (state, action) => {
6161
let updated_actionSuccess = state.actionSuccess;
6262
let updated_exportResultText = state.exportResultText;
6363
if (result && result !== 'RESERVED_PAGE') {
64-
updated_settings_last_exported = Number((new Date()).getTime());
64+
updated_settings_last_exported = Date.now();
6565
moment.locale(state.language).toLowerCase().replace('_', '-');
6666
updated_exportResultText = `${t('settings_export_success')} ${moment(updated_settings_last_exported).format('LLL')}`;
6767
updated_actionSuccess = true;
@@ -123,7 +123,7 @@ const _importSettingsNative = (state, action) => {
123123
updated_state.alert_bubble_timeout = Math.min(30, updated_state.alert_bubble_timeout);
124124
}
125125

126-
updated_state.settings_last_imported = Number((new Date()).getTime());
126+
updated_state.settings_last_imported = Date.now();
127127
updated_state.importResultText = `${t('settings_import_success')} ${moment(updated_state.settings_last_imported).format('LLL')}`;
128128
updated_state.actionSuccess = true;
129129

extension-manifest-v2/jest.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ module.exports = {
2020
'<rootDir>/test/',
2121
'<rootDir>/app/'
2222
],
23-
testURL: 'http://localhost',
23+
testEnvironment: 'jsdom',
24+
testEnvironmentOptions: {
25+
url: 'http://localhost',
26+
}
2427
};

0 commit comments

Comments
 (0)