<commit_before><template>
  <div>
    <q-btn
      icon="fa-trash"
      flat
      color="negative"
      @click="requestDeleteAccount"
      loader
      :value="isPending || dialogShown"
    >
      {{ $t('BUTTON.DELETE_ACCOUNT') }}
    </q-btn>
    <div
      v-if="hasNonFieldError"
      class="text-negative"
    >
      {{ firstNonFieldError }}
    </div>
  </div>
</template>

<script>
import { QField, QInput, QBtn, Dialog } from 'quasar'
import statusMixin from '@/mixins/statusMixin'

export default {
  components: { QField, QInput, QBtn },
  mixins: [statusMixin],
  data () {
    return {
      dialogShown: false,
    }
  },
  methods: {
    requestDeleteAccount () {
      this.dialogShown = true
      Dialog.create({
        title: this.$t('USERDATA.DIALOGS.REQUEST_DELETE_ACCOUNT.TITLE'),
        message: this.$t('USERDATA.DIALOGS.REQUEST_DELETE_ACCOUNT.MESSAGE'),
        buttons: [
          {
            label: this.$t('BUTTON.CANCEL'),
            handler: () => {
              this.dialogShown = false
            },
          },
          {
            label: this.$t('USERDATA.DIALOGS.REQUEST_DELETE_ACCOUNT.CONFIRM'),
            handler: () => {
              this.$emit('requestDeleteAccount')
              this.dialogShown = false
            },
          },
        ],
      })
    },
  },
}
</script>

<style scoped lang="stylus"></style><commit_msg>Use new dialog style for request-account-delete dialog (#989)<commit_after><template>
  <div>
    <q-btn
      icon="fa-trash"
      flat
      color="negative"
      @click="requestDeleteAccount"
      loader
      :value="isPending || dialogShown"
    >
      {{ $t('BUTTON.DELETE_ACCOUNT') }}
    </q-btn>
    <div
      v-if="hasNonFieldError"
      class="text-negative"
    >
      {{ firstNonFieldError }}
    </div>
  </div>
</template>

<script>
import { QField, QInput, QBtn, Dialog } from 'quasar'
import statusMixin from '@/mixins/statusMixin'

export default {
  components: { QField, QInput, QBtn },
  mixins: [statusMixin],
  data () {
    return {
      dialogShown: false,
    }
  },
  methods: {
    requestDeleteAccount () {
      this.dialogShown = true
      Dialog.create({
        title: this.$t('USERDATA.DIALOGS.REQUEST_DELETE_ACCOUNT.TITLE'),
        message: this.$t('USERDATA.DIALOGS.REQUEST_DELETE_ACCOUNT.MESSAGE'),
        cancel: this.$t('BUTTON.CANCEL'),
        ok: this.$t('USERDATA.DIALOGS.REQUEST_DELETE_ACCOUNT.CONFIRM'),
      })
        .then(() => {
          this.$emit('requestDeleteAccount')
          this.dialogShown = false
        })
        .catch(() => {
          this.dialogShown = false
        })
    },
  },
}
</script>

<style scoped lang="stylus"></style>
{'fraction_non_alphanumeric': 0.15005557613931086, 'fraction_numerical': 0.0011115227862171174, 'mean_word_length': 2.172737955346651, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 31, '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': '247478', 'n_tokens_mistral': 884, 'n_tokens_neox': 883, 'n_words': 141}