GSoC 2022 with OpenMRS: Week 06
It has been six weeks of coding. The Week 06 of Google Summer of Code started on the 18th of July this week and my main goal of this week was to complete the development of the schema editor. In the last blog post I mentioned the initial development process of the schema editor, here is a link to that post
This week the first task was to route to the form builder from the dashboard according to the selected option. If it’s a form with a schema or a form without a schema the route should be /editor/{form-uuid}
and when creating a new form the route to be editor/new
. To achieve this I used routes and useParams
hook in react. First I defined the routes in the root component and used the useParams
hook to get the dynamic parameter. Using the URL parameters I can identify whether it is a new form or existing form and call the relevant functions.
Next task was to call functions according to the URL parameters. When the URL parameter is /new
the user should be able to create a schema and a new form and save it to the server. When the URL parameter is /{form-uuid}
there can be two types of forms one with a schema and another without a schema. If it’s a form with a schema the schema should be fetched and displayed in the Ace editor therefore the user can edit the schema or else if the form doesn’t have a schema the default schema template should be given in the editor so a new schema can be created. And when rendering the form the JSON schema should be compiled to find any errors.
I was able to develop these parts this week, but when saving the forms to the server I faced a few bugs. Because of that I wasn’t able to send the Pull request within this week.
In the beginning of next week I will send the pull request and start working on the element editor (interactive builder). Also the UI designs that I made got reviewed, hope to update the designs according to the given feedback and finalize the design.
On 25th the midterm evaluation will begin, looking forward to completing it as well. Thank you for reading, Stay tuned and check back next week for the seventh week’s blog post. Peace ✌️