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

feat/Adjust the searchbar to perform searches by title, description or context #238

Merged

Conversation

Hardsys-Andre
Copy link

Brief Information

The type of this pull request is:

  • bug fixing
  • [x ] new feature
  • others

What does this PR do?

search the issue card for the desired information within the title, description or context fields

image

Closes #216

Copy link

vercel bot commented Sep 11, 2024

@Hardsys-Andre is attempting to deploy a commit to the WEB3DEV Team on Vercel.

A member of the Team first needs to authorize it.

@Guboehm Guboehm added the enhancement New feature or request label Sep 11, 2024
@Guboehm Guboehm linked an issue Sep 11, 2024 that may be closed by this pull request
<SearchBar
searchQuery={searchQuery}
setSearchQuery={setSearchQuery}
placeholder="Search by title, description, or context depth"
Copy link
Collaborator

Choose a reason for hiding this comment

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

use translation for it

Copy link
Author

Choose a reason for hiding this comment

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

@Guboehm , done the translation of this item below

return issues.filter((issue) =>
Object.entries(selectedFilters).every(
([filterName, selectedValue]) =>
!selectedValue ||
issue.fields.some((field) => field.field === filterName && field.value === selectedValue)
) &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

this const has a lot of responsibility, can you separate the responsibilities into more consts?

Copy link
Author

Choose a reason for hiding this comment

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

@Guboehm and @nomadbitcoin, I made an adjustment to this component because before the search was working but the filter had an error and was not filtering. Despite using the same "const", I separated the two functions into issuesFilter and issuesSearch. I chose this way because the search also has to work within an already established filter.

@@ -121,7 +125,7 @@ const TaskPage = ({ issues }) => {
</div>
<div className="flex flex-col gap-4">
{filteredIssues.map((issue) => (
<IssueCard key={issue.github_id} issue={issue} t={t} userInfo={userAuth} />
<IssueCard key={issue.github_id} issue={issue} userInfo={userAuth} />
Copy link
Contributor

Choose a reason for hiding this comment

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

pass userAuth as parameter is very weird, avoid doing that since we can get this information globally

@@ -98,10 +98,10 @@ Deploy this project on Vercel in one click:

#### Windows

1. Download and install Java from the official [Oracle website](https://www.java.com/en/download/ie_manual.jsp). Make sure to choose the version suitable for your system.
1. Download and install SDK Java 20 from the official [Oracle website](https://www.oracle.com/java/technologies/javase/jdk20-archive-downloads.html). Make sure to choose the version suitable for your system.
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

yarn.lock Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not upload changes in these temporary files

Copy link
Contributor

Choose a reason for hiding this comment

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

I think search and filtering should be separate hooks that operate on the same data.

@nomadbitcoin nomadbitcoin merged commit 1fafa5a into w3b3d3v:feat/web3task-staging Sep 26, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Implement Functional SearchBar Generic
3 participants