Skip to content

Commit

Permalink
Fix mismatch between the key-value pairs returned as part of view and…
Browse files Browse the repository at this point in the history
… get-configuration call.
  • Loading branch information
varshavaradarajan committed Jul 17, 2017
1 parent f41515f commit 21297b3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/com/tw/go/plugin/EmailNotificationPluginImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ private GoPluginApiResponse handleGetPluginSettingsConfiguration() {
response.put(PLUGIN_SETTINGS_SENDER_EMAIL_ID, createField("Sender Email ID", null, true, false, "3"));
response.put(PLUGIN_SETTINGS_SMTP_USERNAME, createField("SMTP Username", null, true, false, "4"));
response.put(PLUGIN_SETTINGS_SENDER_PASSWORD, createField("Sender Password", null, true, true, "5"));
response.put(PLUGIN_SETTINGS_FILTER, createField("Pipeline/Stage/Status filter", null, false, false, "6"));
response.put(PLUGIN_SETTINGS_RECEIVER_EMAIL_ID, createField("Receiver Email-id", null, true, false, "6"));
response.put(PLUGIN_SETTINGS_FILTER, createField("Pipeline/Stage/Status filter", null, false, false, "7"));
return renderJSON(SUCCESS_RESPONSE_CODE, response);
}

Expand Down Expand Up @@ -228,6 +229,13 @@ public void validate(Map<String, Object> fieldValidation) {
}
});

validate(response, new FieldValidator() {
@Override
public void validate(Map<String, Object> fieldValidation) {
validateRequiredField(configuration, fieldValidation, PLUGIN_SETTINGS_RECEIVER_EMAIL_ID, "Receiver Email-id");
}
});

return renderJSON(SUCCESS_RESPONSE_CODE, response);
}

Expand Down

0 comments on commit 21297b3

Please sign in to comment.