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

[R20-1321] Add custom collection #777

Merged
merged 21 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
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 Aug 15, 2023
d17c7a3
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly Aug 15, 2023
d3a1ea8
test(@dpc-sdp/ripple-tide-search): :white_check_mark: ignore resize o…
dylankelly Aug 15, 2023
8f96db7
test(@dpc-sdp/ripple-tide-search): :test_tube: remove unimplemented test
dylankelly Aug 15, 2023
f497e7a
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly Aug 21, 2023
39632df
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly Aug 22, 2023
52970c2
refactor(@dpc-sdp/ripple-tide-search): :sparkles: use backend json field
dylankelly Aug 22, 2023
7adf56b
Merge branch 'develop' into feature/custom-collection
dylankelly Aug 22, 2023
ffda251
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly Aug 24, 2023
e276a84
Merge branch 'develop' into feature/custom-collection
waitingallday Aug 25, 2023
7de48e1
fix(@dpc-sdp/ripple-tide-search): fix cc mapping
dylankelly Aug 27, 2023
e31d40b
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly Aug 28, 2023
b7b7d92
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly Aug 29, 2023
9844062
fix(@dpc-sdp/ripple-tide-search): :lipstick: add margin between error…
dylankelly Aug 30, 2023
06fff8c
test(@dpc-sdp/ripple-tide-search): skip custom collection tests
dylankelly Aug 30, 2023
c1a9acb
test(@dpc-sdp/ripple-tide-search): :green_heart: fix custom collectio…
dylankelly Aug 31, 2023
cc3fc59
refactor(@dpc-sdp/ripple-tide-search): :recycle: rename proxy handler…
dylankelly Aug 31, 2023
d8f460d
Merge branch 'develop' of github.com:dpc-sdp/ripple-framework into fe…
dylankelly Sep 4, 2023
2c0da90
fix(@dpc-sdp/ripple-tide-search): fix search request proxy config
dylankelly Sep 4, 2023
7eb8063
fix(@dpc-sdp/ripple-tide-search): :bug: disable autocomplete on custo…
dylankelly Sep 4, 2023
2304ad5
fix(@dpc-sdp/ripple-tide-search): :bug: fix autocomplete end point
dylankelly Sep 4, 2023
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
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 examples/nuxt-app/test/fixtures/landingpage/custom-collection.json
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",
Copy link
Contributor Author

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

"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
}
}
}
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" }]
}
Loading