• 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/ChatMessageAddress.vue
1
<template>
2
  <div>
3
    <b-row>
4
      <b-col cols="12" sm="6" :offset-sm="chatmessage.userid != me?.id ? 0 : 6">
×
5
        <div v-if="chatmessage.userid != me?.id" class="media">
×
6
          <b-card border-variant="success">
7
            <b-card-title>
8
              <h4>{{ otheruser.displayname }} sent an address:</h4>
9
            </b-card-title>
10
            <b-card-text>
11
              <b-row>
12
                <b-col>
13
                  <pre
14
                    v-if="address"
×
15
                    :class="address.instructions ? '' : 'mb-2'"
×
16
                    style="text-wrap: wrap"
17
                    >{{ multiline }}</pre
×
18
                  >
×
19
                  <pre v-else>This address has been deleted.</pre>
20
                  <hr v-if="address?.instructions" />
×
21
                  <div v-if="address?.instructions" class="mb-2">
22
                    {{ address.instructions }}
×
23
                  </div>
24
                </b-col>
×
25
              </b-row>
26
              <b-row v-if="address?.postcode">
27
                <b-col>
28
                  <l-map
29
                    ref="map"
30
                    :zoom="16"
31
                    :max-zoom="maxZoom"
32
                    :center="[address.lat, address.lng]"
33
                    :style="'width: 100%; height: 200px'"
34
                  >
35
                    <l-tile-layer
36
                      :url="osmtile()"
37
                      :attribution="attribution()"
38
                    />
39
                    <l-marker
40
                      :lat-lng="[address.lat, address.lng]"
41
                      :interactive="false"
42
                    />
43
                  </l-map>
44
                  <ExternalLink
45
                    :href="
46
                      'https://maps.google.com/?q=' +
47
                      address.lat +
48
                      ',' +
49
                      address.lng +
50
                      '&z=16'
51
                    "
52
                    class="mt-1 small"
53
                  >
54
                    View in Google Maps
×
55
                  </ExternalLink>
56
                </b-col>
57
              </b-row>
58
            </b-card-text>
59
          </b-card>
×
60
        </div>
61
        <div v-else class="media float-end">
62
          <b-card border-variant="success">
63
            <b-card-title>
64
              <h4>You sent an address:</h4>
65
            </b-card-title>
66
            <b-card-text>
67
              <b-row>
68
                <b-col cols="12">
×
69
                  <div v-if="address" class="d-flex justify-content-between">
×
70
                    <pre
71
                      :class="address.instructions ? '' : 'mb-2'"
72
                      style="text-wrap: wrap"
73
                      >{{ multiline }}</pre
74
                    >
75
                    <div>
76
                      <b-button
77
                        variant="white"
78
                        class="ml-2"
79
                        @click="editAddress"
80
                        >Address Book</b-button
×
81
                      >
82
                    </div>
×
83
                  </div>
84
                  <pre v-else>This address has been deleted.</pre>
85
                  <div class="text-muted small">
×
86
                    Your address book lets you easily send addresses, and also
87
                    add instructions so that people can find you.
×
88
                  </div>
89
                  <hr v-if="address?.instructions" />
×
90
                  <div v-if="address?.instructions" class="mb-2">
91
                    {{ address.instructions }}
×
92
                  </div>
93
                </b-col>
94
              </b-row>
95
              <b-row v-if="address?.postcode">
96
                <b-col>
97
                  <l-map
98
                    ref="map"
99
                    :zoom="14"
100
                    :max-zoom="maxZoom"
101
                    :center="[address.lat, address.lng]"
102
                    :style="'width: 100%; height: 200px'"
103
                  >
104
                    <l-tile-layer
105
                      :url="osmtile()"
106
                      :attribution="attribution()"
107
                    />
108
                    <l-marker
109
                      :lat-lng="[address.lat, address.lng]"
110
                      :interactive="false"
111
                    />
112
                  </l-map>
113
                  <ExternalLink
114
                    :href="
115
                      'https://maps.google.com/?q=' +
116
                      address.lat +
117
                      ',' +
118
                      address.lng +
119
                      '&z=16'
120
                    "
121
                    class="mt-1 small"
×
122
                  >
123
                    View in Google Maps
124
                  </ExternalLink>
125
                </b-col>
126
              </b-row>
127
            </b-card-text>
128
          </b-card>
129
        </div>
130
      </b-col>
×
131
    </b-row>
132
    <AddressModal
133
      v-if="showAddress"
134
      :choose="true"
135
      t-o-d-o
136
      @chosen="sendAddress"
137
      @hidden="addressClosed"
138
    />
139
  </div>
140
</template>
141
<script setup>
142
import ExternalLink from './ExternalLink'
143
import AddressModal from './AddressModal'
144
import { useAddressStore } from '~/stores/address'
145
import { useChatStore } from '~/stores/chat'
146
import { useChatMessageBase } from '~/composables/useChat'
147
import { constructMultiLine } from '~/composables/usePAF'
148
import { attribution, osmtile } from '~/composables/useMap'
149
import { MAX_MAP_ZOOM } from '~/constants'
×
150
import { ref, computed, onMounted } from '#imports'
151

152
const props = defineProps({
153
  chatid: {
154
    type: Number,
155
    required: true,
156
  },
157
  id: {
158
    type: Number,
159
    required: true,
160
  },
161
  pov: {
162
    type: Number,
163
    required: false,
164
    default: null,
165
  },
166
})
×
167

×
168
// Store access
169
const addressStore = useAddressStore()
170
const chatStore = useChatStore()
×
171

172
// Chat base properties
173
const { otheruser, chatmessage, me } = useChatMessageBase(
174
  props.chatid,
175
  props.id,
176
  props.pov
177
)
×
178

×
179
// Component state
180
const showAddress = ref(false)
181
const address = ref(null)
×
182

×
183
// Computed properties
184
const maxZoom = computed(() => MAX_MAP_ZOOM)
185
const multiline = computed(() => constructMultiLine(address.value))
×
186

×
187
// Methods
×
188
const editAddress = async () => {
189
  await addressStore.fetch()
190
  showAddress.value = true
×
191
}
×
192

×
193
const addressClosed = async () => {
194
  await chatStore.fetchMessages(props.chatid)
195
  showAddress.value = false
×
196
}
×
197

×
198
const sendAddress = async (id) => {
199
  await chatStore.send(props.chatid, null, id)
200
  showAddress.value = false
201
}
×
202

203
// Setup
×
204
onMounted(async () => {
205
  if (process.client) {
206
    await import('leaflet/dist/leaflet-src.esm')
207
  }
×
208

×
209
  // The addressid is (wrongly) stored in the message.
×
210
  const addressid = parseInt(chatmessage.value?.message)
211
  if (addressid) {
212
    address.value = await addressStore.fetch(addressid)
213
  }
214
})
215
</script>
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