Skip to content

Topic search filtering 19 2#84

Merged
dcollie2 merged 5 commits intomainfrom
topic-search-filtering-19-2
Feb 23, 2025
Merged

Topic search filtering 19 2#84
dcollie2 merged 5 commits intomainfrom
topic-search-filtering-19-2

Conversation

@dmitrytrager
Copy link
Copy Markdown
Collaborator

@dmitrytrager dmitrytrager commented Feb 20, 2025

What Issue Does This PR Cover, If Any?

This PR is an addition to the task of topics search.
Let's use full power of Rails 8 and make search work automatically (without submitting form by button click).

What Changed? And Why Did It Change?

Any change of search form input will lead to debounced form submission.
This works through new Stimulus controller.

How Has This Been Tested?

Manually

Please Provide Screenshots

No 'Submit' button, form was submitted after typing:
Screenshot 2025-02-20 at 23 00 23

Additional Comments

  1. turbo_frame_tag does not work inside the table, so we cannot wrap only table body and have to wrap the whole table
  2. this PR is not related to planned Topics filtering update, I will work on this issue separately
  3. net-smtp update fixes CI build

@dmitrytrager dmitrytrager force-pushed the topic-search-filtering-19-2 branch from b4b0da4 to 1b2def5 Compare February 20, 2025 22:04
@dmitrytrager dmitrytrager marked this pull request as ready for review February 20, 2025 22:17
<% @topics.each do |topic| %>
<tr>
<td class="text-bold-500"><%= topic.title %></td>
<td class="text-bold-500"><%= topic.description.truncate(25, omission: "...") %></td>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Truncate needs a safe navigation operator. It will throw an undefined method for nil error if description is not provided.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Our existing tests will catch this if we set only the required fields in the topics factory.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We also have an errant not-null on description and UID in the schema. Both of those should be optional.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

So should we make description and title nullable?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I got that in the import branch, so we're good.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Actually, since this is pulled into another file, we'll need to get it here. I got the migration portion but we'll need to add the save navigation operator before those two truncates. Then I think we're good to go.

@dmitrytrager
Copy link
Copy Markdown
Collaborator Author

I've committed JS libraries that were downloaded when I run import map command.
Hope that helps

Copy link
Copy Markdown
Collaborator

@dcollie2 dcollie2 left a comment

Choose a reason for hiding this comment

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

We just need the &.truncate fixes and we're ready to merge.

* main:
  Bump selenium-webdriver from 4.28.0 to 4.29.0
  Update language.rb
  chore: annotate models, factories and fixtures
  chore: introduce annotate gem
  test: add min length validation for name
  fix: better spec descriptions
  Remove calls to simple-datatables
  WIP
  Implement topic importer
  Add old_id to topics for uniqueness and backfill
  Add old_id to providers for backfilling
  WIP
  chore: update net-smtp gem
  feat: add file_storage_prefix method to language model
  refactor: remove file_share_folder column from languages
  fix: provider seeds
  change logic for sign_in test helper
@dmitrytrager dmitrytrager force-pushed the topic-search-filtering-19-2 branch from a706ff3 to eb926d4 Compare February 23, 2025 13:28
@dmitrytrager
Copy link
Copy Markdown
Collaborator Author

I've force pushed this branch merged with main

@dcollie2 dcollie2 merged commit f46f1be into main Feb 23, 2025
@dcollie2 dcollie2 deleted the topic-search-filtering-19-2 branch February 23, 2025 16:22
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