<commit_before>angular.module('os.biospecimen.specimenlist')
  .controller('SpecimenListSpecimensCtrl', function(
    $scope, $state, $stateParams, $timeout, $filter, currentUser, reqBasedDistOrShip, list,
    SpecimensHolder, SpecimenList, CollectionProtocol, Container, DeleteUtil, Alerts, Util) {

    function init() { 
      $scope.orderCreateOpts =    {resource: 'Order', operations: ['Create']};
      $scope.shipmentCreateOpts = {resource: 'ShippingAndTracking', operations: ['Create']};
      $scope.specimenUpdateOpts = {resource: 'VisitAndSpecimen', operations: ['Update']};

      $scope.ctx = {
        list: list,
        spmnsInView: [],
        filterOpts: {},
        filterPvs: {init: false},
        selection: {all: false, any: false, specimens: []},
        reqBasedDistOrShip: (reqBasedDistOrShip.value == 'true'),
        url: SpecimenList.url(),
        breadcrumbs: $stateParams.breadcrumbs
      }

      $scope.$on('osRightDrawerOpen', initFilterPvs);

      $scope.pagingOpts = {
        totalSpmns: 0,
        currPage: 1,
        spmnsPerPage: 100
      };

      Util.filter($scope, 'ctx.filterOpts', loadSpecimens);
      $scope.$watch('pagingOpts.currPage', function() {
        loadSpecimens();
      });
    }

    function loadSpecimens(filterOpts) {
      if (filterOpts) {
        $scope.pagingOpts = {
          totalSpmns: 0,
          currPage: 1,
          spmnsPerPage: 100
        };
      }

      var pagingOpts = $scope.pagingOpts;
      var startAt = (pagingOpts.currPage - 1) * pagingOpts.spmnsPerPage;
      var maxResults = pagingOpts.spmnsPerPage + 1;

      var queryParams = angular.extend({startAt: startAt, maxResults: maxResults}, $scope.ctx.filterOpts);
      $scope.ctx.list.getSpecimens(queryParams).then(
        function(specimens) {
          pagingOpts.totalSpmns = (pagingOpts.currPage - 1) * pagingOpts.spmnsPerPage + specimens.length;
          if (specimens.length >= maxResults) {
            specimens.splice(specimens.length - 1, 1);
          }

          $scope.ctx.spmnsInView = specimens;
        }
      );
    };

    function initFilterPvs() {
      if ($scope.ctx.filterPvs.init) {
        return;
      }

      $scope.ctx.filterPvs.init = true;
      $scope.ctx.filterPvs.lineages = ['New', 'Aliquot', 'Derivative'];
      loadCpList();
      loadContainerList();
    }
<commit_msg>v3.5 release: Disabling pagination of specimens in cart<commit_after>angular.module('os.biospecimen.specimenlist')
  .controller('SpecimenListSpecimensCtrl', function(
    $scope, $state, $stateParams, $timeout, $filter, currentUser, reqBasedDistOrShip, list,
    SpecimensHolder, SpecimenList, CollectionProtocol, Container, DeleteUtil, Alerts, Util) {

    function init() { 
      $scope.orderCreateOpts =    {resource: 'Order', operations: ['Create']};
      $scope.shipmentCreateOpts = {resource: 'ShippingAndTracking', operations: ['Create']};
      $scope.specimenUpdateOpts = {resource: 'VisitAndSpecimen', operations: ['Update']};

      $scope.ctx = {
        list: list,
        spmnsInView: [],
        filterOpts: {},
        filterPvs: {init: false},
        selection: {all: false, any: false, specimens: []},
        reqBasedDistOrShip: (reqBasedDistOrShip.value == 'true'),
        url: SpecimenList.url(),
        breadcrumbs: $stateParams.breadcrumbs
      }

      $scope.$on('osRightDrawerOpen', initFilterPvs);

      $scope.pagingOpts = {
        totalSpmns: 0,
        currPage: 1,
        spmnsPerPage: 10000 // for v3.5, practically disabling list specimens pagination
      };

      Util.filter($scope, 'ctx.filterOpts', loadSpecimens);
      $scope.$watch('pagingOpts.currPage', function() {
        loadSpecimens();
      });
    }

    function loadSpecimens(filterOpts) {
      if (filterOpts) {
        $scope.pagingOpts = {
          totalSpmns: 0,
          currPage: 1,
          spmnsPerPage: 10000
        };
      }

      var pagingOpts = $scope.pagingOpts;
      var startAt = (pagingOpts.currPage - 1) * pagingOpts.spmnsPerPage;
      var maxResults = pagingOpts.spmnsPerPage + 1;

      var queryParams = angular.extend({startAt: startAt, maxResults: maxResults}, $scope.ctx.filterOpts);
      $scope.ctx.list.getSpecimens(queryParams).then(
        function(specimens) {
          pagingOpts.totalSpmns = (pagingOpts.currPage - 1) * pagingOpts.spmnsPerPage + specimens.length;
          if (specimens.length >= maxResults) {
            specimens.splice(specimens.length - 1, 1);
          }

          $scope.ctx.spmnsInView = specimens;
        }
      );
    };

    function initFilterPvs() {
      if ($scope.ctx.filterPvs.init) {
        return;
      }

      $scope.ctx.filterPvs.init = true;
      $scope.ctx.filterPvs.lineages = ['New', 'Aliquot', 'Derivative'];
      loadCpList();
      loadContainerList();
    }

{'fraction_non_alphanumeric': 0.1320091040761432, 'fraction_numerical': 0.007862611214566521, 'mean_word_length': 2.6844512195121952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5932431', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1558, 'n_words': 272}