<commit_before><link rel="import" href="../../../../../bower_components/polymer/polymer-element.html">
<link rel="import" href="../../../../../bower_components/polymer/lib/elements/dom-if.html">
<link rel="import" href="../../../../../bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../../../../../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="../../../../../bower_components/iron-icons/image-icons.html">

<dom-module id="report-status">
  <template strip-whitespace>
    <style>
      :host {
        display: inline-block;
      }

      iron-icon {
        --iron-icon-width: 16px;
        --iron-icon-height: 16px;
        padding-right: 4px;
        margin-top: -2px;
      }

      :host([status-type="default"]) iron-icon {
        color: var(--primary-color);
      }

      :host([status-type="success"]) iron-icon {
        color: var(--success-color);
      }

      :host([status-type="error"]) iron-icon {
        color: var(--dark-error-color);
      }

      :host([status-type="neutral"]) iron-icon {
        color: var(--secondary-text-color);
      }

      :host([status-type="warning"]) iron-icon {
        color: var(--warning-color);
      }

      :host([status-type="no-status"]) iron-icon {
        color: var(--medium-icon-color);
      }
    </style>

    <template is="dom-if" if="[[!noIcon]]">
      <iron-icon icon$="[[icon]]"></iron-icon>
    </template>
    <template is="dom-if" if="[[!noLabel]]">
      <span>[[label]]</span>
    </template>
    <slot></slot>

  </template>

  <script>

    /**
     * @polymer
     * @customElement
     * @extends {Polymer.Element}
     */
    class ReportStatus extends Polymer.Element {
      static get is() {
        return 'report-status';
      }

      static get properties() {
        return {
          status: {
            value: null
          },
          noLabel: {
            type: Boolean,
            value: false
          },
          noIcon: {
            type: Boolean,
            value: false
          },
          statusType: {
            type: String,
            computed: '_computeStatusType(status)',
            reflectToAttribute: true
          },
          label: {
            type: String,
            computed: '_computeLabel(status, final, reportType)'
          },
          icon: {
            type: String,
            computed: '_computeIcon(statusType)'
          },
          final: {
            type: Boolean,
            value: false
          },
          reportType: {
            type: String,
            value: ''
          }
        };
      }

      _computeStatusType(status) {
        if (status === null || typeof status === 'undefined') {
          return 'no-status';
        }
        switch (status) {
          case '1':
          case 'Sub':
          case 'Met':
          case 'OnT':
          case 'Com':
          case 'Acc':
            return 'success';
          case '2':
          case 'Ove':
          case 'Sen':
            return 'error';
          case '3':
          case 'Due':
          case 'NoP':
          case 'Ong':
            return 'neutral';
          case 'Rej':
          case 'Con':
          case 'Pla':
            return 'warning';
          case 'NoS':
            return 'no-status';
          default:
            return 'default';
        }
      }

      _computeLabel(status, final, reportType) {
        if (status === null || typeof status === 'undefined') {
          return 'No Status';
        }
        switch (status) {
          case '1':
            return 'Nothing due';
          case '2':
          case 'Ove':
            return 'Overdue';
          case '3':
          case 'Due':
            return 'Due';
          case 'Sub':
            return 'Submitted';
          case 'Rej':
            return 'Rejected';
          case 'Met':
            return final ? 'Met results as planned' : 'Met';
          case 'OnT':
            return 'On Track';
          case 'NoP':
            return 'No Progress';
          case 'Con':
            return final ? 'Constrained (partially met result)' : 'Constrained';
          case 'Ong':
            return 'Ongoing';
          case 'Pla':
            return 'Planned';
          case 'Com':
            return 'Completed';
          case 'NoS':
            return 'No Status';
          case 'Sen':
            return 'Sent Back';
          case 'Acc':
            return reportType !== 'HR' ? 'Accepted' : 'Received';
        }
      }

      _computeIcon(type) {
        if (!this.hideIcon) {
          switch (type) {
            case 'success':
              return 'icons:check-circle';
            case 'error':
            case 'warning':
              return 'icons:error';
          }
        }
        return 'image:lens';
      }
    }

    window.customElements.define(ReportStatus.is, ReportStatus);
  </script>
</dom-module><commit_msg>submitted status icon update<commit_after><link rel="import" href="../../../../../bower_components/polymer/polymer-element.html">
<link rel="import" href="../../../../../bower_components/polymer/lib/elements/dom-if.html">
<link rel="import" href="../../../../../bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../../../../../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="../../../../../bower_components/iron-icons/image-icons.html">

<dom-module id="report-status">
  <template strip-whitespace>
    <style>
      :host {
        display: inline-block;
      }

      iron-icon {
        --iron-icon-width: 16px;
        --iron-icon-height: 16px;
        padding-right: 4px;
        margin-top: -2px;
      }

      :host([status-type="default"]) iron-icon {
        color: var(--primary-color);
      }

      :host([status-type="submitted"]) iron-icon,
      :host([status-type="success"]) iron-icon {
        color: var(--success-color);
      }

      :host([status-type="error"]) iron-icon {
        color: var(--dark-error-color);
      }

      :host([status-type="neutral"]) iron-icon {
        color: var(--secondary-text-color);
      }

      :host([status-type="warning"]) iron-icon {
        color: var(--warning-color);
      }

      :host([status-type="no-status"]) iron-icon {
        color: var(--medium-icon-color);
      }
    </style>

    <template is="dom-if" if="[[!noIcon]]">
      <iron-icon icon$="[[icon]]"></iron-icon>
    </template>
    <template is="dom-if" if="[[!noLabel]]">
      <span>[[label]]</span>
    </template>
    <slot></slot>

  </template>

  <script>

    /**
     * @polymer
     * @customElement
     * @extends {Polymer.Element}
     */
    class ReportStatus extends Polymer.Element {
      static get is() {
        return 'report-status';
      }

      static get properties() {
        return {
          status: {
            value: null
          },
          noLabel: {
            type: Boolean,
            value: false
          },
          noIcon: {
            type: Boolean,
            value: false
          },
          statusType: {
            type: String,
            computed: '_computeStatusType(status)',
            reflectToAttribute: true
          },
          label: {
            type: String,
            computed: '_computeLabel(status, final, reportType)'
          },
          icon: {
            type: String,
            computed: '_computeIcon(statusType)'
          },
          final: {
            type: Boolean,
            value: false
          },
          reportType: {
            type: String,
            value: ''
          }
        };
      }

      _computeStatusType(status) {
        if (status === null || typeof status === 'undefined') {
          return 'no-status';
        }
        switch (status) {
          case '1':
          case 'Met':
          case 'OnT':
          case 'Com':
          case 'Acc':
            return 'success';
          case 'Sub':
            return 'submitted';
          case '2':
          case 'Ove':
          case 'Sen':
            return 'error';
          case '3':
          case 'Due':
          case 'NoP':
          case 'Ong':
            return 'neutral';
          case 'Rej':
          case 'Con':
          case 'Pla':
            return 'warning';
          case 'NoS':
            return 'no-status';
          default:
            return 'default';
        }
      }

      _computeLabel(status, final, reportType) {
        if (status === null || typeof status === 'undefined') {
          return 'No Status';
        }
        switch (status) {
          case '1':
            return 'Nothing due';
          case '2':
          case 'Ove':
            return 'Overdue';
          case '3':
          case 'Due':
            return 'Due';
          case 'Sub':
            return 'Submitted';
          case 'Rej':
            return 'Rejected';
          case 'Met':
            return final ? 'Met results as planned' : 'Met';
          case 'OnT':
            return 'On Track';
          case 'NoP':
            return 'No Progress';
          case 'Con':
            return final ? 'Constrained (partially met result)' : 'Constrained';
          case 'Ong':
            return 'Ongoing';
          case 'Pla':
            return 'Planned';
          case 'Com':
            return 'Completed';
          case 'NoS':
            return 'No Status';
          case 'Sen':
            return 'Sent Back';
          case 'Acc':
            return reportType !== 'HR' ? 'Accepted' : 'Received';
        }
      }

      _computeIcon(type) {
        if (!this.hideIcon) {
          switch (type) {
            case 'success':
              return 'icons:check-circle';
            case 'submitted':
              return 'icons:assignment-turned-in';
            case 'error':
            case 'warning':
              return 'icons:error';
          }
        }
        return 'image:lens';
      }
    }

    window.customElements.define(ReportStatus.is, ReportStatus);
  </script>
</dom-module>
{'fraction_non_alphanumeric': 0.15454184058835221, 'fraction_numerical': 0.002385211687537269, 'mean_word_length': 1.3925344745601522, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3018281', 'n_tokens_mistral': 2868, 'n_tokens_neox': 2780, 'n_words': 618}