Rewrite UI plugin action description API
Using methods on an interface that plugins/extensions implement makes for a very brittle API. We cannot safely add a new method without breaking all existing code or introducing another interface for plugins to implement. Change the UI action description to be a single method interface that returns an instance of a concrete description object. Plugins can populate the fields they know about and need for their use case, and the server will do its best to honor what the plugin has given. New methods can be added to the description without affecting the API versioning, enabling Gerrit to add more features in the future. The confirmation message feature has been removed. In the near future plugins will have the ability to register JavaScript code to be executed client-side when the button is activated and before the RPC is started. This will allow plugins to perform more custom logic, such as obtaining additional input. Looking even further ahead plugins may register their own JS handler to render a button, allowing the plugin to use a more complex widget. The UiAction.Description type may need to be extended to allow server side view code to pass custom data to the UI rendering logic. Change-Id: If5e0e6b42d6d1e8a111a2d304ce54b9d8834688a
This commit is contained in:
@@ -21,5 +21,4 @@ public class UiCommandDetail {
|
||||
public String label;
|
||||
public String title;
|
||||
public boolean enabled;
|
||||
public String confirmationMessage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user