renderTable()

in src/content/components/BugList/BugList.js [202:259]


  renderTable() {
    const { props } = this;
    const totalBugs = this.filterResolved();
    const selectedBugs = Object.keys(this.state.selectedBugs);
    return (
      <table className={styles.bugTable}>
        <thead>
          {props.showSummaryBar ? (
            <tr
              className={props.compact ? styles.editorCompact : styles.editor}>
              {this.props.bulkEdit ? (
                <th className={`${styles.th} ${styles.bulkColumn}`}>
                  <input
                    type="checkbox"
                    value="all"
                    checked={
                      totalBugs.length > 0 &&
                      selectedBugs.length === totalBugs.length
                    }
                    onChange={this.onAllSelectedCheck}
                  />
                </th>
              ) : null}
              <th className={styles.th} colSpan={props.columns.length}>
                {this._renderSectionBugSelection(selectedBugs, totalBugs)}
              </th>
            </tr>
          ) : null}
          <tr className={styles.labels}>
            {this.props.bulkEdit ? <th className={styles.th} /> : null}
            {props.columns.map(id => (
              <th className={styles.th} key={id}>
                {getDisplayName(id)}
              </th>
            ))}
          </tr>
        </thead>
        <tbody>
          {totalBugs.map(bug => (
            <tr className={this.getRowClassName(bug)} key={bug.id}>
              {this.props.bulkEdit ? (
                <td className={`${styles.td} ${styles.bulkColumn}`}>
                  <input
                    type="checkbox"
                    value={bug.id}
                    data-bug-id={bug.id}
                    checked={!!this.state.selectedBugs[bug.id]}
                    onChange={this.onCheck}
                  />
                </td>
              ) : null}
              {props.columns.map(columnId => this.renderColumn(columnId, bug))}
            </tr>
          ))}
        </tbody>
      </table>
    );
  }