Merge "Set reflectToAttribute for name on gr-endpoint-param"
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-builder/gr-diff-builder-image.ts b/polygerrit-ui/app/elements/diff/gr-diff-builder/gr-diff-builder-image.ts
index f3de371..15264ea 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-builder/gr-diff-builder-image.ts
+++ b/polygerrit-ui/app/elements/diff/gr-diff-builder/gr-diff-builder-image.ts
@@ -52,8 +52,7 @@
// TODO(kaspern): Support blame for image diffs and remove the hardcoded 4
// column limit.
td.setAttribute('colspan', '4');
- const endpoint = this._createElement('gr-endpoint-decorator');
- const endpointDomApi = endpoint;
+ const endpointDomApi = this._createElement('gr-endpoint-decorator');
endpointDomApi.setAttribute('name', 'image-diff');
endpointDomApi.appendChild(
this._createEndpointParam('baseImage', this._baseImage)
@@ -61,7 +60,7 @@
endpointDomApi.appendChild(
this._createEndpointParam('revisionImage', this._revisionImage)
);
- td.appendChild(endpoint);
+ td.appendChild(endpointDomApi);
tr.appendChild(td);
tbody.appendChild(tr);
return tbody;
diff --git a/polygerrit-ui/app/elements/plugins/gr-endpoint-decorator/gr-endpoint-decorator.ts b/polygerrit-ui/app/elements/plugins/gr-endpoint-decorator/gr-endpoint-decorator.ts
index 674297d..3a83729 100644
--- a/polygerrit-ui/app/elements/plugins/gr-endpoint-decorator/gr-endpoint-decorator.ts
+++ b/polygerrit-ui/app/elements/plugins/gr-endpoint-decorator/gr-endpoint-decorator.ts
@@ -114,6 +114,7 @@
}
const expectProperties = this._getEndpointParams().map(paramEl => {
const helper = plugin.attributeHelper(paramEl);
+ // TODO: this should be replaced by accessing the property directly
const paramName = paramEl.getAttribute('name');
if (!paramName) throw Error('plugin endpoint parameter missing a name');
return helper
diff --git a/polygerrit-ui/app/elements/plugins/gr-endpoint-param/gr-endpoint-param.ts b/polygerrit-ui/app/elements/plugins/gr-endpoint-param/gr-endpoint-param.ts
index 41964d5..9e9f348 100644
--- a/polygerrit-ui/app/elements/plugins/gr-endpoint-param/gr-endpoint-param.ts
+++ b/polygerrit-ui/app/elements/plugins/gr-endpoint-param/gr-endpoint-param.ts
@@ -29,7 +29,7 @@
export class GrEndpointParam extends GestureEventListeners(
LegacyElementMixin(PolymerElement)
) {
- @property({type: String})
+ @property({type: String, reflectToAttribute: true})
name = '';
@property({