From 57daf35bd6649a55ff327022602ccabe23edd9d4 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Thu, 1 Aug 2024 11:16:04 -0500 Subject: [PATCH] Edit check: some simple counters for steps in the process Change-Id: Iac0faea1f06eb30ac075a702cdcaaec29e0fbaf0 --- editcheck/modules/init.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editcheck/modules/init.js b/editcheck/modules/init.js index d99934fd18..5cdcb233ef 100644 --- a/editcheck/modules/init.js +++ b/editcheck/modules/init.js @@ -166,6 +166,7 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable let saveProcessDeferred; mw.hook( 've.preSaveProcess' ).add( ( saveProcess, target ) => { + ve.track( 'counter.editcheck.preSaveChecksAvailable' ); const surface = target.getSurface(); if ( surface.getMode() !== 'visual' ) { @@ -181,6 +182,7 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable let checks = mw.editcheck.editCheckFactory.createAllByListener( 'onBeforeSave', surface ); if ( checks.length ) { + ve.track( 'counter.editcheck.preSaveChecksShown' ); mw.editcheck.refCheckShown = true; const surfaceView = surface.getView(); @@ -323,10 +325,12 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable const delay = ve.createDeferred(); // If they inserted, wait 2 seconds on desktop before showing save dialog setTimeout( () => { + ve.track( 'counter.editcheck.preSaveChecksCompleted' ); delay.resolve(); }, !OO.ui.isMobile() && data.action !== 'reject' ? 2000 : 0 ); return delay.promise(); } else { + ve.track( 'counter.editcheck.preSaveChecksAbandoned' ); return ve.createDeferred().reject().promise(); } } );