Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/2.17.4 #1368

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <jeffrey.dowdle@dpc.vic.gov.au>
- Dylankelly <dylan.kelly@dpc.vic.gov.au>
- Jason Smith <jason.smith@dpc.vic.gov.au>
## 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 <jeffrey.dowdle@dpc.vic.gov.au>

## 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 @@ -60,8 +60,8 @@ const fixed = {
`
<figure class="rpl-document">
<a class="rpl-document__link rpl-u-focusable-within" aria-label="Secure document File type: PDF. Size: 139.44 KB." href="https://content.vic.gov.au/system/files/secure/2024-09/file-sample_150kB.pdf" target="_blank">
<span class="rpl-document__icon rpl-icon rpl-icon--size-l rpl-icon--colour-default rpl-icon--icon-document-lined">
<svg role="presentation"><use xlink:href="#icon-document-lined"></use></svg>
<span class="rpl-document__icon rpl-icon rpl-icon--size-l rpl-icon--colour-default rpl-icon--icon-file-secure">
<svg role="presentation"><use xlink:href="#icon-file-secure"></use></svg>
</span>
<div class="rpl-document__content">
<span class="rpl-document__name rpl-type-p rpl-type-weight-bold rpl-u-focusable-inline">Secure document</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,15 @@ const pluginDocuments = function (this: any) {
})
}

const mediaIcon = $element.hasClass('embedded-entity--media--secure-file')
? 'file-secure'
: 'document-lined'

return $element.replaceWith(`
<figure class="rpl-document">
<a class="rpl-document__link rpl-u-focusable-within" aria-label="${label}" href="${link}" target="_blank">
<span class="rpl-document__icon rpl-icon rpl-icon--size-l rpl-icon--colour-default rpl-icon--icon-document-lined">
<svg role="presentation"><use xlink:href="#icon-document-lined"></use></svg>
<span class="rpl-document__icon rpl-icon rpl-icon--size-l rpl-icon--colour-default rpl-icon--icon-${mediaIcon}">
<svg role="presentation"><use xlink:href="#icon-${mediaIcon}"></use></svg>
</span>
<div class="rpl-document__content">
<span class="rpl-document__name rpl-type-p rpl-type-weight-bold rpl-u-focusable-inline">${title}</span>
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/ripple-ui-core/src/assets/icons/sprite.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ripple-ui-core/src/assets/icons/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/ripple-ui-core/src/components/icon/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const RplIconGroups = {
'icon-enlarge',
'icon-enlarge-square-filled',
'icon-exclamation-circle-filled',
'icon-file-secure',
'icon-free',
'icon-home',
'icon-information-circle-filled',
Expand Down