-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLDR-18220 Dashboard Other category for all other paths #4273
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,12 +14,14 @@ | |||||
import javax.json.bind.Jsonb; | ||||||
import javax.json.bind.JsonbBuilder; | ||||||
import javax.ws.rs.Consumes; | ||||||
import javax.ws.rs.DefaultValue; | ||||||
import javax.ws.rs.GET; | ||||||
import javax.ws.rs.HeaderParam; | ||||||
import javax.ws.rs.POST; | ||||||
import javax.ws.rs.Path; | ||||||
import javax.ws.rs.PathParam; | ||||||
import javax.ws.rs.Produces; | ||||||
import javax.ws.rs.QueryParam; | ||||||
import javax.ws.rs.core.MediaType; | ||||||
import javax.ws.rs.core.Response; | ||||||
import javax.ws.rs.core.Response.Status; | ||||||
|
@@ -476,6 +478,13 @@ public Response getDashboard( | |||||
@PathParam("locale") @Schema(required = true, description = "Locale ID") String locale, | ||||||
@PathParam("level") @Schema(required = true, description = "Coverage Level") | ||||||
String level, | ||||||
@QueryParam("includeOther") | ||||||
@DefaultValue("false") | ||||||
@Schema( | ||||||
required = false, | ||||||
description = "Include all rows ('Other' category)", | ||||||
example = "true") | ||||||
boolean includeOther, | ||||||
@HeaderParam(Auth.SESSION_HEADER) String sessionString) { | ||||||
CLDRLocale loc = CLDRLocale.getInstance(locale); | ||||||
CookieSession cs = Auth.getSession(sessionString); | ||||||
|
@@ -486,7 +495,8 @@ public Response getDashboard( | |||||
|
||||||
// *Beware* org.unicode.cldr.util.Level (coverage) ≠ VoteResolver.Level (user) | ||||||
Level coverageLevel = org.unicode.cldr.util.Level.fromString(level); | ||||||
ReviewOutput ret = new Dashboard().get(loc, cs.user, coverageLevel, null /* xpath */); | ||||||
ReviewOutput ret = | ||||||
new Dashboard().get(loc, cs.user, coverageLevel, null /* xpath */, includeOther); | ||||||
ret.coverageLevel = coverageLevel.name(); | ||||||
|
||||||
return Response.ok().entity(ret).build(); | ||||||
|
@@ -551,7 +561,7 @@ public Response getParticipationFor( | |||||
coverageLevel = org.unicode.cldr.util.Level.fromString(level); | ||||||
} | ||||||
ReviewOutput reviewOutput = | ||||||
new Dashboard().get(loc, target, coverageLevel, null /* xpath */); | ||||||
new Dashboard().get(loc, target, coverageLevel, null /* xpath */, false); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: never add a boolean without a comment what it is
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah! If you have a moment during the Stanford visit I'd love for your help setting up my IDE to for things like this. Do you use Eclipse or VSCode? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. VS code with the red hat, Java package |
||||||
reviewOutput.coverageLevel = coverageLevel.name(); | ||||||
|
||||||
ParticipationResults participationResults = | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -402,7 +402,7 @@ private static Dashboard.ReviewNotification[] getOnePathDash( | |||||
String baseXp, CLDRLocale locale, CookieSession mySession) { | ||||||
Level coverageLevel = Level.get(mySession.getEffectiveCoverageLevel(locale.toString())); | ||||||
Dashboard.ReviewOutput ro = | ||||||
new Dashboard().get(locale, mySession.user, coverageLevel, baseXp); | ||||||
new Dashboard().get(locale, mySession.user, coverageLevel, baseXp, false); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same nit
Suggested change
|
||||||
return ro.getNotifications(); | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,8 @@ public enum NotificationCategory { | |
|
||
/** You have abstained, or not yet voted for any value */ | ||
abstained('A', "Abstained", "You have abstained, or not yet voted for any value."), | ||
; | ||
|
||
other('O', "Other", "All other values"); | ||
Comment on lines
-60
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it's without errors, warnings and it isn't abstained, that this group should be thought of as "voted, no issues"? To keep the name minimal we can call it other, but I wonder if we should make it clearer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
public final char abbreviation; | ||
public final String buttonLabel; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion for future improvement: hover text for this control with brief explanation what it does, e.g., "Include notifications for ALL paths within the chosen coverage level that do not belong to another notification category. Note: the number of 'other' notifications may be very large"