Allow modifying project config values on save
Upon saving the changes to a project config, allow modification of the values that were entered before the result is committed. This is useful for plugins which need to validate or change the entered configuration values before they are saved. For example, a plugin may require the value to be saved as encrypted text in the configuration file. This feature would allow the user to input their value in plain text, and the plugin may override this method to take care of the encryption. Once the changes are saved, the updated value(s) are shown in the project config field(s). Change-Id: I54301b132f421665531ff41643b18933fdbb127c
This commit is contained in:
@@ -240,6 +240,8 @@ public class PutConfig implements RestModifyView<ProjectResource, Input> {
|
||||
if (!value.equals(oldValue)) {
|
||||
validateProjectConfigEntryIsEditable(projectConfigEntry,
|
||||
projectState, e.getKey(), pluginName);
|
||||
v.setValue(projectConfigEntry.preUpdate(v.getValue()));
|
||||
value = v.getValue().value;
|
||||
try {
|
||||
switch (projectConfigEntry.getType()) {
|
||||
case BOOLEAN:
|
||||
|
||||
Reference in New Issue
Block a user