diff options
-rw-r--r-- | Documentation/dev-plugins.txt | 34 | ||||
-rw-r--r-- | java/com/google/gerrit/extensions/api/changes/HashtagsInput.java | 5 | ||||
-rw-r--r-- | polygerrit-ui/app/elements/settings/gr-identities/gr-identities.html | 74 |
3 files changed, 47 insertions, 66 deletions
diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt index c8ea869dc5..e2925498e7 100644 --- a/Documentation/dev-plugins.txt +++ b/Documentation/dev-plugins.txt @@ -2451,40 +2451,6 @@ command can be used. Disabled plugins can be re-enabled using the link:cmd-plugin-enable.html[plugin enable] command. -== Known issues and bugs - -=== Error handling in UI when using the REST API - -When a plugin invokes a REST endpoint in the UI, it provides an -`AsyncCallback` to handle the result. At the moment the -`onFailure(Throwable)` of the callback is never invoked, even if there -is an error. Errors are always handled by the Gerrit core UI which -shows the error dialog. This means currently plugins cannot do any -error handling and e.g. ignore expected errors. - -In the following example the REST endpoint would return '404 Not -Found' if the user has no username and the Gerrit core UI would -display an error dialog for this. However having no username is -not an error and the plugin may like to handle this case. - -[source,java] ----- -new RestApi("accounts").id("self").view("username") - .get(new AsyncCallback<NativeString>() { - - @Override - public void onSuccess(NativeString username) { - // TODO - } - - @Override - public void onFailure(Throwable caught) { - // never invoked - } -}); ----- - - [[reviewer-suggestion]] == Reviewer Suggestion Plugins diff --git a/java/com/google/gerrit/extensions/api/changes/HashtagsInput.java b/java/com/google/gerrit/extensions/api/changes/HashtagsInput.java index 8f66f127f1..bbc8a2e7ad 100644 --- a/java/com/google/gerrit/extensions/api/changes/HashtagsInput.java +++ b/java/com/google/gerrit/extensions/api/changes/HashtagsInput.java @@ -26,4 +26,9 @@ public class HashtagsInput { public HashtagsInput(Set<String> add) { this.add = add; } + + public HashtagsInput(Set<String> add, Set<String> remove) { + this(add); + this.remove = remove; + } } diff --git a/polygerrit-ui/app/elements/settings/gr-identities/gr-identities.html b/polygerrit-ui/app/elements/settings/gr-identities/gr-identities.html index be851b1415..a87661111f 100644 --- a/polygerrit-ui/app/elements/settings/gr-identities/gr-identities.html +++ b/polygerrit-ui/app/elements/settings/gr-identities/gr-identities.html @@ -27,8 +27,20 @@ limitations under the License. <template> <style include="shared-styles"></style> <style include="gr-form-styles"> - td { - width: 5em; + tr th.emailAddressHeader, + tr th.identityHeader { + width: 15em; + padding: 0 10px; + } + tr td.statusColumn, + tr td.emailAddressColumn, + tr td.identityColumn { + word-break: break-word; + } + tr td.emailAddressColumn, + tr td.identityColumn { + padding: 4px 10px; + width: 15em; } .deleteButton { float: right; @@ -36,40 +48,38 @@ limitations under the License. .deleteButton:not(.show) { display: none; } - .statusColumn { - white-space: nowrap; - } </style> <div class="gr-form-styles"> - <table id="identities"> - <thead> - <tr> - <th class="statusHeader">Status</th> - <th class="emailAddressHeader">Email Address</th> - <th class="identityHeader">Identity</th> - <th class="deleteHeader"></th> - </tr> - </thead> - <tbody> - <template is="dom-repeat" items="[[_identities]]" filter="filterIdentities"> + <fieldset> + <table> + <thead> <tr> - <td class$="statusColumn"> - [[_computeIsTrusted(item.trusted)]] - </td> - <td>[[item.email_address]]</td> - <td>[[_computeIdentity(item.identity)]]</td> - <td> - <gr-button - link - class$="deleteButton [[_computeHideDeleteClass(item.can_delete)]]" - on-tap="_handleDeleteItem"> - Delete - </gr-button> - </td> + <th class="statusHeader">Status</th> + <th class="emailAddressHeader">Email Address</th> + <th class="identityHeader">Identity</th> + <th class="deleteHeader"></th> </tr> - </template> - </tbody> - </table> + </thead> + <tbody> + <template is="dom-repeat" items="[[_identities]]" filter="filterIdentities"> + <tr> + <td class="statusColumn"> + [[_computeIsTrusted(item.trusted)]] + </td> + <td class="emailAddressColumn">[[item.email_address]]</td> + <td class="identityColumn">[[_computeIdentity(item.identity)]]</td> + <td class="deleteColumn"> + <gr-button + class$="deleteButton [[_computeHideDeleteClass(item.can_delete)]]" + on-tap="_handleDeleteItem"> + Delete + </gr-button> + </td> + </tr> + </template> + </tbody> + </table> + </fieldset> </div> <gr-overlay id="overlay" with-backdrop> <gr-confirm-delete-item-dialog |