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

Klantcontact.onderwerpobjecten inline does not show related onderwerpobjecten #261

Closed
stevenbal opened this issue Oct 3, 2024 · 3 comments · Fixed by #275
Closed

Klantcontact.onderwerpobjecten inline does not show related onderwerpobjecten #261

stevenbal opened this issue Oct 3, 2024 · 3 comments · Fixed by #275
Assignees
Labels
approved bug Something isn't working owner: dimpact

Comments

@stevenbal
Copy link
Collaborator

Product versie / Product version

latest

Omschrijf het probleem / Describe the bug

Onderwerpobjecten do not show up in the inline of the Klantcontact admin, despite existing in the API

image

GET http://localhost:8000/klantinteracties/api/v1/onderwerpobjecten

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "uuid": "27b2bd53-4416-4e22-93bb-98bf650dbe06",
      "url": "http://localhost:8000/klantinteracties/api/v1/onderwerpobjecten/27b2bd53-4416-4e22-93bb-98bf650dbe06",
      "klantcontact": {
        "uuid": "68c1fd86-a772-4aeb-bccd-a6143b552ada",
        "url": "http://localhost:8000/klantinteracties/api/v1/klantcontacten/68c1fd86-a772-4aeb-bccd-a6143b552ada"
      },
      "wasKlantcontact": null,
      "onderwerpobjectidentificator": {
        "objectId": "objectId",
        "codeObjecttype": "codeObjecttype",
        "codeRegister": "codeRegister",
        "codeSoortObjectId": "codeSoortObjectId"
      }
    }
  ]
}

Stappen om te reproduceren / Steps to reproduce

  1. Create a Klantcontact via the API
  2. Create a related Onderwerpobject via the API
  3. Navigate to /admin/klantinteracties/klantcontact and click on the newly created Klantcontact
  4. Scroll down to the Onderwerpobjecten inline and observe that it is empty

Verwacht gedrag / Expected behavior

The admin should show the related onderwerpobjecten

@stevenbal
Copy link
Collaborator Author

Might be because the Onderwerpobject resource has both klantcontact and was_klantcontact fields. I'm not sure what the difference between them is @bart-maykin do you know more about this?

@joeribekker
Copy link
Member

joeribekker commented Oct 22, 2024

if you look at the model (https://vng-realisatie.github.io/klantinteracties/informatiemodel/semantisch_model) it shows 2 relations:

wasKlantcontact: OnderwerpObject-was->Klantcontact
klantcontact: Klantcontact-(gingover->OnderwerpObject

So, we need to make sure the admin shows the proper one (or the API?)

@Coperh
Copy link
Contributor

Coperh commented Nov 1, 2024

The current behaviour in the admin:

  • was_klantcontact can be added in-line that creates an OnderwerpObject with the current klantcontact being the was_klantcontact value and requiring the other klantcontact field to be set
  • the klantcontact OnderwerpObject is not shown at all in the klantcontact admin
  • klantcontact does not require any OnderwerpObjects

The above API example is shows that wasKlantcontact is None and thus is not related to any admin klantcontact.

Coperh added a commit that referenced this issue Nov 8, 2024
…n-inline-fix

♻️[#261] change Onderwerpobject inline to use klantcontact
@github-project-automation github-project-automation bot moved this from Implemented to Done in Data en API fundament Nov 8, 2024
SonnyBA added a commit that referenced this issue Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved bug Something isn't working owner: dimpact
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants