Remove handling of change.allowDrafts

This setting applied to the Draft Workflow (draft patch sets), removed
in 2.15 (not to be confused with Draft Comments, which still exist).

Change-Id: Ibc413d7df2e8b28c30f29324c6fb39ab2ca0f007
This commit is contained in:
Matthew Webber 2018-02-21 13:20:29 +00:00
parent e6b2d13110
commit dbb5c72e7c
6 changed files with 0 additions and 17 deletions

View File

@ -54,7 +54,6 @@ public class ServerInfoIT extends AbstractDaemonTest {
@GerritConfig(name = "auth.httpPasswordUrl", value = "https://example.com/password")
// change
@GerritConfig(name = "change.allowDrafts", value = "false")
@GerritConfig(name = "change.largeChange", value = "300")
@GerritConfig(name = "change.replyTooltip", value = "Publish votes and draft comments")
@GerritConfig(name = "change.replyLabel", value = "Vote")
@ -99,7 +98,6 @@ public class ServerInfoIT extends AbstractDaemonTest {
assertThat(i.auth.httpPasswordUrl).isNull();
// change
assertThat(i.change.allowDrafts).isNull();
assertThat(i.change.largeChange).isEqualTo(300);
assertThat(i.change.replyTooltip).startsWith("Publish votes and draft comments");
assertThat(i.change.replyLabel).isEqualTo("Vote\u2026");
@ -173,7 +171,6 @@ public class ServerInfoIT extends AbstractDaemonTest {
assertThat(i.auth.httpPasswordUrl).isNull();
// change
assertThat(i.change.allowDrafts).isTrue();
assertThat(i.change.largeChange).isEqualTo(500);
assertThat(i.change.replyTooltip).startsWith("Reply and score");
assertThat(i.change.replyLabel).isEqualTo("Reply\u2026");

View File

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

View File

@ -60,8 +60,6 @@ public class ServerInfo extends JavaScriptObject {
protected ServerInfo() {}
public static class ChangeConfigInfo extends JavaScriptObject {
public final native boolean allowDrafts() /*-{ return this.allow_drafts || false; }-*/;
public final native boolean allowBlame() /*-{ return this.allow_blame || false; }-*/;
public final native int largeChange() /*-{ return this.large_change || 0; }-*/;

View File

@ -38,15 +38,10 @@ import java.io.IOException;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.revwalk.RevWalk;
class DeleteChangeOp implements BatchUpdateOp {
static boolean allowDrafts(Config cfg) {
return cfg.getBoolean("change", "allowDrafts", true);
}
static ReviewDb unwrap(ReviewDb db) {
// This is special. We want to delete exactly the rows that are present in
// the database, even when reading everything else from NoteDb, so we need

View File

@ -222,7 +222,6 @@ public class GetServerInfo implements RestReadView<ConfigResource> {
private ChangeConfigInfo getChangeInfo(Config cfg) {
ChangeConfigInfo info = new ChangeConfigInfo();
info.allowBlame = toBoolean(cfg.getBoolean("change", "allowBlame", true));
info.allowDrafts = toBoolean(cfg.getBoolean("change", "allowDrafts", true));
boolean hasAssigneeInIndex =
indexes.getSearchIndex().getSchema().hasField(ChangeField.ASSIGNEE);
info.showAssigneeInChangesTable =

View File

@ -217,7 +217,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
final Provider<ReviewDb> db;
final StarredChangesUtil starredChangesUtil;
final SubmitDryRun submitDryRun;
final boolean allowsDrafts;
private final Provider<CurrentUser> self;
@ -281,7 +280,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
listMembers,
starredChangesUtil,
accountCache,
cfg == null ? true : cfg.getBoolean("change", "allowDrafts", true),
notesMigration);
}
@ -313,7 +311,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
Provider<ListMembers> listMembers,
StarredChangesUtil starredChangesUtil,
AccountCache accountCache,
boolean allowsDrafts,
NotesMigration notesMigration) {
this.db = db;
this.queryProvider = queryProvider;
@ -341,7 +338,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
this.listMembers = listMembers;
this.starredChangesUtil = starredChangesUtil;
this.accountCache = accountCache;
this.allowsDrafts = allowsDrafts;
this.hasOperands = hasOperands;
this.notesMigration = notesMigration;
}
@ -375,7 +371,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
listMembers,
starredChangesUtil,
accountCache,
allowsDrafts,
notesMigration);
}