Merge pull request #5142 from christianbeeznest/ofaj-21328

Message: Enhance presentation when replying to a message - refs #21328
pull/5146/head
christianbeeznest 10 months ago committed by GitHub
commit 060f8f11f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      assets/vue/utils/dates.js
  2. 11
      assets/vue/views/message/MessageReply.vue

@ -6,4 +6,10 @@ const formatDateTime = function(date) {
return DateTime(date).format('DD/MM/YYYY');
};
export { formatDateTime };
const formatDateTimeFromISO = function(dateStr) {
if (!dateStr) return '';
return DateTime.fromISO(dateStr).toFormat('dd/LL/yyyy HH:mm');
};
export { formatDateTime, formatDateTimeFromISO };

@ -77,10 +77,11 @@ import BaseButton from "../../components/basecomponents/BaseButton.vue"
import { useI18n } from "vue-i18n"
import { useSecurityStore } from "../../store/securityStore"
import { useNotification } from "../../composables/notification"
import { formatDateTimeFromISO } from "../../utils/dates"
const item = ref({})
const store = useStore()
const securityStore = useSecurityStore();
const securityStore = useSecurityStore()
const route = useRoute()
const router = useRouter()
@ -96,7 +97,11 @@ onMounted(async () => {
const response = await store.dispatch("message/load", id)
item.value = await response
const originalUserInfo = await store.dispatch("user/load", '/api/users/' + item.value.sender.id)
const originalSenderName = originalUserInfo.fullName
const originalSenderEmail = originalUserInfo.email
const formattedDate = formatDateTimeFromISO(item.value.sendDate)
const translatedHeader = t('Email reply header', { date: formattedDate, senderName: originalSenderName, senderEmail: `<a href="mailto:${originalSenderEmail}">${originalSenderEmail}</a>` })
delete item.value["@id"]
delete item.value["id"]
delete item.value["firstReceiver"]
@ -151,7 +156,7 @@ onMounted(async () => {
}*/
// Set reply content.
item.value.content = `<br /><blockquote>${item.value.content}</blockquote>`
item.value.content = `<br /><br /><hr /><blockquote>${translatedHeader}<hr />${item.value.content}</blockquote>`
})
const isLoading = computed(() => store.state.message.isLoading)

Loading…
Cancel
Save