<commit_before>define(['app', 'underscore', '/app/views/forms/edit/edit.js',
        '../view/view-endorsement.directive.js', '/app/services/search-service.js'], function (app, _) {

  app.controller("editEndorsement", ["$scope", "$http", "searchService", "$controller", "$location", 'realm',
  function ($scope, $http, searchService, $controller,$location, realm) {
    $controller('editController', {$scope: $scope});

    $scope.temp = {};
    $scope.path= $location.path();

    _.extend($scope.options, {
      endorsedSchemas		: function () {
        var schemas = [];
            schemas.push({"identifier": "modelContractualClause", "title": "Model Contractual Clauses, Codes of Conduct, Guidelines, Best Practices and/or Standards"});
            schemas.push({"identifier": "communityProtocol", "title": "Community protocols and procedures and customary laws"});
        return schemas;
      },
      referenceRecords    : function(){
          console.log('ref rec');
            return loadReferenceRecords();
        }
    });

    function loadReferenceRecords(){
        if($scope.temp.endorsedSchema){
            var searchQuery = {
                fields: 'title_t, createdDate_dt, schema_s, identifier_s',
                query : 'realm_ss:' + realm.value.toLowerCase() + ' AND schema_s:' + $scope.temp.endorsedSchema.identifier
            };

            return searchService.list(searchQuery)
                .then(function(data){
                    var records = _.map(data.data.response.docs, function(document){
                                        return { identifier : document.identifier_s, title : document.title_t } ;
                                    });
                    console.log(records);
                    return records;
                });
<commit_msg>add vlr to endorsement schema list<commit_after>define(['app', 'underscore', '/app/views/forms/edit/edit.js',
        '../view/view-endorsement.directive.js', '/app/services/search-service.js'], function (app, _) {

  app.controller("editEndorsement", ["$scope", "$http", "searchService", "$controller", "$location", 'realm',
  function ($scope, $http, searchService, $controller,$location, realm) {
    $controller('editController', {$scope: $scope});

    $scope.temp = {};
    $scope.path= $location.path();

    _.extend($scope.options, {
      endorsedSchemas		: function () {
        var schemas = [];
            schemas.push({"identifier": "resource", "title": "Virtual Library Records"});
            schemas.push({"identifier": "modelContractualClause", "title": "Model Contractual Clauses, Codes of Conduct, Guidelines, Best Practices and/or Standards"});
            schemas.push({"identifier": "communityProtocol", "title": "Community protocols and procedures and customary laws"});
        return schemas;
      },
      referenceRecords    : function(){
          console.log('ref rec');
            return loadReferenceRecords();
        }
    });

    function loadReferenceRecords(){
        if($scope.temp.endorsedSchema){
            var searchQuery = {
                fields: 'title_t, createdDate_dt, schema_s, identifier_s',
                query : 'realm_ss:' + realm.value.toLowerCase() + ' AND schema_s:' + $scope.temp.endorsedSchema.identifier
            };

            return searchService.list(searchQuery)
                .then(function(data){
                    var records = _.map(data.data.response.docs, function(document){
                                        return { identifier : document.identifier_s, title : document.title_t } ;
                                    });
                    console.log(records);
                    return records;
                });

{'fraction_non_alphanumeric': 0.14231907452246434, 'fraction_numerical': 0.0, 'mean_word_length': 2.3285586392121753, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1075482', 'n_tokens_mistral': 984, 'n_tokens_neox': 938, 'n_words': 199}