<commit_before>import Ember from 'ember';


export default Ember.Component.extend({

    data : [],
    pagebackbtn : null,
    pagenextbtn : null,

    init(){
        this._super(...arguments);
        let data = this.processData(this.get('data.hits.hits'));
        this.set('data', data); 
    }, 
    pagebackbtn: Ember.computed('page',  function() {
        if(Number(this.parameters["page"]) == 0) {
            return 'disable';
        }else{
            return null;
        }
     }),
     pagenextbtn: Ember.computed('data',  function() {
        if(this.get('data').length < 10){
            return 'disable';
        }else{
            return null;
        }
     }),
    processData (data) {
        return data.map((datum) => {
            var options = {year: 'numeric', month: 'long', day: 'numeric' };
            options.timeZone = 'UTC';
            if (datum._source.description) {
                datum["description_truncated"] = datum._source.description.substring(0,200)+"..."
            }
            if (datum._source.date) {
                datum["_source"]["date"] = (new Date(datum["_source"]["date"])).toLocaleDateString('en-US', options);
            }
            if (datum._source.date_created) {
                datum["_source"]["date_created"] = (new Date(datum["_source"]["date_created"])).toLocaleDateString('en-US', options)
            }
            if (datum._source.date_modified) {
                datum["_source"]["date_modified"] = (new Date(datum["_source"]["date_modified"])).toLocaleDateString('en-US', options)
            }
            if (datum._source.date_published) {
                datum["_source"]["date_published"] = (new Date(datum["_source"]["date_published"])).toLocaleDateString('en-US', options)
            }
            if (datum._source.date_updated) {
                datum["_source"]["date_updated"] = (new Date(datum["_source"]["date_updated"])).toLocaleDateString('en-US', options)
            }
            return datum;
        });
    },

    actions: {<commit_msg>If page parameters are removed it still disables the back button. [SIDASH-128] (#185)<commit_after>import Ember from 'ember';


export default Ember.Component.extend({

    data : [],
    pagebackbtn : null,
    pagenextbtn : null,

    init(){
        this._super(...arguments);
        let data = this.processData(this.get('data.hits.hits'));
        this.set('data', data); 
    }, 
    pagebackbtn: Ember.computed('page',  function() {
          let page = Number(this.parameters['page']);
          if (page == 0 || !page) {
              return 'disable';
          } else {
              return null;
          }
     }),
     pagenextbtn: Ember.computed('data',  function() {
        if(this.get('data').length < 10){
            return 'disable';
        }else{
            return null;
        }
     }),
    processData (data) {
        return data.map((datum) => {
            var options = {year: 'numeric', month: 'long', day: 'numeric' };
            options.timeZone = 'UTC';
            if (datum._source.description) {
                datum['description_truncated'] = datum._source.description.substring(0,200)+'...'
            }
            if (datum._source.date) {
                datum["_source"]["date"] = (new Date(datum["_source"]["date"])).toLocaleDateString('en-US', options);
            }
            if (datum._source.date_created) {
                datum["_source"]["date_created"] = (new Date(datum["_source"]["date_created"])).toLocaleDateString('en-US', options)
            }
            if (datum._source.date_modified) {
                datum["_source"]["date_modified"] = (new Date(datum["_source"]["date_modified"])).toLocaleDateString('en-US', options)
            }
            if (datum._source.date_published) {
                datum["_source"]["date_published"] = (new Date(datum["_source"]["date_published"])).toLocaleDateString('en-US', options)
            }
            if (datum._source.date_updated) {
                datum["_source"]["date_updated"] = (new Date(datum["_source"]["date_updated"])).toLocaleDateString('en-US', options)
            }
            return datum;
        });
    },

    actions: {
{'fraction_non_alphanumeric': 0.16527744701119315, 'fraction_numerical': 0.004763038818766373, 'mean_word_length': 2.1296572280178836, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4028484', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1251, 'n_words': 197}