Make edit summaries mandatory
This commit is contained in:
parent
2d549b79f1
commit
5fda43a5c7
@ -35,19 +35,23 @@ PerformEditsDialog.launch = function(logged_in_username, max_severity) {
|
||||
elmts.performEditsButton.prop("disabled",true).addClass("button-disabled");
|
||||
} else {
|
||||
elmts.performEditsButton.click(function() {
|
||||
Refine.postProcess(
|
||||
"wikidata",
|
||||
"perform-wikibase-edits",
|
||||
{},
|
||||
{
|
||||
summary: elmts.editSummary.val(),
|
||||
},
|
||||
{ includeEngine: true, cellsChanged: true, columnStatsChanged: true },
|
||||
{ onDone:
|
||||
function() {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
if(elmts.editSummary.val().length == 0) {
|
||||
elmts.editSummary.focus();
|
||||
} else {
|
||||
Refine.postProcess(
|
||||
"wikidata",
|
||||
"perform-wikibase-edits",
|
||||
{},
|
||||
{
|
||||
summary: elmts.editSummary.val(),
|
||||
},
|
||||
{ includeEngine: true, cellsChanged: true, columnStatsChanged: true },
|
||||
{ onDone:
|
||||
function() {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -30,6 +30,7 @@ import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONWriter;
|
||||
@ -66,9 +67,9 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation {
|
||||
|
||||
public PerformWikibaseEditsOperation(JSONObject engineConfig, String summary) {
|
||||
super(engineConfig);
|
||||
Validate.notNull(summary, "An edit summary must be provided.");
|
||||
Validate.notEmpty(summary, "An edit summary must be provided.");
|
||||
this.summary = summary;
|
||||
|
||||
// getEngine(request, project);
|
||||
}
|
||||
|
||||
static public AbstractOperation reconstruct(Project project, JSONObject obj)
|
||||
|
@ -55,6 +55,11 @@ public class PerformWikibaseEditsOperationTest extends OperationTest {
|
||||
throws Exception {
|
||||
return TestingData.jsonFromFile("data/operations/perform-edits.json");
|
||||
}
|
||||
|
||||
@Test(expectedExceptions=IllegalArgumentException.class)
|
||||
public void testConstructor() {
|
||||
new PerformWikibaseEditsOperation(new JSONObject("{}"), "");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadChange()
|
||||
|
Loading…
Reference in New Issue
Block a user