async componentWillMount()

in src/content/components/Triage/Triage.js [43:124]


  async componentWillMount() {
    this._isMounted = true;
    const prevIteration =
      this.context.iterations.getAdjacentIteration(-1).number;
    this.setState({
      triageOwner: this.context.teams.omc.find(user => user.is_triage_owner),
    });
    await this.context.qm.runCachedQueries(
      [
        {
          include_fields: prevColumns.concat(["whiteboard", "type"]),
          resolution: "---",
          rules: [
            {
              key: "keywords",
              operator: "notequals",
              value: "github-merged",
            },
            {
              key: "cf_fx_iteration",
              operator: "substring",
              value: prevIteration,
            },
            {
              operator: "OR",
              rules: [
                {
                  key: "blocked",
                  operator: "anywordssubstr",
                  value: this.context.metas.map(m => m.id).join(","),
                },
                {
                  key: "component",
                  operator: "anyexact",
                  value: BUGZILLA_TRIAGE_COMPONENTS.join(","),
                },
              ],
            },
          ],
        },
        {
          include_fields: columns.concat(["whiteboard", "type", "flags"]),
          resolution: "---",
          priority: "--",
          component: BUGZILLA_TRIAGE_COMPONENTS,
          order: "changeddate DESC",
          rules: [
            { key: "keywords", operator: "nowords", value: "meta" },
            {
              key: "status_whiteboard",
              operator: "notsubstring",
              value: "[blocked]",
            },
          ],
        },
      ],
      () => this._isMounted,
      ({
        rsp: [{ bugs: previousIterationBugs }, { bugs }],
        awaitingNetwork,
      }) => {
        let needinfoBugs = [];
        let untriagedBugs = [];
        for (let b of bugs) {
          if (isNeedInfo(b)) {
            needinfoBugs.push(b);
          } else {
            untriagedBugs.push(b);
          }
        }
        this.setState({
          loaded: true,
          awaitingNetwork,
          bugs,
          needinfoBugs,
          untriagedBugs,
          previousIterationBugs,
          prevIteration,
        });
      }
    );
  }