zetkin / app.zetkin.org

Revamped Zetkin web interface.
https://app-zetkin-org.vercel.app
22 stars 40 forks source link

Call assignments are created with no default "Done" criteria (`goal_filters`) #1418

Open richardolsson opened 1 year ago

richardolsson commented 1 year ago

Description

When creating a new call assignment, it should be configured such by default that people are only spoken to once in that assignment. This is usually done by including a call_history filter in the goal_filters. But by default right now, the goal_filters is empty, meaning that there is no definition of done and a person can basically be spoken to an infinite number of times in the same assignment.

Steps to reproduce

  1. Go to http://localhost:3000/organize/1/projects/1
  2. Click on "Create activity"
  3. Click "Create call assignment"
  4. Click "Edit done criteria"

Expected Behaviour

Should show a Smart Search with a filter to find all people who have been reached in the current call assignment.

Actual Behaviour

Shows an empty Smart Search

Screenshots

Empty done criteria (Smart Search)

image

Proposed solution

After creating the Call Assignment (in CampaignActionButtons), immediately patch the goal_filters array, with the ID of the newly created assignment.

goal_filters = [{
  type: 'call_history',
  config: {
    operator: 'reached',
    assignment: '<id>', // <--- put ID of freshly created assignment here
  }
}];
andreas-karlsson commented 1 year ago

@richardolsson I'll take a stab at this one if no one else has started yet.

niklasva82 commented 1 year ago

This is blocked because $self in campaign/{campaign_id}/callassignments does not work properly on the backend.

richardolsson commented 1 year ago

That's a pity! Honestly I can't believe we (that is, I myself) even implemented $self in the first place, because I think it's quite ugly. The solution I would have gone with today is to create the call assignment first, then get it's ID and patch it (in an RPC). So that's another solution that would work to solve this issue.

richardolsson commented 5 months ago

The solution I would have gone with today is to create the call assignment first, then get it's ID and patch it (in an RPC). So that's another solution that would work to solve this issue.

I've updated the issue to reflect this proposed solution instead, and changed the tag as this does make the issue slightly bigger (but it's still a small medium). 😊