<commit_before>const { CREATE_JOURNAL_DOCUMENT } = require('../../app/action-types')

const { component, on, emits, wire } = capsid

/**
 * The form component which creates journal with `.is-primary` button.
 */
@component('js-create-journal-form')
class CreateJournalForm {
  @wire.el('[name="title"]') get title () {}
  @wire.el('[name="currencyCode"]') get currencyCode () {}
  @wire.el('[name="commaPeriodSetting"]') get commaPeriodSetting () {}
  @wire.el('[name="startDate"]') get startDate () {}
  @wire.el('[name="endDate"]') get endDate () {}
  @wire.el('button.is-primary') get primaryButton () {}
  @wire.el('button.is-danger') get cancelButton () {}

  @on('click', { at: 'button.is-primary' })
  @emits(CREATE_JOURNAL_DOCUMENT)
  createJournal (e) {
    e.preventDefault()

    this.primaryButton.setAttribute('disabled', true)
    this.cancelButton.setAttribute('disabled', true)

    return {
      title: this.title.value,
      currencyCode: this.currencyCode.value,
      commaPeriodSetting: this.commaPeriodSetting.value,
      startDate: this.startDate.dataset.date,
      endDate: this.endDate.dataset.date
    }
  }

  @on('click', { at: 'button.is-danger' })
  cancel (e) {
    e.preventDefault()
    history.back()
  }
}

module.exports = CreateJournalForm<commit_msg>fix: fix parameter handling of create-journal process<commit_after>const { CREATE_JOURNAL_DOCUMENT } = require('../../app/action-types')

const { component, on, emits, wire } = capsid

/**
 * The form component which creates journal with `.is-primary` button.
 */
@component('js-create-journal-form')
class CreateJournalForm {
  @wire.el('[name="title"]') get title () {}
  @wire.el('[name="currencyCode"]') get currencyCode () {}
  @wire.el('[name="commaPeriodSetting"]') get commaPeriodSetting () {}
  @wire.el('[name="startDate"]') get startDate () {}
  @wire.el('[name="endDate"]') get endDate () {}
  @wire.el('button.is-primary') get primaryButton () {}
  @wire.el('button.is-danger') get cancelButton () {}

  @on('click', { at: 'button.is-primary' })
  @emits(CREATE_JOURNAL_DOCUMENT)
  createJournal (e) {
    e.preventDefault()

    this.primaryButton.setAttribute('disabled', true)
    this.cancelButton.setAttribute('disabled', true)

    return {
      title: this.title.value,
      currencyCode: this.currencyCode.value,
      commaPeriodSetting: this.commaPeriodSetting.value,
      start: this.startDate.dataset.date,
      end: this.endDate.dataset.date
    }
  }

  @on('click', { at: 'button.is-danger' })
  cancel (e) {
    e.preventDefault()
    history.back()
  }
}

module.exports = CreateJournalForm
{'fraction_non_alphanumeric': 0.17584097859327216, 'fraction_numerical': 0.0, 'mean_word_length': 4.071705426356589, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3738007', 'n_tokens_mistral': 862, 'n_tokens_neox': 853, 'n_words': 151}