Revert "Add params to change-view-integration plugin endpoint"
This reverts commit 21f69bc9067123080457add66a699f09ce86fb10.
Reason for revert: This is breaking the build
Change-Id: I7d57184a5ebb38307e2437cae81544d4f3644317
diff --git a/Documentation/pg-plugin-endpoints.txt b/Documentation/pg-plugin-endpoints.txt
index 7c960dd..8ae25fd 100644
--- a/Documentation/pg-plugin-endpoints.txt
+++ b/Documentation/pg-plugin-endpoints.txt
@@ -40,16 +40,6 @@
view page, and it may take full page's width. Primary purpose is to enable
plugins to display custom CI related information (build status, etc).
-* `change`
-+
-current change displayed, an instance of
-link:rest-api-changes.html#change-info[ChangeInfo]
-
-* `revision`
-+
-current revision displayed, an instance of
-link:rest-api-changes.html#revision-info[RevisionInfo]
-
=== change-metadata-item
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
@@ -62,8 +52,3 @@
+
current change displayed, an instance of
link:rest-api-changes.html#change-info[ChangeInfo]
-
-* `revision`
-+
-current revision displayed, an instance of
-link:rest-api-changes.html#revision-info[RevisionInfo]
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 caf2fa3..936b284 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
@@ -19,7 +19,6 @@
<link rel="import" href="../../../styles/shared-styles.html">
<link rel="import" href="../../core/gr-navigation/gr-navigation.html">
<link rel="import" href="../../plugins/gr-endpoint-decorator/gr-endpoint-decorator.html">
-<link rel="import" href="../../plugins/gr-endpoint-param/gr-endpoint-param.html">
<link rel="import" href="../../plugins/gr-external-style/gr-external-style.html">
<link rel="import" href="../../shared/gr-account-chip/gr-account-chip.html">
<link rel="import" href="../../shared/gr-account-link/gr-account-link.html">
@@ -331,7 +330,6 @@
</section>
<gr-endpoint-decorator name="change-metadata-item">
<gr-endpoint-param name="change" value="[[change]]"></gr-endpoint-param>
- <gr-endpoint-param name="revision" value="[[currentRevision]]"></gr-endpoint-param>
</gr-endpoint-decorator>
</gr-external-style>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
diff --git a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.js b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.js
index 00b4c2a..db6c44c 100644
--- a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.js
+++ b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.js
@@ -37,8 +37,6 @@
properties: {
/** @type {?} */
change: Object,
- /** @type {?} */
- currentRevision: Object,
commitInfo: Object,
mutable: Boolean,
/**
diff --git a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata_test.html b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata_test.html
index 0b88f22..522d34e 100644
--- a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata_test.html
+++ b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata_test.html
@@ -38,9 +38,6 @@
setup(() => {
sandbox = sinon.sandbox.create();
- stub('gr-endpoint-decorator', {
- _import: sandbox.stub().returns(Promise.resolve()),
- });
stub('gr-rest-api-interface', {
getConfig() { return Promise.resolve({}); },
getLoggedIn() { return Promise.resolve(false); },
@@ -618,29 +615,5 @@
});
});
});
-
- suite('plugin endpoints', () => {
- test('endpoint params', done => {
- element.change = {labels: {}};
- element.currentRevision = {};
- let hookEl;
- let plugin;
- Gerrit.install(
- p => {
- plugin = p;
- plugin.hook('change-metadata-item').getLastAttached().then(
- el => hookEl = el);
- },
- '0.1',
- 'http://some/plugins/url.html');
- Gerrit._setPluginsCount(0);
- flush(() => {
- assert.strictEqual(hookEl.plugin, plugin);
- assert.strictEqual(hookEl.change, element.change);
- assert.strictEqual(hookEl.revision, element.currentRevision);
- done();
- });
- });
- });
});
</script>
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html
index 56548de..9e58204 100644
--- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html
+++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html
@@ -15,6 +15,7 @@
-->
<link rel="import" href="../../../bower_components/polymer/polymer.html">
+
<link rel="import" href="../../../behaviors/gr-patch-set-behavior/gr-patch-set-behavior.html">
<link rel="import" href="../../../behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.html">
<link rel="import" href="../../../behaviors/rest-client-behavior/rest-client-behavior.html">
@@ -24,7 +25,6 @@
<link rel="import" href="../../diff/gr-diff-preferences/gr-diff-preferences.html">
<link rel="import" href="../../edit/gr-edit-constants.html">
<link rel="import" href="../../plugins/gr-endpoint-decorator/gr-endpoint-decorator.html">
-<link rel="import" href="../../plugins/gr-endpoint-param/gr-endpoint-param.html">
<link rel="import" href="../../shared/gr-account-link/gr-account-link.html">
<link rel="import" href="../../shared/gr-button/gr-button.html">
<link rel="import" href="../../shared/gr-change-star/gr-change-star.html">
@@ -357,7 +357,6 @@
<div class="changeInfo-column changeMetadata hideOnMobileOverlay">
<gr-change-metadata
change="{{_change}}"
- revision="[[_currentRevision]]"
commit-info="[[_commitInfo]]"
server-config="[[_serverConfig]]"
mutable="[[_loggedIn]]"
@@ -487,10 +486,6 @@
on-reload-drafts="_reloadDraftsWithCallback"></gr-file-list>
</section>
<gr-endpoint-decorator name="change-view-integration">
- <gr-endpoint-param name="change" value="[[_change]]">
- </gr-endpoint-param>
- <gr-endpoint-param name="revision" value="[[_currentRevision]]">
- </gr-endpoint-param>
</gr-endpoint-decorator>
<gr-messages-list id="messageList"
class="hideOnMobileOverlay"
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
index 145c1f8..cd56752 100644
--- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
+++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
@@ -166,7 +166,6 @@
type: Boolean,
value: true,
},
- _currentRevision: Object,
_currentRevisionActions: Object,
_allPatchSets: {
type: Array,
@@ -984,7 +983,6 @@
parseInt(lineHeight.slice(0, lineHeight.length - 2), 10);
this._change = change;
- this._currentRevision = currentRevision;
if (!this._patchRange || !this._patchRange.patchNum ||
this.patchNumEquals(this._patchRange.patchNum,
currentRevision._number)) {
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_test.html b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_test.html
index ccdc50e..4a4cd5c 100644
--- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_test.html
+++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_test.html
@@ -49,11 +49,6 @@
setup(() => {
sandbox = sinon.sandbox.create();
- stub('gr-endpoint-decorator', {
- _import: sandbox.stub().returns(Promise.resolve()),
- });
- // Since _endpoints are global, must reset state.
- Gerrit._endpoints = new GrPluginEndpoints();
navigateToChangeStub = sandbox.stub(Gerrit.Nav, 'navigateToChange');
stub('gr-rest-api-interface', {
getConfig() { return Promise.resolve({test: 'config'}); },
@@ -1378,30 +1373,5 @@
assert.equal(Gerrit.Nav.getEditUrlForDiff.lastCall.args[1], 'foo');
assert.isTrue(Gerrit.Nav.navigateToRelativeUrl.called);
});
-
- suite('plugin endpoints', () => {
- test('endpoint params', done => {
- element._change = {labels: {}};
- element._currentRevision = {};
- let hookEl;
- let plugin;
- Gerrit.install(
- p => {
- plugin = p;
- plugin.hook('change-view-integration').getLastAttached().then(
- el => hookEl = el);
- },
- '0.1',
- 'http://some/plugins/url.html');
- Gerrit._setPluginsCount(0);
- flush(() => {
- assert.strictEqual(hookEl.plugin, plugin);
- assert.strictEqual(hookEl.change, element._change);
- assert.strictEqual(hookEl.revision, element._currentRevision);
- done();
- });
- });
- });
});
-
</script>