diff --git a/schemas/sitePreferencesSchema.json b/schemas/sitePreferencesSchema.json index 8673b8f23f..926c7ef2f9 100644 --- a/schemas/sitePreferencesSchema.json +++ b/schemas/sitePreferencesSchema.json @@ -19,12 +19,14 @@ "default", "relevance", "-usage_score", + "start_date", "-ongoing" ], "enumNames": [ "Default", "Relevance", "Usage", + "Start Date", "End Date" ] }, diff --git a/serverless/src/openSearchGranuleSearch/__tests__/renderOpenSearchTemplate.test.js b/serverless/src/openSearchGranuleSearch/__tests__/renderOpenSearchTemplate.test.js index e611011b19..a70154f103 100644 --- a/serverless/src/openSearchGranuleSearch/__tests__/renderOpenSearchTemplate.test.js +++ b/serverless/src/openSearchGranuleSearch/__tests__/renderOpenSearchTemplate.test.js @@ -44,7 +44,7 @@ describe('renderOpenSearchTemplate', () => { expect(response).toEqual('https://cwic.wgiss.ceos.org/opensearch/granules.atom?datasetId=C1597928934-NOAA_NCEI&count=20&geoBox=-92.5761953125,40.874451651754995,-92.57519531250.001,40.875451651754990.001&clientId=eed-edsc-dev') }) - test('inlcludes a start and end date when temporal values are provided', () => { + test('includes a start and end date when temporal values are provided', () => { const response = renderOpenSearchTemplate( 'https://cwic.wgiss.ceos.org/opensearch/granules.atom?datasetId=C1597928934-NOAA_NCEI&startIndex={startIndex?}&count={count?}&timeStart={time:start}&timeEnd={time:end}&geoBox={geo:box}&clientId=eed-edsc-dev', { diff --git a/static/src/js/components/SearchPanels/SearchPanels.js b/static/src/js/components/SearchPanels/SearchPanels.js index b17d4f8c85..1a83061ce3 100644 --- a/static/src/js/components/SearchPanels/SearchPanels.js +++ b/static/src/js/components/SearchPanels/SearchPanels.js @@ -312,6 +312,11 @@ class SearchPanels extends PureComponent { isActive: activeCollectionsSortKey === '-usage_score', onClick: () => setCollectionSort('-usage_score') }, + { + label: 'Start Date', + isActive: activeCollectionsSortKey === 'start_date', + onClick: () => setCollectionSort('start_date') + }, { label: 'End Date', isActive: activeCollectionsSortKey === '-ongoing', diff --git a/static/src/js/components/SearchPanels/__tests__/SearchPanels.test.js b/static/src/js/components/SearchPanels/__tests__/SearchPanels.test.js index cf59f78589..5d2a436342 100644 --- a/static/src/js/components/SearchPanels/__tests__/SearchPanels.test.js +++ b/static/src/js/components/SearchPanels/__tests__/SearchPanels.test.js @@ -158,8 +158,10 @@ describe('SearchPanels component', () => { expect(collectionResultsPanelProps.sortsArray[0].isActive).toBe(true) expect(collectionResultsPanelProps.sortsArray[1].label).toBe('Usage') expect(collectionResultsPanelProps.sortsArray[1].isActive).toBe(false) - expect(collectionResultsPanelProps.sortsArray[2].label).toBe('End Date') + expect(collectionResultsPanelProps.sortsArray[2].label).toBe('Start Date') expect(collectionResultsPanelProps.sortsArray[2].isActive).toBe(false) + expect(collectionResultsPanelProps.sortsArray[3].label).toBe('End Date') + expect(collectionResultsPanelProps.sortsArray[3].isActive).toBe(false) }) describe('when in the default portal', () => {