HomePhabricator

Add gr-endpoint-slot to enhance decorate endpoint

Authored by Tao Zhou <taoalpha@google.com> on Jun 5 2020, 7:35 PM.

Description

Add gr-endpoint-slot to enhance decorate endpoint

This will allow gerrit to provide more granualar control over where
plugin's component should register to.

As an example:

<gr-endpoint-decorator name="some-endpoint">
  <h3>
     header
    <gr-endpoint-slot name="sub-header"></gr-endpoint-slot>
  <h3>
  <section>
      // some other content
  </section>
  <gr-endpoint-slot name="footer">
</gr-endpoint-decorator>
// plugin to provide either or both slots
plugin.registerCustomComponent(
  'some-endpoint',
  'some-module',
  {slot: 'sub-header'}
);
plugin.registerCustomComponent(
  'some-endpoint',
  'some-other-module',
  {slot: 'footer'}
);

Now a plugin can register with one some-endpoint with two components
and have them in a controllable place.

When slot not provided or not defined, will fallback to old behavior:
append to the endpoint-decorator.

Change-Id: I2fe1852d3e9d94db14e570f42729709ceadc3761

Event Timeline