GuidedSetupManualChannelEmailPreConfigured.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed } from 'vue'
  4. import { useRouter } from 'vue-router'
  5. import QueryHandler from '#shared/server/apollo/handler/QueryHandler.ts'
  6. import { useApplicationStore } from '#shared/stores/application.ts'
  7. import { useEmailAddressesQuery } from '#desktop/entities/email-addresses/graphql/queries/emailAddresses.api.ts'
  8. import GuidedSetupActionFooter from '../../components/GuidedSetupActionFooter.vue'
  9. import { useSystemSetup } from '../../composables/useSystemSetup.ts'
  10. defineOptions({
  11. beforeRouteEnter() {
  12. const application = useApplicationStore()
  13. if (!application.config.system_online_service) {
  14. return '/guided-setup/manual/channels/email'
  15. }
  16. return true
  17. },
  18. })
  19. const router = useRouter()
  20. const { setTitle } = useSystemSetup()
  21. setTitle(__('Connect Channels'))
  22. const emailAddressesQuery = new QueryHandler(
  23. useEmailAddressesQuery({
  24. onlyActive: true,
  25. }),
  26. )
  27. const emailAddressesResult = emailAddressesQuery.result()
  28. const emailAddresses = computed(() => {
  29. return (
  30. emailAddressesResult.value?.emailAddresses.map((emailAddress) => {
  31. return {
  32. name: emailAddress.name,
  33. email: emailAddress.email,
  34. }
  35. }) || []
  36. )
  37. })
  38. const finish = () => {
  39. router.push('/guided-setup/manual/finish')
  40. }
  41. </script>
  42. <template>
  43. <div class="flex flex-col gap-2.5">
  44. <CommonLabel>
  45. {{ $t('Your Zammad has the following email address:') }}
  46. </CommonLabel>
  47. <ul
  48. class="list-disc gap-1 text-sm text-gray-100 ltr:ml-5 rtl:mr-5 dark:text-neutral-400"
  49. >
  50. <li v-for="address in emailAddresses" :key="address.email">
  51. {{ address.name }} &lt;{{ address.email }}&gt;
  52. </li>
  53. </ul>
  54. <CommonLabel>
  55. {{
  56. $t(
  57. 'If you want to use additional email addresses, you can configure them later.',
  58. )
  59. }}
  60. </CommonLabel>
  61. <GuidedSetupActionFooter
  62. go-back-route="/guided-setup/manual/system-information"
  63. :submit-button-text="__('Finish')"
  64. submit-button-type="button"
  65. @submit="finish"
  66. />
  67. </div>
  68. </template>