From f8c60390003310718808371b08ac5f5b8f1f09fe Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Thu, 24 Oct 2024 16:01:19 +1100 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20=F0=9F=94=96=20hotfix=20update=20t?= =?UTF-8?q?o=20ripple=202.17.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 12 ++++++++++++ lerna.json | 4 +--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb4bc0ac9..d2ba3ca3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,18 @@ - Jeffrey Dowdle - Dylankelly - Jason Smith +## 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 ## v2.17.2 diff --git a/lerna.json b/lerna.json index 6a882d828..dc8302355 100644 --- a/lerna.json +++ b/lerna.json @@ -7,7 +7,5 @@ "message": "chore(release): publish %s [skip ci]" } }, - "packages": [ - "packages/*" - ] + "packages": ["packages/*"] } From 36d9cdebd73b12532ed2563c5445cecde44d648f Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Fri, 1 Nov 2024 16:45:08 +1100 Subject: [PATCH 2/3] feat(@dpc-sdp/ripple-tide-search): added ability to override default map zoom behaviour --- packages/nuxt-ripple/app.config.ts | 11 +++++ .../global/TideSearchAddressLookup.vue | 42 ++++++++++++++++++- .../utils/rplAddressSuggestionsFn.ts | 1 + 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/packages/nuxt-ripple/app.config.ts b/packages/nuxt-ripple/app.config.ts index ce7f3ff82..7b78ba329 100644 --- a/packages/nuxt-ripple/app.config.ts +++ b/packages/nuxt-ripple/app.config.ts @@ -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]: { diff --git a/packages/ripple-tide-search/components/global/TideSearchAddressLookup.vue b/packages/ripple-tide-search/components/global/TideSearchAddressLookup.vue index bb1b310ac..e4dcc6656 100644 --- a/packages/ripple-tide-search/components/global/TideSearchAddressLookup.vue +++ b/packages/ripple-tide-search/components/global/TideSearchAddressLookup.vue @@ -82,6 +82,7 @@ interface Props { function: string args: Record } + onLocationSelectOverrideFn?: string | null } const props = withDefaults(defineProps(), { @@ -95,7 +96,8 @@ const props = withDefaults(defineProps(), { tagsComponent: undefined, mapResultsFnName: '', isGettingLocation: false, - userGeolocation: null + userGeolocation: null, + onLocationSelectOverrideFn: null }) const results = ref([]) @@ -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) @@ -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: + // } + // } + // } + // + 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 } diff --git a/packages/ripple-tide-search/utils/rplAddressSuggestionsFn.ts b/packages/ripple-tide-search/utils/rplAddressSuggestionsFn.ts index 2cfd35424..70db97518 100644 --- a/packages/ripple-tide-search/utils/rplAddressSuggestionsFn.ts +++ b/packages/ripple-tide-search/utils/rplAddressSuggestionsFn.ts @@ -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 } From 678b4000a11239616449297c076688b4932ce99a Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 6 Nov 2024 15:24:30 +1100 Subject: [PATCH 3/3] feat(@dpc-sdp/ripple-ui-core): :sparkles: add icon-file-secure --- .../src/utils/markup-transpiler/cheerio.test.ts | 4 ++-- .../src/utils/markup-transpiler/default-plugins.ts | 8 ++++++-- .../src/assets/icons/core/icon-file-secure.svg | 4 ++++ packages/ripple-ui-core/src/assets/icons/sprite.js | 2 +- packages/ripple-ui-core/src/assets/icons/sprite.svg | 2 +- packages/ripple-ui-core/src/components/icon/constants.ts | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 packages/ripple-ui-core/src/assets/icons/core/icon-file-secure.svg diff --git a/packages/ripple-tide-api/src/utils/markup-transpiler/cheerio.test.ts b/packages/ripple-tide-api/src/utils/markup-transpiler/cheerio.test.ts index e7309c418..f21e09156 100644 --- a/packages/ripple-tide-api/src/utils/markup-transpiler/cheerio.test.ts +++ b/packages/ripple-tide-api/src/utils/markup-transpiler/cheerio.test.ts @@ -60,8 +60,8 @@ const fixed = { `
- - + +
Secure document diff --git a/packages/ripple-tide-api/src/utils/markup-transpiler/default-plugins.ts b/packages/ripple-tide-api/src/utils/markup-transpiler/default-plugins.ts index cadac7200..b3e7e6125 100644 --- a/packages/ripple-tide-api/src/utils/markup-transpiler/default-plugins.ts +++ b/packages/ripple-tide-api/src/utils/markup-transpiler/default-plugins.ts @@ -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(`
- - + +
${title} diff --git a/packages/ripple-ui-core/src/assets/icons/core/icon-file-secure.svg b/packages/ripple-ui-core/src/assets/icons/core/icon-file-secure.svg new file mode 100644 index 000000000..999be8f08 --- /dev/null +++ b/packages/ripple-ui-core/src/assets/icons/core/icon-file-secure.svg @@ -0,0 +1,4 @@ + + + diff --git a/packages/ripple-ui-core/src/assets/icons/sprite.js b/packages/ripple-ui-core/src/assets/icons/sprite.js index 30cbbe3b5..6341d5ff6 100644 --- a/packages/ripple-ui-core/src/assets/icons/sprite.js +++ b/packages/ripple-ui-core/src/assets/icons/sprite.js @@ -1 +1 @@ -export default ["icon-cancel","icon-check-circle-filled","icon-chevron-down","icon-chevron-left","icon-chevron-right","icon-chevron-up","icon-current-location","icon-document-lined","icon-document","icon-download","icon-enlarge-square-filled","icon-enlarge","icon-exclamation-circle-filled","icon-facebook","icon-home","icon-information-circle-filled","icon-link-external-square-filled","icon-linkedin","icon-mail","icon-phone","icon-pin","icon-twitter","icon-view","icon-whatsapp","icon-x"] \ No newline at end of file +export default ["icon-cancel","icon-check-circle-filled","icon-chevron-down","icon-chevron-left","icon-chevron-right","icon-chevron-up","icon-current-location","icon-document-lined","icon-document","icon-download","icon-enlarge-square-filled","icon-enlarge","icon-exclamation-circle-filled","icon-facebook","icon-file-secure","icon-home","icon-information-circle-filled","icon-link-external-square-filled","icon-linkedin","icon-mail","icon-phone","icon-pin","icon-twitter","icon-view","icon-whatsapp","icon-x"] \ No newline at end of file diff --git a/packages/ripple-ui-core/src/assets/icons/sprite.svg b/packages/ripple-ui-core/src/assets/icons/sprite.svg index a05c014b6..a49815ab9 100644 --- a/packages/ripple-ui-core/src/assets/icons/sprite.svg +++ b/packages/ripple-ui-core/src/assets/icons/sprite.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/ripple-ui-core/src/components/icon/constants.ts b/packages/ripple-ui-core/src/components/icon/constants.ts index 0c3309b69..0d1bdc4c7 100644 --- a/packages/ripple-ui-core/src/components/icon/constants.ts +++ b/packages/ripple-ui-core/src/components/icon/constants.ts @@ -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',