Skip to content

Commit a93ad54

Browse files
authored
CLDR-13457 Dashboard rename New to Changed (#307)
-For changedOldValue, rename New (N) to Changed (C), and rename last-release to baseline -Fix some warnings by deleting unused parameter nonVettingPhase -Remove unused old temporary debugTimeStamp from json -Delete some old commented-out dead code -Comments
1 parent 85398f0 commit a93ad54

File tree

2 files changed

+32
-52
lines changed

2 files changed

+32
-52
lines changed

tools/cldr-apps/src/org/unicode/cldr/web/VettingViewerQueue.java

+6-39
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
import com.ibm.icu.impl.Row.R4;
4848
import com.ibm.icu.lang.CharSequences;
4949
import com.ibm.icu.text.DurationFormat;
50-
import com.ibm.icu.text.SimpleDateFormat;
51-
import com.ibm.icu.util.Calendar;
5250
import com.ibm.icu.util.ULocale;
5351

5452
/**
@@ -161,8 +159,6 @@ private static class QueueEntry {
161159
public Map<Pair<CLDRLocale, Organization>, VVOutput> output = new TreeMap<Pair<CLDRLocale, Organization>, VVOutput>();
162160
}
163161

164-
// public static QueueEntry summaryEntry = null;
165-
166162
private static final Object OnlyOneVetter = new Object() {
167163
}; // TODO: remove.
168164

@@ -229,8 +225,8 @@ public Task(QueueEntry entry, CLDRLocale locale, SurveyMain sm, String baseUrl,
229225
this.st_org = st_org;
230226
this.entry = entry;
231227
this.sm = sm;
232-
this.usersLevel = usersLevel; // Level.get(ctx.getEffectiveCoverageLevel());
233-
this.usersOrg = usersOrg; // VoteResolver.Organization.fromString(ctx.session.user.voterOrg());
228+
this.usersLevel = usersLevel;
229+
this.usersOrg = usersOrg;
234230
}
235231

236232
/**
@@ -297,26 +293,11 @@ public void nudge() {
297293

298294
if ((now - last) > 1200) {
299295
last = now;
300-
// StringBuffer bar =
301-
// SurveyProgressManager.appendProgressBar(new
302-
// StringBuffer(),n,ourmax);
303-
// String remStr="";
304296
if (n > 500) {
305297
progress.update(n, setRemStr(now));
306298
} else {
307299
progress.update(n);
308300
}
309-
// try {
310-
// mout.println("<script type=\"text/javascript\">document.getElementById('LoadingBar').innerHTML=\""+bar+
311-
// " ("+n+" items loaded" + remStr + ")" +
312-
// "\";</script>");
313-
// mout.flush();
314-
// } catch (java.io.IOException e) {
315-
// System.err.println("Nudge: got IOException "
316-
// + e.toString() + " after " + n);
317-
// throw new RuntimeException(e); // stop
318-
// processing
319-
// }
320301
}
321302
}
322303

@@ -335,7 +316,7 @@ public void done() {
335316
}
336317

337318
if (!isSummary(locale)) {
338-
vv.generateHtmlErrorTables(aBuffer, choiceSet, locale.getBaseName(), usersOrg, usersLevel, true, false);
319+
vv.generateHtmlErrorTables(aBuffer, choiceSet, locale.getBaseName(), usersOrg, usersLevel, false);
339320
} else {
340321
if (DEBUG)
341322
System.err.println("Starting summary gen..");
@@ -629,13 +610,6 @@ private void getJSONReview(Appendable output, CLDRFile sourceFile, CLDRFile base
629610
reviewInfo.put("hidden", review.getHiddenField(ctx.userId(), ctx.getLocale().toString()));
630611
reviewInfo.put("direction", ctx.getDirectionForLocale());
631612

632-
/*
633-
* Add a time stamp to the json for debugging. This is probably temporary.
634-
* There's a bug we're unable to reproduce anywhere other than the production server.
635-
* Reference: https://unicode-org.atlassian.net/browse/CLDR-13124
636-
*/
637-
reviewInfo.put("debugTimeStamp", new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(Calendar.getInstance().getTime()).toString());
638-
639613
output.append(reviewInfo.toString());
640614
} catch (JSONException | IOException e) {
641615
e.printStackTrace();
@@ -695,14 +669,15 @@ public void writeVettingViewerOutput(CLDRLocale locale, StringBuffer aBuffer, We
695669
Factory baselineFactory = CLDRConfig.getInstance().getCommonAndSeedAndMainAndAnnotationsFactory();
696670
CLDRFile baselineFile = baselineFactory.make(loc, true);
697671
Relation<R2<SectionId, PageId>, VettingViewer<Organization>.WritingInfo> file;
698-
file = vv.generateFileInfoReview(aBuffer, choiceSet, loc, usersOrg, usersLevel, true, quick, sourceFile, quick ? null : baselineFile);
672+
file = vv.generateFileInfoReview(aBuffer, choiceSet, loc, usersOrg, usersLevel, quick, sourceFile, quick ? null : baselineFile);
699673
this.getJSONReview(aBuffer, sourceFile, baselineFile, file, choiceSet, loc, true, quick, ctx);
700674
} else {
701675
/*
702676
* TODO: if this is not dead code (i.e., if r_vetting.jsp is still used), could pass
703677
* sourceFile and baselineFile to generateHtmlErrorTables rather than recreating in that function.
678+
* This really appears to be dead code!
704679
*/
705-
vv.generateHtmlErrorTables(aBuffer, choiceSet, loc, usersOrg, usersLevel, true, quick);
680+
vv.generateHtmlErrorTables(aBuffer, choiceSet, loc, usersOrg, usersLevel, quick);
706681
}
707682
} else {
708683
if (DEBUG) {
@@ -868,14 +843,6 @@ private QueueEntry getEntry(CookieSession session) {
868843
return entry;
869844
}
870845

871-
// private synchronized QueueEntry getSummaryEntry() {
872-
// QueueEntry entry = summaryEntry;
873-
// if (summaryEntry == null) {
874-
// entry = summaryEntry = new QueueEntry();
875-
// }
876-
// return entry;
877-
// }
878-
879846
LruMap<CLDRLocale, BallotBox<UserRegistry.User>> ballotBoxes = new LruMap<CLDRLocale, BallotBox<User>>(8);
880847

881848
BallotBox<UserRegistry.User> getBox(SurveyMain sm, CLDRLocale loc) {

tools/java/org/unicode/cldr/util/VettingViewer.java

+26-13
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ public enum Choice {
111111
"The English value has changed in CLDR, but the corresponding value for your language has not. Check if any changes are needed in your language.",
112112
6),
113113
/**
114-
* The value changed from the last version of CLDR
114+
* The value changed from the baseline
115115
*/
116-
changedOldValue('N', "New", "The winning value was altered from the last-released CLDR value. (Informational)", 7),
116+
changedOldValue('C', "Changed", "The winning value was altered from the baseline value. (Informational)", 7),
117117
/**
118118
* Given the users' coverage, some items are missing.
119119
*/
@@ -479,10 +479,9 @@ public String getUrl(CLDRLocale locale) {
479479
* @param localeId
480480
* @param user
481481
* @param usersLevel
482-
* @param nonVettingPhase
483482
*/
484483
public void generateHtmlErrorTables(Appendable output, EnumSet<Choice> choices, String localeID, T user,
485-
Level usersLevel, boolean nonVettingPhase, boolean quick) {
484+
Level usersLevel, boolean quick) {
486485

487486
// Gather the relevant paths
488487
// each one will be marked with the choice that it triggered.
@@ -501,7 +500,7 @@ public void generateHtmlErrorTables(Appendable output, EnumSet<Choice> choices,
501500
}
502501
}
503502

504-
FileInfo fileInfo = new FileInfo().getFileInfo(sourceFile, baselineFile, sorted, choices, localeID, nonVettingPhase, user,
503+
FileInfo fileInfo = new FileInfo().getFileInfo(sourceFile, baselineFile, sorted, choices, localeID, user,
505504
usersLevel, quick);
506505

507506
// now write the results out
@@ -522,14 +521,14 @@ public void generateHtmlErrorTables(Appendable output, EnumSet<Choice> choices,
522521
* Called only by writeVettingViewerOutput
523522
*/
524523
public Relation<R2<SectionId, PageId>, WritingInfo> generateFileInfoReview(Appendable output, EnumSet<Choice> choices, String localeID, T user,
525-
Level usersLevel, boolean nonVettingPhase, boolean quick, CLDRFile sourceFile, CLDRFile baselineFile) {
524+
Level usersLevel, boolean quick, CLDRFile sourceFile, CLDRFile baselineFile) {
526525

527526
// Gather the relevant paths
528527
// each one will be marked with the choice that it triggered.
529528
Relation<R2<SectionId, PageId>, WritingInfo> sorted = Relation.of(
530529
new TreeMap<R2<SectionId, PageId>, Set<WritingInfo>>(), TreeSet.class);
531530

532-
new FileInfo().getFileInfo(sourceFile, baselineFile, sorted, choices, localeID, nonVettingPhase, user,
531+
new FileInfo().getFileInfo(sourceFile, baselineFile, sorted, choices, localeID, user,
533532
usersLevel, quick);
534533

535534
// now write the results out
@@ -551,16 +550,30 @@ public void addAll(FileInfo other) {
551550

552551
private FileInfo getFileInfo(CLDRFile sourceFile, CLDRFile baselineFile,
553552
Relation<R2<SectionId, PageId>, WritingInfo> sorted,
554-
EnumSet<Choice> choices, String localeID, boolean nonVettingPhase,
553+
EnumSet<Choice> choices, String localeID,
555554
T user, Level usersLevel, boolean quick) {
556555
return this.getFileInfo(sourceFile, baselineFile, sorted,
557-
choices, localeID, nonVettingPhase,
556+
choices, localeID,
558557
user, usersLevel, quick, null);
559558
}
560559

560+
/**
561+
* Loop through paths for the Dashboard
562+
*
563+
* @param sourceFile
564+
* @param baselineFile
565+
* @param sorted
566+
* @param choices
567+
* @param localeID
568+
* @param user
569+
* @param usersLevel
570+
* @param quick
571+
* @param xpath
572+
* @return
573+
*/
561574
private FileInfo getFileInfo(CLDRFile sourceFile, CLDRFile baselineFile,
562575
Relation<R2<SectionId, PageId>, WritingInfo> sorted,
563-
EnumSet<Choice> choices, String localeID, boolean nonVettingPhase,
576+
EnumSet<Choice> choices, String localeID,
564577
T user, Level usersLevel, boolean quick, String xpath) {
565578

566579
errorChecker.initErrorStatus(sourceFile);
@@ -860,7 +873,7 @@ private void writeSummaryTable(Appendable output, String header, Level desiredLe
860873
if (organization != null) {
861874
level = StandardCodes.make().getLocaleCoverageLevel(organization.toString(), localeID);
862875
}
863-
FileInfo fileInfo = new FileInfo().getFileInfo(sourceFile, baselineFile, null, choices, localeID, true, organization, level, false);
876+
FileInfo fileInfo = new FileInfo().getFileInfo(sourceFile, baselineFile, null, choices, localeID, organization, level, false);
864877
localeNameToFileInfo.put(name, fileInfo);
865878
totals.addAll(fileInfo);
866879

@@ -1426,7 +1439,7 @@ public ArrayList<String> getErrorOnPath(EnumSet<Choice> choices, String localeID
14261439
} catch (Exception e) {
14271440
}
14281441

1429-
EnumSet<Choice> errors = new FileInfo().getFileInfo(sourceFile, baselineFile, sorted, choices, localeID, nonVettingPhase, user, usersLevel,
1442+
EnumSet<Choice> errors = new FileInfo().getFileInfo(sourceFile, baselineFile, sorted, choices, localeID, user, usersLevel,
14301443
false, path).problems;
14311444

14321445
ArrayList<String> out = new ArrayList<String>();
@@ -1739,7 +1752,7 @@ public static void writeFile(String myOutputDir, VettingViewer<Organization> tab
17391752

17401753
switch (newCode) {
17411754
case newCode:
1742-
tableView.generateHtmlErrorTables(out, choiceSet, localeStringID, organization, usersLevel, SHOW_ALL, false);
1755+
tableView.generateHtmlErrorTables(out, choiceSet, localeStringID, organization, usersLevel, false);
17431756
break;
17441757
// case oldCode:
17451758
// tableView.generateHtmlErrorTablesOld(out, choiceSet, localeStringID, userNumericID, usersLevel, SHOW_ALL);

0 commit comments

Comments
 (0)