Merge branch 'stable-2.14'

* stable-2.14:
  Leave assignee feature always enabled
  Hide assignee by default in Gerrit changes table

Change-Id: I7bc3b19ea72affe8417928e2ffed08de8d6e6dfb
This commit is contained in:
David Pursehouse
2017-04-10 19:58:18 +09:00
8 changed files with 16 additions and 23 deletions

View File

@@ -1028,12 +1028,12 @@ performance improvements by reducing the number of refs in the repo.
+ +
Default is true. Default is true.
[[change.showAssignee]]change.showAssignee:: [[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
+ +
Allow assignee workflow. If set to false, assignees will not be visible anywhere Show assignee field in changes table. If set to false, assignees will
in UI. not be visible in changes table.
+ +
Default is true. Default is false.
[[change.submitLabel]]change.submitLabel:: [[change.submitLabel]]change.submitLabel::
+ +

View File

@@ -16,7 +16,7 @@ package com.google.gerrit.extensions.common;
public class ChangeConfigInfo { public class ChangeConfigInfo {
public Boolean allowBlame; public Boolean allowBlame;
public Boolean showAssignee; public Boolean showAssigneeInChangesTable;
public Boolean allowDrafts; public Boolean allowDrafts;
public int largeChange; public int largeChange;
public String replyLabel; public String replyLabel;

View File

@@ -70,7 +70,7 @@ public class ServerInfo extends JavaScriptObject {
public final native String replyTooltip() /*-{ return this.reply_tooltip; }-*/; public final native String replyTooltip() /*-{ return this.reply_tooltip; }-*/;
public final native boolean showAssignee() /*-{ return this.show_assignee || false; }-*/; public final native boolean showAssigneeInChangesTable() /*-{ return this.show_assignee_in_changes_table || false; }-*/;
public final native int updateDelay() /*-{ return this.update_delay || 0; }-*/; public final native int updateDelay() /*-{ return this.update_delay || 0; }-*/;

View File

@@ -158,11 +158,9 @@ public class SearchSuggestOracle extends HighlightSuggestOracle {
suggestions.add("hashtag:"); suggestions.add("hashtag:");
} }
if (Gerrit.info().change().showAssignee()) {
suggestions.add("is:assigned"); suggestions.add("is:assigned");
suggestions.add("is:unassigned"); suggestions.add("is:unassigned");
suggestions.add("assignee:"); suggestions.add("assignee:");
}
suggestions.add("AND"); suggestions.add("AND");
suggestions.add("OR"); suggestions.add("OR");

View File

@@ -156,7 +156,6 @@ public class MyPreferencesScreen extends SettingsScreen {
dateTimePanel.add(timeFormat); dateTimePanel.add(timeFormat);
} }
highlightAssigneeInChangeTable = new CheckBox(Util.C.highlightAssigneeInChangeTable()); highlightAssigneeInChangeTable = new CheckBox(Util.C.highlightAssigneeInChangeTable());
highlightAssigneeInChangeTable.setEnabled(Gerrit.info().change().showAssignee());
relativeDateInChangeTable = new CheckBox(Util.C.showRelativeDateInChangeTable()); relativeDateInChangeTable = new CheckBox(Util.C.showRelativeDateInChangeTable());
sizeBarInChangeTable = new CheckBox(Util.C.showSizeBarInChangeTable()); sizeBarInChangeTable = new CheckBox(Util.C.showSizeBarInChangeTable());
legacycidInChangeTable = new CheckBox(Util.C.showLegacycidInChangeTable()); legacycidInChangeTable = new CheckBox(Util.C.showLegacycidInChangeTable());
@@ -290,7 +289,7 @@ public class MyPreferencesScreen extends SettingsScreen {
maximumPageSize.setEnabled(on); maximumPageSize.setEnabled(on);
dateFormat.setEnabled(on); dateFormat.setEnabled(on);
timeFormat.setEnabled(on); timeFormat.setEnabled(on);
highlightAssigneeInChangeTable.setEnabled(Gerrit.info().change().showAssignee()); highlightAssigneeInChangeTable.setEnabled(on);
relativeDateInChangeTable.setEnabled(on); relativeDateInChangeTable.setEnabled(on);
sizeBarInChangeTable.setEnabled(on); sizeBarInChangeTable.setEnabled(on);
legacycidInChangeTable.setEnabled(on); legacycidInChangeTable.setEnabled(on);

View File

@@ -1346,11 +1346,7 @@ public class ChangeScreen extends Screen {
commit.set(commentLinkProcessor, info, revision); commit.set(commentLinkProcessor, info, revision);
related.set(info, revision); related.set(info, revision);
reviewers.set(info); reviewers.set(info);
if (Gerrit.info().change().showAssignee()) {
assignee.set(info); assignee.set(info);
} else {
setVisible(assigneeRow, false);
}
if (Gerrit.isNoteDbEnabled()) { if (Gerrit.isNoteDbEnabled()) {
hashtags.set(info, revision); hashtags.set(info, revision);
} else { } else {

View File

@@ -80,7 +80,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
super(Util.C.changeItemHelp()); super(Util.C.changeItemHelp());
columns = BASE_COLUMNS; columns = BASE_COLUMNS;
labelNames = Collections.emptyList(); labelNames = Collections.emptyList();
showAssignee = Gerrit.info().change().showAssignee(); showAssignee = Gerrit.info().change().showAssigneeInChangesTable();
showLegacyId = Gerrit.getUserPreferences().legacycidInChangeTable(); showLegacyId = Gerrit.getUserPreferences().legacycidInChangeTable();
if (Gerrit.isSignedIn()) { if (Gerrit.isSignedIn()) {

View File

@@ -204,10 +204,10 @@ public class GetServerInfo implements RestReadView<ConfigResource> {
ChangeConfigInfo info = new ChangeConfigInfo(); ChangeConfigInfo info = new ChangeConfigInfo();
info.allowBlame = toBoolean(cfg.getBoolean("change", "allowBlame", true)); info.allowBlame = toBoolean(cfg.getBoolean("change", "allowBlame", true));
info.allowDrafts = toBoolean(cfg.getBoolean("change", "allowDrafts", true)); info.allowDrafts = toBoolean(cfg.getBoolean("change", "allowDrafts", true));
info.showAssignee = boolean hasAssigneeInIndex =
toBoolean( indexes.getSearchIndex().getSchema().hasField(ChangeField.ASSIGNEE);
cfg.getBoolean("change", "showAssignee", true) info.showAssigneeInChangesTable =
&& indexes.getSearchIndex().getSchema().hasField(ChangeField.ASSIGNEE)); toBoolean(cfg.getBoolean("change", "showAssigneeInChangesTable", false) && hasAssigneeInIndex);
info.largeChange = cfg.getInt("change", "largeChange", 500); info.largeChange = cfg.getInt("change", "largeChange", 500);
info.replyTooltip = info.replyTooltip =
Optional.ofNullable(cfg.getString("change", null, "replyTooltip")).orElse("Reply and score") Optional.ofNullable(cfg.getString("change", null, "replyTooltip")).orElse("Reply and score")