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.
[[change.showAssignee]]change.showAssignee::
[[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
+
Allow assignee workflow. If set to false, assignees will not be visible anywhere
in UI.
Show assignee field in changes table. If set to false, assignees will
not be visible in changes table.
+
Default is true.
Default is false.
[[change.submitLabel]]change.submitLabel::
+

View File

@@ -16,7 +16,7 @@ package com.google.gerrit.extensions.common;
public class ChangeConfigInfo {
public Boolean allowBlame;
public Boolean showAssignee;
public Boolean showAssigneeInChangesTable;
public Boolean allowDrafts;
public int largeChange;
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 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; }-*/;

View File

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

View File

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

View File

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

View File

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

View File

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