Make a magic constant for the Submit approval category
This category has special meaning to Gerrit as it triggers magic code in the change workflow. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -20,6 +20,10 @@ import com.google.gwtorm.client.StringKey;
|
||||
|
||||
/** Types of approvals that can be associated with a {@link Change}. */
|
||||
public final class ApprovalCategory {
|
||||
/** Id of the special "Submit" action (and category). */
|
||||
public static final ApprovalCategory.Id SUBMIT =
|
||||
new ApprovalCategory.Id("SUBM");
|
||||
|
||||
public static class Id extends StringKey<Key<?>> {
|
||||
@Column(length = 4)
|
||||
protected String id;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ImportGerrit1 {
|
||||
try {
|
||||
verifyCategory = db.approvalCategories().byName("Verified");
|
||||
approveCategory = db.approvalCategories().byName("Code Review");
|
||||
submitCategory = db.approvalCategories().byName("Submit");
|
||||
submitCategory = db.approvalCategories().get(ApprovalCategory.SUBMIT);
|
||||
|
||||
final Statement query = sql.createStatement();
|
||||
java.sql.ResultSet srcs;
|
||||
|
||||
@@ -232,7 +232,7 @@ public class GerritServer {
|
||||
final ApprovalCategory cat;
|
||||
final ArrayList<ApprovalCategoryValue> vals;
|
||||
|
||||
cat = new ApprovalCategory(new ApprovalCategory.Id("SUBM"), "Submit");
|
||||
cat = new ApprovalCategory(ApprovalCategory.SUBMIT, "Submit");
|
||||
cat.setPosition((short) -1);
|
||||
vals = new ArrayList<ApprovalCategoryValue>();
|
||||
vals.add(value(cat, 1, "Submit"));
|
||||
|
||||
Reference in New Issue
Block a user