@@ -36,8 +36,9 @@ const COLUMN_TITLE_COVERAGE_LEVEL = "Coverage";
36
36
const COLUMN_TITLE_LEVEL = "Level" ;
37
37
const COLUMN_TITLE_PROGRESS_PERCENT = "Done" ;
38
38
const COLUMN_TITLE_ABSTAIN_COUNT = "Abst." ;
39
- const COLUMN_TITLE_EMP = "EMP" ;
40
- const COLUMN_TITLE_MP = "MP" ;
39
+ const COLUMN_TITLE_ERROR_COUNT = "Err." ;
40
+ const COLUMN_TITLE_MISSING_COUNT = "Miss." ;
41
+ const COLUMN_TITLE_PROVISIONAL_COUNT = "Prov." ;
41
42
const COLUMN_TITLE_USER_ID = "User#" ;
42
43
const COLUMN_TITLE_USER_EMAIL = "Email" ;
43
44
const COLUMN_TITLE_USER_NAME = "Name" ;
@@ -66,13 +67,18 @@ const COLUMNS = [
66
67
default : 0 ,
67
68
} ,
68
69
{
69
- title : COLUMN_TITLE_EMP ,
70
- comment : "Sum of errors + missing + provisional (for locale)" ,
70
+ title : COLUMN_TITLE_ERROR_COUNT ,
71
+ comment : "Number of errors (for locale)" ,
71
72
default : 0 ,
72
73
} ,
73
74
{
74
- title : COLUMN_TITLE_MP ,
75
- comment : "Sum of missing + provisional (for locale)" ,
75
+ title : COLUMN_TITLE_MISSING_COUNT ,
76
+ comment : "Number of missing paths (for locale)" ,
77
+ default : 0 ,
78
+ } ,
79
+ {
80
+ title : COLUMN_TITLE_PROVISIONAL_COUNT ,
81
+ comment : "Number of provisional paths (for locale)" ,
76
82
default : 0 ,
77
83
} ,
78
84
{
@@ -161,6 +167,7 @@ function makeRequest(req) {
161
167
"cldrVettingParticipation.makeRequest, fetching initial data"
162
168
) ;
163
169
}
170
+ vpData . startTime = Date . now ( ) ;
164
171
const p = new URLSearchParams ( ) ;
165
172
p . append ( "what" , "vetting_participation" ) ;
166
173
p . append ( "s" , cldrStatus . getSessionId ( ) ) ;
@@ -187,6 +194,8 @@ function loadHandler(json) {
187
194
console . dir ( { json } ) ;
188
195
cldrNotify . error ( "Error loading vetting participation" , json . err ) ;
189
196
} else if ( callbackToSetData ) {
197
+ vpData . firstResponseTime = Date . now ( ) ;
198
+
190
199
// This json is the response to the initial request to what=vetting_participation
191
200
storeInitialResponseData ( json ) ;
192
201
@@ -268,10 +277,13 @@ function preloadVotingResults() {
268
277
if ( wasCancelled ( ) ) {
269
278
return ;
270
279
}
271
- // "user" here is an object; id = user.id
272
- if ( ! isRegularVetter ( user ) ) {
280
+ if ( ! user . locales || ! user . locales . length ) {
281
+ if ( VP_DEBUG ) {
282
+ console . log ( "user.locales is missing or empty for user id " + id ) ;
283
+ }
273
284
continue ;
274
285
}
286
+ // "user" here is an object; id = user.id
275
287
user . data = { } ;
276
288
for ( const locale of user . locales . sort ( ) ) {
277
289
if ( VP_DEBUG ) {
@@ -322,6 +334,7 @@ function preloadVotingResults() {
322
334
323
335
async function createTable ( ) {
324
336
const columnIndex = getIndexOfColumnsByTitle ( ) ;
337
+ vpData . accountColumnIndex = columnIndex [ COLUMN_TITLE_USER_ID ] ;
325
338
const rowMap = { } ;
326
339
for ( const [ id , user ] of Object . entries ( vpData . uidToUser ) ) {
327
340
if ( VP_DEBUG ) {
@@ -366,9 +379,9 @@ async function createTable() {
366
379
daysAgo = "♾️" ;
367
380
}
368
381
row [ columnIndex [ COLUMN_TITLE_LAST_MOD ] ] = daysAgo ;
369
- row [ columnIndex [ COLUMN_TITLE_EMP ] ] =
370
- errorCount + missingCount + provisionalCount ;
371
- row [ columnIndex [ COLUMN_TITLE_MP ] ] = missingCount + provisionalCount ;
382
+ row [ columnIndex [ COLUMN_TITLE_ERROR_COUNT ] ] = errorCount ;
383
+ row [ columnIndex [ COLUMN_TITLE_MISSING_COUNT ] ] = missingCount ;
384
+ row [ columnIndex [ COLUMN_TITLE_PROVISIONAL_COUNT ] ] = provisionalCount ;
372
385
const sortKey = localeName + " " + user . org + " " + id ;
373
386
rowMap [ sortKey ] = [ ...row ] ; // clone the array since table will retain a reference
374
387
}
@@ -387,7 +400,8 @@ function showResults() {
387
400
console . log ( "showResults, done, 100%" ) ;
388
401
}
389
402
const viewData = {
390
- message : "Done" ,
403
+ accountColumnIndex : vpData . accountColumnIndex ,
404
+ message : getDoneMessage ( ) ,
391
405
percent : 100 ,
392
406
status : Status . SUCCEEDED ,
393
407
tableHeader : getHeaderRow ( ) ,
@@ -397,6 +411,27 @@ function showResults() {
397
411
callbackToSetData ( viewData ) ;
398
412
}
399
413
414
+ // Tell the time (in minutes) it took to wait, and the time it took to finish (after the wait ended)
415
+ function getDoneMessage ( ) {
416
+ const finishTime = Date . now ( ) ;
417
+ const minutesWaiting = Math . floor (
418
+ ( vpData . firstResponseTime - vpData . startTime ) / 1000
419
+ ) ;
420
+ const minutesFurther = Math . floor (
421
+ ( finishTime - vpData . firstResponseTime ) / 1000
422
+ ) ;
423
+ const minutesTotal = minutesWaiting + minutesFurther ;
424
+ return (
425
+ "Done. Time elapsed = " +
426
+ minutesTotal +
427
+ " minutes (" +
428
+ minutesWaiting +
429
+ " waiting for first response + " +
430
+ minutesFurther +
431
+ " additional)"
432
+ ) ;
433
+ }
434
+
400
435
function wasCancelled ( ) {
401
436
return latestReq === RequestType . CANCEL ;
402
437
}
@@ -538,12 +573,4 @@ function addColumnComments(worksheet) {
538
573
}
539
574
}
540
575
541
- /** are we tracking this user? */
542
- function isRegularVetter ( user ) {
543
- if ( user . allLocales || ! user . locales ) {
544
- return false ;
545
- }
546
- return user . userlevelName === "vetter" || user . userlevelName === "guest" ;
547
- }
548
-
549
576
export { Status , cancel , hasPermission , saveAsSheet , start , viewMounted } ;
0 commit comments