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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter cards with shortcuts to users and labels #713

Merged
merged 2 commits into from Apr 22, 2024

Conversation

emmguyot
Copy link
Contributor

@emmguyot emmguyot commented Apr 14, 2024

Hi,

I've implemented the card search functionality #53.
This feature allows users to search for :

  • cards based on their name
  • regular expression when starting with /
  • users assigned to cards with @xxx
  • user who created the card with !xxx
  • labels with #xxx.
    It enhances the overall usability of the project and keep it simple with only a few click.

Changes made:

  • Added a search input field to the card list.
  • Updated the UI to display search results dynamically.

Testing:

  • Tested various search queries (including edge cases) to ensure accurate results.
  • Verified that the UI updates correctly when searching.

Preview :
image

Thanks for reviewing! 馃檶

@CLAassistant
Copy link

CLAassistant commented Apr 14, 2024

CLA assistant check
All committers have signed the CLA.

@meltyshev
Copy link
Member

Hi! Thanks for working on this 馃檹

We really like that it's possible to add members and labels right from the text, as well as search using regular expressions. We'd like to add slight style improvements for the search input.

Please note that we'll not be able to accept this PR without a signed CLA.

@emmguyot-adscom
Copy link

Currently updating this PR to be able to filter by creator of the cards, using ! as the starting character

@timmwille
Copy link

amazing to see this onboarding, thank you!!

@emmguyot
Copy link
Contributor Author

The filter by creator is implemented.
The description in this PR has been updated too

@meltyshev
Copy link
Member

Thank you! I'll try to check everything today/tomorrow :)

static findLabelsFromText(filterText, labels) {
const selectLabel = filterText.toLocaleLowerCase();
const matchingLabels = labels.filter((label) =>
label.name.toLocaleLowerCase().startsWith(selectLabel),
Copy link
Member

Choose a reason for hiding this comment

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

Label name can be empty, and if there is such a label, an error Cannot read properties of null (reading 'toLocaleLowerCase') will occur.

Choose a reason for hiding this comment

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

I'll fix this

@meltyshev
Copy link
Member

I have a small suggestion to not add users/labels to the filter immediately. For example if a board has user @a and user @ab, when you type @a it's immediately added to the users filter, so there is no way to add user @ab this way.

Probably adding to the filter should be done only if there is a space after the username (or maybe you have any other suggestions)?

@emmguyot-adscom
Copy link

emmguyot-adscom commented Apr 22, 2024

I have a small suggestion to not add users/labels to the filter immediately. For example if a board has user @a and user @ab, when you type @a it's immediately added to the users filter, so there is no way to add user @ab this way.

Probably adding to the filter should be done only if there is a space after the username (or maybe you have any other suggestions)?

Well, in fact, in your case, when typing @a the a user won't be used to filter because it is used only if only one user fits your entry.
So when typing @ab the ab user will be used.
Though, the problem is, in this case, how to filter on a user. So using the space separator may be a way to solve this.

@meltyshev
Copy link
Member

So using the space separator may be a way to solve this.

I think that would be a good solution. Everything else works perfectly :)

@emmguyot
Copy link
Contributor Author

Both are fixed

@meltyshev meltyshev merged commit eb56b21 into plankanban:master Apr 22, 2024
1 check passed
@meltyshev
Copy link
Member

Perfect, thanks 馃檹

@jpjoux
Copy link

jpjoux commented Apr 25, 2024

Hello
This is a great feature, @emmguyot is it possible to extend the search to the description / comments (and not limited to the card title) ?

@emmguyot
Copy link
Contributor Author

Hello This is a great feature, @emmguyot is it possible to extend the search to the description / comments (and not limited to the card title) ?

Sure it's possible and quite simple. I don't think that the markdown syntax will be a problem that need a workaround.
@meltyshev I go and create another PR ?

@emmguyot emmguyot deleted the SearchCards branch April 26, 2024 18:36
@emmguyot emmguyot mentioned this pull request Apr 26, 2024
@emmguyot
Copy link
Contributor Author

You can check #729 PR

@meltyshev
Copy link
Member

Sure it's possible and quite simple. I don't think that the markdown syntax will be a problem that need a workaround. @meltyshev I go and create another PR ?

Thanks for the quick response with the fix! I'll accept the PR right away.

robertocjunior pushed a commit to robertocjunior/planka that referenced this pull request May 14, 2024
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.

None yet

6 participants