avniproject / avni-webapp

Web application for management and data entry
https://avniproject.org
GNU Affero General Public License v3.0
12 stars 42 forks source link

Voided answer concepts showing up in App designer #1113

Open mahalakshme opened 10 months ago

mahalakshme commented 10 months ago

Describe the bug

Currently coded answer concepts which have been removed from the coded concept still show up in App Designer.

To Reproduce

Steps to reproduce the behaviour:

Refer this video to understand the issue:

Expected behavior

The removed concept A should not show up as part/answer to the coded concept

ombhardwajj commented 7 months ago

@mahalakshme , @vinayvenu I have fixed this issue and submitted a PR. Please have a look!

petmongrels commented 5 months ago

@ombhardwajj

Some background.

This is the domain model of Concept answers.

What should happen in remove answer

Implementing this when the new Concept Answer has not been saved even once

Implementing this when the new Concept Answer has not been saved and being removed

mahalakshme commented 3 months ago

@ombhardwajj are the above code review comments resolved?

ombhardwajj commented 3 months ago

@mahalakshme No they have not been resolved , I am currently working on metabase issue and will only be able to work on this once that issue is complete!

mahalakshme commented 1 month ago

@ombhardwajj would you be able to address the above comments? Just wanted to know, so that if you don't have time, someone within the team can pick it up

ombhardwajj commented 1 month ago

@mahalakshme I will address it within one week!

ombhardwajj commented 4 weeks ago

Hey @petmongrels @mahalakshme I've made a change in the backend in order to fix this bug. Have a look here

I added a new method in ConceptAnswerRepository, findByAnswerConceptAndIsVoidedFalse, to retrieve only non voided ConceptAnswer entries associated with a given answerConcept.

I modified the addDependentConcepts method in ConceptService to use this new repository method, ensuring only non voided answers are included in the usage data returned by the /web/concept/usage/{uuid} endpoint.

I've tested it out and it works as expected. Let me know your thoughts on this approach.

petmongrels commented 3 weeks ago

There is more work to be done in this. I am moving this back for prioritisation.