-
Notifications
You must be signed in to change notification settings - Fork 13
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
[R20-1321] Add custom collection #777
Merged
Merged
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
8ecb601
feat(@dpc-sdp/ripple-tide-search): :sparkles: add custom collection c…
dylankelly d17c7a3
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly d3a1ea8
test(@dpc-sdp/ripple-tide-search): :white_check_mark: ignore resize o…
dylankelly 8f96db7
test(@dpc-sdp/ripple-tide-search): :test_tube: remove unimplemented test
dylankelly f497e7a
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly 39632df
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly 52970c2
refactor(@dpc-sdp/ripple-tide-search): :sparkles: use backend json field
dylankelly 7adf56b
Merge branch 'develop' into feature/custom-collection
dylankelly ffda251
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly e276a84
Merge branch 'develop' into feature/custom-collection
waitingallday 7de48e1
fix(@dpc-sdp/ripple-tide-search): fix cc mapping
dylankelly e31d40b
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly b7b7d92
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly 9844062
fix(@dpc-sdp/ripple-tide-search): :lipstick: add margin between error…
dylankelly 06fff8c
test(@dpc-sdp/ripple-tide-search): skip custom collection tests
dylankelly c1a9acb
test(@dpc-sdp/ripple-tide-search): :green_heart: fix custom collectio…
dylankelly cc3fc59
refactor(@dpc-sdp/ripple-tide-search): :recycle: rename proxy handler…
dylankelly d8f460d
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly 2c0da90
fix(@dpc-sdp/ripple-tide-search): fix search request proxy config
dylankelly 7eb8063
fix(@dpc-sdp/ripple-tide-search): :bug: disable autocomplete on custo…
dylankelly 2304ad5
fix(@dpc-sdp/ripple-tide-search): :bug: fix autocomplete end point
dylankelly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
examples/nuxt-app/test/features/search-listing/custom-collection.feature
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,29 @@ | ||
Feature: Custom Collection | ||
|
||
As an editor I want to be able to add a view of results in a search index to a landing page. | ||
|
||
Background: | ||
Given the page endpoint for path "/custom-collection" returns fixture "/landingpage/custom-collection" with status 200 | ||
Given the site endpoint returns fixture "/site/reference" with status 200 | ||
And the search autocomplete request is stubbed with "/search-listing/suggestions/none" fixture | ||
Given I am using a "macbook-16" device | ||
|
||
@mockserver | ||
Scenario: Custom collection | ||
Given the "/api/tide/elasticsearch/sdp_data_pipelines_scl/_search" network request is stubbed with fixture "/landingpage/custom-collection/response" and status 200 as alias "cslReq" | ||
Given I visit the page "/custom-collection" | ||
Then the landing page component "TideCustomCollection" should exist | ||
And the custom collection component should have a search input bar | ||
And the custom collection component results count should read "Displaying 1-10 of 282 results" | ||
And the "cslReq" network request should be made to the elasticsearch endpoint | ||
And the search listing layout should be "table" | ||
|
||
@mockserver | ||
Scenario: Custom collection error | ||
Given the "/api/tide/elasticsearch/sdp_data_pipelines_scl/_search" network request is stubbed with fixture "/landingpage/custom-collection/response" and status 400 as alias "cslReq" | ||
Given I visit the page "/custom-collection" | ||
Then the landing page component "TideCustomCollection" should exist | ||
And the custom collection component should display the error "Sorry! Something went wrong. Please try again later." | ||
|
||
|
||
|
194 changes: 194 additions & 0 deletions
194
examples/nuxt-app/test/fixtures/landingpage/custom-collection.json
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,194 @@ | ||
{ | ||
"title": "Custom collection", | ||
"changed": "2022-11-02T12:47:29+11:00", | ||
"created": "2022-11-02T12:47:29+11:00", | ||
"type": "landing_page", | ||
"nid": "11dede11-10c0-111e1-1100-000000000330", | ||
"summary": "Page summary", | ||
"showInPageNav": true, | ||
"inPageNavHeadingLevel": "h3", | ||
"background": "default", | ||
"header": { | ||
"title": "Custom collection test", | ||
"summary": "Test landing page title introduction text", | ||
"theme": "default", | ||
"backgroundImage": null | ||
}, | ||
"sidebar": { | ||
"contacts": [ | ||
{ | ||
"id": "26146cba-f307-449e-885c-7446efb3f315", | ||
"contactTitle": "Victorian Government", | ||
"contactName": "Victorian Government", | ||
"department": "Department of Premier and Cabinet", | ||
"email": "no-reply@vic.gov.au", | ||
"locationAddress": { | ||
"countryCode": "AU", | ||
"administrativeArea": "VIC", | ||
"locality": "Melbourne", | ||
"postalCode": "3001", | ||
"addressLine1": "Department of Premier and Cabinet", | ||
"addressLine2": "GPO Box 4509" | ||
}, | ||
"postalAddress": { | ||
"countryCode": "AU", | ||
"administrativeArea": "VIC", | ||
"locality": "Melbourne", | ||
"postalCode": "3001", | ||
"addressLine1": "Department of Premier and Cabinet", | ||
"addressLine2": "GPO Box 4509" | ||
}, | ||
"phones": [ | ||
{ | ||
"id": "8a6d0e28-3d34-40b7-a97b-ef980f0f6f49", | ||
"title": "Calls in Australia", | ||
"number": "1300 366 356" | ||
}, | ||
{ | ||
"id": "798566cf-2e8c-48eb-bc89-38a6486cb06a", | ||
"title": "Calls from overseas", | ||
"number": "+61 3 9603 8804" | ||
} | ||
], | ||
"socialMedia": [ | ||
{ | ||
"id": "0b58c974-05bd-4379-8947-12c4959b992c", | ||
"type": "twitter", | ||
"text": "Twitter", | ||
"url": "https://twitter.com/VicGovAu" | ||
} | ||
] | ||
} | ||
], | ||
"relatedLinks": [ | ||
{ | ||
"id": "33133902-1f57-4283-9f6b-48dd76297c69", | ||
"text": "State Government of Victoria", | ||
"url": "https://www.vic.gov.au" | ||
}, | ||
{ | ||
"id": "254c49f8-b14a-44a1-bad0-729bfb40e425", | ||
"text": "Department of Premier and Cabinet", | ||
"url": "https://www.vic.gov.au/department-premier-and-cabinet" | ||
} | ||
], | ||
"socialShareNetworks": ["Facebook", "Twitter", "LinkedIn"], | ||
"siteSectionNav": { | ||
"title": "Site-section Navigation", | ||
"items": [ | ||
{ | ||
"text": "Demo Landing Page", | ||
"url": "route:entity.node.canonical;node=65", | ||
"id": "683e718c-f024-41f5-aea3-3036155ef4c8", | ||
"parent": null, | ||
"weight": 0 | ||
} | ||
] | ||
} | ||
}, | ||
"headerComponents": [], | ||
"bodyComponents": [ | ||
{ | ||
"uuid": "a99aa287-7fac-430b-864e-3a1b044460b1", | ||
"component": "TideLandingPageContent", | ||
"id": "969", | ||
"props": { | ||
"html": "<p>This is a collection of grants which have some content above them</p>" | ||
} | ||
}, | ||
{ | ||
"uuid": "55555555-5555-5555-5555-555555555555", | ||
"component": "TideCustomCollection", | ||
"id": "123", | ||
"title": "Cameras save lives", | ||
"props": { | ||
"link": { | ||
"url": "https://www.vic.gov.au", | ||
"text": "View more" | ||
}, | ||
"searchListingConfig": { | ||
"searchProvider": "elasticsearch", | ||
"index": "sdp_data_pipelines_scl", | ||
"resultsPerPage": 10, | ||
"labels": { | ||
"submit": "Search", | ||
"placeholder": "Enter suburb, postcode, streetname or offence location" | ||
}, | ||
"customSort": [ | ||
{ | ||
"camera_id": "asc" | ||
} | ||
] | ||
}, | ||
"queryConfig": { | ||
"multi_match": { | ||
"query": "{{query}}", | ||
"fields": ["suburb^3", "street^2", "offence_location"] | ||
} | ||
}, | ||
"globalFilters": [], | ||
"resultsConfig": { | ||
"layout": { | ||
"component": "TideSearchResultsTable", | ||
"props": { | ||
"columns": [ | ||
{ | ||
"label": "Suburb", | ||
"key": "suburb", | ||
"isArray": false | ||
}, | ||
{ | ||
"label": "Location", | ||
"key": "street", | ||
"isArray": false | ||
}, | ||
{ | ||
"label": "Last annual test", | ||
"key": "last_annual_test", | ||
"isArray": false | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"meta": { | ||
"url": "/demo-landing-page", | ||
"langcode": "en", | ||
"description": "Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae", | ||
"additional": [ | ||
{ | ||
"tag": "link", | ||
"attributes": { | ||
"rel": "canonical", | ||
"href": "https://develop.content.reference.sdp.vic.gov.au/demo-landing-page" | ||
} | ||
}, | ||
{ | ||
"tag": "meta", | ||
"attributes": { | ||
"name": "title", | ||
"content": "Demo Landing Page | Single Digital Presence Content Management System" | ||
} | ||
}, | ||
{ | ||
"tag": "meta", | ||
"attributes": { | ||
"property": "og:image", | ||
"content": "https://develop.content.reference.sdp.vic.gov.au/sites/default/files/tide_demo_content/Melbourne-tram.jpg" | ||
} | ||
} | ||
], | ||
"keywords": "", | ||
"image": { | ||
"src": "https://develop.content.reference.sdp.vic.gov.au/sites/default/files/tide_demo_content/Melbourne-tram.jpg", | ||
"alt": "Demo: Melbourne tram", | ||
"title": "Demo: Melbourne tram", | ||
"width": 1413, | ||
"height": 785, | ||
"drupal_internal__target_id": 46 | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
examples/nuxt-app/test/fixtures/landingpage/custom-collection/request.json
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,6 @@ | ||
{ | ||
"query": { "match_all": {} }, | ||
"size": 1, | ||
"from": 0, | ||
"sort": [{ "camera_id": "asc" }] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the node index as default