• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Freegle / iznik-nuxt3 / f1b2e232-33ec-457b-9de8-c38d9a34f62e

28 Nov 2025 11:02PM UTC coverage: 44.781% (+1.2%) from 43.578%
f1b2e232-33ec-457b-9de8-c38d9a34f62e

push

circleci

actions-user
Auto-merge production to app-ci-fd (daily scheduled)

Automated merge from production branch after successful tests.

🤖 Automated by GitHub Actions

3197 of 7643 branches covered (41.83%)

Branch coverage included in aggregate %.

9 of 9 new or added lines in 1 file covered. (100.0%)

112 existing lines in 11 files now uncovered.

3470 of 7245 relevant lines covered (47.9%)

12.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/components/ChatMessageModMail.vue
1
<template>
2
  <div>
3
    <b-row>
4
      <b-col>
5
        <div class="media">
6
          <b-card border-variant="success" :class="{ 'ml-auto': !amUser }">
7
            <b-card-title>
8
              <div v-if="group">
×
9
                <h4>
10
                  <ProfileImage
11
                    v-if="group"
×
12
                    :image="group.profile"
13
                    class="mr-1 mb-1 mt-1 inline"
14
                    is-thumbnail
15
                    size="sm"
16
                  />
17
                  <span class="align-middle">
18
                    Message from {{ group.namedisplay }} Volunteers
19
                  </span>
20
                </h4>
21
              </div>
22
              <h4 v-else>Message from Freegle Volunteers</h4>
23
            </b-card-title>
24
            <b-card-text>
25
              <div :class="emessage ? 'media-body chatMessage' : 'media-body'">
×
26
                <span>
27
                  <span
28
                    v-if="
×
29
                      chatmessage.secondsago < 60 ||
30
                      chatmessage.id > chat.lastmsgseen
31
                    "
32
                    class="prewrap font-weight-bold"
33
                    >{{ emessage }}</span
34
                  >
35
                  <span v-else class="preline forcebreak">{{ emessage }}</span>
36
                  <b-img
37
                    v-if="chatmessage.image"
×
38
                    fluid
39
                    :src="chatmessage.image.path"
40
                    lazy
41
                    rounded
42
                  />
43
                </span>
44
              </div>
45
              <div v-if="chatmessage.refmsgid && refmsg">
×
46
                <hr />
47
                <p>
×
48
                  If you have been asked to edit and resend this message, you
49
                  can do so here:
50
                </p>
51
                <b-button variant="warning" @click="repost">
52
                  <v-icon icon="pen" /> Edit and Resend
×
53
                </b-button>
54
              </div>
55
              <NoticeMessage
56
                v-else-if="chat.chattype === 'User2User'"
57
                variant="warning"
58
                class="mt-2"
59
              >
60
                <p>
×
61
                  Volunteers won't see any replies you make in here about this
62
                  message - they'll go to the other freegler. If you want to
63
                  contact the volunteers, please use the button below.
64
                </p>
65
                <GroupSelect
66
                  v-model="contactGroupId"
×
67
                  remember="contactmods"
68
                  class="mb-3"
69
                />
70
                <ChatButton
71
                  :groupid="contactGroupId"
72
                  size="md"
73
                  title="Contact community volunteers"
74
                  variant="primary"
75
                  class="mb-2"
76
                />
77
              </NoticeMessage>
78
            </b-card-text>
79
          </b-card>
80
        </div>
81
      </b-col>
82
    </b-row>
83
  </div>
84
</template>
85
<script setup>
86
import { ref, computed } from 'vue'
87
import NoticeMessage from './NoticeMessage'
88
import ChatButton from './ChatButton'
89
import { useComposeStore } from '~/stores/compose'
90
import {
91
  fetchReferencedMessage,
92
  useChatMessageBase,
93
} from '~/composables/useChat'
94
import ProfileImage from '~/components/ProfileImage'
95
import GroupSelect from '~/components/GroupSelect'
96
import { useRouter } from '#imports'
97

UNCOV
98
const props = defineProps({
×
99
  chatid: {
100
    type: Number,
101
    required: true,
102
  },
103
  id: {
104
    type: Number,
105
    required: true,
106
  },
107
  last: {
108
    type: Boolean,
109
    required: false,
110
    default: false,
111
  },
112
  pov: {
113
    type: Number,
114
    required: false,
115
    default: null,
116
  },
117
  highlightEmails: {
118
    type: Boolean,
119
    required: false,
120
    default: false,
121
  },
122
})
123

124
// Use the chat base composable
UNCOV
125
const { chat, chatmessage, emessage, refmsg, me, myid } = useChatMessageBase(
×
126
  props.chatid,
127
  props.id,
128
  props.pov
129
)
130

UNCOV
131
const composeStore = useComposeStore()
×
UNCOV
132
const contactGroupId = ref(null)
×
133

134
// Setup
UNCOV
135
await fetchReferencedMessage(props.chatid, props.id)
×
136

UNCOV
137
const group = computed(() => {
×
UNCOV
138
  return chat.value && chat.value.group ? chat.value.group : null
×
139
})
140

UNCOV
141
const amUser = computed(() => {
×
UNCOV
142
  return chat.value && chat.value.user && chat.value.user.id === myid
×
143
})
144

145
async function repost() {
×
UNCOV
146
  const message = Object.assign({}, refmsg.value)
×
147

148
  if (message) {
×
149
    // Remove any partially composed messages we currently have, because they'll be confusing.
150
    await composeStore.clearMessages()
×
151

152
    // Add this message to the compose store so that it will show up on the compose page.
UNCOV
153
    await composeStore.setMessage(
×
154
      0,
155
      {
156
        type: message.type,
157
        item: message.item?.name?.trim(),
×
158
        description: message.textbody.trim(),
159
        availablenow: message.availablenow,
160
        repostof: chatmessage.value.refmsgid,
161
      },
162
      me.value
163
    )
164

UNCOV
165
    composeStore.setAttachmentsForMessage(0, message.attachments)
×
166

UNCOV
167
    const router = useRouter()
×
168
    router.push(message.type === 'Offer' ? '/give' : '/find')
×
169
  }
170
}
171
</script>
172
<style scoped lang="scss">
173
.chatMessage {
174
  border: 1px solid $color-gray--light;
175
  border-radius: 10px;
176
  padding-top: 2px;
177
  padding-bottom: 2px;
178
  padding-left: 4px;
179
  padding-right: 2px;
180
  word-wrap: break-word;
181
  line-height: 1.5;
182
}
183
</style>
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc