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

Freegle / iznik-nuxt3 / ce5abe40-6f99-4088-a6e7-20c39d0d906f

28 Nov 2025 03:32PM UTC coverage: 43.578% (-2.3%) from 45.902%
ce5abe40-6f99-4088-a6e7-20c39d0d906f

push

circleci

edwh
Fix TestFlight version to be higher than production (99.0.x) and force update plugin

3135 of 7742 branches covered (40.49%)

Branch coverage included in aggregate %.

3417 of 7293 relevant lines covered (46.85%)

12.25 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

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
125
const { chat, chatmessage, emessage, refmsg, me, myid } = useChatMessageBase(
126
  props.chatid,
127
  props.id,
128
  props.pov
129
)
130

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

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

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

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

×
145
async function repost() {
×
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.
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

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

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