ChangeScreen2: add Gerrit config and user preference

Now gerrit.changeScreen can be set in gerrit.config to select which
UI is presented: OLD_UI for the legacy view, and CHANGE_SCREEN2 for
the new UI. The current default is OLD_UI but this is expected to
change in the future before the old UI is deleted.

A per user preference can be used to switch the screen.

Started-by: David Ostrovsky <david@ostrovsky.org>
Change-Id: I340efe7ff264a534cb9a83609bbc63621e2b60c1
This commit is contained in:
Shawn Pearce
2013-09-24 12:13:50 -07:00
parent 0672a19c54
commit 6d731f5c6d
31 changed files with 162 additions and 58 deletions

View File

@@ -17,6 +17,7 @@ package com.google.gerrit.httpd;
import com.google.gerrit.common.data.GerritConfig;
import com.google.gerrit.common.data.GitwebConfig;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences;
import com.google.gerrit.server.account.Realm;
import com.google.gerrit.server.config.AllProjectsName;
import com.google.gerrit.server.config.AnonymousCowardName;
@@ -124,6 +125,9 @@ class GerritConfigProvider implements Provider<GerritConfig> {
config.setSuggestFrom(cfg.getInt("suggest", "from", 0));
config.setChangeUpdateDelay((int) ConfigUtil.getTimeUnit(
cfg, "change", null, "updateDelay", 30, TimeUnit.SECONDS));
config.setChangeScreen(cfg.getEnum(
"gerrit", null, "changeScreen",
AccountGeneralPreferences.ChangeScreen.OLD_UI));
config.setReportBugUrl(cfg.getString("gerrit", null, "reportBugUrl"));
if (config.getReportBugUrl() == null) {