Add frontend code for email format user preference

This change adds all required frontend code for both GWT UI and
Polygerrit as well as docs for the user preferenced introduced by
Change I190644732.

Feature: Issue 5349
Change-Id: I94353380fbd5208cebb7fe8946fb4c4100c8d054
This commit is contained in:
Patrick Hiesel
2017-02-27 16:26:33 +01:00
parent d64dd9968c
commit 006578f7da
8 changed files with 75 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat;
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase;
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView;
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand;
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailFormat;
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy;
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.ReviewCategoryStrategy;
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat;
@@ -52,6 +53,7 @@ public class GeneralPreferences extends JavaScriptObject {
p.legacycidInChangeTable(d.legacycidInChangeTable);
p.muteCommonPathPrefixes(d.muteCommonPathPrefixes);
p.signedOffBy(d.signedOffBy);
p.emailFormat(d.emailFormat);
p.reviewCategoryStrategy(d.getReviewCategoryStrategy());
p.diffView(d.getDiffView());
p.emailStrategy(d.emailStrategy);
@@ -132,6 +134,13 @@ public class GeneralPreferences extends JavaScriptObject {
private native String emailStrategyRaw() /*-{ return this.email_strategy }-*/;
public final EmailFormat emailFormat() {
String s = emailFormatRaw();
return s != null ? EmailFormat.valueOf(s) : null;
}
private native String emailFormatRaw() /*-{ return this.email_format }-*/;
public final DefaultBase defaultBaseForMerges() {
String s = defaultBaseForMergesRaw();
return s != null ? DefaultBase.valueOf(s) : null;
@@ -203,6 +212,12 @@ public class GeneralPreferences extends JavaScriptObject {
private native void emailStrategyRaw(String s) /*-{ this.email_strategy = s }-*/;
public final void emailFormat(EmailFormat f) {
emailFormatRaw(f != null ? f.toString() : null);
}
private native void emailFormatRaw(String s) /*-{ this.email_format = s }-*/;
public final void defaultBaseForMerges(DefaultBase b) {
defaultBaseForMergesRaw(b != null ? b.toString() : null);
}