Allow plugins to define custom data in SubmitRequirement
Replace the raw short/long reasons of SubmitRequirement with a dynamic type and map, allowing for more powerful implementations later. Also remove the label field, superseeded by the data Map. Use AutoValues for the SubmitRequirement class, as it is marked GwtIncompatible. The idea behind this change is to provide a future proof API that both plugins and end users will enjoy. A user interface is being worked on, and will benefit of these changes. Change-Id: I030609cd164d308f2231a2abba2eb16b09524b7f
This commit is contained in:
@@ -261,9 +261,9 @@ public class EventFactory {
|
||||
sa.requirements = new ArrayList<>();
|
||||
for (SubmitRequirement req : submitRecord.requirements) {
|
||||
SubmitRequirementAttribute re = new SubmitRequirementAttribute();
|
||||
re.shortReason = req.shortReason();
|
||||
re.fullReason = req.fullReason();
|
||||
re.label = req.label().orElse(null);
|
||||
re.fallbackText = req.fallbackText();
|
||||
re.type = req.type();
|
||||
re.data = req.data();
|
||||
sa.requirements.add(re);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user