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

Sort nil dates last in both directions #278

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Conversation

hackartisan
Copy link
Member

companion PR: pulibrary/pul_solr#445

This will probably require a reindex (via DpulCollections.IndexingPipeline.Figgy.IndexingConsumer.start_over!(n))

advances #272

Copy link

github-actions bot commented Nov 27, 2024

Container Scanning Status: ✅ Success


ghcr.io/pulibrary/dpul-collections:pr-278 (debian 12.6)
=======================================================
Total: 0 (HIGH: 0, CRITICAL: 0)

@@ -114,6 +114,48 @@ defmodule DpulCollectionsWeb.SearchLiveTest do
|> Enum.empty?()
end

test "when sorting by date, a nil date always sorts last", %{conn: conn} do
# {"id": "nildate", "title_txtm": "Document Nil Date"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these comments still useful to have?

{:ok, view, html} = live(conn, "/search?sort_by=date_desc&page=11")
{:ok, document} = Floki.parse_document(html)

assert document
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Can we use has_element? instead of Floki parsing the HTML? https://hexdocs.pm/phoenix_live_view/Phoenix.LiveViewTest.html#has_element?/3

@hackartisan
Copy link
Member Author

@tpendragon thanks for the suggestions, it's updated

@tpendragon tpendragon merged commit fc0ebf6 into main Nov 27, 2024
4 checks passed
@tpendragon tpendragon deleted the 272-nil-dates-last branch November 27, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants