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:
parent
e6b2d13110
commit
dbb5c72e7c
@ -54,7 +54,6 @@ public class ServerInfoIT extends AbstractDaemonTest {
|
|||||||
@GerritConfig(name = "auth.httpPasswordUrl", value = "https://example.com/password")
|
@GerritConfig(name = "auth.httpPasswordUrl", value = "https://example.com/password")
|
||||||
|
|
||||||
// change
|
// change
|
||||||
@GerritConfig(name = "change.allowDrafts", value = "false")
|
|
||||||
@GerritConfig(name = "change.largeChange", value = "300")
|
@GerritConfig(name = "change.largeChange", value = "300")
|
||||||
@GerritConfig(name = "change.replyTooltip", value = "Publish votes and draft comments")
|
@GerritConfig(name = "change.replyTooltip", value = "Publish votes and draft comments")
|
||||||
@GerritConfig(name = "change.replyLabel", value = "Vote")
|
@GerritConfig(name = "change.replyLabel", value = "Vote")
|
||||||
@ -99,7 +98,6 @@ public class ServerInfoIT extends AbstractDaemonTest {
|
|||||||
assertThat(i.auth.httpPasswordUrl).isNull();
|
assertThat(i.auth.httpPasswordUrl).isNull();
|
||||||
|
|
||||||
// change
|
// change
|
||||||
assertThat(i.change.allowDrafts).isNull();
|
|
||||||
assertThat(i.change.largeChange).isEqualTo(300);
|
assertThat(i.change.largeChange).isEqualTo(300);
|
||||||
assertThat(i.change.replyTooltip).startsWith("Publish votes and draft comments");
|
assertThat(i.change.replyTooltip).startsWith("Publish votes and draft comments");
|
||||||
assertThat(i.change.replyLabel).isEqualTo("Vote\u2026");
|
assertThat(i.change.replyLabel).isEqualTo("Vote\u2026");
|
||||||
@ -173,7 +171,6 @@ public class ServerInfoIT extends AbstractDaemonTest {
|
|||||||
assertThat(i.auth.httpPasswordUrl).isNull();
|
assertThat(i.auth.httpPasswordUrl).isNull();
|
||||||
|
|
||||||
// change
|
// change
|
||||||
assertThat(i.change.allowDrafts).isTrue();
|
|
||||||
assertThat(i.change.largeChange).isEqualTo(500);
|
assertThat(i.change.largeChange).isEqualTo(500);
|
||||||
assertThat(i.change.replyTooltip).startsWith("Reply and score");
|
assertThat(i.change.replyTooltip).startsWith("Reply and score");
|
||||||
assertThat(i.change.replyLabel).isEqualTo("Reply\u2026");
|
assertThat(i.change.replyLabel).isEqualTo("Reply\u2026");
|
||||||
|
@ -17,7 +17,6 @@ package com.google.gerrit.extensions.common;
|
|||||||
public class ChangeConfigInfo {
|
public class ChangeConfigInfo {
|
||||||
public Boolean allowBlame;
|
public Boolean allowBlame;
|
||||||
public Boolean showAssigneeInChangesTable;
|
public Boolean showAssigneeInChangesTable;
|
||||||
public Boolean allowDrafts;
|
|
||||||
public Boolean disablePrivateChanges;
|
public Boolean disablePrivateChanges;
|
||||||
public int largeChange;
|
public int largeChange;
|
||||||
public String replyLabel;
|
public String replyLabel;
|
||||||
|
@ -60,8 +60,6 @@ public class ServerInfo extends JavaScriptObject {
|
|||||||
protected ServerInfo() {}
|
protected ServerInfo() {}
|
||||||
|
|
||||||
public static class ChangeConfigInfo extends JavaScriptObject {
|
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 boolean allowBlame() /*-{ return this.allow_blame || false; }-*/;
|
||||||
|
|
||||||
public final native int largeChange() /*-{ return this.large_change || 0; }-*/;
|
public final native int largeChange() /*-{ return this.large_change || 0; }-*/;
|
||||||
|
@ -38,15 +38,10 @@ import java.io.IOException;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.eclipse.jgit.lib.Config;
|
|
||||||
import org.eclipse.jgit.lib.ObjectId;
|
import org.eclipse.jgit.lib.ObjectId;
|
||||||
import org.eclipse.jgit.revwalk.RevWalk;
|
import org.eclipse.jgit.revwalk.RevWalk;
|
||||||
|
|
||||||
class DeleteChangeOp implements BatchUpdateOp {
|
class DeleteChangeOp implements BatchUpdateOp {
|
||||||
static boolean allowDrafts(Config cfg) {
|
|
||||||
return cfg.getBoolean("change", "allowDrafts", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ReviewDb unwrap(ReviewDb db) {
|
static ReviewDb unwrap(ReviewDb db) {
|
||||||
// This is special. We want to delete exactly the rows that are present in
|
// 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
|
// the database, even when reading everything else from NoteDb, so we need
|
||||||
|
@ -222,7 +222,6 @@ public class GetServerInfo implements RestReadView<ConfigResource> {
|
|||||||
private ChangeConfigInfo getChangeInfo(Config cfg) {
|
private ChangeConfigInfo getChangeInfo(Config cfg) {
|
||||||
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));
|
|
||||||
boolean hasAssigneeInIndex =
|
boolean hasAssigneeInIndex =
|
||||||
indexes.getSearchIndex().getSchema().hasField(ChangeField.ASSIGNEE);
|
indexes.getSearchIndex().getSchema().hasField(ChangeField.ASSIGNEE);
|
||||||
info.showAssigneeInChangesTable =
|
info.showAssigneeInChangesTable =
|
||||||
|
@ -217,7 +217,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
|
|||||||
final Provider<ReviewDb> db;
|
final Provider<ReviewDb> db;
|
||||||
final StarredChangesUtil starredChangesUtil;
|
final StarredChangesUtil starredChangesUtil;
|
||||||
final SubmitDryRun submitDryRun;
|
final SubmitDryRun submitDryRun;
|
||||||
final boolean allowsDrafts;
|
|
||||||
|
|
||||||
private final Provider<CurrentUser> self;
|
private final Provider<CurrentUser> self;
|
||||||
|
|
||||||
@ -281,7 +280,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
|
|||||||
listMembers,
|
listMembers,
|
||||||
starredChangesUtil,
|
starredChangesUtil,
|
||||||
accountCache,
|
accountCache,
|
||||||
cfg == null ? true : cfg.getBoolean("change", "allowDrafts", true),
|
|
||||||
notesMigration);
|
notesMigration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,7 +311,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
|
|||||||
Provider<ListMembers> listMembers,
|
Provider<ListMembers> listMembers,
|
||||||
StarredChangesUtil starredChangesUtil,
|
StarredChangesUtil starredChangesUtil,
|
||||||
AccountCache accountCache,
|
AccountCache accountCache,
|
||||||
boolean allowsDrafts,
|
|
||||||
NotesMigration notesMigration) {
|
NotesMigration notesMigration) {
|
||||||
this.db = db;
|
this.db = db;
|
||||||
this.queryProvider = queryProvider;
|
this.queryProvider = queryProvider;
|
||||||
@ -341,7 +338,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
|
|||||||
this.listMembers = listMembers;
|
this.listMembers = listMembers;
|
||||||
this.starredChangesUtil = starredChangesUtil;
|
this.starredChangesUtil = starredChangesUtil;
|
||||||
this.accountCache = accountCache;
|
this.accountCache = accountCache;
|
||||||
this.allowsDrafts = allowsDrafts;
|
|
||||||
this.hasOperands = hasOperands;
|
this.hasOperands = hasOperands;
|
||||||
this.notesMigration = notesMigration;
|
this.notesMigration = notesMigration;
|
||||||
}
|
}
|
||||||
@ -375,7 +371,6 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
|
|||||||
listMembers,
|
listMembers,
|
||||||
starredChangesUtil,
|
starredChangesUtil,
|
||||||
accountCache,
|
accountCache,
|
||||||
allowsDrafts,
|
|
||||||
notesMigration);
|
notesMigration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user