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

Batch update of all submissions doesn't work when filter is in place #4745

Closed
jeverling opened this issue Dec 4, 2023 · 2 comments · Fixed by #4833
Closed

Batch update of all submissions doesn't work when filter is in place #4745

jeverling opened this issue Dec 4, 2023 · 2 comments · Fixed by #4833

Comments

@jeverling
Copy link
Contributor

jeverling commented Dec 4, 2023

Description

Hi, when I try to batch update the status of all submissions, this works. The payload is the following:

{"confirm":true,"validation_status.uid":null}

However, when a filter is active to select a subset of submissions, the batch update doesn't work. The payload contains "query" then instead of "confirm":true:

{"query":{"_submission_time":"2022"},"validation_status.uid":"validation_status_approved"}

Selecting individual submissions works, but selecting and batch updating all submissions does not.

Steps to Reproduce

  1. Select all submissions and apply a batch status update -> works
  2. Filter the submissions by a field that has a filter, then select all and apply a batch status update -> doesn't work

Expected behavior

The batch update for all matching submissions should also work when a filter is applied.

Actual behavior

The batch update for all submissions fails, when a filter is active.

Additional details

See below video for a demonstration of the issue.

kpi_batch_status_update_bug.mp4
@jeverling
Copy link
Contributor Author

What do you think about just removing the special case for this.props.fetchState.filtered.length === true, and have it submit the submission IDs like it does when a subset is selected?
See !4

@magicznyleszek
Copy link
Member

I've tested this issue. The problem perhaps is on the Back-end side.

Imagine my project having two questions:

  • Your_name (text type)
  • Is_it_really_your_name (select_one type with two choices: yes, and no)

And I have four submissions:

[
  {
    "start": "2024-02-02T13:44:20.189+01:00",
    "Your_name": "Kate Wittgenstein",
    "Is_it_really_your_name": "yes",
  },
  {
    "start": "2024-02-02T13:44:10.816+01:00",
    "Your_name": "Andrea Hue",
    "Is_it_really_your_name": "yes",
  },
  {
    "start": "2024-02-02T13:44:02.370+01:00",
    "Your_name": "Joe Newton",
    "Is_it_really_your_name": "no",
  },
  {

    "start": "2024-02-02T13:43:53.403+01:00",
    "Your_name": "Joe Johnson",
    "Is_it_really_your_name": "yes",
  }
]

Now I'm doing the scenario of going to Project > Data > Table and bulk updating validation_status.

First scenario:

  • Nothing filtered
  • Changing validation status to "approved" works:
    • request: {"confirm":true,"validation_status.uid":"validation_status_approved"}
    • response: 4 submissions have been updated

Second scenario:

  • I filter with Is_it_really_your_name being yes
  • Changing validation status to "approved" works:
    • request: {"query":{"Is_it_really_your_name":"yes"},"validation_status.uid":"validation_status_approved"}
    • response: 3 submissions have been updated

Third scenario:

  • I filter with Your_name being Joe
  • Changing validation status to "approved" doesn't work 🐛:
    • request: {"query":{"Your_name":"Joe"},"validation_status.uid":"validation_status_approved"}
    • response: 0 submissions have been updated

Fourth scenario:

  • I filter with Your_name being Joe Newton
  • Changing validation status to "approved" does work:
    • request: {"query":{"Your_name":"Joe+Newton"},"validation_status.uid":"validation_status_approved"}
    • response: 1 submissions have been updated

So it seems that Back-end doesn't support/understand "query":{"Your_name":"Joe"} as a search for "text that includes Joe", but rather exact value "text that is Joe". I will talk with other developers what should be the way forward

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