Skip to content

Passive targeting#290

Merged
davisagli merged 20 commits intomainfrom
passive-targeting
Dec 11, 2025
Merged

Passive targeting#290
davisagli merged 20 commits intomainfrom
passive-targeting

Conversation

@davisagli
Copy link
Copy Markdown
Member

@davisagli davisagli commented Dec 8, 2025

Steps to test:

  1. Set up Plone site
  2. Set up solr (make solr-start-and-rebuild)
  3. Reindex (make solr-activate-and-reindex)
  4. Make sure there is a Profile with username set to your user's username, and with an organisational unit and location assigned.
  5. Make sure there is some content assigned to the same organisational unit and location.
  6. Create a listing or search block with sort set to "user relevance"
    Expected: the block should show results matching the user's organisational unit and location first.

@davisagli
Copy link
Copy Markdown
Member Author

@sneridagh The lo-fi design for this (in https://gitlab.kitconcept.io/kitconcept/distribution-kitconcept-intranet/-/issues/205) adds a message shown in the block view when this sort option is selected. I'd like to discuss the best way to add that without needing to override components.

@sneridagh
Copy link
Copy Markdown
Member

@davisagli I tried to follow instructions. I could not make it work, and I find the following problems.

Steps to test:

  1. Set up Plone site
  2. Set up solr (make solr-start-and-rebuild)
  3. Reindex (make solr-activate-and-reindex)
  4. Make sure there is a Profile with username set to your user's username, and with an organisational unit and location assigned.

A profile in /personen, right? Theres no username field in the profiles. I created:

http://localhost:3000/personen/victor

I made it so the id of the profile is the username. That didn't work. We have to get this right, specially when we create the users in bulk but it also has to work when creating profiles TTW. I noticed that the profile nowadays have a Standort fieldset, and then the location vocabulary in categories.

  1. Make sure there is some content assigned to the same organisational unit and location.

I only added my location. It's not an AND, right?

  1. Create a listing or search block with sort set to "user relevance"
    Expected: the block should show results matching the user's organisational unit and location first.

I did, created a page with a listing, filtering by news items, and set the sort, and the news item that I added my location is not on the top of the list.

Let's review it together this evening.

@sneridagh
Copy link
Copy Markdown
Member

@davisagli ok, I made it work looking at the tests, the username is in the collective.person.user behavior, and it's not applied in the site (yet). I applied manually, and it worked. The news item I assigned to my location is on the top.

We will need docs for the feature too.

@davisagli
Copy link
Copy Markdown
Member Author

@sneridagh I must have added the behavior manually when I was working locally -- and then I was misled to thinking it was already enabled everywhere, because the tests pass (because the indexer was there even though the field wasn't). Will fix.

@davisagli davisagli requested a review from a team as a code owner December 9, 2025 18:07
@davisagli
Copy link
Copy Markdown
Member Author

@sneridagh I think this is ready now.

@davisagli
Copy link
Copy Markdown
Member Author

Don't merge; needs collective/collective.person#17 first

@davisagli davisagli merged commit 790cc2b into main Dec 11, 2025
26 checks passed
@davisagli davisagli deleted the passive-targeting branch December 11, 2025 19:49
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.

3 participants