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

[DH/Editor] : Sort by changeDate by default #1022

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions apps/datahub-e2e/src/e2e/datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('datasets', () => {
cy.get('@sortBy')
.getActiveDropdownOption()
.invoke('attr', 'data-cy-value')
.should('equal', 'desc,_score')
.should('equal', 'desc,changeDate')
})
})

Expand Down Expand Up @@ -345,7 +345,7 @@ describe('datasets', () => {

describe('isSpatial filter', () => {
beforeEach(() => {
cy.get('@filters').eq(4).click()
cy.get('@filters').eq(5).click()
getFilterOptions()
})
it('should have options', () => {
Expand Down Expand Up @@ -473,7 +473,7 @@ describe('datasets', () => {
cy.intercept('GET', '/assets/configuration/default.toml', {
fixture: 'config-with-geometry.toml',
})
cy.visit('/search')
cy.visit('/search?_sort=-_score')
})
it('boosts records in the provided geometry', () => {
cy.get('gn-ui-results-list-item')
Expand Down Expand Up @@ -541,7 +541,7 @@ describe('datasets', () => {
cy.get('.cdk-overlay-container')
.find('[role=listbox]')
.find('button')
.should('have.length', 3)
.should('have.length', 4)
})
})

Expand Down
1 change: 1 addition & 0 deletions libs/common/domain/src/lib/model/search/sort-by.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export const SortByEnum: Record<string, SortByField> = {
POPULARITY: ['desc', 'userSavedCount'],
RELEVANCY: ['desc', '_score'],
QUALITY_SCORE: ['desc', 'qualityScore'],
CHANGE_DATE: ['desc', 'changeDate'],
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ describe('RouterEffects', () => {
a: new SetFilters({ any: 'any' }, 'main'),
b: new SetSortBy(['desc', 'createDate'], 'main'),
c: new Paginate(2, 'main'),
d: new SetSortBy(['desc', '_score'], 'main'),
d: new SetSortBy(['desc', 'changeDate'], 'main'),
e: new Paginate(1, 'main'),
})
expect(effects.syncSearchState$).toBeObservable(expected)
Expand All @@ -273,7 +273,7 @@ describe('RouterEffects', () => {
a: new SetFilters({ any: 'any' }, 'main'),
b: new SetSortBy(['desc', 'createDate'], 'main'),
c: new Paginate(2, 'main'),
d: new SetSortBy(['desc', '_score'], 'main'),
d: new SetSortBy(['desc', 'changeDate'], 'main'),
e: new Paginate(12, 'main'),
})
expect(effects.syncSearchState$).toBeObservable(expected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class RouterEffects {
let sortBy =
ROUTE_PARAMS.SORT in newParams
? sortByFromString(newParams[ROUTE_PARAMS.SORT])
: SortByEnum.RELEVANCY
: SortByEnum.CHANGE_DATE
let pageNumber =
ROUTE_PARAMS.PAGE in newParams
? parseInt(newParams[ROUTE_PARAMS.PAGE])
Expand Down
4 changes: 4 additions & 0 deletions libs/feature/search/src/lib/sort-by/sort-by.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export class SortByComponent implements OnInit {
label: marker('results.sortBy.dateStamp'),
value: SortByEnum.CREATE_DATE.join(','),
},
{
label: marker('results.sortBy.changeDate'),
value: SortByEnum.CHANGE_DATE.join(','),
},
{
label: marker('results.sortBy.popularity'),
value: SortByEnum.POPULARITY.join(','),
Expand Down
1 change: 1 addition & 0 deletions translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"results.records.hits.found": "{hits, plural, =0{Keine Dokumente entsprechen der angegebenen Suche.} one{1 Datensatz gefunden.} other{{hits} Datensätze gefunden.}}",
"results.records.hits.selected": "{ amount } ausgewählt",
"results.showMore": "Mehr Ergebnisse anzeigen...",
"results.sortBy.changeDate": "",
"results.sortBy.dateStamp": "Neueste",
"results.sortBy.popularity": "Beliebtheit",
"results.sortBy.qualityScore": "Qualitätsbewertung",
Expand Down
3 changes: 2 additions & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@
"results.records.hits.found": "{hits, plural, =0{No documents match the specified search.} one{1 record found.} other{{hits} records found.}}",
"results.records.hits.selected": "{ amount } selected",
"results.showMore": "Show more results...",
"results.sortBy.dateStamp": "Most recent",
"results.sortBy.changeDate": "Last modification",
"results.sortBy.dateStamp": "Newest",
"results.sortBy.popularity": "Popularity",
"results.sortBy.qualityScore": "Quality score",
"results.sortBy.relevancy": "Relevancy",
Expand Down
1 change: 1 addition & 0 deletions translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"results.records.hits.found": "",
"results.records.hits.selected": "",
"results.showMore": "",
"results.sortBy.changeDate": "",
"results.sortBy.dateStamp": "",
"results.sortBy.popularity": "",
"results.sortBy.qualityScore": "",
Expand Down
1 change: 1 addition & 0 deletions translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"results.records.hits.found": "{hits, plural, =0{Aucune correspondance.} one{1 enregistrement trouvé.} other{{hits} résultats.}}",
"results.records.hits.selected": "{amount, plural, one{1 sélectionnée} other{{ amount } sélectionnées}}",
"results.showMore": "Plus de résultats...",
"results.sortBy.changeDate": "Dernière modification",
"results.sortBy.dateStamp": "Plus récent",
"results.sortBy.popularity": "Popularité",
"results.sortBy.qualityScore": "Indicateur de qualité",
Expand Down
1 change: 1 addition & 0 deletions translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"results.records.hits.found": "{hits, plural, =0{Nessuna corrispondenza.} one{1 record trovato.} other{{hits} risultati.}}",
"results.records.hits.selected": "{amount, plural, one{1 selezionato} other{{ amount } selezionati}}",
"results.showMore": "Altri risultati...",
"results.sortBy.changeDate": "",
"results.sortBy.dateStamp": "Più recente",
"results.sortBy.popularity": "Popolarità",
"results.sortBy.qualityScore": "Indicatore di qualità",
Expand Down
1 change: 1 addition & 0 deletions translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"results.records.hits.found": "",
"results.records.hits.selected": "",
"results.showMore": "",
"results.sortBy.changeDate": "",
"results.sortBy.dateStamp": "",
"results.sortBy.popularity": "",
"results.sortBy.qualityScore": "",
Expand Down
1 change: 1 addition & 0 deletions translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"results.records.hits.found": "",
"results.records.hits.selected": "",
"results.showMore": "",
"results.sortBy.changeDate": "",
"results.sortBy.dateStamp": "",
"results.sortBy.popularity": "",
"results.sortBy.qualityScore": "",
Expand Down
1 change: 1 addition & 0 deletions translations/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"results.records.hits.found": "{hits, plural, =0{Žiadne dokumenty nezodpovedajú zadanému vyhľadávaniu.} one{1 záznam nájdený.} other{{hits} záznamov nájdených.}}",
"results.records.hits.selected": "{ amount } označených",
"results.showMore": "Zobraziť viac výsledkov...",
"results.sortBy.changeDate": "",
"results.sortBy.dateStamp": "Najnovšie",
"results.sortBy.popularity": "Popularita",
"results.sortBy.qualityScore": "Hodnotenie kvality",
Expand Down
Loading