Skip to content

Commit

Permalink
Extract this nested ternary operation into an independent statement
Browse files Browse the repository at this point in the history
Delete comment code
  • Loading branch information
RodrigoZambrana committed Dec 16, 2024
1 parent e3f2455 commit 71ffbbf
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,7 @@ protected void populateItem(final ListItem<Auditor> item) {
item.add(new Label("name", currentAuditor.getName()));
item.add(new Label("mail", currentAuditor.getMail()));
item.add(new Label("isCommissioner", (currentAuditor.isCommissioner() ? getString("auditorManagementCommissionerYes") : getString("auditorManagementCommissionerNo"))));
item.add(new Label("agreedConformity", (currentAuditor.isCommissioner() ? (currentAuditor.isAgreedConformity() ? getString("auditorManagementCommissionerYes") : getString("auditorManagementCommissionerNo")) : "-")));

// String auditorLinkText = LinksUtils.buildAuditorResultsLink(currentAuditor.getResultToken());
// Label auditorLinkTextLabel = new Label("auditorLinkText", auditorLinkText);
// ExternalLink auditorLink = new ExternalLink("auditorLink", auditorLinkText);
// auditorLink.add(auditorLinkTextLabel);
// item.add(auditorLink);

// Feature: WatchAuditLinkRegistryAndHideAutitLink
item.add(new Label("agreedConformity", getAgreedConformityLabel(currentAuditor)));

String auditorLinkText = LinksUtils.buildAuditorResultsLink(currentAuditor.getResultToken());
String userAdminId = SecurityUtils.getUserAdminId();
Expand Down Expand Up @@ -96,6 +88,14 @@ public void onConfirm() {
} catch (Exception e) {
appLogger.error(e);
}

}

private String getAgreedConformityLabel(Auditor currentAuditor) {
if (currentAuditor.isCommissioner()) {
return currentAuditor.isAgreedConformity() ? getString("auditorManagementCommissionerYes") : getString("auditorManagementCommissionerNo");
}
return "-";
}

}

0 comments on commit 71ffbbf

Please sign in to comment.