odk-x / tool-suite-X

ODK-X Tool Suite Project roadmaps, issue queue, release notes and wiki.
https://www.odk-x.org
Apache License 2.0
25 stars 43 forks source link

Create setting to hide some forms in main ODK-X Survey interface #154

Open elmps2018 opened 4 years ago

elmps2018 commented 4 years ago

The ODK-X Survey interface shows all forms, including subforms that should only be opened through parent forms: https://docs.opendatakit.org/odk-x/survey-using/#opening-a-form It would be great to have a setting available to hide forms that should not be entered directly

Requests/discussion: https://forum.opendatakit.org/t/odk-x-survey-hide-subform/25195 https://forum.opendatakit.org/t/odk-2-0-survey-hiding-subforms/5725

elmps2018 commented 4 years ago

161 also was a request to address this feature (closed that to leave this)

pawanharariya commented 3 years ago

I would like to work on this issue. However I am facing some problems like how to determine whether a form is parent or child of another form? Can anyone give some guidance on how to get started with this issue?

elmps2018 commented 3 years ago

Hi @pawanharariya! What are parent and child forms will be specific to each app, so the idea is to add a setting, generally, to forms to hide them in the main interface (the result then is that they can only be accessed as subforms inside the parent form).

If you want an example, in the sample app, as described here: https://docs.odk-x.org/survey-sample-app-open-form/ the Household Members and Education forms are not intended to be called directly, but are launched from within the Household form.

pawanharariya commented 3 years ago

Okay @elmps2018 so like there should be a hide button against each form. But then the user may also end up hiding a parent form. How to deal with such situation?

elmps2018 commented 3 years ago

@pawanharariya I think creating the setting per form is enough, and then users will just need to hide only the right forms.

pawanharariya commented 3 years ago

@elmps2018 okay if at some later time the user finds a need to unhide some form. How will that be done?

wbrunette commented 3 years ago

One approach could be to add a property to the settings sheet in the form definition that causes the form not to show up. Something like "hideFormInSurveyList", it could default to "false" and only if someone changes that property to "true" would it be hidden.

This might not be an easy win, as it does require some javascript skills.

elmps2018 commented 3 years ago

@pawanharariya others may want to weigh in on this, but at least how I set up surveys, it is not something that needs to be changed during fieldwork. You can always access the child forms through the parent form. So you would not need to unhide.

pawanharariya commented 3 years ago

I was also thinking the same to provide some property in the form itself marking it as hidden or shown. I don't have knowledge of javascript currently if only someone could do the javascript part in app-desiner, I can then finish the android part. Till then I will find some other issue to work upon.

wbrunette commented 3 years ago

@pawanharariya you might want to investigate this more as I think the list maybe in a Webkit so it's all JavaScript. If it's in native android you could create a variable that defaults to false that someone else could obtain from the formDef.json.

carcablop commented 3 years ago

Hello. I am Outreachy applicant and I am would to work on this issue. I would appreciate if someone gives me a guide on how to start with this issue. Thanks.

linl33 commented 3 years ago

@pawanharariya Have you started working on this issue? If not please let @carcablop work on this issue.

@carcablop You can find information on getting started at https://forum.odk-x.org/t/welcome-outreachy-applicants/1240. Thanks for participating in Outreachy.

wbrunette commented 3 years ago

after getting a message from @pawanharariya,

@carcablop I have assigned the issue to you. Let us know if you have questions.

tegajunior commented 3 years ago

@wbrunette please I am an Outreachy Intern, my stack includes html, css, and javascript. I want to contribute on the "New Date Prompts for ODK-X Survey" project. Can you assign me any issue. And if @carcablop won't be working on this issue, I will love to take it up. Thanks

wbrunette commented 3 years ago

@wbrunette please I am an Outreachy Intern, my stack includes html, css, and javascript. I want to contribute on the "New Date Prompts for ODK-X Survey" project. Can you assign me any issue. And if @carcablop won't be working on this issue, I will love to take it up. Thanks

@tegajunior How about this issue to get started: https://github.com/odk-x/tool-suite-X/issues/71

wbrunette commented 3 years ago

@carcablop can you give us an update on this issue? do you have any questions? If you no longer want to work on this issue please let us know.

sanyud24 commented 3 years ago

If nobody is working on this issue right now , May I ?

wbrunette commented 3 years ago

@carcablop since we have not heard from you in weeks, I am going to assign this issue to @sanyud24. If you are still working on the issue or have questions please let us know as soon as possible and I will re-assign the issue back to you.

sanyud24 commented 3 years ago

Thankyou @wbrunette for assigning 👍

carcablop commented 3 years ago

@wbrunette Sorry for not responding in time, I am no longer working on this issue. Thank you.

sanyud24 commented 3 years ago

subforms

Here ,most of the subforms are already inside the parentform , like household member and education form inside household and many more then, What changes do I have to do ?

elmps2018 commented 3 years ago

Hi @sanyud24 it looks like you are looking in Chrome (preview) but if you look at the main survey screen on the tablet, the household member and education form are directly available and we want people to be able to hide those.

sanyud24 commented 3 years ago

Ohkay , Thankyou @elmps2018 , I got it !!

sanyud24 commented 3 years ago

Hi evryone , its a silly doubt , but I wanted to know that if I change a "Json" file of one of the table then using "$grunt" will the local json server work? and will I be able to fetch the object inside survey app code locally ??because I worked earlier with json objects but it was in the form of API so I'm confused .

Earlier I tried hiding sub-forms using position in a listview , but it got messed up when sorted by TableId cause the position number changed , so as mentioned by @wbrunette above I want to test it using json-def file in app-designer .

wbrunette commented 3 years ago

@sanyud24 I do not think you can test it in the app-designer because the Android form's list is not the same as the app-designer forms list. The app-designer list of forms is simply another form called framework.

sanyud24 commented 3 years ago

No, sorry ,What I want to say is that if I change a Json file inside app-designer locally on my device and run app-designer ,then will I be able to fetch json object inside survey app.

sanyud24 commented 3 years ago

There's FormProviderApi which fetches the forms inside the listview in survey app . Am I right here? I just want to clear somethings

wbrunette commented 3 years ago

using the command "grunt adbpush" will push the files to your device assuming you have USB debugging turned on. To verify everything is set up correctly type "adb devices" and you should see your android device listed there (not an emulator will show up as a device"

sanyud24 commented 3 years ago

Ohkay I'll try it , thankyou!!