Uploading tasks.js break everything

I started app development from get strated step by step after i goes to task field after that all the contact forms are hide and no add anything will show only access form is shown in report .how to solve this issue please anyone help me.

Welcome to the CHT forum @SanghArsha_PyakuRel !

I am sorry to know that you are having problems with tasks.js.
To be able to help you solve the problem, we will need some more details:

  • What does your tasks.js look like?
  • Are there any errors in the browser console?
  • Have you tried deploying our default config?
1 Like

my tasks.js look like this:

module.exports = [
{
name: ‘assessment-after-registration’,
title: ‘First Assessment’,
icon: ‘icon-healthcare’,
appliesTo: ‘contacts’,
appliesToType: [‘patient’],
appliesIf: c => user.parent && user.parent.contact_type === ‘chw_area’ && !c.contact.date_of_death && !c.contact.muted,
actions: [{ form: ‘assessment’ }],
events: [{
start: 7,
days: 7,
end: 0,
}],
},

];
after this i load the content by using this command:
cht --url=https://<username>:<password>@localhost
it update the localhost run in browser after this contact form are not seen and any add button show only see assess form in repot

Could you please scroll down a bit further in the browser console to see if there are other errors?

Also, you can try simplifying the appliesIf by removing some parts and checking if that solves the problem.

Are you still logged in as the admin/medic user?
If so, the change in tasks.js should not affect the admin user.

If you want to be sure that it’s not the tasks breaking your contact forms, you can keep it empty and upload.

tasks.js:

module.exports = [];

I suspect that, in your case, the contact forms do not match the ones defined in the app settings.

Can you see the contact forms when you go to this page as an admin user?
https://192-168-31-82.local-ip.medicmobile.org:10443/admin/#/forms

If you can see entries like form:contact:* similar to above, do they match with your hierarchy definition (contact_types) in your base_settings.json or app_settings.json?

Here is an example from the default config:

The create_form defined in line 314 matches with the contact form shown in the screenshot above.

Please check your settings and share.

My app forms is like this:

in my base_settings.json is like this:

The contact forms seem to be missing here.

Can you please check your forms/contact folder?
image

Nothing inside this .

Please get the contact forms from here and upload them with cht:

After you run cht, please check the admin page again:


Thank You So Much Sir ! it works.

1 Like

You are welcome. I am glad that it worked. :slightly_smiling_face:

You had mentioned:

Is this the tutorial that you have been following?

Please feel free to suggest improvements to it so that it can be helpful for the new developers. You can suggest edits from the links available at the top right section of the CHT Docs:
image

1 Like

Issue like this :

You haven’t answer to my question above:

From your problem description, I think it should be a documentation issue.
If the problem is with the CHT core, then only it goes to the project issue (cht-core repo).

image

From the relevant page in CHT docs, you can click on Create documentation issue to create an issue in cht-docs. We will probably require more details on what happened at what step of the tutorial/guide, and what improvements you would suggest to make it better.

You can also click on Edit this page and suggest improvements directly in the form of a pull request.

Thanks @SanghArsha_PyakuRel for creating a documentation issue, we will update the documentation and keep you posted.

1 Like