diff --git a/tools/cldr-apps/js/src/views/DashboardWidget.vue b/tools/cldr-apps/js/src/views/DashboardWidget.vue index 7944239dda5..c7bd185ea74 100644 --- a/tools/cldr-apps/js/src/views/DashboardWidget.vue +++ b/tools/cldr-apps/js/src/views/DashboardWidget.vue @@ -291,10 +291,6 @@ export default { }, fetchData() { - if (!cldrStatus.getSurveyUser()) { - this.fetchErr = "Please log in to see the Dashboard."; - return; - } this.locale = cldrStatus.getCurrentLocale(); this.level = cldrCoverage.effectiveName(this.locale); if (!this.locale || !this.level) { diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/Dashboard.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/Dashboard.java index e4e99292322..f3e5fd4d238 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/Dashboard.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/Dashboard.java @@ -232,7 +232,10 @@ public ReviewEntry(String code) { public ReviewOutput get( CLDRLocale locale, UserRegistry.User user, Level coverageLevel, String xpath) { final SurveyMain sm = CookieSession.sm; - Organization usersOrg = Organization.fromString(user.voterOrg()); + Organization usersOrg = Organization.unaffiliated; + if (user != null) { + usersOrg = Organization.fromString(user.voterOrg()); + } STFactory sourceFactory = sm.getSTFactory(); VettingViewer vv = new VettingViewer<>( @@ -240,7 +243,11 @@ public ReviewOutput get( EnumSet choiceSet = VettingViewer.getDashboardNotificationCategories(usersOrg); VettingParameters args = new VettingParameters(choiceSet, locale, coverageLevel); - args.setUserAndOrganization(user.id, usersOrg); + if (user != null) { + args.setUserAndOrganization(user.id, usersOrg); + } else { + args.setUserAndOrganization(UserRegistry.NO_USER, usersOrg); + } args.setFiles(locale, sourceFactory, sm.getDiskFactory()); if (xpath != null) { args.setXpath(xpath); @@ -286,6 +293,10 @@ private void addNotificationEntries( notification = getNextNotification(reviewOutput, notification, entry); + if (notification.category.equals("Abstained") + && args.getUserId() == UserRegistry.NO_USER) { + continue; // don't show abstained when the user can't vote. + } addNotificationGroup(args, notification, englishFile, entry); } } diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/STFactory.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/STFactory.java index 3451e94764d..f74214299b5 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/STFactory.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/STFactory.java @@ -1108,6 +1108,10 @@ private void internalSetVoteForValue( @Override public boolean userDidVote(User myUser, String somePath) { + if (myUser == null || myUser.id == UserRegistry.NO_USER) { + // if there is no user, by definition the user did not vote. + return false; + } PerXPathData xpd = peekXpathData(somePath); return (xpd != null && xpd.userDidVote(myUser)); }