Skip to content

Commit

Permalink
Merge pull request #1272 from dpc-sdp/feature/SDPAP-9389-external-red…
Browse files Browse the repository at this point in the history
…irects

[SD-83] external redirects
  • Loading branch information
dylankelly authored Jul 25, 2024
2 parents 13f8e65 + badd972 commit 707ba8d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/nuxt-app/test/features/search-listing/list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Feature: List layout
And the search network request should be called with the "/search-listing/list/request" fixture
And the search listing results count should read "Displaying 1-9 of 124 results"
And the search listing results should have following items:
| title | content | component |
| 2-BE-event-1 | The ingenious hero who travelled far and wide | tide-search-result |
| 5-BE-land-3 Landing Page | Outside thundered the approaching surf of war | tide-search-result |
| Accessibility - demo | Accessibility information about this website. | tide-search-result |
| title | content | url | component |
| 2-BE-event-1 | The ingenious hero who travelled far and wide | /2-be-event-1 | tide-search-result |
| 5-BE-land-3 Landing Page | Outside thundered the approaching surf of war | /5-be-land-3-landing-page-complete-test | tide-search-result |
| Accessibility - demo | Accessibility information about this website. | https://vic.gov.au/page | tide-search-result |

@mockserver
Example: A custom skeleton loader can be use for list result items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@
"field_paragraph_body": [
"The Department of Premier and Cabinet, as owner of this website on behalf of the Victorian Government, is committed to providing a website that is accessible to the widest possible audience, regardless of technology or ability.  This website aims to meet level AA of the Web Content Accessibility Guidelines (WCAG) 2.1 World Wide Web Consortium (W3C) Web Content Accessibility Guidelines 2.0 . If there is information on this website that you can't access, or have any suggestions on how we can improve the accessibility of this website, please email us via  digital@dpc.vic.gov.au digital@dpc.vic.gov.au  or contact us by mail to: Department of Premier and Cabinet 1 Treasury Place East Melbourne VIC 3002 All constructive feedback regarding the accessibility or usability of this website is welcome and will be carefully considered. Assistance If you are a TTY user, phone 133 677 133 677 then ask for 1300 366 356 If you are a Speak and Listen user, phone 1300 555 727 1300 555 727 then ask for 1300 366 356 For SMS relay, use 0423 677 767 0423 677 767 If you are an internet relay user, visit the Internet Relay call page Make an Internet Relay call page and use this number: 1300 366 356"
],
"field_redirect_website": [
"https://vic.gov.au/page"
],
"field_tags": [
2095,
2096
Expand Down
6 changes: 6 additions & 0 deletions packages/ripple-tide-search/composables/useSearchResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ export default (result, options: ResultOptions = { summaryMaxLength: 150 }) => {
const { $app_origin, $config } = useNuxtApp()
const title = computed(() => getSearchResultValue(result, 'title'))
const url = computed(() => {
const externalURL = getSearchResultValue(result, 'field_redirect_website')

if (externalURL) {
return externalURL
}

return stripSiteId(getSearchResultValue(result, 'url'), $app_origin || '')
})
const updated = computed(() => {
Expand Down

0 comments on commit 707ba8d

Please sign in to comment.