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

Fix application status filters #1257

Merged
merged 3 commits into from
Jun 28, 2024
Merged

Conversation

matti-lamppu
Copy link
Collaborator

@matti-lamppu matti-lamppu commented Jun 27, 2024

🛠️ Changelog

  • Fixes Issue that happens when fetching application sections, filtering by application status, but also selecting section status (see example below). There was a bug with the lookup_property library that overwrote the statuses in thee query that is now fixed.
  • Also simplified the lookup property for the application section REJECTED status.
query {
  applicationSections(
    applicationStatus: [IN_ALLOCATION]
  ) {
    edges {
      node {
        status  # This is the issue, works without it
        application {
          status
        }
      }
    }
  }
}

🧪 Test plan

  • Automated tests

🚧 Dependencies

  • None

🎫 Tickets

@matti-lamppu matti-lamppu added the fix Fixes a bug label Jun 27, 2024
@matti-lamppu matti-lamppu self-assigned this Jun 27, 2024
@matti-lamppu
Copy link
Collaborator Author

The issue is with lookup_property: It's not working properly with the queyset.query.annotations dictionary when there are multiple annotations with the same name from different models. Specifically this part of the core is incorrect. I'll work on a fix in the library for this.

Because all allocations must be made, or sections must be rejected
or locked before we can move to the handled stage, we can simplify
the status lookup property to just check if there are any usable
reservation unit options.
@matti-lamppu matti-lamppu force-pushed the fix-application-status-filters branch from ec9a27f to 3cdb253 Compare June 28, 2024 06:56
@matti-lamppu
Copy link
Collaborator Author

Bug fixed in library and updated here.

@matti-lamppu matti-lamppu requested review from vergama and ranta June 28, 2024 07:01
Copy link

@matti-lamppu matti-lamppu marked this pull request as ready for review June 28, 2024 07:07
@matti-lamppu
Copy link
Collaborator Author

/fast-forward

Copy link

Triggered from #1257 (comment) by @​matti-lamppu.

Trying to fast forward main (65da25e) to fix-application-status-filters (3cdb253).

Target branch (main):

commit 65da25eb26cba7cf761e44175e949fbc72fe2b66 (HEAD -> main, tag: v0.51.3, origin/main, origin/HEAD)
Author: Matti Lamppu <matti.lamppu@vincit.fi>
Date:   Thu Jun 27 11:15:01 2024 +0300

    Fix admin panel buttons not working in some cases
    
    Only display the buttons in list of form views depending on
    which it is intended to work in.

Pull request (fix-application-status-filters):

commit 3cdb2530c17f9b6a4033586df591894a0fd4b0a1 (pull_request/fix-application-status-filters)
Author: Matti Lamppu <matti.lamppu@vincit.fi>
Date:   Thu Jun 27 09:32:55 2024 +0300

    Update deps

Fast forwarding main (65da25e) to fix-application-status-filters (3cdb253).

$ git push origin 3cdb2530c17f9b6a4033586df591894a0fd4b0a1:main
To https://github.com/City-of-Helsinki/tilavarauspalvelu-core.git
   65da25eb..3cdb2530  3cdb2530c17f9b6a4033586df591894a0fd4b0a1 -> main

@github-actions github-actions bot merged commit 3cdb253 into main Jun 28, 2024
6 checks passed
@github-actions github-actions bot deleted the fix-application-status-filters branch June 28, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants