From 73789218ab7d2dc59da885122ba17f87144b3094 Mon Sep 17 00:00:00 2001 From: Viktar Donich Date: Thu, 16 Nov 2017 12:42:22 -0800 Subject: [PATCH] Pass ChangeInfo to change-metadata-item plugin endpoint This grants access for plugin-provided elements to the currently displayed change. Change-Id: Ie3b0ef1ab2ab6bb9e4eb8c26c5a3e73e271c642e --- Documentation/pg-plugin-endpoints.txt | 26 +++++++++++++++++-- .../gr-change-metadata.html | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Documentation/pg-plugin-endpoints.txt b/Documentation/pg-plugin-endpoints.txt index 45c6e72676..8ae25fd344 100644 --- a/Documentation/pg-plugin-endpoints.txt +++ b/Documentation/pg-plugin-endpoints.txt @@ -1,7 +1,5 @@ = Gerrit Code Review - PolyGerrit Plugin Styling -== Plugin endpoints - Plugin should be html-based and imported following PolyGerrit's link:pg-plugin-dev.html#loading[dev guide]. @@ -20,6 +18,23 @@ Gerrit.install(plugin => { }); ``` +== Default parameters +All endpoints receive the following params, set as attributes to custom components +that are instantiated at the endpoint: + +* `plugin` ++ +the current plugin instance, the one that is used by `Gerrit.install()`. + +* `content` ++ +decorated DOM Element, is only set for registrations that decorate existing +components. + +== Plugin endpoints + +Following endpoints are available to plugins + === change-view-integration Extension point is located between `Files` and `Messages` section on the change view page, and it may take full page's width. Primary purpose is to enable @@ -30,3 +45,10 @@ Extension point is located on the bottom of the change view left panel, under `Label Status` and `Links` sections. It's width is equal to the left panel's and primary purpose is to enable plugins to add sections of metadata to the left panel. + +In addition to default parameters, the following are available: + +* `change` ++ +current change displayed, an instance of +link:rest-api-changes.html#change-info[ChangeInfo] diff --git a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.html b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.html index eff4345ef8..936b284f58 100644 --- a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.html +++ b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.html @@ -329,6 +329,7 @@ limitations under the License. +