Skip to content

Commit

Permalink
Fix sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
reebalazs committed Mar 1, 2024
1 parent e4e1b15 commit 31b360c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions acceptance/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Cypress.Commands.add(
contentContactName,
contentWebsite,
contentContactMail,
contentEffective,
reviewState = 'published',
withImage,
path = '',
Expand Down Expand Up @@ -189,6 +190,7 @@ Cypress.Commands.add(
description: contentDescription,
subjects: contentSubjects,
topic: contentTopics,
effective: contentEffective,
file: {
data: 'dGVzdGZpbGUK',
encoding: 'base64',
Expand All @@ -215,6 +217,7 @@ Cypress.Commands.add(
title: contentTitle,
description: contentDescription,
subjects: contentSubjects,
effective: contentEffective,
image: {
data:
'iVBORw0KGgoAAAANSUhEUgAAANcAAAA4CAMAAABZsZ3QAAAAM1BMVEX29fK42OU+oMvn7u9drtIPisHI4OhstdWZyt4fkcXX5+sAg74umMhNp86p0eJ7vNiKw9v/UV4wAAAAAXRSTlMAQObYZgAABBxJREFUeF7tmuty4yAMhZG4X2zn/Z92J5tsBJwWXG/i3XR6frW2Y/SBLIRAfaQUDNt8E5tLUt9BycfcKfq3R6Mlfyimtx4rzp+K3dtibXkor99zsEqLYZltblTecciogoh+TXfY1Ve4dn07rCDGG9dHSEEOg/GmXl0U1XDxTKxNK5De7BxsyyBr6gGm2/vPxKJ8F6f7BXKfRMp1xIWK9A+5ks25alSb353dWnDJN1k35EL5f8dVGifTf/4tjUuuFq7u4srmXC60yAmldLXIWbg65RKU87lcGxJCFqUPv0IacW0PmSivOZFLE908inPToMmii/roG+MRV/O8FU88i8tFsxV3a06MFUw0Qu7RmAtdV5/HVVaOVMTWNOWSwMljLhzhcB6XIS7OK5V6AvRDNN7t5VJWQs1J40UmalbK56usBG/CuCHSYuc+rkUGeMCViNRARPrzW52N3oQLe6WifNliSuuGaH3czbVNudI9s7ZLUCLHVwWlyES522o1t14uvmbblmVTKqFjaZYJFSTPP4dLL1kU1z7p0lzdbRulmEWLxoQX+z9ce7A8GqEEucllLxePuZwdJl1Lezu0hoswvTPt61DrFcRuujV/2cmlxaGBC7Aw6cpovGANwRiSdOAWJ5AGy4gLL64dl0QhUEAuEUNws+XxV+OKGPdw/hESGYF9XEGaFC7sNLMSXWJjHsnanYi87VK428N2uxpOjOFANcagLM5l+7mSycM8KknZpKLcGi6jmzWGr/vLurZ/0g4u9AZuAoeb5r1ceQhyiTPY1E4wUR6u/F3H2ojSpXMMriBPT9cezTto8Cx+MsglHL4fv1Rxrb1LVw9yvyQpJ3AhFnLZfuRLH2QsOG3FGGD20X/th/u5bFAt16Bt308KjF+MNOXgl/SquIEySX3GhaZvc67KZbDxcCDORz2N8yCWPaY5lyQZO7lQ29fnZbt3Xu6qoge4+DjXl/MocySPOp9rlvdyznahRyHEYd77v3LhugOXDv4J65QXfl803BDAdaWBEDhfVx7nKofjoVCgxnUAqw/UAUDPn788BDvQuG4TDtdtUPvzjSlXAB8DvaDOhhrmhwbywylXAm8CvaouikJTL93gs3y7Yy4VYbIxOHrcMizPqWOjqO9l3Uz52kibQy4xxOgqhJvD+w5rvokOcAlGvNCfeqCv1ste1stzLm0f71Iq3ZfTrPfuE5nhPtF+LvQE2lffQC7pYtQy3tdzdrKvd5TLVVzDetScS3nEKmmwDyt1Cev1kX3YfbvzNK4fzrlw+cB6vm+uiUgf2zdXI62241LawCb7Pi5FXFPF8KpzDoF/Sw2lg+GrHNbno1mhPu+VCF/vfMnw06PnUl6j48dVHD3jHNHPua+fc3o/5yp/zsGi0vYtzi3Pz5mHd4T6BWMIlewacd63AAAAAElFTkSuQmCC',
Expand Down Expand Up @@ -243,6 +246,7 @@ Cypress.Commands.add(
title: contentTitle,
description: contentDescription,
subjects: contentSubjects,
effective: contentEffective,
target_url: target_url,
shows_people: false,
language,
Expand Down Expand Up @@ -277,6 +281,7 @@ Cypress.Commands.add(
description: contentDescription,
head_title: contentHeadTitle,
subjects: contentSubjects,
effective: contentEffective,
blocks: blocks,
blocks_layout: blocksLayout,
allow_discussion: allow_discussion,
Expand All @@ -302,6 +307,7 @@ Cypress.Commands.add(
description: contentDescription,
head_title: contentHeadTitle,
subjects: contentSubjects,
effective: contentEffective,
allow_discussion: allow_discussion,
review_state: reviewState,
contact_name: contentContactName,
Expand Down
3 changes: 3 additions & 0 deletions acceptance/cypress/tests/search-ui.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ context('Search Acceptance Tests (UI)', () => {
contentId: 'alpha',
contentTitle: 'Alpha Beta Gaga Colorful',
path: '/',
contentEffective: '2018-01-21T08:00:00',
});
cy.request({
method: 'POST',
Expand All @@ -28,6 +29,7 @@ context('Search Acceptance Tests (UI)', () => {
contentId: 'beta',
contentTitle: 'Beta Colorful',
path: '',
contentEffective: '2018-02-21T08:00:00',
});
cy.request({
method: 'POST',
Expand All @@ -45,6 +47,7 @@ context('Search Acceptance Tests (UI)', () => {
contentId: 'gamma',
contentTitle: 'Gamma Colorful',
path: '',
contentEffective: '2018-03-21T08:00:00',
});
cy.request({
method: 'POST',
Expand Down
2 changes: 2 additions & 0 deletions src/components/theme/SolrSearch/SearchQuery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
export const queryStateFromParams = (params) => ({
searchword: params.SearchableText || '',
sortOn: params.sort_on || 'relevance',
sortOrder: params.sort_order || '',
groupSelect: parseInt(params.group_select) || 0,
allowLocal: (params.allow_local || '').toLowerCase() === 'true',
local: (params.local || '').toLowerCase() === 'true',
Expand All @@ -18,6 +19,7 @@ export const queryStateFromParams = (params) => ({
export const queryStateToParams = (queryState) => ({
SearchableText: queryState.searchword,
sort_on: queryState.sortOn,
sort_order: queryState.sortOrder,
group_select: '' + queryState.groupSelect,
allow_local: '' + (queryState.allowLocal || false),
local: '' + (queryState.local || false),
Expand Down

0 comments on commit 31b360c

Please sign in to comment.