Skip to content

Commit

Permalink
Merge pull request #95 from os2ulf/feature/OS2UOL-67
Browse files Browse the repository at this point in the history
OS2UOL-67: Added truncateString to body in BaseCard
  • Loading branch information
SorenBonde authored Jul 4, 2024
2 parents 9c4e4de + 363519b commit 9900a38
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/base/BaseCard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { stripHtmlFromString } from '~/utils/stripHtml';
import { truncateString } from '~/utils/truncateString';
const props = defineProps({
data: {
Expand Down Expand Up @@ -203,6 +204,9 @@ const allSubjectOrThemeArr = ref(
const processedSubjectOrThemeString = ref(
limitCharLengthAndConvertToString(allSubjectOrThemeArr.value, 85),
);
const cardBodyText: any = ref(stripHtmlFromString(props.data?.body) || '');
</script>

<template>
Expand All @@ -229,7 +233,7 @@ const processedSubjectOrThemeString = ref(
</div>

<div v-if="data?.body" class="card__text">
{{ stripHtmlFromString(data?.body) }}
{{ truncateString(cardBodyText, 155) }}
</div>
<div class="card__icons" v-if="targetGroupFields || providerData">
<div class="card__icon" v-if="providerData">
Expand Down

0 comments on commit 9900a38

Please sign in to comment.