younginnovations / iatipublisher

IATI Publishing Tool
GNU Affero General Public License v3.0
7 stars 0 forks source link

Complete status not showing after user adds mandatory fields for Result element #1337

Open praweshsth opened 8 months ago

praweshsth commented 8 months ago

Overview

Currently, when user adds all the mandatory data in result, the status of result is not showing completed. Need to fix it.

QA

Steps to replicate

  1. Fill the mandatory field of result element and indicator level
  2. Save the form .

Actual Output: The result element status is displayed as incomplete, and as well as  no tick mark in the sidebar result element. Image

Expected Output: The status of the result element on the activity summary page should be presented as complete, and the tick mark should also be displayed in the result element in the sidebar.

praweshsth commented 8 months ago

@odscrachel I'm adding you here for you to track the issue.

sarinasindurakar commented 8 months ago
praweshsth commented 8 months ago

@odscrachel

If the fields of the Result as mentioned in this document sheet (Result only), which are mandatory, should be added to make the status of the Result 'Complete'. However, if there are multiple Result, all the Result's field as mentioned above should be added to make the Result's status 'Complete'.

Going through the fields, we need to discuss the logic to make Result's Status 'Complete' might need a change. Because some of the sub-elements or Result/ indicator such as 'Document Link' are not required but if a field within the sub-element is added then the required fields of the sub-element should be completed. In case if such sub elements' fields are not added, it shouldn't contribute to the status of the result to be complete. This logic is not implemented as of now. The logic searches all the fields marked as mandatory (in the document) are filled or not. So for now, user need to add all the mandatory fields to make the 'Result' Complete.

As per the IATI Standard, user should only add 'Reference' in either in Result level or in Indicator level but not in both. That is how the IATI Publisher is built. Since there are old data that contains 'Reference' in both levels, we will write the script to bypass the no-Reference-in-both-levels rule and make the Results' status complete if all the mandatory fields are completed as mentioned above in first paragraph. However, if user goes to edit the result or indicator, they will see warning message that Reference is already in another level. As I have mentioned earlier, one of the solutions to avoid the warning is to remove Reference from one level. But, as you have mentioned, we have to discuss it with the clients.

praweshsth commented 8 months ago

@A4family @sarinasindurakar In discussion with ODSC team yesterday, for now, let's bypass the activities that have reference in both levels (result and indicator) and show the results complete or not based on the required fields.

cc: @odscrachel