Revert "Add committer warner"
This reverts commit 809bbb175f39a4c9767735ba92188f174a339c36.
Reason for revert:
Using innerHTML is not supported, and this blocks import
of chromium-behavior into google.
Change-Id: Id8003f990e6613abc38c082e44d5898cacdf843b
diff --git a/src/main/resources/static/chromium-behavior.js b/src/main/resources/static/chromium-behavior.js
index 2cd1cab..4809ef7 100644
--- a/src/main/resources/static/chromium-behavior.js
+++ b/src/main/resources/static/chromium-behavior.js
@@ -12,16 +12,12 @@
import {installLgtmWatcher} from './lgtm-catcher.js';
import {maybeInstallReland} from './reland-button.js';
import {warnAboutTbr} from './tbr-warner.js';
-import {maybeInstallCommitterWarning} from './committer-warner.js';
Gerrit.install((plugin) => {
const chopsBanner = new ChopsBanner(window.location.host);
plugin.hook('banner').onAttached((el) => {
chopsBanner.register(el);
});
- plugin.hook('change-metadata-item').onAttached((el) => {
- maybeInstallCommitterWarning(el);
- });
let onConfirmRevertChange, onRevert, onPostRevert;
if (window.location.host === 'skia-review.googlesource.com') {
diff --git a/src/main/resources/static/committer-warner.js b/src/main/resources/static/committer-warner.js
deleted file mode 100644
index 0e3f89a..0000000
--- a/src/main/resources/static/committer-warner.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import {STATUS_SUBMITTED} from './common.js';
-
-const COMMITTER_WARNER_STYLES = {
- styleContainer:
- 'display: inline-block;' +
- 'width: 100%;' +
- 'padding-top: var(--spacing-l);' +
- 'padding-left: var(--metadata-horizontal-padding);' +
- 'padding-bottom: var(--spacing-l);',
-};
-
-/**
- * Adds a committer warning to the page if appropriate.
- * @param {element} element: the change-metadata-item element.
- */
-export async function maybeInstallCommitterWarning(element) {
- if (element.change.status === STATUS_SUBMITTED) {
- return;
- }
-
- if (element.revision.commit.author.email ===
- element.revision.commit.committer.email) {
- return;
- }
-
- const message = "Author and Committer are different";
- installCommitterWarning(element, message);
-}
-
-/**
- * Adds a committer warning to the page.
- * @param {element} element: the element object
- * @param {string} message: the message for the current change
- */
-function installCommitterWarning(element, message) {
- element.innerHTML = `
- <div style="${COMMITTER_WARNER_STYLES.styleContainer}">
- <span><span style='color:red; font-weight: bold'>⚠</span> ${message}</span>
- </div>
- `;
-}