web-app icon indicating copy to clipboard operation
web-app copied to clipboard

unable to add a survey to the client

Open bharathcgowda opened this issue 3 years ago • 12 comments

Description

unable to add a survey to the client

Steps to Reproduce

  1. first create a basic survey at admin->system->manage surveys
  2. go to institution->client and select any client
  3. in client screen go to more and click on survey
  4. click on take survey and select a survey
  5. now submit the survey

Expected Behaviour

user should be able to submit the survey successfully

Screenshots, if any

image

bharathcgowda avatar Apr 02 '21 12:04 bharathcgowda

After inspecting the errors produced by the submit button I found that the first error produced would be solved by an Access-Control-Allow-Origin header. This error is produced when the browser refuses access to a remote resource which usually happens when trying to execute a cross domain request. There is also a chrome extension that can be used to fix this error temporarily which is what I used. The second error was a POST 500 error which is caused by the api and cannot be fixed from the client end. I would suggest revising the api or using an api with different information to see if you receive a different outcome.

Screen Shot 2021-04-13 at 9 13 20 PM Screen Shot 2021-04-13 at 8 40 27 PM Screen Shot 2021-04-15 at 8 06 37 PM

pesoseliza avatar Apr 17 '21 19:04 pesoseliza

thank you for the analysis and detailed explanation @elizamota, @BLasan will you be able to look into this issue once?

bharathcgowda avatar Apr 19 '21 08:04 bharathcgowda

thank you for the analysis and detailed explanation @elizamota, @BLasan will you be able to look into this issue once?

Sure

BLasan avatar Apr 19 '21 09:04 BLasan

@bharathcgowda I think this is not an issue with the server. I tried the same surveys as in @elizamota 's Screenshots. But I'm not getting any issues. I think this needs to be fixed in the front-end. No issues with the released version of Mifos (Community-App). Try the same scenarion using the host https://dev.mifos.io

BLasan avatar Apr 19 '21 12:04 BLasan

Both @bharathcgowda and I were on the local host when the error appeared so it could just be the Access-Control-Allow-Origin header. If you tried the same scenario on the local host it would produce the error from the original issue. Since it doesn't seem to affect https://dev.mifos.io its probably not a big problem.

pesoseliza avatar Apr 19 '21 12:04 pesoseliza

@bharathcgowda @elizamota Screenshot from 2021-04-19 18-14-44

Screenshot from 2021-04-19 19-35-19

BLasan avatar Apr 19 '21 12:04 BLasan

@BLasan @elizamota @bharathcgowda I had a same issue today on https://github.com/openMF/web-app but then I switched to https://github.com/openMF/community-app/ and everything is working fine on same same server as tested by @BLasan

JemCdo avatar Jun 03 '21 11:06 JemCdo

Right,thank you for testing this @JemCdo.

We have to fix the issue on the web-app project as well.

bharathcgowda avatar Jun 04 '21 10:06 bharathcgowda

I´ve found the issue under src/app/clients/clients-view/clients-actions/take-survey/take-survey.component.ts

The way to get clientId is wrong, so when the request send, clientId is undefined, the parameter for get that id should be this.route.parent.snapshot.paramMap.get("clientId"); but its written this.route.parent.parent.snapshot.paramMap.get("clientId");

CesarCrZy avatar Aug 17 '21 15:08 CesarCrZy

Hi @CesarCrZy thank you for finding the root cause, will you be able send a PR for the same?

bharathcgowda avatar Aug 17 '21 15:08 bharathcgowda

Sure!

CesarCrZy avatar Aug 17 '21 16:08 CesarCrZy

The issue is blocked due to API failure. Fineract ticket is raised https://issues.apache.org/jira/browse/FINERACT-1636

ramvr1256 avatar Jun 20 '22 05:06 ramvr1256