ArticleBubbleSecurityWarning.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { toRef } from 'vue'
  4. import { useArticleSecurity } from '#shared/composables/useArticleSecurity.ts'
  5. import type { TicketArticle } from '#shared/entities/ticket/types.ts'
  6. import CommonButton from '#desktop/components/CommonButton/CommonButton.vue'
  7. interface Props {
  8. article: TicketArticle
  9. }
  10. const props = defineProps<Props>()
  11. const { hasError, signingMessage, encryptionMessage, retrySecurityProcess } =
  12. useArticleSecurity(toRef(props.article))
  13. </script>
  14. <template>
  15. <CommonAlert v-if="hasError" class="-:rounded-none" variant="warning">
  16. <div>
  17. <h2>{{ $t('Security Error') }}</h2>
  18. <p v-if="signingMessage">{{ $t('Sign:') }} {{ signingMessage }}</p>
  19. <p v-if="encryptionMessage">
  20. {{ $t('Encryption:') }} {{ encryptionMessage }}
  21. </p>
  22. <p v-if="!signingMessage && !encryptionMessage" class="block">
  23. {{ $t('No security information available.') }}
  24. </p>
  25. <CommonButton
  26. class="!p-0 !text-current underline hover:outline-transparent dark:hover:outline-transparent"
  27. size="medium"
  28. transparent-background
  29. @click="retrySecurityProcess"
  30. >{{ $t('Retry Security Process') }}</CommonButton
  31. >
  32. </div>
  33. </CommonAlert>
  34. </template>