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);
}