-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #948 from dpc-sdp/feature/map-popup
Feature/map popup
- Loading branch information
Showing
15 changed files
with
433 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 33 additions & 23 deletions
56
examples/nuxt-app/components/global/VSBAMapPopupContent.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,52 @@ | ||
<template> | ||
<div class="vsba-map-popup-content" v-if="!hasMultiple"> | ||
<p class="rpl-type-p-small"> | ||
{{ selectedFeature[0].field_about_project_processed[0] }} | ||
</p> | ||
<RplTextLink | ||
class="rpl-type-p-small rpl-u-margin-t-4" | ||
:url="formatUrl(selectedFeature[0].url[0])" | ||
<div class="vsba-map-popup-content"> | ||
<h4 class="rpl-type-p-small">What's happening?</h4> | ||
|
||
<p | ||
v-if="feature.field_project_title?.length === 1" | ||
class="rpl-type-p-small" | ||
> | ||
View page | ||
</RplTextLink> | ||
{{ feature.title[0] }} | ||
</p> | ||
<RplContent v-else class="vsba-map-popup-list"> | ||
<ul> | ||
<li v-for="project in feature.field_project_title" :key="project"> | ||
{{ project }} | ||
</li> | ||
</ul> | ||
</RplContent> | ||
<p class="rpl-type-p-small rpl-u-margin-t-3"> | ||
<RplTextLink :url="formatUrl(feature.url[0])"> | ||
View {{ feature.title[0] }} | ||
</RplTextLink> | ||
</p> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
interface Props { | ||
selectedFeature: any | ||
feature: any | ||
} | ||
const props = withDefaults(defineProps<Props>(), {}) | ||
const hasMultiple = computed(() => { | ||
return ( | ||
Array.isArray(props.selectedFeature) && props.selectedFeature.length > 1 | ||
) | ||
}) | ||
const formatUrl = (str) => str.replace(/\/site-(\d+)/, '') | ||
const url = computed(() => { | ||
if (!hasMultiple && props.selectedFeature[0].url) { | ||
return props.selectedFeature[0].url[0].replace(/\/site-(\d+)/, '') | ||
} | ||
return false | ||
}) | ||
</script> | ||
<style> | ||
.vsba-map-popup-content { | ||
display: flex; | ||
flex-direction: column; | ||
padding: var(--rpl-sp-4); | ||
} | ||
.vsba-map-popup-list ul { | ||
font-size: var(--rpl-type-size-1); | ||
line-height: var(--rpl-type-lh-3); | ||
letter-spacing: var(--rpl-type-ls-1); | ||
} | ||
.vsba-map-popup-list ul li:before { | ||
top: 0.6rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
examples/nuxt-app/test/fixtures/map-table/ise/aggregations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"took": 1, | ||
"timed_out": false, | ||
"_shards": { | ||
"total": 5, | ||
"successful": 5, | ||
"skipped": 0, | ||
"failed": 0 | ||
}, | ||
"hits": { | ||
"total": { | ||
"value": 2129, | ||
"relation": "eq" | ||
}, | ||
"max_score": null, | ||
"hits": [] | ||
}, | ||
"aggregations": { | ||
"category": { | ||
"doc_count_error_upper_bound": 0, | ||
"sum_other_doc_count": 0, | ||
"buckets": [ | ||
{ | ||
"key": "Early childhood", | ||
"doc_count": 274 | ||
}, | ||
{ | ||
"key": "New school", | ||
"doc_count": 87 | ||
}, | ||
{ | ||
"key": "Non-government grant", | ||
"doc_count": 198 | ||
}, | ||
{ | ||
"key": "Planning", | ||
"doc_count": 13 | ||
}, | ||
{ | ||
"key": "School upgrade", | ||
"doc_count": 991 | ||
}, | ||
{ | ||
"key": "Tech school", | ||
"doc_count": 10 | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.