Files
habitica/website/client/components/settings/deleteModal.vue
negue 4108a22d78 [WIP] bootstrap-vue upgrade (#9178)
* update bootstrap-vue to 1.0.0-beta.9 - remove all individual bootstrap components and use BootstrapVue into Vue

* change modal action names from show::modal to bv::show::modal

* check if drops are undefined

* fix modal widths - sellModal now using input instead of dropbox

* upgrade to bootstrap 4.0beta

* include package-lock changes

* fix app menu dropdown position

* upgrade bootstrap to beta2 (was missing grid offset and other fixes) - refix header menu position

* fix tags popup (auto width to max not working) - fix filter panel width (adding width: 100% works until max-width)

* show hide logo on different screensize (new css breakpoints - http://getbootstrap.com/docs/4.0/utilities/display/ )

* fix package-lock?

* fix active button style / app header toggle button

* fix package-lock !

* update package lock after merge - new mixin "openedItemRows" to save the "show more/show less" in stable

* mixin naming style

* fix buyQuestModal marginTop

* fix customMenuDropdown position

* fix userDropdown items
2017-11-08 18:40:37 +01:00

63 lines
1.8 KiB
Vue

<template lang="pug">
b-modal#delete(:title="$t('deleteAccount')", :hide-footer='true' size='md')
.regular-delete(v-if='user.auth.local.email')
strong {{ $t('deleteLocalAccountText') }}
br
.row
.col-6
input.form-control(type='password', v-model='password')
br
.row
#feedback.col-12.form-group
label(for='feedbackTextArea') {{ $t('feedback') }}
textarea#feedbackTextArea.form-control(v-model='feedback')
.modal-footer
button.btn.btn-primary(@click='close()') {{ $t('neverMind') }}
button.btn.btn-danger(@click='deleteAccount()', :disabled='!password') {{ $t('deleteDo') }}
.modal-header
.social-delete(v-if='!user.auth.local.email')
h4 {{ $t('deleteAccount') }}
.modal-body
p {{ $t('deleteSocialAccountText') }}
br
.row
.col-md-6
input.form-control(type='text', v-model='password')
.modal-footer
button.btn.btn-default(@click='close()') {{ $t('neverMind') }}
button.btn.btn-danger(:disabled='!password', @click='deleteAccount()') {{ $t('deleteDo') }}
</template>
<script>
import axios from 'axios';
import { mapState } from 'client/libs/store';
export default {
data () {
return {
password: '',
feedback: '',
};
},
computed: {
...mapState({user: 'user.data'}),
},
methods: {
close () {
this.$root.$emit('bv::hide::modal', 'reset');
},
async deleteAccount () {
await axios.delete('/api/v3/user', {
data: {
password: this.password,
feedback: this.feedback,
},
});
localStorage.clear();
window.location.href = '/static/home';
this.$root.$emit('bv::hide::modal', 'reset');
},
},
};
</script>