Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: display email text in timeline[WTEL-4939] #115

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
<wt-divider />

<div>
<p class="email-point-timeline-subject__title">{{ t('contacts.timeline.emails.subject') }}:</p>
<p v-html="content"></p>
<p
v-if="subject"
class="email-point-timeline-subject__title"
>{{ t('contacts.timeline.emails.subject') }}:
<span>{{ props.subject }}</span>
</p>
<p
v-if="content && opened"
v-html="content"></p>
</div>
</div>
</template>
Expand All @@ -23,12 +30,19 @@ const props = defineProps({
type: Object,
required: true,
},
body: {
type: String,
},
opened: {
type: Boolean,
default: false,
},
});

const { t } = useI18n();

const content = computed(() => {
return dompurify.sanitize(md.render(props.subject));
return dompurify.sanitize(md.render(props.body));
});
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<wt-divider />

<div class="email-point-timeline-row-files-container__wrapper">
<email-points-timeline-row-file
<email-point-timeline-row-file
v-for="file of files"
:key="file.id"
:file="file"
Expand All @@ -14,7 +14,7 @@
</template>

<script setup>
import EmailPointsTimelineRowFile from './email-points-timeline-row-file.vue';
import EmailPointTimelineRowFile from './email-point-timeline-row-file.vue';

const props = defineProps({
files: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@
</div>

<timeline-row-dropdown-transition>
<div v-if="opened">
<email-point-timeline-row-subject
v-if="task?.subject"
<div>
<email-point-timeline-row-content
v-if="task?.subject || task?.body"
:subject="task.subject"
:body="task.body"
:opened="opened"
/>

<email-points-timeline-row-files-container
v-if="task.attachments?.length"
<email-point-timeline-row-files-container
v-if="task.attachments?.length && opened"
:files="task.attachments"
/>
</div>

</timeline-row-dropdown-transition>
</section>
</template>
<script setup>
import { ref } from 'vue';
import EmailTaskTimelineHeader from '../task-row/email-task-timeline-header.vue';
import EmailPointTimelineRowSubject from './email-point-timeline-row-subject.vue';
import EmailPointsTimelineRowFilesContainer from './email-points-timeline-row-files-container.vue';
import EmailPointTimelineRowContent from './email-point-timeline-row-content.vue';
import EmailPointTimelineRowFilesContainer from './email-point-timeline-row-files-container.vue';
import TimelineRowDropdownTransition from '../../../../components/utils/timeline-row-dropdown-transition.vue';

const props = defineProps({
Expand Down
Loading