mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-03 20:48:07 +00:00 
			
		
		
		
	feat: Show a confirmation banner if the email is not verified (#8808)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
		@@ -0,0 +1,43 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <banner
 | 
			
		||||
    v-if="shouldShowBanner"
 | 
			
		||||
    color-scheme="alert"
 | 
			
		||||
    :banner-message="bannerMessage"
 | 
			
		||||
    :action-button-label="actionButtonMessage"
 | 
			
		||||
    action-button-icon="mail"
 | 
			
		||||
    has-action-button
 | 
			
		||||
    @click="resendVerificationEmail"
 | 
			
		||||
  />
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import Banner from 'dashboard/components/ui/Banner.vue';
 | 
			
		||||
import { mapGetters } from 'vuex';
 | 
			
		||||
import accountMixin from 'dashboard/mixins/account';
 | 
			
		||||
import alertMixin from 'shared/mixins/alertMixin';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  components: { Banner },
 | 
			
		||||
  mixins: [accountMixin, alertMixin],
 | 
			
		||||
  computed: {
 | 
			
		||||
    ...mapGetters({
 | 
			
		||||
      currentUser: 'getCurrentUser',
 | 
			
		||||
    }),
 | 
			
		||||
    bannerMessage() {
 | 
			
		||||
      return this.$t('APP_GLOBAL.EMAIL_VERIFICATION_PENDING');
 | 
			
		||||
    },
 | 
			
		||||
    actionButtonMessage() {
 | 
			
		||||
      return this.$t('APP_GLOBAL.RESEND_VERIFICATION_MAIL');
 | 
			
		||||
    },
 | 
			
		||||
    shouldShowBanner() {
 | 
			
		||||
      return !this.currentUser.confirmed;
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    resendVerificationEmail() {
 | 
			
		||||
      this.$store.dispatch('resendConfirmation');
 | 
			
		||||
      this.showAlert(this.$t('APP_GLOBAL.EMAIL_VERIFICATION_SENT'));
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div
 | 
			
		||||
    class="banner flex items-center h-12 gap-4 text-white dark:text-white text-xs py-3 px-4 justify-center"
 | 
			
		||||
    class="flex items-center justify-center h-12 gap-4 px-4 py-3 text-xs text-white banner dark:text-white"
 | 
			
		||||
    :class="bannerClasses"
 | 
			
		||||
  >
 | 
			
		||||
    <span class="banner-message">
 | 
			
		||||
@@ -18,7 +18,7 @@
 | 
			
		||||
      <woot-button
 | 
			
		||||
        v-if="hasActionButton"
 | 
			
		||||
        size="tiny"
 | 
			
		||||
        icon="arrow-right"
 | 
			
		||||
        :icon="actionButtonIcon"
 | 
			
		||||
        :variant="actionButtonVariant"
 | 
			
		||||
        color-scheme="primary"
 | 
			
		||||
        class-names="banner-action__button"
 | 
			
		||||
@@ -67,6 +67,10 @@ export default {
 | 
			
		||||
      type: String,
 | 
			
		||||
      default: '',
 | 
			
		||||
    },
 | 
			
		||||
    actionButtonIcon: {
 | 
			
		||||
      type: String,
 | 
			
		||||
      default: 'arrow-right',
 | 
			
		||||
    },
 | 
			
		||||
    colorScheme: {
 | 
			
		||||
      type: String,
 | 
			
		||||
      default: '',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user