<commit_before>class Marty::DataImportView < Marty::CmFormPanel
  include Marty::Extras::Layout

  action :apply do |a|
    a.text  	= I18n.t("data_import_view.import")
    a.tooltip  	= I18n.t("data_import_view.import")
    a.icon  	= :database_go
    a.disabled 	= false
  end

  js_configure do |c|
    c.set_result = <<-JS
      function(html) {
	var result = this.netzkeGetComponent('result');
	result.updateBodyHtml(html);
      }
      JS

    c.init_component = <<-JS
      function() {
        var me = this;
        me.callParent();
        var form = me.getForm();

        var comboname = form.findField('import_type');
        var textname  = form.findField('import_data');

        comboname.on('select', function(combo, record) {
          textname.setValue("");
          me.netzkeGetComponent('result').updateBodyHtml('');
        });
      }<commit_msg>When the user re-runs the currently selected import, the results/errors text is cleared out.<commit_after>class Marty::DataImportView < Marty::CmFormPanel
  include Marty::Extras::Layout

  action :apply do |a|
    a.text  	= I18n.t("data_import_view.import")
    a.tooltip  	= I18n.t("data_import_view.import")
    a.icon  	= :database_go
    a.disabled 	= false
  end

  js_configure do |c|

    c.set_result = <<-JS
      function(html) {
	var result = this.netzkeGetComponent('result');
	result.updateBodyHtml(html);
      }
      JS

    c.init_component = <<-JS
      function() {
        var me = this;
        me.callParent();
        var form = me.getForm();

        var comboname = form.findField('import_type');
        var textname  = form.findField('import_data');
        var importbutton = me.actions["apply"].items[0];

        comboname.on('select', function(combo, record) {
          textname.setValue("");
          me.netzkeGetComponent('result').updateBodyHtml('');
        });

        importbutton.on('click', function(t, e, ops) {
          me.netzkeGetComponent('result').updateBodyHtml('');
        });
      }
{'fraction_non_alphanumeric': 0.13937282229965156, 'fraction_numerical': 0.004479840716774514, 'mean_word_length': 2.634719710669078, 'pattern_counts': {'":': 0, '<': 13, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1675978', 'n_tokens_mistral': 666, 'n_tokens_neox': 646, 'n_words': 121}