Examples of ApprovalDetail


Examples of com.google.gerrit.common.data.ApprovalDetail

    final boolean canRemoveReviewers = detail.getChange().getStatus().isOpen() //
        && control.getCurrentUser() instanceof IdentifiedUser;
    final HashMap<Account.Id, ApprovalDetail> ad =
        new HashMap<Account.Id, ApprovalDetail>();
    for (PatchSetApproval ca : allApprovals) {
      ApprovalDetail d = ad.get(ca.getAccountId());
      if (d == null) {
        d = new ApprovalDetail(ca.getAccountId());
        d.setCanRemove(canRemoveReviewers);
        ad.put(d.getAccount(), d);
      }
      if (d.canRemove()) {
        d.setCanRemove(control.canRemoveReviewer(ca));
      }
      if (ca.getPatchSetId().equals(psId)) {
        d.add(ca);
      }
    }

    final Account.Id owner = detail.getChange().getOwner();
    if (ad.containsKey(owner)) {
View Full Code Here

Examples of com.google.gerrit.common.data.ApprovalDetail

    final boolean canRemoveReviewers = detail.getChange().getStatus().isOpen() //
        && control.getCurrentUser() instanceof IdentifiedUser;
    final HashMap<Account.Id, ApprovalDetail> ad =
        new HashMap<Account.Id, ApprovalDetail>();
    for (PatchSetApproval ca : allApprovals) {
      ApprovalDetail d = ad.get(ca.getAccountId());
      if (d == null) {
        d = new ApprovalDetail(ca.getAccountId());
        d.setCanRemove(canRemoveReviewers);
        ad.put(d.getAccount(), d);
      }
      if (d.canRemove()) {
        d.setCanRemove(control.canRemoveReviewer(ca));
      }
      if (ca.getPatchSetId().equals(psId)) {
        d.add(ca);
      }
    }

    final Account.Id owner = detail.getChange().getOwner();
    if (ad.containsKey(owner)) {
View Full Code Here

Examples of com.google.gerrit.common.data.ApprovalDetail

            columns.add(lbl.label);
          }

          switch (lbl.status) {
            case OK: {
              ApprovalDetail ad = byUser.get(lbl.appliedBy);
              if (ad != null) {
                ad.approved(lbl.label);
              }
              break;
            }

            case REJECT: {
              ApprovalDetail ad = byUser.get(lbl.appliedBy);
              if (ad != null) {
                ad.rejected(lbl.label);
              }
              break;
            }

            case MAY:
              break;

            case NEED:
            case IMPOSSIBLE:
              if (reportedMissing.add(lbl.label)) {
                Element li = DOM.createElement("li");
                li.setClassName(Gerrit.RESOURCES.css().missingApproval());
                DOM.setInnerText(li, Util.M.needApproval(lbl.label));
                DOM.appendChild(missingList, li);
              }
              break;
          }
        }
      }
      missing.setVisible(!reportedMissing.isEmpty());

    } else {
      for (ApprovalDetail ad : approvals) {
        for (PatchSetApproval psa : ad.getPatchSetApprovals()) {
          ApprovalType legacyType = types.byId(psa.getCategoryId());
          if (legacyType == null) {
            continue;
          }
          String labelName = legacyType.getCategory().getLabelName();
          if (psa.getValue() != 0 ) {
            if (psa.getValue() == legacyType.getMax().getValue()) {
              ad.approved(labelName);
            } else if (psa.getValue() == legacyType.getMin().getValue()) {
              ad.rejected(labelName);
            }
          }
          if (!columns.contains(labelName)) {
            columns.add(labelName);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.