-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDPAP-6808] Data listing i.e custom table (#1276)
* feat(@dpc-sdp/ripple-nuxt-tide): add data listing landing page component and mappings, Tide-Api-Search-Index header * feat(@dpc-sdp/ripple-tide-search-api): add tide-api-search-index to search and getAggregations helper function * feat: reference site; add data driven component and config * feat(@dpc-sdp/ripple-nuxt-tide): update nodeModulePath to get data driven component working in monorepo * feat: updates for new pipeline data, rename to avoid conflict * feat: add query field boosts * feat(@dpc-sdp/ripple-nuxt-tide): add support for fuzy matching * feat(reference): remove data list * feat(reference): remove myvic nohoist * feat(reference): revert config-loader update as we no longer need this change --------- Co-authored-by: David Featherston <david.featherstone@dpc.vic.gov.au>
- Loading branch information
Showing
14 changed files
with
874 additions
and
141 deletions.
There are no files selected for viewing
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
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
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
35 changes: 35 additions & 0 deletions
35
packages/ripple-nuxt-tide/modules/landing-page/__tests__/data-list.test.js
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,35 @@ | ||
import { getQueryParams } from '../lib/data-list' | ||
|
||
const data = { | ||
perPage: 10, | ||
currentPage: 1, | ||
sort: 'title', | ||
sortOptions: [{ | ||
id: 'title', | ||
name: 'Title', | ||
order: 'asc' | ||
}], | ||
model: { | ||
search: 'Melbourne', | ||
status: ['Pending', 'Complete'] | ||
}, | ||
searchField: 'search', | ||
queryFields: ['title'], | ||
aggregationFields: ['status'] | ||
} | ||
|
||
describe('getQueryParams', () => { | ||
const params = getQueryParams(data) | ||
|
||
test('should be sorting in ascending order by title', () => { | ||
expect(params.sort).toEqual({ title: 'asc' }) | ||
}) | ||
|
||
test('should return query field value when search field model is set', () => { | ||
expect(params.q).toEqual('Melbourne') | ||
}) | ||
|
||
test('should return formatted filters with the search field value', () => { | ||
expect(params.filters.status.values).toContain('Pending') | ||
}) | ||
}) |
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
Oops, something went wrong.