<commit_before>function onDisplayRenderScreen() {}

function onHideRenderScreen() {}

function addReviewItem(entity) {
    var container = $('.reconciliationsToReview');
    var newTemplate = $(".templates .reviewNewTemplate");
    var skippedTemplate = $(".templates .reviewSkippedTemplate");
    var reconciledTemplate = $(".templates .reviewReconciledTemplate");
    if (!entity) return;
    if (entity.isCVT() || null == entity.id || $.isArray(entity.id))
        return;

    var template;
    switch(entity.id){
      case "None": template = newTemplate.clone(); break;
      case ""    : template = skippedTemplate.clone(); break;
      default    : template = reconciledTemplate.clone(); break;
    }
    
    $(".candidateName",template).html("<a class='internalLink' href='#" + entity['/rec_ui/id'] + "'>" + textValue(entity) + "</a>");
    var freebaseName = null;
    if (entity['/rec_ui/freebase_name']){
        $.each(entity['/rec_ui/freebase_name'],function(idx,name){
            if (name.toLowerCase() === textValue(entity).toLowerCase())
                freebaseName = name;
        })
        freebaseName = freebaseName || entity['/rec_ui/freebase_name'][0];
    }
    var handleName = function(freebaseName) {
        $(".freebaseName", template).html(entity.freebaseLink(freebaseName));
        if (freebaseName && textValue(entity).toLowerCase() === freebaseName.toLowerCase())
            $(".freebaseName", template).addClass("identicalMatch");
    }
    if (freebaseName) handleName(freebaseName);
    else freebase.getName(entity.id, handleName);
        
    $(".internalLink", template).click(function(val) {
        $("#tabs > ul").tabs("select",0);
        displayReconChoices(entity["/rec_ui/id"]);
        return false;})
    container.append(template);
}<commit_msg>Fixes TOOL-98 - items aren't properly updated on the review screen<commit_after>function onDisplayRenderScreen() {}

function onHideRenderScreen() {}

function addReviewItem(entity) {
    var container = $('.reconciliationsToReview');
    var newTemplate = $(".templates .reviewNewTemplate");
    var skippedTemplate = $(".templates .reviewSkippedTemplate");
    var reconciledTemplate = $(".templates .reviewReconciledTemplate");
    if (!entity) return;
    if (entity.isCVT() || null == entity.id || $.isArray(entity.id))
        return;
    
    var template;
    switch(entity.id){
      case "None": template = newTemplate.clone(); break;
      case ""    : template = skippedTemplate.clone(); break;
      default    : template = reconciledTemplate.clone(); break;
    }
    
    var classSelector = "reviewEntity" + entity['/rec_ui/id'];
    template.addClass(classSelector);
    $("." + classSelector, container).remove();
    
    $(".candidateName",template).html("<a class='internalLink' href='#" + entity['/rec_ui/id'] + "'>" + textValue(entity) + "</a>");
    var freebaseName = null;
    if (entity['/rec_ui/freebase_name']){
        $.each(entity['/rec_ui/freebase_name'],function(idx,name){
            if (name.toLowerCase() === textValue(entity).toLowerCase())
                freebaseName = name;
        })
        freebaseName = freebaseName || entity['/rec_ui/freebase_name'][0];
    }
    var handleName = function(freebaseName) {
        $(".freebaseName", template).html(entity.freebaseLink(freebaseName));
        if (freebaseName && textValue(entity).toLowerCase() === freebaseName.toLowerCase())
            $(".freebaseName", template).addClass("identicalMatch");
    }
    if (freebaseName) handleName(freebaseName);
    else freebase.getName(entity.id, handleName);
        
    $(".internalLink", template).click(function(val) {
        $("#tabs > ul").tabs("select",0);
        displayReconChoices(entity["/rec_ui/id"]);
        return false;})
    container.append(template);
}
{'fraction_non_alphanumeric': 0.16469971151324417, 'fraction_numerical': 0.0015735641227380016, 'mean_word_length': 3.4870588235294115, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 9, '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': '6666588', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1110, 'n_words': 198}