|
|
@@ -22,7 +22,7 @@
|
|
|
<v-row>
|
|
|
<!-- Map Column (hidden in 'list-view' mode)-->
|
|
|
<v-col
|
|
|
- v-show="mapview"
|
|
|
+ v-if="mapview"
|
|
|
cols="12"
|
|
|
sm="6"
|
|
|
>
|
|
|
@@ -30,6 +30,7 @@
|
|
|
<UiMapStructures
|
|
|
ref="map"
|
|
|
:structures="filteredStructures"
|
|
|
+ :zoom-at-start="mapZoomAtStart"
|
|
|
@boundsUpdated="mapBoundsFilterChanged"
|
|
|
/>
|
|
|
</no-ssr>
|
|
|
@@ -206,7 +207,14 @@
|
|
|
:contain="true"
|
|
|
style="margin: 12px;"
|
|
|
/>
|
|
|
- <div v-else style="height: 104px; width: 264px"></div>
|
|
|
+ <v-skeleton-loader
|
|
|
+ v-else
|
|
|
+ type="card-avatar"
|
|
|
+ boilerplate
|
|
|
+ width="164px"
|
|
|
+ height="84px"
|
|
|
+ style="margin: 10px 50px;"
|
|
|
+ />
|
|
|
</div>
|
|
|
|
|
|
<div :class="'d-flex flex-column' + (listview ? ' flex-grow-1' : '')">
|
|
|
@@ -251,17 +259,21 @@
|
|
|
</v-card-text>
|
|
|
</div>
|
|
|
|
|
|
- <v-chip-group
|
|
|
+ <div
|
|
|
v-if="structure.practices"
|
|
|
- column
|
|
|
- active-class="primary--text"
|
|
|
- class="d-flex flex-row align-start"
|
|
|
+ class="d-grid flex-wrap"
|
|
|
:style="listview ? 'width: 25%;min-width: 25%;' : ''"
|
|
|
>
|
|
|
- <v-chip v-for="practice in structure.practices" :key="practice" outlined small pill>
|
|
|
+ <v-chip
|
|
|
+ v-for="practice in structure.practices"
|
|
|
+ :key="practice"
|
|
|
+ class="ma-1"
|
|
|
+ label
|
|
|
+ small
|
|
|
+ >
|
|
|
{{ $t(practice) }}
|
|
|
</v-chip>
|
|
|
- </v-chip-group>
|
|
|
+ </div>
|
|
|
|
|
|
<span v-if="mapview" class="flex-fill" />
|
|
|
|
|
|
@@ -339,7 +351,8 @@ export default Vue.extend({
|
|
|
federationFilter: null as number | null,
|
|
|
distanceFilter: null as number | null,
|
|
|
mapBoundsFilter: null as LatLngBounds | null,
|
|
|
- mapBoundsFilterStarted: false // map bounds filter is only activated when the map bounds are updated
|
|
|
+ mapBoundsFilterStarted: false, // map bounds filter is only activated when the map bounds are updated
|
|
|
+ mapZoomAtStart: false
|
|
|
}
|
|
|
},
|
|
|
async fetch () {
|
|
|
@@ -361,7 +374,7 @@ export default Vue.extend({
|
|
|
|
|
|
// zoom on map markers (except if the parent structure is the CMF)
|
|
|
if (this.parent !== CMF_ID) {
|
|
|
- this.fitMapToResults()
|
|
|
+ this.mapZoomAtStart = true
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -399,7 +412,7 @@ export default Vue.extend({
|
|
|
viewChanged (e: number) {
|
|
|
this.view = (e === 0) ? 'map' : 'list'
|
|
|
if (this.mapview) {
|
|
|
- this.fitMapToResults()
|
|
|
+ this.mapZoomAtStart = true
|
|
|
}
|
|
|
},
|
|
|
textFilterChanged (newVal: string) {
|
|
|
@@ -448,7 +461,7 @@ export default Vue.extend({
|
|
|
matchTextFilter (structure: Structure): boolean {
|
|
|
if (!this.textFilter) { return true }
|
|
|
|
|
|
- return structure.name.toLowerCase().includes(this.textFilter.toLowerCase())
|
|
|
+ return this.searchTextNormalize(structure.name).includes(this.searchTextNormalize(this.textFilter))
|
|
|
},
|
|
|
/**
|
|
|
* Does the structure match the current locationFilter
|
|
|
@@ -526,9 +539,11 @@ export default Vue.extend({
|
|
|
*/
|
|
|
search (): void {
|
|
|
this.filteredStructures = this.structures.filter((s) => { return this.matchFilters(s) })
|
|
|
- this.fitMapToResults()
|
|
|
+ if (this.mapview) {
|
|
|
+ this.fitMapToResults()
|
|
|
+ }
|
|
|
},
|
|
|
- autocompleteSearchNormalize (s: string): string {
|
|
|
+ searchTextNormalize (s: string): string {
|
|
|
return s
|
|
|
.toLowerCase()
|
|
|
.replace(/[éèẽëê]/g, 'e')
|
|
|
@@ -548,7 +563,7 @@ export default Vue.extend({
|
|
|
* @param itemText
|
|
|
*/
|
|
|
enhancedAutocompleteFilter (_: any, queryText: string, itemText: string): boolean {
|
|
|
- return this.autocompleteSearchNormalize(itemText).includes(this.autocompleteSearchNormalize(queryText))
|
|
|
+ return this.searchTextNormalize(itemText).includes(this.searchTextNormalize(queryText))
|
|
|
}
|
|
|
}
|
|
|
})
|