Skip to content

Commit

Permalink
Merge branch 'develop' into release/2.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dylankelly authored Nov 7, 2024
2 parents 6b010d0 + 98f09c5 commit 7360726
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 5 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
- Jeffrey Dowdle <[email protected]>
- Dylankelly <[email protected]>
- Jason Smith <[email protected]>
## v2.17.3

[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/2.17.2...v2.17.3)


### 🩹 Fixes

- **@dpc-sdp/ripple-tide-search:** Fix issue with search listing dropdown reactivity ([3ef6daed1](https://github.com/dpc-sdp/ripple-framework/commit/3ef6daed1))

### ❤️ Contributors

- Jeffrey Dowdle <[email protected]>

## v2.17.2

Expand Down
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
"message": "chore(release): publish %s [skip ci]"
}
},
"packages": [
"packages/*"
]
"packages": ["packages/*"]
}
11 changes: 11 additions & 0 deletions packages/nuxt-ripple/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ declare module '@nuxt/schema' {
string,
(map: any, results: any, location: any, mapDeadSpace: any) => void
>
onLocationSelectOverrideFns: Record<
string,
// Return true if behaviour was overridden, or false to use the default behaviour
(
map: any,
popup: any,
location: any,
userGeolocation: any,
mapDeadSpace: any
) => boolean | void
>
}
customInputs?: {
[key: string]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ interface Props {
function: string
args: Record<string, any>
}
onLocationSelectOverrideFn?: string | null
}
const props = withDefaults(defineProps<Props>(), {
Expand All @@ -95,7 +96,8 @@ const props = withDefaults(defineProps<Props>(), {
tagsComponent: undefined,
mapResultsFnName: '',
isGettingLocation: false,
userGeolocation: null
userGeolocation: null,
onLocationSelectOverrideFn: null
})
const results = ref([])
Expand All @@ -104,7 +106,7 @@ const emit = defineEmits<{
(e: 'update', payload: addressResultType): void
}>()
const { rplMapRef, deadSpace, defaultExtent } = inject('rplMapInstance')
const { rplMapRef, popup, deadSpace, defaultExtent } = inject('rplMapInstance')
const pendingZoomAnimation = ref(false)
Expand Down Expand Up @@ -217,6 +219,42 @@ async function centerMapOnLocation(
location: addressResultType,
animate: boolean
) {
// There is the option of overriding the default zoom behavior by passing in an app config function
//
// In app.config.ts:
// {
// ripple: {
// search: {
// onLocationSelectOverrideFns: <function>
// }
// }
// }
//
if (props.onLocationSelectOverrideFn) {
const overrideFn = useAppConfigFunction(
props.onLocationSelectOverrideFn,
'onLocationSelectOverrideFns'
)
const didOverride = overrideFn(
map,
popup,
location,
props.userGeolocation,
deadSpace
)
// Sometimes you only want to override the behavior for a specific behavior, and it would be
// annoying to have to reimplement everything else. For this reason, the function can return a
// boolean indicating whether the behavior was overridden. If false, the default behavior will
// still run.
//
// If the function doesn't return anything (i.e. undefined), the default behavior won't run
if (didOverride || typeof didOverride === undefined) {
return
}
}
if (!props.controlMapZooming) {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const getLGASuggestions = async (query, args) => {
return {
id: itm._id,
name,
lgaOfficialName: itm._source.lga_official_name,
bbox: itm._source.lga_bbox,
tag
}
Expand Down

0 comments on commit 7360726

Please sign in to comment.