<commit_before>import $ from 'jquery';
import app from '../../../app';
import loadTemplate from '../../../utils/loadTemplate';
import ServerConfig from '../../../models/ServerConfig';
import BaseModal from '../BaseModal';
import Configurations from './Configurations';
import ConfigurationForm from './ConfigurationForm';

export default class extends BaseModal {
  constructor(options = {}) {
    const opts = {
      initialTabView: 'Configurations',
      ...options,
    };

    super(opts);
    this.options = opts;

    this.tabViewCache = {};
    this.tabViews = {
      Configurations,
      ConfigurationForm,
    };
  }

  className() {
    return `${super.className()} connectionManagement tabbedModal modalScrollPage`;
  }

  events() {
    return {
      'click .js-tab': 'onTabClick',
      ...super.events(),
    };
  }

  get closeClickTargets() {
    return [
      ...this.$closeClickTargets.get(),
      ...super.closeClickTargets,
    ];
  }

  onTabClick(e) {
    const targ = $(e.target).closest('.js-tab');
    this.selectTab(targ.data('tab'), targ);
  }

  createConfigurationsTabView() {
    const configTab = this.createChild(Configurations, {
      collection: app.serverConfigs,
    });

    this.listenTo(configTab, 'editConfig',
      e => this.selectTab('ConfigForm', { configFormModel: e.model }));
    this.listenTo(configTab, 'newClick', e => this.selectTab('ConfigForm'));

    return configTab;
  }

  createConfigurationFormView(model) {<commit_msg>lint fix<commit_after>import $ from 'jquery';
import app from '../../../app';
import loadTemplate from '../../../utils/loadTemplate';
import ServerConfig from '../../../models/ServerConfig';
import BaseModal from '../BaseModal';
import Configurations from './Configurations';
import ConfigurationForm from './ConfigurationForm';

export default class extends BaseModal {
  constructor(options = {}) {
    const opts = {
      initialTabView: 'Configurations',
      ...options,
    };

    super(opts);
    this.options = opts;

    this.tabViewCache = {};
    this.tabViews = {
      Configurations,
      ConfigurationForm,
    };
  }

  className() {
    return `${super.className()} connectionManagement tabbedModal modalScrollPage`;
  }

  events() {
    return {
      'click .js-tab': 'onTabClick',
      ...super.events(),
    };
  }

  get closeClickTargets() {
    return [
      ...this.$closeClickTargets.get(),
      ...super.closeClickTargets,
    ];
  }

  onTabClick(e) {
    const targ = $(e.target).closest('.js-tab');
    this.selectTab(targ.data('tab'), targ);
  }

  createConfigurationsTabView() {
    const configTab = this.createChild(Configurations, {
      collection: app.serverConfigs,
    });

    this.listenTo(configTab, 'editConfig',
      e => this.selectTab('ConfigForm', { configFormModel: e.model }));
    this.listenTo(configTab, 'newClick', () => this.selectTab('ConfigForm'));

    return configTab;
  }

  createConfigurationFormView(model) {
{'fraction_non_alphanumeric': 0.1597035040431267, 'fraction_numerical': 0.0, 'mean_word_length': 3.0230352303523036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1790135', 'n_tokens_mistral': 874, 'n_tokens_neox': 867, 'n_words': 174}