|
|
@@ -198,7 +198,7 @@
|
|
|
outlined
|
|
|
:class="'structure-card pa-3 d-flex ' + ((mapview || $vuetify.breakpoint.smAndDown) ? 'flex-column' : 'flex-row align-items-center')"
|
|
|
>
|
|
|
- <div class="d-flex justify-center max-w100" >
|
|
|
+ <div class="d-flex justify-center max-w100">
|
|
|
<v-img
|
|
|
v-if="structure.logoId"
|
|
|
:src="'https://api.opentalent.fr/app.php/_internal/secure/files/' + structure.logoId"
|
|
|
@@ -209,11 +209,10 @@
|
|
|
:contain="true"
|
|
|
style="margin: 12px;"
|
|
|
/>
|
|
|
- <div v-else style="height: 104px; width: 264px"></div>
|
|
|
+ <div v-else style="height: 104px; width: 264px" />
|
|
|
</div>
|
|
|
|
|
|
<div :class="'d-flex flex-column' + (listview ? ' flex-grow-1' : '')">
|
|
|
-
|
|
|
<v-card-title class="title">
|
|
|
<nuxt-link :to="{path: '/structures/' + structure.id, query: { parent: parent, view: view, theme: theme }}">
|
|
|
{{ structure.name }}
|
|
|
@@ -227,9 +226,9 @@
|
|
|
<font-awesome-icon class="icon" :icon="['fas', 'map-marker-alt']" />
|
|
|
</td>
|
|
|
<td>
|
|
|
- <span v-if="structure.streetAddress">{{ structure.streetAddress }}<br></span>
|
|
|
- <span v-if="structure.postalCode" class="postalCode">{{ structure.postalCode }} </span>
|
|
|
- {{ structure.addressCity }}
|
|
|
+ <span v-if="structure.mapAddress.streetAddress">{{ structure.mapAddress.streetAddress }}<br></span>
|
|
|
+ <span v-if="structure.mapAddress.postalCode" class="postalCode">{{ structure.mapAddress.postalCode }} </span>
|
|
|
+ {{ structure.mapAddress.addressCity }}
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
@@ -486,12 +485,15 @@ export default Vue.extend({
|
|
|
*/
|
|
|
matchLocationFilter (structure: Structure): boolean {
|
|
|
if (!this.locationFilter) { return true }
|
|
|
- if (!structure.latitude || !structure.longitude) { return false }
|
|
|
+ if (structure.mapAddress === null || !structure.mapAddress.latitude || !structure.mapAddress.longitude) { return false }
|
|
|
|
|
|
const radius = Number(this.distanceFilter) ?? 5
|
|
|
|
|
|
return sphericDistance(
|
|
|
- this.locationFilter.latitude, this.locationFilter.longitude, structure.latitude, structure.longitude
|
|
|
+ this.locationFilter.latitude,
|
|
|
+ this.locationFilter.longitude,
|
|
|
+ structure.mapAddress.latitude,
|
|
|
+ structure.mapAddress.longitude
|
|
|
) <= radius
|
|
|
},
|
|
|
/**
|
|
|
@@ -510,10 +512,12 @@ export default Vue.extend({
|
|
|
*/
|
|
|
matchDepartmentFilter (structure: Structure): boolean {
|
|
|
if (!this.departmentFilter) { return true }
|
|
|
- return structure.postalCode !== null &&
|
|
|
+ return structure.mapAddress !== null &&
|
|
|
+ typeof structure.mapAddress.postalCode !== 'undefined' &&
|
|
|
+ structure.mapAddress.postalCode !== null &&
|
|
|
(
|
|
|
- structure.postalCode.startsWith(this.departmentFilter) ||
|
|
|
- (['2A', '2B'].includes(this.departmentFilter) && structure.postalCode.startsWith('20'))
|
|
|
+ structure.mapAddress.postalCode.startsWith(this.departmentFilter) ||
|
|
|
+ (['2A', '2B'].includes(this.departmentFilter) && structure.mapAddress.postalCode.startsWith('20'))
|
|
|
)
|
|
|
},
|
|
|
/**
|
|
|
@@ -532,11 +536,11 @@ export default Vue.extend({
|
|
|
*/
|
|
|
matchMapBounds (structure: Structure): boolean {
|
|
|
if (!this.mapBoundsFilter) { return true }
|
|
|
- if (!(structure.latitude && structure.longitude)) { return false }
|
|
|
- return this.mapBoundsFilter.getSouth() <= structure.latitude &&
|
|
|
- structure.latitude <= this.mapBoundsFilter.getNorth() &&
|
|
|
- this.mapBoundsFilter.getWest() <= structure.longitude &&
|
|
|
- structure.longitude <= this.mapBoundsFilter.getEast()
|
|
|
+ if (structure.mapAddress === null || !(structure.mapAddress.latitude && structure.mapAddress.longitude)) { return false }
|
|
|
+ return this.mapBoundsFilter.getSouth() <= structure.mapAddress.latitude &&
|
|
|
+ structure.mapAddress.latitude <= this.mapBoundsFilter.getNorth() &&
|
|
|
+ this.mapBoundsFilter.getWest() <= structure.mapAddress.longitude &&
|
|
|
+ structure.mapAddress.longitude <= this.mapBoundsFilter.getEast()
|
|
|
},
|
|
|
/**
|
|
|
* Does the structure match each of the page filters
|