feat: Adds ability to delete contact without having to type name (#4155)

This commit is contained in:
Sivin Varghese
2022-03-11 17:00:55 +05:30
committed by GitHub
parent 619441ce1c
commit 578414d788
2 changed files with 7 additions and 21 deletions

View File

@@ -77,7 +77,6 @@
"CONFIRM": { "CONFIRM": {
"TITLE": "Confirm Deletion", "TITLE": "Confirm Deletion",
"MESSAGE": "Are you sure to delete ", "MESSAGE": "Are you sure to delete ",
"PLACE_HOLDER": "Please type {contactName} to confirm",
"YES": "Yes, Delete", "YES": "Yes, Delete",
"NO": "No, Keep" "NO": "No, Keep"
}, },

View File

@@ -126,17 +126,15 @@
@close="toggleMergeModal" @close="toggleMergeModal"
/> />
</div> </div>
<woot-confirm-delete-modal <woot-delete-modal
v-if="showDeleteModal" v-if="showDeleteModal"
:show.sync="showDeleteModal" :show.sync="showDeleteModal"
:on-close="closeDelete"
:on-confirm="confirmDeletion"
:title="$t('DELETE_CONTACT.CONFIRM.TITLE')" :title="$t('DELETE_CONTACT.CONFIRM.TITLE')"
:message="confirmDeleteMessage" :message="confirmDeleteMessage"
:confirm-text="deleteConfirmText" :confirm-text="$t('DELETE_CONTACT.CONFIRM.YES')"
:reject-text="deleteRejectText" :reject-text="$t('DELETE_CONTACT.CONFIRM.NO')"
:confirm-value="contact.name"
:confirm-place-holder-text="confirmPlaceHolderText"
@on-confirm="confirmDeletion"
@on-close="closeDelete"
/> />
</div> </div>
</template> </template>
@@ -221,22 +219,11 @@ export default {
return { twitter: twitterScreenName, ...(socialProfiles || {}) }; return { twitter: twitterScreenName, ...(socialProfiles || {}) };
}, },
// Delete Modal // Delete Modal
deleteConfirmText() {
return `${this.$t('DELETE_CONTACT.CONFIRM.YES')} ${this.contact.name}`;
},
deleteRejectText() {
return `${this.$t('DELETE_CONTACT.CONFIRM.NO')} ${this.contact.name}`;
},
confirmDeleteMessage() { confirmDeleteMessage() {
return `${this.$t('DELETE_CONTACT.CONFIRM.MESSAGE')} ${ return `${this.$t('DELETE_CONTACT.CONFIRM.MESSAGE')} ${
this.contact.name this.contact.name
} ?`; } ?`;
}, },
confirmPlaceHolderText() {
return `${this.$t('DELETE_CONTACT.CONFIRM.PLACE_HOLDER', {
contactName: this.contact.name,
})}`;
},
}, },
methods: { methods: {
toggleMergeModal() { toggleMergeModal() {