Don't show archived validation reports

This commit is contained in:
iadgovuser29 2024-06-21 15:10:32 -04:00
parent adaf637456
commit 806155e19d
2 changed files with 6 additions and 1 deletions

View File

@ -2,12 +2,17 @@ package hirs.attestationca.persist.entity.manager;
import hirs.attestationca.persist.entity.userdefined.Device;
import hirs.attestationca.persist.entity.userdefined.SupplyChainValidationSummary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.UUID;
import java.util.List;
@Repository
public interface SupplyChainValidationSummaryRepository extends JpaRepository<SupplyChainValidationSummary, UUID> {
SupplyChainValidationSummary findByDevice(Device device);
List<SupplyChainValidationSummary> findByArchiveFlagFalse();
Page<SupplyChainValidationSummary> findByArchiveFlagFalse(Pageable pageable);
}

View File

@ -122,7 +122,7 @@ public class ValidationReportsPageController extends PageController<NoPageParams
FilteredRecordsList<SupplyChainValidationSummary> records = new FilteredRecordsList<>();
int currentPage = input.getStart() / input.getLength();
Pageable paging = PageRequest.of(currentPage, input.getLength(), Sort.by(orderColumnName));
org.springframework.data.domain.Page<SupplyChainValidationSummary> pagedResult = supplyChainValidatorSummaryRepository.findAll(paging);
org.springframework.data.domain.Page<SupplyChainValidationSummary> pagedResult = supplyChainValidatorSummaryRepository.findByArchiveFlagFalse(paging);
if (pagedResult.hasContent()) {
records.addAll(pagedResult.getContent());