diff --git a/gr-checks/gr-checks-all-statuses.js b/gr-checks/gr-checks-all-statuses.js
deleted file mode 100644
index 2aaed0b..0000000
--- a/gr-checks/gr-checks-all-statuses.js
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** All statuses */
-export const Statuses = {
-  // non-terminal statuses
-  NOT_STARTED: 'NOT_STARTED',
-  SCHEDULED: 'SCHEDULED',
-  RUNNING: 'RUNNING',
-
-  // terminal statuses
-  SUCCESSFUL: 'SUCCESSFUL',
-  FAILED: 'FAILED',
-  NOT_RELEVANT: 'NOT_RELEVANT',
-
-  STATUS_UNKNOWN: 'UNKNOWN',
-};
-
-/**
- * @param {string} status
- * @param {Array<string>} includedStatuses
- * @returns {boolean}
- */
-function isStatus(status, includedStatuses) {
-  return includedStatuses.includes(status);
-}
-
-/**
- * @param {string} status
- * @returns {boolean} if status is Unevaluated.
- */
-export function isUnevaluated(status) {
-  return isStatus(status, [Statuses.NOT_STARTED]);
-}
-
-/**
- * @param {string} status
- * @returns {boolean} if status is Not Relevant
- */
-export function isNotRelevant(status) {
-  return isStatus(status, [Statuses.NOT_RELEVANT]);
-}
-
-/**
- * @param {string} status
- * @returns {boolean} if status is Scheduled.
- */
-export function isScheduled(status) {
-  return isStatus(status, [Statuses.SCHEDULED]);
-}
-
-/**
- * @param {string} status
- * @returns {boolean} if status is Running. */
-export function isRunning(status) {
-  return isStatus(status, [Statuses.RUNNING]);
-}
-
-/**
- * @param {string} status
- * @returns {boolean} if status is InProgress.
- */
-export function isInProgress(status) {
-  return isStatus(status, [Statuses.SCHEDULED, Statuses.RUNNING]);
-}
-
-/**
- * @param {string} status
- * @returns {boolean} if status is Successful.
- */
-export function isSuccessful(status) {
-  return isStatus(status, [Statuses.SUCCESSFUL]);
-}
-
-/**
- * @param {string} status
- * @returns {boolean} if status is Failed.
- */
-export function isFailed(status) {
-  return isStatus(status, [Statuses.FAILED]);
-}
-
-/**
- * @param {string} status
- * @returns {string} class of given status.
- */
-export function statusClass(status) {
-  if (isUnevaluated(status)) {
-    return 'unevaluated';
-  }
-  if (isInProgress(status)) {
-    return 'in-progress';
-  }
-  if (isSuccessful(status)) {
-    return 'successful';
-  }
-  if (isFailed(status)) {
-    return 'failed';
-  }
-  return 'unevaluated';
-}
\ No newline at end of file
diff --git a/gr-checks/gr-checks-change-list-header-view.js b/gr-checks/gr-checks-change-list-header-view.js
deleted file mode 100644
index 09d60c0..0000000
--- a/gr-checks/gr-checks-change-list-header-view.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-class GrChecksChangeListHeaderView extends Polymer.GestureEventListeners(
-    Polymer.LegacyElementMixin(
-        Polymer.Element)) {
-  /** @returns {string} name of the component */
-  static get is() { return 'gr-checks-change-list-header-view'; }
-
-  /** @returns {?} template for this component */
-  static get template() {
-    return Polymer.html`
-      <style>
-        :host {
-          display: table-cell;
-          padding: 0 3px;
-        }
-      </style>
-      Checks
-    `;
-  }
-}
-
-customElements.define(GrChecksChangeListHeaderView.is,
-    GrChecksChangeListHeaderView);
\ No newline at end of file
diff --git a/gr-checks/gr-checks-change-list-header-view_test.html b/gr-checks/gr-checks-change-list-header-view_test.html
deleted file mode 100644
index f4e964d..0000000
--- a/gr-checks/gr-checks-change-list-header-view_test.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
-<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
-<script src="../bower_components/web-component-tester/browser.js"></script>
-
-<title>gr-checks-change-list-header-view</title>
-
-<test-fixture id="basic">
-  <template>
-    <gr-checks-change-list-header-view></gr-checks-change-list-header-view>
-  </template>
-</test-fixture>
-
-<script type="module">
-  import '../test/common-test-setup.js';
-  import './gr-checks-change-list-header-view.js';
-  suite('gr-checks-change-list-header-view tests', () => {
-    let element;
-    let sandbox;
-
-    setup(done => {
-      sandbox = sinon.sandbox.create();
-
-      element = fixture('basic');
-      flush(done);
-    });
-
-    teardown(() => { sandbox.restore(); });
-
-    test('renders the header', () => {
-      assert.include(element.shadowRoot.textContent, 'Checks');
-    });
-  });
-</script>
diff --git a/gr-checks/gr-checks-change-list-item-cell-view.js b/gr-checks/gr-checks-change-list-item-cell-view.js
deleted file mode 100644
index 98a75aa..0000000
--- a/gr-checks/gr-checks-change-list-item-cell-view.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-class GrChecksChangeListItemCellView extends Polymer.GestureEventListeners(
-    Polymer.LegacyElementMixin(
-        Polymer.Element)) {
-  /** @returns {string} name of the component */
-  static get is() { return 'gr-checks-change-list-item-cell-view'; }
-
-  /** @returns {?} template for this component */
-  static get template() {
-    return Polymer.html`
-      <style>
-      :host {
-        display: inline-block;
-        text-align: center;
-        width: 100%;
-      }
-    </style>
-      `;
-  }
-
-  /**
-   * Defines properties of the component
-   *
-   * @returns {?}
-   */
-  static get properties() {
-    return {
-      change: Object,
-    };
-  }
-}
-
-customElements.define(GrChecksChangeListItemCellView.is,
-    GrChecksChangeListItemCellView);
\ No newline at end of file
diff --git a/gr-checks/gr-checks-change-list-item-cell-view_test.html b/gr-checks/gr-checks-change-list-item-cell-view_test.html
deleted file mode 100644
index a8b5779..0000000
--- a/gr-checks/gr-checks-change-list-item-cell-view_test.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
-<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
-<script src="../bower_components/web-component-tester/browser.js"></script>
-
-<title>gr-checks-change-list-item-cell-view</title>
-
-<test-fixture id="basic">
-  <template>
-    <gr-checks-change-list-item-cell-view></gr-checks-change-list-item-cell-view>
-  </template>
-</test-fixture>
-
-<script type="module">
-  import '../test/common-test-setup.js';
-  import './gr-checks-change-list-item-cell-view.js';
-
-  suite('gr-checks-change-list-item-cell-view tests', () => {
-    let element;
-    let sandbox;
-
-    setup(done => {
-      sandbox = sinon.sandbox.create();
-
-      element = fixture('basic');
-      element.change = {
-        project: 'test-repository',
-        revisions: {
-          'first-sha': 'test-revision',
-          'second-sha': 'test-revision2',
-        },
-      };
-      flush(done);
-    });
-
-    teardown(() => { sandbox.restore(); });
-
-    test('renders the element', () => {
-      assert.isOk(element);
-    });
-  });
-</script>
diff --git a/gr-checks/gr-checks-change-view-tab-header-view.js b/gr-checks/gr-checks-change-view-tab-header-view.js
deleted file mode 100644
index 4c1a022..0000000
--- a/gr-checks/gr-checks-change-view-tab-header-view.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-class GrChecksChangeViewTabHeaderView extends Polymer.GestureEventListeners(
-    Polymer.LegacyElementMixin(
-        Polymer.Element)) {
-  /** @returns {string} name of the component */
-  static get is() { return 'gr-checks-change-view-tab-header-view'; }
-
-  /** @returns {?} template for this component */
-  static get template() {
-    return Polymer.html`Checks`;
-  }
-}
-
-customElements.define(GrChecksChangeViewTabHeaderView.is,
-    GrChecksChangeViewTabHeaderView);
\ No newline at end of file
diff --git a/gr-checks/gr-checks-change-view-tab-header-view_test.html b/gr-checks/gr-checks-change-view-tab-header-view_test.html
deleted file mode 100644
index cee3780..0000000
--- a/gr-checks/gr-checks-change-view-tab-header-view_test.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-
-<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
-<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
-<script src="../bower_components/web-component-tester/browser.js"></script>
-
-<title>gr-checks-change-view-tab-header-view</title>
-
-<test-fixture id="basic">
-  <template>
-    <gr-checks-change-view-tab-header-view></gr-checks-change-view-tab-header-view>
-  </template>
-</test-fixture>
-
-<script type="module">
-  import '../test/common-test-setup.js';
-  import './gr-checks-change-view-tab-header-view.js';
-  suite('gr-checks-change-view-tab-header-view tests', () => {
-    let element;
-    let sandbox;
-
-    setup(done => {
-      sandbox = sinon.sandbox.create();
-
-      element = fixture('basic');
-      flush(done);
-    });
-
-    teardown(() => { sandbox.restore(); });
-
-    test('renders the header', () => {
-      assert.include(element.shadowRoot.textContent.trim(), 'Checks');
-    });
-  });
-</script>
diff --git a/gr-checks/gr-checks-chip-view.js b/gr-checks/gr-checks-chip-view.js
deleted file mode 100644
index 3415844..0000000
--- a/gr-checks/gr-checks-chip-view.js
+++ /dev/null
@@ -1,290 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import './gr-checks-status.js';
-import {statusClass, Statuses} from './gr-checks-all-statuses.js';
-
-const StatusPriorityOrder = [
-  Statuses.FAILED,
-  Statuses.SCHEDULED,
-  Statuses.RUNNING,
-  Statuses.SUCCESSFUL,
-  Statuses.NOT_STARTED,
-  Statuses.NOT_RELEVANT,
-];
-
-const HumanizedStatuses = {
-  // non-terminal statuses
-  NOT_STARTED: 'in progress',
-  NOT_RELEVANT: 'not relevant',
-  SCHEDULED: 'in progress',
-  RUNNING: 'in progress',
-
-  // terminal statuses
-  SUCCESSFUL: 'successful',
-  FAILED: 'failed',
-};
-
-const CHECKS_POLL_INTERVAL_MS = 60 * 1000;
-
-const Defs = {};
-/**
- * @typedef {{
- *   _number: number,
- * }}
- */
-Defs.Change;
-/**
- * @typedef {{
- *   _number: number,
- * }}
- */
-Defs.Revision;
-
-/**
- * @param {Array<Object>} checks
- * @returns {Object}
- */
-function computeCheckStatuses(checks) {
-  return checks.reduce((accum, check) => {
-    accum[check.state] || (accum[check.state] = 0);
-    accum[check.state]++;
-    return accum;
-  }, {total: checks.length});
-}
-
-/**
- * @param {Array<Object>} checks
- * @returns {string}
- */
-function downgradeFailureToWarning(checks) {
-  const hasFailedCheck = checks.some(
-      check => {
-        return check.state == Statuses.FAILED;
-      }
-  );
-  if (!hasFailedCheck) return '';
-  const hasRequiredFailedCheck = checks.some(
-      check => {
-        return check.state == Statuses.FAILED &&
-               check.blocking && check.blocking.length > 0;
-      }
-  );
-  return hasRequiredFailedCheck ? '' : 'set';
-}
-
-class GrChecksChipView extends Polymer.GestureEventListeners(
-    Polymer.LegacyElementMixin(
-        Polymer.Element)) {
-  /** @returns {string} name of the component */
-  static get is() { return 'gr-checks-chip-view'; }
-
-  /** @returns {?} template for this component */
-  static get template() {
-    return Polymer.html`<style>
-
-      :host {
-        display: inline-block;
-        cursor: pointer;
-      }
-
-      .chip {
-        border-color: #D0D0D0;
-        border-radius: 4px;
-        border-style: solid;
-        border-width: 1px;
-        padding: 4px 8px;
-      }
-      .chip.failed {
-        border-color: #DA4236;
-      }
-    </style>
-    <template is="dom-if" if="[[_hasChecks]]">
-      Checks:
-      <span
-        class$="[[_chipClasses]]"
-        role="button"
-        aria-label="Open checks tab"
-      >
-        <gr-checks-status
-          status="[[_status]]"
-          downgrade-failure-to-warning="[[_downgradeFailureToWarning]]">
-        </gr-checks-status>
-        [[_statusString]]
-      </span>
-    </template>`;
-  }
-
-  /**
-   * Defines properties of the component
-   *
-   * @returns {?}
-   */
-  static get properties() {
-    return {
-      revision: Object,
-      change: Object,
-      /** @type {function(number, number): !Promise<!Object>} */
-      getChecks: Function,
-      _checkStatuses: Object,
-      _hasChecks: Boolean,
-      _failedRequiredChecksCount: Number,
-      _status: {type: String, computed: '_computeStatus(_checkStatuses)'},
-      _statusString: {
-        type: String,
-        computed: '_computeStatusString(_status, _checkStatuses,' +
-         '_failedRequiredChecksCount)',
-      },
-      _chipClasses: {type: String, computed: '_computeChipClass(_status)'},
-      // Type is set as string so that it reflects on changes
-      // Polymer does not support reflecting changes in Boolean property
-      _downgradeFailureToWarning: {
-        type: String,
-        value: '',
-      },
-      pollChecksInterval: Object,
-      visibilityChangeListenerAdded: {
-        type: Boolean,
-        value: false,
-      },
-    };
-  }
-
-  created() {
-    super.created();
-    this.addEventListener('click',
-        () => this.showChecksTable());
-  }
-
-  detached() {
-    super.detached();
-    clearInterval(this.pollChecksInterval);
-    this.unlisten(document, 'visibilitychange', '_onVisibililityChange');
-  }
-
-  static get observers() {
-    return [
-      '_pollChecksRegularly(change, getChecks)',
-    ];
-  }
-
-  showChecksTable() {
-    this.dispatchEvent(
-        new CustomEvent(
-            'show-checks-table',
-            {
-              bubbles: true,
-              composed: true,
-              detail: {
-                tab: 'change-view-tab-header-checks',
-                scrollIntoView: true,
-              },
-            })
-    );
-  }
-
-  /**
-   * @param {!Defs.Change} change
-   * @param {function(number, number): !Promise<!Object>} getChecks
-   */
-  _fetchChecks(change, getChecks) {
-    if (!getChecks || !change) return;
-
-    // change.current_revision always points to latest patchset
-    getChecks(change._number, change.revisions[change.current_revision]
-        ._number).then(checks => {
-      this.set('_hasChecks', checks.length > 0);
-      if (checks.length > 0) {
-        this._downgradeFailureToWarning =
-            downgradeFailureToWarning(checks);
-        this._failedRequiredChecksCount =
-            this.computeFailedRequiredChecksCount(checks);
-        this._checkStatuses = computeCheckStatuses(checks);
-      }
-    }, error => {
-      this.set('_hasChecks', false);
-      console.error(error);
-    });
-  }
-
-  _onVisibililityChange() {
-    if (document.hidden) {
-      clearInterval(this.pollChecksInterval);
-      return;
-    }
-    this._pollChecksRegularly(this.change, this.getChecks);
-  }
-
-  _pollChecksRegularly(change, getChecks) {
-    if (this.pollChecksInterval) {
-      clearInterval(this.pollChecksInterval);
-    }
-    const poll = () => this._fetchChecks(change, getChecks);
-    poll();
-    this.pollChecksInterval = setInterval(poll, CHECKS_POLL_INTERVAL_MS);
-    if (!this.visibilityChangeListenerAdded) {
-      this.visibilityChangeListenerAdded = true;
-      this.listen(document, 'visibilitychange', '_onVisibililityChange');
-    }
-  }
-
-  /**
-   * @param {!Object} checkStatuses The number of checks in each status.
-   * @return {string}
-   */
-  _computeStatus(checkStatuses) {
-    return StatusPriorityOrder.find(
-        status => checkStatuses[status] > 0) ||
-          Statuses.STATUS_UNKNOWN;
-  }
-
-  computeFailedRequiredChecksCount(checks) {
-    const failedRequiredChecks = checks.filter(
-        check => {
-          return check.state == Statuses.FAILED &&
-            check.blocking && check.blocking.length > 0;
-        }
-    );
-    return failedRequiredChecks.length;
-  }
-
-  /**
-   * @param {string} status The overall status of the checks.
-   * @param {!Object} checkStatuses The number of checks in each status.
-   * @param {number} failedRequiredChecksCount The number of failed required checks.
-   * @return {string}
-   */
-  _computeStatusString(status, checkStatuses, failedRequiredChecksCount) {
-    if (!checkStatuses) return;
-    if (checkStatuses.total === 0) return 'No checks';
-    let statusString = `${checkStatuses[status]} of ${
-      checkStatuses.total} checks ${HumanizedStatuses[status]}`;
-    if (status === Statuses.FAILED && failedRequiredChecksCount > 0) {
-      statusString += ` (${failedRequiredChecksCount} required)`;
-    }
-    return statusString;
-  }
-
-  /**
-   * @param {string} status The overall status of the checks.
-   * @return {string}
-   */
-  _computeChipClass(status) {
-    return `chip ${statusClass(status)}`;
-  }
-}
-
-customElements.define(GrChecksChipView.is, GrChecksChipView);
\ No newline at end of file
diff --git a/gr-checks/gr-checks-chip-view_test.html b/gr-checks/gr-checks-chip-view_test.html
deleted file mode 100644
index f5a02b3..0000000
--- a/gr-checks/gr-checks-chip-view_test.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!DOCTYPE html>
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
-<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
-<script src="../bower_components/web-component-tester/browser.js"></script>
-
-<title>gr-checks-chip-view</title>
-
-<test-fixture id="basic">
-  <template>
-    <gr-checks-chip-view></gr-checks-chip-view>
-  </template>
-</test-fixture>
-
-<script type="module">
-  import '../test/common-test-setup.js';
-  import './gr-checks-chip-view.js';
-  const CHECK1 = {
-    checkId: 'test-check-id',
-    log: 'http://example.com/test-log-url',
-    started: '2019-02-06T22:25:19.269Z',
-    finished: '2019-02-06T22:25:44.574Z',
-    state: 'SUCCESSFUL',
-  };
-
-  const CHECK2 = {
-    checkId: 'test-check-id-2',
-    log: 'http://example.com/test-log-url',
-    started: '2019-02-06T22:25:19.269Z',
-    finished: '2019-02-06T22:25:44.574Z',
-    state: 'FAILED',
-  };
-
-  suite('gr-checks-chip-view tests', () => {
-    let element;
-    let sandbox;
-    let getChecksSpy;
-
-    setup(done => {
-      sandbox = sinon.sandbox.create();
-
-      getChecksSpy = sinon.stub();
-      getChecksSpy.returns(Promise.resolve([CHECK1, CHECK2, CHECK1]));
-
-      element = fixture('basic');
-      element.getChecks = getChecksSpy;
-      element.change = {
-        _number: 314,
-        current_revision: 'abcd',
-        revisions: {
-          abcd: {
-            _number: 271,
-          },
-        },
-      };
-      element.revision = {
-        _number: 271,
-      };
-      flush(done);
-    });
-
-    teardown(() => { sandbox.restore(); });
-
-    test('renders the checks prefix', () => {
-      assert.include(element.shadowRoot.textContent.trim(), 'Checks:');
-    });
-
-    test('updating revision does not update getChecks call', done => {
-      element.revision = {_number: 272};
-      flush(() => {
-        assert.isFalse(getChecksSpy.calledWith(314, 272));
-        done();
-      });
-    });
-
-    suite('builds chip contents', () => {
-      test('queries the checks', () => {
-        assert.isTrue(getChecksSpy.called);
-        assert.isTrue(getChecksSpy.calledWith(314, 271));
-      });
-
-      test('renders the text of failed checks', () => {
-        const chip = element.$$('.chip');
-        assert.equal(chip.textContent.trim(), '1 of 3 checks failed');
-      });
-    });
-  });
-</script>
diff --git a/gr-checks/gr-checks-item.js b/gr-checks/gr-checks-item.js
deleted file mode 100644
index 40c4d77..0000000
--- a/gr-checks/gr-checks-item.js
+++ /dev/null
@@ -1,258 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import './gr-checks-status.js';
-
-const Defs = {};
-/**
- * @typedef {{
- *   project: string,
- *   change_number: number,
- *   patch_set_id: number,
- *   checker_uuid: string,
- *   state: string,
- *   url: string,
- *   started: string,
- *   finished: string,
- *   created: string,
- *   updated: string,
- *   checker_name: string,
- *   checker_status: string,
- *   blocking: Array<Object>,
- * }}
- */
-Defs.Check;
-
-class GrChecksItem extends Polymer.GestureEventListeners(
-    Polymer.LegacyElementMixin(
-        Polymer.Element)) {
-  /** @returns {string} name of the component */
-  static get is() { return 'gr-checks-item'; }
-
-  /** @returns {?} template for this component */
-  static get template() {
-    return Polymer.html`
-          <style>
-      :host {
-        border-top: 1px solid var(--border-color);
-      }
-
-      td:first-child {
-        padding-left: 1rem;
-      }
-
-      td {
-        padding: 1px 32px 1px 0;
-        white-space: nowrap;
-      }
-
-      a.log {
-        margin-right: 16px;
-        display: inline-block;
-      }
-      .nav-icon {
-        cursor: pointer;
-      }
-      .duration {
-        text-align: center;
-      }
-    </style>
-    <td>
-      <template is="dom-if" if="[[check.message]]">
-          <iron-icon
-            class="nav-icon expand-message"
-            on-click="_toggleMessageShown"
-            icon="[[_computeExpandIcon(showCheckMessage)]]">
-          </iron-icon>
-      </template>
-    </td>
-    <td>[[check.checker_name]]</td>
-    <td>[[_requiredForMerge]]</td>
-    <td>
-      <gr-checks-status
-        show-text
-        status="[[check.state]]"
-        downgrade-failure-to-warning="[[false]]">
-      </gr-checks-status>
-    </td>
-    <td>
-      <gr-date-formatter
-        has-tooltip
-        show-date-and-time
-        date-str="[[_startTime]]">
-      </gr-date-formatter>
-    </td>
-    <td class="duration">[[_duration]]</td>
-    <td>
-      <a href$="[[check.url]]" target="_blank" class="log">
-        <gr-button link no-uppercase disabled="[[!check.url]]">
-          Details
-        </gr-button>
-      </a>
-    </td>
-    <td>
-      <gr-button
-        link
-        no-uppercase
-        on-click="_handleReRunClicked">
-        Re-run
-      </gr-button>
-    </td>
-    <td>[[check.checker_description]]</td>
-      `;
-  }
-
-  /**
-   * Defines properties of the component
-   *
-   * @returns {?}
-   */
-  static get properties() {
-    return {
-      /** @type {Defs.Check} */
-      check: Object,
-      /** @type {function(string): !Promise<!Object>} */
-      _startTime: {
-        type: String,
-        computed: '_computeStartTime(check)',
-      },
-      _duration: {
-        type: String,
-        computed: '_computeDuration(check)',
-      },
-      _requiredForMerge: {
-        type: String,
-        computed: '_computeRequiredForMerge(check)',
-      },
-      showCheckMessage: {
-        type: Boolean,
-        value: false,
-      },
-    };
-  }
-
-  /**
-   * Fired when the retry check button is pressed.
-   *
-   * @event retry-check
-   */
-
-  /**
-   * @param {!Defs.Check} check
-   * @return {string}
-   */
-  _computeStartTime(check) {
-    if (!check.started) return '-';
-    return check.started;
-  }
-
-  _toggleMessageShown() {
-    this.showCheckMessage = !this.showCheckMessage;
-    this.dispatchEvent(new CustomEvent('toggle-check-message',
-        {
-          detail: {uuid: this.check.checker_uuid},
-          bubbles: true,
-          composed: true,
-        }));
-  }
-
-  _computeExpandIcon(showCheckMessage) {
-    return showCheckMessage ? 'gr-icons:expand-less': 'gr-icons:expand-more';
-  }
-
-  /**
-   * @param {!Defs.Check} check
-   * @return {string}
-   */
-  _computeDuration(check) {
-    if (!check.started || !check.finished) {
-      return '-';
-    }
-    const startTime = new Date(check.started);
-    const finishTime = check.finished ? new Date(check.finished) : new Date();
-    return generateDurationString(startTime, finishTime);
-  }
-
-  /**
-   * @param {!Defs.Check} check
-   * @return {string}
-   */
-  _computeRequiredForMerge(check) {
-    return (check.blocking && check.blocking.length === 0) ? 'Optional' :
-      'Required';
-  }
-
-  _handleReRunClicked() {
-    this.dispatchEvent(new CustomEvent('retry-check',
-        {
-          detail: {uuid: this.check.checker_uuid},
-          bubbles: false,
-          composed: true,
-        }));
-  }
-}
-
-customElements.define(GrChecksItem.is, GrChecksItem);
-
-const ZERO_SECONDS = '0 sec';
-
-/**
- * @param {Date} startTime
- * @param {Date} endTime
- * @return {string}
- */
-function generateDurationString(startTime, endTime) {
-  const secondsAgo = Math.round((endTime - startTime) / 1000);
-
-  if (secondsAgo === 0) {
-    return ZERO_SECONDS;
-  }
-
-  const durationSegments = [];
-  if (secondsAgo % 60 !== 0) {
-    durationSegments.push(`${secondsAgo % 60} sec`);
-  }
-  const minutesAgo = Math.floor(secondsAgo / 60);
-  if (minutesAgo % 60 !== 0) {
-    durationSegments.push(`${minutesAgo % 60} min`);
-  }
-  const hoursAgo = Math.floor(minutesAgo / 60);
-  if (hoursAgo % 24 !== 0) {
-    const hours = pluralize(hoursAgo % 24, 'hour', 'hours');
-    durationSegments.push(`${hoursAgo % 24} ${hours}`);
-  }
-  const daysAgo = Math.floor(hoursAgo / 24);
-  if (daysAgo % 30 !== 0) {
-    const days = pluralize(daysAgo % 30, 'day', 'days');
-    durationSegments.push(`${daysAgo % 30} ${days}`);
-  }
-  const monthsAgo = Math.floor(daysAgo / 30);
-  if (monthsAgo > 0) {
-    const months = pluralize(monthsAgo, 'month', 'months');
-    durationSegments.push(`${monthsAgo} ${months}`);
-  }
-  return durationSegments.reverse().slice(0, 2).join(' ');
-}
-
-/**
- * @param {number} unit
- * @param {string} singular
- * @param {string} plural
- * @return {string}
- */
-function pluralize(unit, singular, plural) {
-  return unit === 1 ? singular : plural;
-}
diff --git a/gr-checks/gr-checks-item_test.html b/gr-checks/gr-checks-item_test.html
deleted file mode 100644
index 305d965..0000000
--- a/gr-checks/gr-checks-item_test.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!DOCTYPE html>
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
-<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
-<script src="../bower_components/web-component-tester/browser.js"></script>
-
-<title>gr-checks-item</title>
-
-<test-fixture id="basic">
-  <template>
-    <gr-checks-item></gr-checks-item>
-  </template>
-</test-fixture>
-
-<script type="module">
-  import '../test/common-test-setup.js';
-  import './gr-checks-item.js';
-  const CHECKS_ITEM = {
-    MESSAGE: 1,
-    NAME: 2,
-    BLOCKING: 3,
-    STATUS: 4,
-    START_TIME: 5,
-    DURATION: 6,
-    DETAILS: 7,
-    RERUN: 8,
-    DESCRIPTION: 9,
-  };
-  suite('gr-checks-item tests', () => {
-    let element;
-    let sandbox;
-    let retryCheckSpy;
-
-    setup(done => {
-      sandbox = sinon.sandbox.create();
-      retryCheckSpy = sinon.stub();
-      retryCheckSpy.returns(Promise.resolve());
-
-      element = fixture('basic');
-      element.retryCheck = retryCheckSpy;
-      element.check = {
-        checkId: 'test-check-id',
-        url: 'http://example.com/test-log-url',
-        started: '2019-02-06T22:25:19.269Z',
-        finished: '2019-02-06T22:25:44.574Z',
-      };
-      flush(done);
-    });
-
-    teardown(() => { sandbox.restore(); });
-
-    test('renders the status', () => {
-      const idx = CHECKS_ITEM.STATUS;
-      const status = element.shadowRoot
-          .querySelector(`td:nth-of-type(${idx}) > gr-checks-status`);
-      assert.isOk(status);
-    });
-
-    test('renders the start time', () => {
-      assert.equal(element._startTime, '2019-02-06T22:25:19.269Z');
-    });
-
-    suite('duration', () => {
-      test('renders the run duration', () => {
-        const idx = CHECKS_ITEM.DURATION;
-        const name = element.$$(`td:nth-of-type(${idx})`);
-        assert.equal(name.textContent.trim(), '25 sec');
-      });
-
-      test('renders 0 sec when the start and end time are the same', () => {
-        element.check = {
-          checkId: 'test-check-id',
-          url: 'http://example.com/test-log-url',
-          started: '2019-02-06T22:25:19.269Z',
-          finished: '2019-02-06T22:25:19.269Z',
-        };
-        const idx = CHECKS_ITEM.DURATION;
-        const name = element.shadowRoot
-            .querySelector(`td:nth-of-type(${idx})`);
-        assert.equal(name.textContent.trim(), '0 sec');
-      });
-
-      test('renders > 1m correctly', () => {
-        element.check = {
-          checkId: 'test-check-id',
-           started: '2019-02-06T22:25:19.269Z',
-          finished: '2019-02-06T22:45:29.269Z',
-        };
-        const idx = CHECKS_ITEM.DURATION;
-        const name = element.shadowRoot
-            .querySelector(`td:nth-of-type(${idx})`);
-        assert.equal(name.textContent.trim(), '20 min 10 sec');
-      });
-
-      test('renders > 1h correctly', () => {
-        element.check = {
-          checkId: 'test-check-id',
-           started: '2019-02-06T22:25:19.269Z',
-          finished: '2019-02-06T23:45:29.269Z',
-        };
-        const idx = CHECKS_ITEM.DURATION;
-        const name = element.shadowRoot
-            .querySelector(`td:nth-of-type(${idx})`);
-        assert.equal(name.textContent.trim(), '1 hour 20 min');
-      });
-
-      test('renders > 1d correctly', () => {
-        element.check = {
-          checkId: 'test-check-id',
-           started: '2019-02-06T22:25:19.269Z',
-          finished: '2019-02-07T23:45:29.269Z',
-        };
-        const idx = CHECKS_ITEM.DURATION;
-        const name = element.shadowRoot
-            .querySelector(`td:nth-of-type(${idx})`);
-        assert.equal(name.textContent.trim(), '1 day 1 hour');
-      });
-    });
-
-    test('renders a link to the log', () => {
-      const idx = CHECKS_ITEM.DETAILS;
-      const logLink = element.shadowRoot
-          .querySelector(`td:nth-of-type(${idx}) > a`);
-      assert.equal(logLink.getAttribute('href'),
-          'http://example.com/test-log-url');
-      assert.equal(logLink.textContent.trim(), 'Details');
-    });
-  });
-</script>
diff --git a/gr-checks/gr-checks-status.js b/gr-checks/gr-checks-status.js
deleted file mode 100644
index 557e81c..0000000
--- a/gr-checks/gr-checks-status.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import {htmlTemplate} from './gr-checks-status_html.js';
-import {isNotRelevant, isUnevaluated, isInProgress, isRunning, isScheduled, isSuccessful, isFailed} from './gr-checks-all-statuses.js';
-
-class GrChecksStatus extends Polymer.GestureEventListeners(
-    Polymer.LegacyElementMixin(
-        Polymer.Element)) {
-  /** @returns {string} name of the component */
-  static get is() { return 'gr-checks-status'; }
-
-  /** @returns {?} template for this component */
-  static get template() { return htmlTemplate; }
-
-  /**
-   * Defines properties of the component
-   *
-   * @returns {?}
-   */
-  static get properties() {
-    return {
-      showText: {
-        type: Boolean,
-        value: false,
-        reflectToAttribute: true,
-      },
-      status: String,
-      downgradeFailureToWarning: String,
-    };
-  }
-
-  _isNotRelevant(status) {
-    return isNotRelevant(status);
-  }
-
-  _isUnevaluated(status) {
-    return isUnevaluated(status);
-  }
-
-  _isInProgress(status) {
-    return isInProgress(status);
-  }
-
-  _isRunning(status) {
-    return isRunning(status);
-  }
-
-  _isScheduled(status) {
-    return isScheduled(status);
-  }
-
-  _isSuccessful(status) {
-    return isSuccessful(status);
-  }
-
-  _isFailed(status) {
-    return !this.downgradeFailureToWarning &&
-        isFailed(status);
-  }
-
-  _isWarning(status) {
-    return this.downgradeFailureToWarning &&
-        isFailed(status);
-  }
-}
-
-customElements.define(GrChecksStatus.is, GrChecksStatus);
\ No newline at end of file
diff --git a/gr-checks/gr-checks-status_html.js b/gr-checks/gr-checks-status_html.js
deleted file mode 100644
index 5cca639..0000000
--- a/gr-checks/gr-checks-status_html.js
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export const htmlTemplate = Polymer.html`
-      <style>
-        :host {
-          display: inline-block;
-        }
-        i {
-          border-radius: 50%;
-          color: white;
-          display: inline-block;
-          font-style: normal;
-          height: 16px;
-          margin-right: 4px;
-          text-align: center;
-          width: 16px;
-        }
-        svg {
-          display: inline-block;
-          vertical-align: middle;
-        }
-      </style>
-    <span>
-      <template is="dom-if" if="[[_isNotRelevant(status)]]">
-        <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
-          <g fill="none" fill-rule="evenodd">
-            <path d="M0 0h18v18H0z"/>
-            <path d="M9 11.8a2.8 2.8 0 1 1 0-5.6 2.8 2.8 0 0 1 0 5.6M9 2a7 7 0 1 0 0 14A7 7 0 0 0 9 2" fill="#9E9E9E"/>
-          </g>
-        </svg>
-        <template is="dom-if" if="[[showText]]">
-          <span>
-            Not relevant
-          </span>
-        </template>
-      </template>
-      <template is="dom-if" if="[[_isUnevaluated(status)]]">
-        <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
-          <g fill="none" fill-rule="evenodd">
-            <path d="M0 0h18v18H0z"/>
-            <path d="M9 11.8a2.8 2.8 0 1 1 0-5.6 2.8 2.8 0 0 1 0 5.6M9 2a7 7 0 1 0 0 14A7 7 0 0 0 9 2" fill="#9E9E9E"/>
-          </g>
-        </svg>
-        <template is="dom-if" if="[[showText]]">
-          <span>
-            Unevaluated
-          </span>
-        </template>
-      </template>
-      <template is="dom-if" if="[[_isScheduled(status)]]">
-        <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
-          <g fill="none" fill-rule="evenodd">
-            <path d="M12.184 9.293c-.86 0-1.641-.39-2.15-.976L9.8 9.489l.82.78V13.2h-.78v-2.344l-.821-.781-.39 1.719-2.736-.547.157-.782 1.914.391.625-3.164-.703.273v1.328h-.782V7.457l2.032-.86c.117 0 .196-.039.313-.039.273 0 .508.157.664.391l.39.625c.313.547.939.938 1.68.938v.781zM10.034 4.8c.43 0 .782.352.782.782 0 .43-.352.781-.781.781a.783.783 0 0 1-.782-.781c0-.43.352-.782.782-.782zM9 2a7 7 0 1 0 .002 14.002A7 7 0 0 0 9 2z" fill="#9C27B0"/>
-            <path d="M0 0h18v18H0z"/>
-          </g>
-        </svg>
-        <template is="dom-if" if="[[showText]]">
-          <span>
-            Scheduled
-          </span>
-        </template>
-      </template>
-      <template is="dom-if" if="[[_isRunning(status)]]">
-        <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
-          <g fill="none" fill-rule="evenodd">
-            <path d="M12.184 9.293c-.86 0-1.641-.39-2.15-.976L9.8 9.489l.82.78V13.2h-.78v-2.344l-.821-.781-.39 1.719-2.736-.547.157-.782 1.914.391.625-3.164-.703.273v1.328h-.782V7.457l2.032-.86c.117 0 .196-.039.313-.039.273 0 .508.157.664.391l.39.625c.313.547.939.938 1.68.938v.781zM10.034 4.8c.43 0 .782.352.782.782 0 .43-.352.781-.781.781a.783.783 0 0 1-.782-.781c0-.43.352-.782.782-.782zM9 2a7 7 0 1 0 .002 14.002A7 7 0 0 0 9 2z" fill="#9C27B0"/>
-            <path d="M0 0h18v18H0z"/>
-          </g>
-        </svg>
-        <template is="dom-if" if="[[showText]]">
-          <span>
-            Running
-          </span>
-        </template>
-      </template>
-      <template is="dom-if" if="[[_isSuccessful(status)]]">
-        <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
-          <g fill="none" fill-rule="evenodd">
-            <path d="M9 2C5.136 2 2 5.136 2 9s3.136 7 7 7 7-3.136 7-7-3.136-7-7-7zM7.6 12.5L4.1 9l.987-.987L7.6 10.519l5.313-5.313.987.994-6.3 6.3z" fill="#00C752"/>
-            <path d="M0 0h18v18H0z"/>
-          </g>
-        </svg>
-        <template is="dom-if" if="[[showText]]">
-          <span>
-            Successful
-          </span>
-        </template>
-      </template>
-      <template is="dom-if" if="[[_isFailed(status)]]">
-        <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
-          <g fill="none" fill-rule="evenodd">
-            <path d="M9 2a7 7 0 1 0 0 14A7 7 0 0 0 9 2zm-1 8V5h2v5H8zm0 3v-2h2v2H8z" fill="#DA4236"/>
-            <path d="M0 0h18v18H0z"/>
-          </g>
-        </svg>
-        <template is="dom-if" if="[[showText]]">
-          <span>
-            Failed
-          </span>
-        </template>
-      </template>
-      <template is="dom-if" if="[[_isWarning(status)]]">
-        <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
-          <g fill="none" fill-rule="evenodd">
-            <g transform="translate(2 2)">
-              <circle fill="#F29900" cx="6.921" cy="6.921" r="6.921"/>
-              <path d="M6.92 1.3l4.686 8.2H2.235L6.92 1.3zm-.584 5.271h1.171V3.643H6.336V6.57zm0 2.258h1.171V7.657H6.336V8.83z" fill="#F8F9FA"/>
-            </g>
-            <path d="M0 0h18v18H0z"/>
-          </g>
-        </svg>
-        <template is="dom-if" if="[[showText]]">
-          <span>
-            Failed
-          </span>
-        </template>
-      </template>
-    </span>
-`;
\ No newline at end of file
diff --git a/gr-checks/gr-checks-status_test.html b/gr-checks/gr-checks-status_test.html
deleted file mode 100644
index 3963dc4..0000000
--- a/gr-checks/gr-checks-status_test.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE html>
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
-<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
-<script src="../bower_components/web-component-tester/browser.js"></script>
-
-<title>gr-checks-item</title>
-
-<test-fixture id="basic">
-  <template>
-    <gr-checks-status></gr-checks-status>
-  </template>
-</test-fixture>
-
-<script type="module">
-  import '../test/common-test-setup.js';
-  import './gr-checks-status.js';
-  suite('gr-checks-status tests', () => {
-    let sandbox;
-
-    setup(() => {
-      sandbox = sinon.sandbox.create();
-    });
-
-    teardown(() => { sandbox.restore(); });
-
-    function testStatus(expectedStatusClass, statusText, statusesToTest) {
-      suite(expectedStatusClass, () => {
-        for (const statusToTest of statusesToTest) {
-          test(`renders ${expectedStatusClass} for ${statusToTest}`, done => {
-            const element = fixture('basic');
-            element.status = statusToTest;
-            element.showText = false;
-
-            flush(() => {
-              const svg = element.shadowRoot.querySelector(`span svg`);
-              assert.isOk(svg);
-              done();
-            });
-          });
-          test(`renders ${expectedStatusClass} for ${statusToTest} rendering
-            text ${statusText}`, done => {
-            const element = fixture('basic');
-            element.status = statusToTest;
-            element.showText = true;
-
-            flush(() => {
-              const text = element.shadowRoot.querySelector(`span span`);
-              assert.equal(text.textContent.trim(), statusText);
-              done();
-            });
-          });
-        }
-      });
-    }
-
-    testStatus('successful', 'Successful', ['SUCCESSFUL']);
-    testStatus('failed', 'Failed', ['FAILED']);
-    testStatus('running', 'Running', ['RUNNING']);
-    testStatus('running', 'Scheduled', ['SCHEDULED']);
-    testStatus('unevaluated', 'Unevaluated', ['NOT_STARTED']);
-  });
-</script>
diff --git a/gr-checks/gr-checks-view.js b/gr-checks/gr-checks-view.js
deleted file mode 100644
index a398509..0000000
--- a/gr-checks/gr-checks-view.js
+++ /dev/null
@@ -1,411 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import './gr-checkers-list.js';
-import './gr-checks-status.js';
-import './gr-checks-item.js';
-
-import {htmlTemplate} from './gr-checks-view_html.js';
-import {Statuses} from './gr-checks-all-statuses.js';
-
-const Defs = {};
-
-const StatusPriorityOrder = [
-  Statuses.FAILED,
-  Statuses.SCHEDULED,
-  Statuses.RUNNING,
-  Statuses.SUCCESSFUL,
-  Statuses.NOT_STARTED,
-  Statuses.NOT_RELEVANT,
-];
-
-const STATE_ALL = 'ALL';
-const CheckStateFilters = [STATE_ALL, ...StatusPriorityOrder];
-
-const CHECKS_POLL_INTERVAL_MS = 60 * 1000;
-const CHECKS_LIMIT = 20;
-
-/**
- * @typedef {{
- *   _number: number,
- * }}
- */
-Defs.Change;
-/**
- * @typedef {{
- *   _number: number,
- * }}
- */
-Defs.Revision;
-
-const LoadingStatus = {
-  LOADING: 0,
-  EMPTY: 1,
-  RESULTS: 2,
-  NOT_CONFIGURED: 3,
-};
-
-class GrChecksView extends Polymer.GestureEventListeners(
-    Polymer.LegacyElementMixin(
-        Polymer.Element)) {
-  /** @returns {string} name of the component */
-  static get is() { return 'gr-checks-view'; }
-
-  /** @returns {?} template for this component */
-  static get template() { return htmlTemplate; }
-
-  /**
-   * Defines properties of the component
-   *
-   * @returns {?}
-   */
-  static get properties() {
-    return {
-      revision: {
-        type: Object,
-        observer: '_handleRevisionUpdate',
-      },
-      change: Object,
-      /** @type {function(number, number): !Promise<!Object>} */
-      getChecks: Function,
-      /** @type {function(string): !Promise<boolean>} */
-      isConfigured: Function,
-      /** @type {function(string, string): !Promise<!Object>} */
-      pluginRestApi: Object,
-      _checks: Array,
-      _status: {
-        type: Object,
-        value: LoadingStatus.LOADING,
-      },
-      _visibleChecks: {
-        type: Array,
-      },
-      _statuses: Array,
-      pollChecksInterval: Number,
-      visibilityChangeListenerAdded: {
-        type: Boolean,
-        value: false,
-      },
-      _createCheckerCapability: {
-        type: Boolean,
-        value: false,
-      },
-      _patchSetDropdownItems: {
-        type: Array,
-        value() { return []; },
-        computed: '_computePatchSetDropdownItems(change)',
-      },
-      _currentPatchSet: {
-        type: Number,
-      },
-      _currentStatus: {
-        type: String,
-        value: STATE_ALL,
-      },
-      _showBlockingChecksOnly: {
-        type: Boolean,
-        value: false,
-      },
-      _showAllChecks: {
-        type: Boolean,
-        value: false,
-      },
-      _filteredChecks: Array,
-      _showMoreChecksButton: {
-        type: Boolean,
-        value: false,
-        notify: true,
-      },
-    };
-  }
-
-  static get observers() {
-    return [
-      '_pollChecksRegularly(change, _currentPatchSet, getChecks)',
-      '_updateVisibleChecks(_checks.*, _currentStatus, ' +
-          '_showBlockingChecksOnly, _showAllChecks)',
-      '_pluginReady(plugin)',
-    ];
-  }
-
-  detached() {
-    super.detached();
-    clearInterval(this.pollChecksInterval);
-    this.unlisten(document, 'visibilitychange', '_onVisibililityChange');
-  }
-
-  _pluginReady(plugin) {
-    this.pluginRestApi = plugin.restApi();
-    this._statuses = CheckStateFilters.map(state => {
-      return {
-        text: state,
-        value: state,
-      };
-    });
-    this._initCreateCheckerCapability();
-  }
-
-  _toggleShowChecks() {
-    this._showAllChecks = !this._showAllChecks;
-  }
-
-  _computePatchSetDropdownItems(change) {
-    return Object.values(change.revisions)
-        .filter(patch => patch._number !== 'edit')
-        .map(patch => {
-          return {
-            text: 'Patchset ' + patch._number,
-            value: patch._number,
-          };
-        })
-        .sort((a, b) => b.value - a.value);
-  }
-
-  _computeShowText(showAllChecks) {
-    return showAllChecks ? 'Show Less' : 'Show All';
-  }
-
-  _updateVisibleChecks(checksRecord, status, showBlockingChecksOnly,
-      showAllChecks) {
-    const checks = checksRecord.base;
-    if (!checks) return [];
-    this._filteredChecks = checks.filter(check => {
-      if (showBlockingChecksOnly && (!check.blocking ||
-            !check.blocking.length)) return false;
-      return status === STATE_ALL || check.state === status;
-    });
-    /* The showCheckMessage property is notified for change because the
-      changes to showCheckMessage are not reflected to the dom as the object
-      check has the same reference as before
-      If not notified, then the message for the check is not displayed after
-      clicking the toggle
-      */
-    this._showMoreChecksButton = this._filteredChecks.length > CHECKS_LIMIT;
-    this._visibleChecks = this._filteredChecks.slice(0, showAllChecks ?
-      undefined : CHECKS_LIMIT);
-    this._visibleChecks.forEach((val, idx) =>
-      this.notifyPath(`_visibleChecks.${idx}.showCheckMessage`));
-  }
-
-  _handleRevisionUpdate(revision) {
-    if (!revision) return;
-    this._currentPatchSet = revision._number;
-  }
-
-  _handlePatchSetChanged(e) {
-    // gr-dropdown-list returns value of type "String"
-    const patchSet = parseInt(e.detail.value);
-    if (patchSet === this._currentPatchSet) return;
-    this._currentPatchSet = patchSet;
-  }
-
-  _handleBlockingCheckboxClicked() {
-    this._showBlockingChecksOnly = !this._showBlockingChecksOnly;
-  }
-
-  _handleStatusFilterChanged(e) {
-    const status = e.detail.value;
-    if (status === this._currentStatus) return;
-    this._currentStatus = status;
-  }
-
-  _handleCheckersListResize() {
-    // Force polymer to recalculate position of overlay when length of
-    // checkers changes
-    this.$.listOverlay.refit();
-  }
-
-  _initCreateCheckerCapability() {
-    return this.pluginRestApi.getAccount().then(account => {
-      if (!account) { return; }
-      return this.pluginRestApi
-          .getAccountCapabilities(['checks-administrateCheckers'])
-          .then(capabilities => {
-            if (capabilities['checks-administrateCheckers']) {
-              this._createCheckerCapability = true;
-            }
-          });
-    });
-  }
-
-  _handleConfigureClicked() {
-    this.$$('gr-checkers-list')._showConfigureOverlay();
-  }
-
-  _orderChecks(a, b) {
-    if (a.state != b.state) {
-      const indexA = StatusPriorityOrder.indexOf(a.state);
-      const indexB = StatusPriorityOrder.indexOf(b.state);
-      if (indexA != -1 && indexB != -1) {
-        return indexA - indexB;
-      }
-      return indexA == -1 ? 1 : -1;
-    }
-    if (a.state === Statuses.FAILED) {
-      if (a.blocking && b.blocking &&
-            a.blocking.length !== b.blocking.length) {
-        return a.blocking.length == 0 ? 1 : -1;
-      }
-    }
-    return a.checker_name.localeCompare(b.checker_name);
-  }
-
-  _handleRetryCheck(e) {
-    const uuid = e.detail.uuid;
-    const retryCheck = (change, revision, uuid) => this.pluginRestApi.post(
-        '/changes/' + change + '/revisions/' + revision + '/checks/' + uuid
-              + '/rerun'
-    );
-    retryCheck(this.change._number, this.revision._number, uuid).then(
-        res => {
-          this._fetchChecks(this.change, this.revision._number,
-              this.getChecks);
-        }, error => {
-          this.dispatchEvent(new CustomEvent('show-error',
-              {
-                detail: {message: error.message},
-                bubbles: true,
-                composed: true,
-              }));
-        }
-    );
-  }
-
-  /**
-   * Explicity add showCheckMessage to maintain it
-   *
-   * Loop over checks to make sure no new checks are missed
-   * Remove any check that is not returned the next time
-   * Ensure message is updated
-   *
-   * @param {Array<Object>} checks
-   * @returns {Object}
-   */
-  _updateChecks(checks) {
-    return checks.map(
-        check => {
-          const prevCheck = this._checks.find(
-              c => c.checker_uuid === check.checker_uuid
-          );
-          if (!prevCheck) return Object.assign({}, check);
-          return Object.assign({}, check,
-              {showCheckMessage: prevCheck.showCheckMessage});
-        });
-  }
-
-  /**
-   * @param {!Defs.Change} change
-   * @param {!Defs.Revision} revisionNumber
-   * @param {function(number, number): !Promise<!Object>} getChecks
-   */
-  _fetchChecks(change, revisionNumber, getChecks) {
-    if (!getChecks || !change || !revisionNumber) return;
-
-    getChecks(change._number, revisionNumber).then(checks => {
-      if (revisionNumber !== this._currentPatchSet) return;
-      if (checks && checks.length) {
-        checks.sort((a, b) => this._orderChecks(a, b));
-        if (!this._checks) {
-          this._checks = checks;
-        } else {
-          this._checks = this._updateChecks(checks);
-        }
-        this.set('_status', LoadingStatus.RESULTS);
-      } else {
-        this._checkConfigured();
-      }
-    }, error => {
-      this._checks = [];
-      this.set('_status', LoadingStatus.EMPTY);
-    });
-  }
-
-  _onVisibililityChange() {
-    if (document.hidden) {
-      clearInterval(this.pollChecksInterval);
-      return;
-    }
-    this._pollChecksRegularly(this.change, this._currentPatchSet,
-        this.getChecks);
-  }
-
-  _toggleCheckMessage(e) {
-    const uuid = e.detail.uuid;
-    if (!uuid) {
-      console.warn('uuid not found');
-      return;
-    }
-    const idx = this._checks.findIndex(check => check.checker_uuid === uuid);
-    if (idx == -1) {
-      console.warn('check not found');
-      return;
-    }
-    // Update subproperty of _checks[idx] so that it reflects to polymer
-    this.set(`_checks.${idx}.showCheckMessage`,
-        !this._checks[idx].showCheckMessage);
-  }
-
-  _pollChecksRegularly(change, revisionNumber, getChecks) {
-    if (!change || !revisionNumber || !getChecks) return;
-    if (this.pollChecksInterval) {
-      clearInterval(this.pollChecksInterval);
-    }
-    const poll = () => this._fetchChecks(change, revisionNumber, getChecks);
-    poll();
-    this.pollChecksInterval = setInterval(poll, CHECKS_POLL_INTERVAL_MS);
-    if (!this.visibilityChangeListenerAdded) {
-      this.visibilityChangeListenerAdded = true;
-      this.listen(document, 'visibilitychange', '_onVisibililityChange');
-    }
-  }
-
-  _checkConfigured() {
-    const repository = this.change['project'];
-    this.isConfigured(repository).then(configured => {
-      const status =
-            configured ? LoadingStatus.EMPTY : LoadingStatus.NOT_CONFIGURED;
-      this.set('_status', status);
-    });
-  }
-
-  _isLoading(status) {
-    return status === LoadingStatus.LOADING;
-  }
-
-  _isEmpty(status) {
-    return status === LoadingStatus.EMPTY;
-  }
-
-  _hasResults(status) {
-    return status === LoadingStatus.RESULTS;
-  }
-
-  _isNotConfigured(status) {
-    return status === LoadingStatus.NOT_CONFIGURED;
-  }
-
-  _computeHeaderClass(currentPatchSet, sortedAllPatchsets) {
-    if (!sortedAllPatchsets
-         || sortedAllPatchsets.length < 1
-          || !currentPatchSet) {
-      return '';
-    }
-    return currentPatchSet === sortedAllPatchsets[0].value ?
-      '' : 'oldPatchset';
-  }
-}
-
-customElements.define(GrChecksView.is, GrChecksView);
\ No newline at end of file
diff --git a/gr-checks/gr-checks-view_html.js b/gr-checks/gr-checks-view_html.js
deleted file mode 100644
index 22af763..0000000
--- a/gr-checks/gr-checks-view_html.js
+++ /dev/null
@@ -1,263 +0,0 @@
-/**
- * @license
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export const htmlTemplate = Polymer.html`
-    <style>
-      :host {
-        display: block;
-        width: 100%;
-        overflow: auto;
-      }
-
-      table {
-        width: 100%;
-      }
-
-      gr-checks-item {
-        display: table-row;
-      }
-
-      gr-dropdown-list {
-        --trigger-style: {
-          color: var(--deemphasized-text-color);
-          text-transform: none;
-          font-family: var(--font-family);
-        }
-        --trigger-hover-color: rgba(0,0,0,.6);
-      }
-      @media screen and (max-width: 50em) {
-        gr-dropdown-list {
-          --native-select-style: {
-            max-width: 5.25em;
-          }
-          --dropdown-content-stype: {
-            max-width: 300px;
-          }
-        }
-      }
-
-      .headerRow {
-        border-bottom: 1px solid #ddd;
-      }
-
-      .topHeader {
-        padding-right: 32px;
-        padding-bottom: 4px;
-        text-align: left;
-        white-space: nowrap;
-      }
-
-      th.topHeader:last-child {
-        width: 100%;
-      }
-
-      h2 {
-        font-size: 1.17em;
-        font-weight: 500;
-      }
-
-      h3 {
-        flex: 1;
-        font-size: 1.17em;
-        font-weight: 500;
-        margin-bottom: 1.5rem;
-      }
-
-      header {
-        display: flex;
-        padding: var(--spacing-s) var(--spacing-m);
-      }
-
-      header.oldPatchset {
-        background: var(--emphasis-color);
-      }
-
-      table {
-        margin-bottom: 16px;
-      }
-
-      th:first-child {
-        padding-left: 1rem;
-      }
-
-      .no-content {
-        min-height: 106px;
-        padding: 24px 0;
-        text-align: center;
-      }
-
-      /* Add max-width 1px to check-message make sure content doesn't
-         expand beyond the table width */
-      .check-message {
-        padding-left: 1rem;
-        background: var(--table-subheader-background-color);
-        max-width: 1px;
-      }
-
-      .message {
-        white-space: pre-wrap;
-        word-wrap: break-word;
-      }
-
-      .message-heading {
-        font-weight: bold;
-        margin-top: 1em;
-      }
-
-      .check-message-heading {
-        padding-left: 1em;
-      }
-
-      .configure-button-container {
-        text-align: right;
-        flex: 1;
-      }
-
-      .filter {
-        margin-left: 10px;
-      }
-
-      #listOverlay {
-        width: 75%;
-      }
-
-      .container {
-        display: flex;
-        width: 100%;
-      }
-
-      .blocking-checks-container {
-        margin-left: 10px;
-        display: flex;
-        align-items: center;
-      }
-
-      .show-more-checks {
-        margin: 0 0 var(--spacing-l) var(--spacing-l);
-      }
-
-      .checks-table {
-        border-collapse: collapse;
-      }
-
-    </style>
-
-    <header class$="[[_computeHeaderClass(_currentPatchSet, _patchSetDropdownItems)]]">
-      <div class="container">
-        <template is="dom-if" if="[[_patchSetDropdownItems.length]]">
-          <gr-dropdown-list
-            class="patch-set-dropdown"
-            items="[[_patchSetDropdownItems]]"
-            on-value-change="_handlePatchSetChanged"
-            value="[[_currentPatchSet]]">
-          </gr-dropdown-list>
-        </template>
-        <template is="dom-if" if="[[_hasResults(_status)]]">
-          <div class="filter">
-            <span> Filter By: </span>
-            <gr-dropdown-list
-              class="check-state-filter"
-              items="[[_statuses]]"
-              on-value-change="_handleStatusFilterChanged"
-              value="[[_currentStatus]]">
-            </gr-dropdown-list>
-          </div>
-          <div class="blocking-checks-container">
-            <input type="checkbox"
-              name="blocking"
-              checked$="[[_showBlockingChecksOnly]]"
-              on-click="_handleBlockingCheckboxClicked"
-              value="blocking">
-              Required for Submit
-          </div>
-        </template>
-        <template is="dom-if" if="[[_createCheckerCapability]]">
-          <div class="configure-button-container">
-            <gr-button on-click="_handleConfigureClicked"> Configure </gr-button>
-          </div>
-        </template>
-      </div>
-    </header>
-
-    <template is="dom-if" if="[[_isLoading(_status)]]">
-      <div class="no-content">
-        <p>Loading...</p>
-      </div>
-    </template>
-
-    <template is="dom-if" if="[[_isEmpty(_status)]]">
-      <div class="no-content">
-        <h2>No checks ran for this code review</h2>
-        <p>Configure checkers to view the results here.</p>
-      </div>
-    </template>
-
-    <template is="dom-if" if="[[_isNotConfigured(_status)]]">
-      <div class="no-content">
-        <h2>Code review checks not configured</h2>
-        <p>Configure checkers to view the results here.</p>
-      </div>
-    </template>
-
-    <template is="dom-if" if="[[_hasResults(_status)]]">
-      <table class="checks-table">
-        <thead>
-          <tr class="headerRow">
-            <th class="topHeader"></th>
-            <th class="topHeader">Name</th>
-            <th class="topHeader">For submit</th>
-            <th class="topHeader">Status</th>
-            <th class="topHeader">Started</th>
-            <th class="topHeader">Duration</th>
-            <th class="topHeader"><!-- actions --></th>
-            <th class="topHeader"><!-- re-run --></th>
-            <th class="topHeader">Description</th>
-          </tr>
-        </thead>
-        <tbody>
-          <template is="dom-repeat" items="[[_visibleChecks]]" as="check">
-              <tr>
-                <gr-checks-item on-retry-check="_handleRetryCheck" on-toggle-check-message="_toggleCheckMessage"
-                  check="[[check]]">
-                </gr-checks-item>
-              </tr>
-              <template is="dom-if" if="[[check.showCheckMessage]]">
-                <tr>
-                  <td colspan="10" class="check-message-heading">
-                    <span class="message-heading">
-                      Message
-                    </span>
-                  </td>
-                </tr>
-                <tr>
-                  <td colspan="10" class="check-message">
-                    <span class="message"> [[check.message]] </span>
-                  </td>
-                </tr>
-              </template>
-          </template>
-        </tbody>
-      </table>
-      <template is="dom-if" if="[[_showMoreChecksButton]]">
-        <gr-button class="show-more-checks" on-click="_toggleShowChecks">
-          [[_computeShowText(_showAllChecks)]]
-        </gr-button>
-      </template>
-    </template>
-
-    <gr-checkers-list on-resize="_handleCheckersListResize" plugin-rest-api="[[pluginRestApi]]"></gr-checkers-list>
-    `;
\ No newline at end of file
diff --git a/gr-checks/gr-checks-view_test.html b/gr-checks/gr-checks-view_test.html
deleted file mode 100644
index beeac95..0000000
--- a/gr-checks/gr-checks-view_test.html
+++ /dev/null
@@ -1,559 +0,0 @@
-<!DOCTYPE html>
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
-<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
-<script src="../bower_components/web-component-tester/browser.js"></script>
-
-<title>gr-checks-item</title>
-
-<!-- Gr-overlay does not exist in the test framework
-It is expected to be provided by Gerrit core -->
-
-<script type="module">
-  import '../test/common-test-setup.js';
-
-  class GrOverlay extends Polymer.Element {
-    static get is() { return 'gr-overlay'; }
-
-    refit() {}
-
-    open() {}
-  }
-
-  customElements.define(GrOverlay.is, GrOverlay);
-</script>
-
-<test-fixture id="basic">
-  <template>
-    <gr-checks-view></gr-checks-view>
-  </template>
-</test-fixture>
-
-<script type="module">
-  import './gr-checks-view.js';
-  import {Statuses} from './gr-checks-all-statuses.js';
-
-  const CHECK1 = {
-    checkId: 'test-check-id',
-    logUrl: 'http://example.com/test-log-url',
-    startTime: '2019-02-06T22:25:19.269Z',
-    finishTime: '2019-02-06T22:25:44.574Z',
-    checker_name: 'test checker',
-    state: 'RUNNING',
-    checker_status: 'ENABLED',
-    blocking: [],
-    checker_description: 'No-op jobs for testing purposes',
-    message: '\n\nChange-Id: I8df212a28ae23cc239afd10ee4f506887e03ab70\n',
-    showCheckMessage: undefined,
-    checker_uuid: 'codestyle-a6a0e4682515f3521897c5f950d1394f4619d928',
-  };
-  const CHECK2 = {
-    checkId: 'test-check-id2',
-    logUrl: 'http://example.com/test-log-url',
-    startTime: '2019-02-06T22:25:19.269Z',
-    finishTime: '2019-02-06T22:25:44.574Z',
-    checker_name: 'test checker2',
-    state: 'RUNNING',
-    checker_status: 'ENABLED',
-    blocking: [],
-    checker_description: 'No-op jobs for testing purposes 2',
-    message: '\n\nChange-Id: I8df212a28ae23cc239afd10ee4f506887e03ab70\n',
-    showCheckMessage: undefined,
-    checker_uuid: 'polygerrit-a6a0e4682515f3521897c5f950d1394f4619d928',
-  };
-  const REVISION = {
-    kind: 'REWORK',
-    _number: 3,
-    created: '2018-05-15 21:56:13.000000000',
-    uploader: {
-      _account_id: 1000000,
-    },
-    ref: 'refs/changes/00/1000/1',
-    commit: {
-      parents: [],
-      subject: '',
-      message: '\n\nChange-Id: I8df212a28ae23cc239afd10ee4f506887e03ab70\n',
-      commit: '1c9a1dfd38ea51dc7880f3ddf669100710f0c91b',
-    },
-  };
-  const REVISION2 = {
-    kind: 'REWORK',
-    _number: 2,
-    created: '2018-05-15 21:56:13.000000000',
-    uploader: {
-      _account_id: 1000000,
-    },
-    ref: 'refs/changes/00/1000/2',
-    commit: {
-      parents: [],
-      subject: '',
-      message: '\n\nChange-Id: I8df212a28ae23cc239afd10ee4f506887e03ab70\n',
-      commit: '1c9a1dfd38ea51dc6880f3ddf669100710f0c91b',
-    },
-  };
-
-  const CHECKS_POLL_INTERVAL_MS = 60 * 1000;
-  const STATE_ALL = 'ALL';
-  const CHECKS_LIMIT = 20;
-
-  suite('gr-checks-view tests', () => {
-    let element;
-    let sandbox;
-    let getChecksSpy;
-    let getChecksResolve;
-    let retryCheckSpy;
-    let isConfiguredSpy;
-    let isConfiguredResolve;
-    let getAccountSpy;
-    let getAccountResolve;
-    let fetchJSONSpy;
-    let getAccountCapabilitiesSpy;
-    let getAccountCapabilitiesResolve;
-    let postSpy;
-    let postReject;
-    setup(done => {
-      sandbox = sinon.sandbox.create();
-
-      getChecksSpy = sinon.stub();
-      const getChecksPromise = new Promise((resolve, reject) => {
-        getChecksResolve = resolve;
-      });
-      getChecksSpy.returns(getChecksPromise);
-
-      isConfiguredSpy = sinon.stub();
-      const isConfiguredPromise = new Promise((resolve, reject) => {
-        isConfiguredResolve = resolve;
-      });
-      isConfiguredSpy.returns(isConfiguredPromise);
-
-      retryCheckSpy = sinon.stub();
-      retryCheckSpy.returns(Promise.resolve());
-
-      const plugin = {};
-      getAccountSpy = sinon.stub();
-      const getAccountPromise = new Promise((resolve, reject) => {
-        getAccountResolve = resolve;
-      });
-      getAccountSpy.returns(getAccountPromise);
-
-      postSpy = sinon.stub();
-      const postPromise = new Promise((resolve, reject) => {
-        postReject = reject;
-      });
-      postSpy.returns(postPromise);
-
-      fetchJSONSpy = sinon.stub();
-      const fetchJSONPromise = new Promise(() => {});
-      fetchJSONSpy.returns(fetchJSONPromise);
-
-      getAccountCapabilitiesSpy = sinon.stub();
-      const getAccountCapabilitiesPromise = new Promise((resolve, reject) => {
-        getAccountCapabilitiesResolve = resolve;
-      });
-      getAccountCapabilitiesSpy.returns(getAccountCapabilitiesPromise);
-
-      plugin.restApi = () => ({
-        getAccount: getAccountSpy,
-        fetchJSON: fetchJSONSpy,
-        getAccountCapabilities: getAccountCapabilitiesSpy,
-        post: postSpy,
-      });
-      element = fixture('basic');
-      Object.assign(element, {
-        retryCheck: retryCheckSpy,
-        getChecks: getChecksSpy,
-        isConfigured: isConfiguredSpy,
-        change: {
-          project: 'test-repository',
-          _number: 2,
-          revisions: {
-            'first-sha': REVISION2,
-            'second-sha': REVISION,
-          },
-        },
-        plugin,
-        revision: REVISION,
-      });
-      flush(done);
-    });
-
-    teardown(() => { sandbox.restore(); });
-
-    test('renders loading', () => {
-      // Element also contains the hidden gr-overlay hence use includes
-      assert(element.shadowRoot.textContent.trim().includes('Loading...'));
-    });
-
-    test('queries the checks', () => {
-      assert.isTrue(getChecksSpy.called);
-      assert.isTrue(getChecksSpy.calledWith(2, 3));
-    });
-
-    suite('no checks returned', () => {
-      setup(done => {
-        getChecksResolve([]);
-        flush(done);
-      });
-
-      test('it calls to check if the checks are configured', () => {
-        assert.isTrue(isConfiguredSpy.called);
-        assert.isTrue(isConfiguredSpy.calledWith('test-repository'));
-      });
-
-      test('no configure button renders', () => {
-        assert(!element.$$('gr-button'));
-      });
-
-      suite('not configured', () => {
-        setup(done => {
-          isConfiguredResolve(false);
-          flush(done);
-        });
-
-        test('renders checks not configured', () => {
-          const header = element.$$('h2');
-          assert.equal(header.textContent.trim(),
-              'Code review checks not configured');
-        });
-
-        suite('create checker capability false', () => {
-          setup(done => {
-            getAccountResolve(true);
-            getAccountCapabilitiesResolve({'checks-administrateCheckers': false});
-            flush(done);
-          });
-
-          test('checker button does not render', () => {
-            assert(!element.$$('gr-button'));
-          });
-        });
-
-        suite('create checker capability true', () => {
-          setup(done => {
-            getAccountResolve(true);
-            getAccountCapabilitiesResolve({'checks-administrateCheckers': true});
-            flush(done);
-          });
-          test('checker button renders', () => {
-            assert(element.$$('gr-button'));
-          });
-        });
-      });
-
-      suite('no checks ran', () => {
-        setup(done => {
-          isConfiguredResolve(true);
-          flush(done);
-        });
-
-        test('renders checks not configured', () => {
-          const header = element.shadowRoot.querySelector('h2');
-          assert.equal(header.textContent.trim(),
-              'No checks ran for this code review');
-        });
-      });
-    });
-
-    suite('checks updated properly', () => {
-      setup(done => {
-        element._checks = [CHECK1, CHECK2];
-        flush(done);
-      });
-
-      test('message is updated', () => {
-        const NEW_CHECKS = [Object.assign({}, CHECK1),
-          Object.assign({}, CHECK2)];
-        NEW_CHECKS[0].message = 'New message 1';
-        NEW_CHECKS[1].message = 'New message 2';
-        const EXPECTED_CHECKS = [Object.assign({}, CHECK1),
-          Object.assign({}, CHECK2)];
-        EXPECTED_CHECKS[0].message = 'New message 1';
-        EXPECTED_CHECKS[1].message = 'New message 2';
-        const UPDATED_CHECKS = element._updateChecks(NEW_CHECKS);
-        assert.equal(UPDATED_CHECKS[0].message, NEW_CHECKS[0].message);
-        assert.equal(UPDATED_CHECKS[1].message, NEW_CHECKS[1].message);
-      });
-
-      test('total checks updated if one is deleted', () => {
-        const NEW_CHECKS = [Object.assign({}, CHECK1)];
-        const EXPECTED_CHECKS = [Object.assign({}, CHECK1)];
-        const UPDATED_CHECKS = element._updateChecks(NEW_CHECKS);
-        assert.equal(UPDATED_CHECKS.length, 1);
-        assert.deepEqual(UPDATED_CHECKS, EXPECTED_CHECKS);
-      });
-
-      test('status is updated', () => {
-        const NEW_CHECKS = [Object.assign({}, CHECK1),
-          Object.assign({}, CHECK2)];
-        NEW_CHECKS[0].state = 'SUCCESSFUL';
-        NEW_CHECKS[1].state = 'FAILED';
-        const UPDATED_CHECKS = element._updateChecks(NEW_CHECKS);
-        assert.deepEqual(UPDATED_CHECKS, NEW_CHECKS);
-      });
-
-      test('showMessage property is retained', () => {
-        element._checks[0].showCheckMessage = true;
-        element._checks[1].showCheckMessage = false;
-
-        const NEW_CHECKS = [Object.assign({}, CHECK1),
-          Object.assign({}, CHECK2)];
-        const UPDATED_CHECKS = element._updateChecks(NEW_CHECKS);
-        assert.equal(UPDATED_CHECKS[0].showCheckMessage,
-            CHECK1.showCheckMessage);
-        assert.equal(UPDATED_CHECKS[1].showCheckMessage,
-            CHECK2.showCheckMessage);
-
-        element._checks[0].showCheckMessage = undefined;
-        element._checks[1].showCheckMessage = undefined;
-      });
-
-      test('url is not set if new check has no url', () => {
-        const NEW_CHECKS = [Object.assign({}, CHECK1),
-          Object.assign({}, CHECK2)];
-        delete NEW_CHECKS[0]['url'];
-        delete NEW_CHECKS[1]['url'];
-        const UPDATED_CHECKS = element._updateChecks(NEW_CHECKS);
-        assert.isNotOk(UPDATED_CHECKS[0].url);
-        assert.isNotOk(UPDATED_CHECKS[1].url);
-      });
-
-      test('url is not set if new check has no url', () => {
-        const NEW_CHECKS = [Object.assign({}, CHECK1),
-          Object.assign({}, CHECK2)];
-        delete NEW_CHECKS[0]['url'];
-        delete NEW_CHECKS[1]['url'];
-        const UPDATED_CHECKS = element._updateChecks(NEW_CHECKS);
-        assert.isNotOk(UPDATED_CHECKS[0].url);
-        assert.isNotOk(UPDATED_CHECKS[1].url);
-      });
-
-      test('message is not shown if new check has no message', () => {
-        const NEW_CHECKS = [Object.assign({}, CHECK1),
-          Object.assign({}, CHECK2)];
-        NEW_CHECKS[0].message = '';
-        const UPDATED_CHECKS = element._updateChecks(NEW_CHECKS);
-        assert.equal(UPDATED_CHECKS[0].message, NEW_CHECKS[0].message);
-      });
-    });
-
-    suite('with checks', () => {
-      setup(done => {
-        const CHECK3 = Object.assign({}, CHECK1, {state: 'FAILED'});
-        const CHECK4 = Object.assign({}, CHECK1, {state: 'FAILED',
-          blocking: [1, 2, 3]});
-        getChecksResolve([CHECK1, CHECK2, CHECK3, CHECK4]);
-        flush(done);
-      });
-
-      test('it calls to check if the checks are configured', () => {
-        assert.isFalse(isConfiguredSpy.called);
-      });
-
-      test('renders a table of all the checks', () => {
-        const tbody = element.$$('table > tbody');
-        assert.lengthOf(tbody.querySelectorAll('gr-checks-item'), 4);
-      });
-
-      test('retry fires show-error event', done => {
-        postReject(new Error('random error'));
-        const fireStub = sandbox.stub(element, 'dispatchEvent');
-        Polymer.dom.flush();
-        const checksItem = element.shadowRoot.querySelectorAll(
-            'table > tbody > gr-checks-item'
-        )[0];
-        const reRun = checksItem.shadowRoot.querySelectorAll('td')[7];
-        const reRunButton = reRun.querySelector('gr-button');
-        reRunButton.click();
-        flush(() => {
-          assert.equal(fireStub.firstCall.args[0].type, ('show-error'));
-          done();
-        });
-      });
-
-      suite('message is rendered', () => {
-        setup(done => {
-          element._checks = [CHECK1, CHECK2];
-          flush(done);
-        });
-
-        test('messsage icon is displayed', () => {
-          const checkItems = element.shadowRoot
-              .querySelectorAll('gr-checks-item');
-          const messagesCount = [...checkItems].reduce((count, item) => {
-            return count += item.shadowRoot
-                .querySelectorAll('.expand-message').length;
-          }, 0);
-          assert.equal(messagesCount,
-              element._visibleChecks.length);
-        });
-
-        test('message displayed on clicking icon', done => {
-          const checkItem = element.shadowRoot.querySelector('gr-checks-item');
-          checkItem.shadowRoot
-              .querySelector('.expand-message').click();
-          flush(() => {
-            const msg = element.shadowRoot
-                .querySelector('.check-message').innerText
-                .trim();
-            assert.equal(msg, element._visibleChecks[0].message.trim());
-            done();
-          });
-        });
-      });
-
-      suite('create checker capability false', () => {
-        setup(done => {
-          getAccountResolve(true);
-          getAccountCapabilitiesResolve({'checks-administrateCheckers': false});
-          flush(done);
-        });
-        test('checker button does not render', () => {
-          assert(!element.$$('gr-button'));
-        });
-      });
-
-      test('retry checks', done => {
-        const checkItems = element.shadowRoot
-            .querySelectorAll('gr-checks-item');
-        const retryButton = checkItems[0].shadowRoot
-            .querySelectorAll('gr-button')[1];
-        MockInteractions.tap(retryButton);
-        const expectedUrl = '/changes/2/revisions/3/checks/codestyle-'
-          + 'a6a0e4682515f3521897c5f950d1394f4619d928/rerun';
-        flush(() => {
-          assert.isTrue(postSpy.calledWith(expectedUrl));
-          done();
-        });
-      });
-
-      suite('create checker capability true', () => {
-        setup(done => {
-          getAccountResolve(true);
-          getAccountCapabilitiesResolve({
-            'checks-administrateCheckers': true,
-          });
-          flush(done);
-        });
-
-        test('checker button renders', () => {
-          assert(element.$$('gr-button'));
-        });
-      });
-
-      suite('patchset navigation', () => {
-        test('renders the dropdown', () => {
-          assert.isNotNull(element.shadowRoot
-              .querySelector('.patch-set-dropdown'));
-        });
-
-        test('when patchset updated it fetches new checks', done => {
-          const clock = sinon.useFakeTimers();
-          const fetchChecksStub = sandbox.stub(element,
-              '_fetchChecks');
-          assert.equal(element._currentPatchSet, 3);
-          element.revision = REVISION2;
-          flush(() => {
-            const firstCallArgs = fetchChecksStub.args[0];
-            assert.equal(firstCallArgs[1], element._currentPatchSet);
-            clock.tick(CHECKS_POLL_INTERVAL_MS + 1000);
-            flush(() => {
-              assert(fetchChecksStub.callCount === 2);
-              const secondCallArgs = fetchChecksStub.args[1];
-              assert.equal(secondCallArgs[1], element._currentPatchSet);
-              done();
-            });
-          });
-        });
-
-        test('update to revision updates currentPatchset', done => {
-          assert.equal(element._currentPatchSet, 3);
-          element.revision = REVISION2;
-          flush(() => {
-            assert.equal(element._currentPatchSet, 2);
-            done();
-          });
-        });
-      });
-
-      suite('check state filter', () => {
-        test('renders the filter dropdown', () => {
-          assert.isNotNull(element.shadowRoot
-              .querySelector('.check-state-filter'));
-        });
-
-        test('default filter is all', () => {
-          assert.equal(element._currentStatus, STATE_ALL);
-        });
-
-        test('updating filter status filters checks', done => {
-          assert.equal(element._visibleChecks.length, 4);
-          element._currentStatus = Statuses.RUNNING;
-          flush(() => {
-            assert.equal(element._visibleChecks.length, 2);
-            done();
-          });
-        });
-      });
-
-      suite('blocking checkbox', () => {
-        test('renders the checkbox', () => {
-          assert.isNotNull(element.shadowRoot
-              .querySelector('input[name="blocking"]'));
-        });
-
-        test('default filter is all', () => {
-          assert.equal(element.shadowRoot
-              .querySelector('input[name="blocking"]').checked,
-          false);
-        });
-
-        test('blocking checkbox filters checks', done => {
-          assert.equal(element._visibleChecks.length, 4);
-          element.shadowRoot.querySelector('input[name="blocking"]').click();
-          flush(() => {
-            assert.equal(element._visibleChecks.length, 1);
-            done();
-          });
-        });
-      });
-    });
-
-    suite('with large number of checks', () => {
-      setup(done => {
-        const CHECK3 = Object.assign({}, CHECK1, {state: 'FAILED'});
-        const CHECK4 = Object.assign({}, CHECK1, {state: 'FAILED',
-          blocking: [1, 2, 3]});
-        const checks = [];
-        for (let i = 1; i <= 20; i++) {
-          checks.push(...[CHECK1, CHECK2, CHECK3, CHECK4]);
-        }
-        getChecksResolve(checks);
-        flush(done);
-      });
-
-      test('rendered checks are limited by default', () => {
-        assert.equal(element._visibleChecks.length, CHECKS_LIMIT);
-      });
-
-      test('show more button expands to show all checks', () => {
-        const showMoreChecksButton = element.shadowRoot
-            .querySelector('.show-more-checks');
-        assert.isOk(showMoreChecksButton);
-        showMoreChecksButton.click();
-        flush(() => {
-          assert.equal(element._visibleChecks.length, element._checks.length);
-        });
-      });
-
-      test('show more button hides if checks are below limit', () => {
-        element._currentStatus = Statuses.NOT_STARTED;
-        flush(() => {
-          const showMoreChecksButton = element.querySelector(
-              '.show-more-checks');
-          assert.equal(showMoreChecksButton.style.display, 'none');
-        });
-      });
-    });
-  });
-
-</script>
diff --git a/gr-checks/gr-checks.js b/gr-checks/gr-checks.js
index 39152f5..d72e920 100644
--- a/gr-checks/gr-checks.js
+++ b/gr-checks/gr-checks.js
@@ -14,65 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import './gr-checks-chip-view.js';
-import './gr-checks-view.js';
-import './gr-checks-change-view-tab-header-view.js';
-import './gr-checks-change-list-header-view.js';
-import './gr-checks-change-list-item-cell-view.js';
-import './gr-checks-item.js';
-import './gr-checks-status.js';
 import {RebootFetcher} from './gr-checks-reboot.js';
 
-function installChecksLegacy(plugin) {
-  const getChecks = (change, revision) => {
-    return plugin.restApi().get(
-        '/changes/' + change + '/revisions/' + revision + '/checks?o=CHECKER');
-  };
-
-  // TODO(brohlfs): Enable this dashboard column when search queries start
-  // returning checks.
-  // plugin.registerDynamicCustomComponent(
-  //     'change-list-header',
-  //     'gr-checks-change-list-header-viewgg');
-  // plugin.registerDynamicCustomComponent(
-  //     'change-list-item-cell',
-  //     'gr-checks-change-list-item-cell-view');
-  plugin.registerCustomComponent(
-      'commit-container',
-      'gr-checks-chip-view').onAttached(
-      view => {
-        view['getChecks'] = getChecks;
-      }
-  );
-  plugin.registerDynamicCustomComponent(
-      'change-view-tab-header',
-      'gr-checks-change-view-tab-header-view'
-  );
-  plugin.registerDynamicCustomComponent(
-      'change-view-tab-content',
-      'gr-checks-view').onAttached(
-      view => {
-        view['isConfigured'] = repository => Promise.resolve(true);
-        view['getChecks'] = getChecks;
-      });
-}
-
-function installChecksReboot(plugin) {
+Gerrit.install(plugin => {
   const checksApi = plugin.checks();
   const fetcher = new RebootFetcher(plugin.restApi());
   checksApi.register({
-    fetch: (data) => fetcher.fetch(data)
+    fetch: data => fetcher.fetch(data),
   });
-}
-
-Gerrit.install(plugin => {
-  const experiments = window.ENABLED_EXPERIMENTS || [];
-  if (experiments.includes("UiFeature__ci_reboot_checks_checks")) {
-    // Until end of 2020 this is only interesting for developing purposes. So
-    // no real user is affected for the time being.
-    console.log('Installing checks REBOOT plugin.');
-    installChecksReboot(plugin);
-  } else {
-    installChecksLegacy(plugin);
-  }
 });
