Skip to content

Commit

Permalink
fix timestamp qualification checking in multiple badges scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
celuchmarek committed Jun 26, 2024
1 parent 0e485d3 commit f028bea
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private static HBox createMultipleBadges(SignatureQualification signatureQualifi

var simple = reports.getSimpleReport();
for (var timestamp : simple.getSignatureTimestamps(signatureId)) {
var isQualified = timestamp.getQualificationDetails() != null;
var isQualified = simple.getTimestampQualification(timestamp.getId()) == TimestampQualification.QTSA;
var isFailed = timestamp.getIndication() == Indication.TOTAL_FAILED
|| timestamp.getIndication() == Indication.FAILED;
var isIndeterminate = timestamp.getIndication() == Indication.INDETERMINATE;
Expand All @@ -152,16 +152,13 @@ private static HBox createMultipleBadges(SignatureQualification signatureQualifi
flowPane.getChildren().add(createInvalidBadge("Neplatná ČP"));

else if (isIndeterminate)
flowPane.getChildren().add(
createUnknownBadge("Neznáma ČP"));
flowPane.getChildren().add(createUnknownBadge("Neznáma ČP"));

else if (isQualified)
flowPane.getChildren().add(
createValidQualifiedBadge(simple.getTimestampQualification(timestamp.getId()).getReadable()));
flowPane.getChildren().add(createValidQualifiedBadge(simple.getTimestampQualification(timestamp.getId()).getReadable()));

else
flowPane.getChildren().add(
createUnknownBadge("Neznáma ČP"));
flowPane.getChildren().add(createUnknownBadge("Neznáma ČP"));
}

return new HBox(flowPane);
Expand Down

0 comments on commit f028bea

Please sign in to comment.