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

Expand on tag filters #803

Open
wants to merge 6 commits into
base: 1.x
Choose a base branch
from
Open

Expand on tag filters #803

wants to merge 6 commits into from

Conversation

abrenoch
Copy link

I noticed the tags filter was a bit rigid so I have some proposed changes:

  • Adds useTagIdPath as a query variable. This will allow searching for tags by their nested location (such as /7/11/15/) rather than just the name. If 2 tags with the same name existed within 2 different parents, there was no way to differentiate which one was returned. This will allow targeting specific tags within the scope of the parents.
  • Adds hasAllTags as a query variable. Currently the tag filter matches any of the tags provided in the query, setting this variable to true will require results match all the tags provided.

@dvesh3 dvesh3 added this to the 1.7.0 milestone Sep 22, 2023
@Corepex Corepex self-assigned this Feb 1, 2024
@Corepex
Copy link
Contributor

Corepex commented Feb 5, 2024

@abrenoch, thanks for submitting a PR to data-hub 🥳

I tested your implementation, and I still have some questions.
I've tested everything based on the demo data (see https://demo.pimcore.fun/admin)

You correctly pointed out that filtering tags based on their name could be improved since there can be tags with an identical name.

I checked out your code and tried the useTagIdPath flag to filter based on the tag`s path (instead of just the name).
In that example, the idPath was /3/4/ (Quality/high-res) - but that returned no result.
After checking the SQL I noticed that you can only filter for an idPath "group" (in my case /3/) since the idPath column doesn't hold the whole path of the tag.

Please have another look at this PR and fix this issue 👍

I'm looking forward to your improved PR 💯 🥇

@fashxp fashxp modified the milestones: 1.7.0, 1.8.0 Feb 27, 2024
@Corepex
Copy link
Contributor

Corepex commented Mar 22, 2024

@abrenoch friendly reminder ⏰. I would love to see this PR merged 🎉.

@Corepex
Copy link
Contributor

Corepex commented Mar 29, 2024

@abrenoch ⏰ please have another look at this PR 🍭

@abrenoch
Copy link
Author

abrenoch commented Apr 2, 2024

@Corepex Hey must have missed your pings - I'll try to take a look at this in the next couple days

@abrenoch
Copy link
Author

abrenoch commented Apr 3, 2024

@abrenoch, thanks for submitting a PR to data-hub 🥳

I tested your implementation, and I still have some questions. I've tested everything based on the demo data (see https://demo.pimcore.fun/admin)

You correctly pointed out that filtering tags based on their name could be improved since there can be tags with an identical name.

I checked out your code and tried the useTagIdPath flag to filter based on the tags path (instead of just the name). In that example, the idPathwas/3/4/ (Quality/high-res) - but that returned no result. After checking the SQL I noticed that you can only filter for an idPath"group" (in my case/3/) since the idPath` column doesn't hold the whole path of the tag.

Please have another look at this PR and fix this issue 👍

I'm looking forward to your improved PR 💯 🥇

Hey updated so this path search should work now - not sure how I overlooked that. Using a pattern like /3/4/ like you described above should work now (extrapolating /3/ and then using 4 as an additional search condition). Just let me know if you run into any more trouble.

@Corepex
Copy link
Contributor

Corepex commented Apr 5, 2024

@abrenoch, thanks for updating your PR.

The problem with the idPath seems to be solved. At least the filtering works now, as expected.
I noticed another thing dought: It seems that you deleted the part with hasAllTags. At least I can't find any reference to that argument. Please bring that function back.

I guess the hasAllTags param should work in both scenarios (useTagIdPath: true and useTagIdPath: false).

Besides that, it looks quite promising :)

@abrenoch
Copy link
Author

abrenoch commented Apr 5, 2024

@Corepex Whoops how silly of me - was too focused on the other problem to notice I lost it in the merge 😅 . Will fix that shortly!

Copy link

github-actions bot commented Apr 5, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@abrenoch
Copy link
Author

abrenoch commented Apr 5, 2024

I have read the CLA Document and I hereby sign the CLA

@Corepex
Copy link
Contributor

Corepex commented Apr 19, 2024

@abrenoch, somehow, it still doesn't work. I created a dummy event and assigned three according tags to it 2, 3, /3/4.
I also added hasAllTags: true and useTagIdPath: true. At least with that settings I don't get any results.

Please check your setup and try to recreate this usecase.

DataObject:
image

Query:

query
{
  getEventListing(tags: "2, 3, /3/4/", hasAllTags: true, useTagIdPath: true)
  {
    edges {
      node {
        id
      }
    }
  }
}

Copy link

sonarcloud bot commented Apr 25, 2024

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
4.8% Duplication on New Code

See analysis details on SonarCloud

@abrenoch
Copy link
Author

Gotcha @Corepex . Sorry but it may take me a while to get back to this; we have moved past pimcore since I originally opened this PR and I'm not sure how much time I would have to continue contributing (or, er, trying to I guess). But if someone else wanted to whip it into shape in the meantime I would certainly welcome it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants