I made the PR to openmrs-module-referencemetadata. I have a minor change to be done for 3 or 4 test cases. Apart from that the reports which we were discussed have completed. I think it’s now time start working on exposing these reports to outside. Can you please point me where to start off with that?
It’s been a while since I could update this thread, as I was bit busy with my college work. However it’s all done now and I’m much more focused over here. I have created a simple react component for List of Users report. I have not much concerned about the styling yet.
I have created the components for rest of the reports as well. Here is the commit I have made for it.
I’m still a newbie to ReactJS. I couldn’t find the way to display the report components when an item has been clicked from the navigation bar. I think, it shouldn’t redirect to a new page, instead it should it done as in a SAP (Single Page Application). Any advice on it?
I have written the component in more generic way. That’s why the date is being showing as an integer.
Extract out the common UI styling and make a separate npm module (for others to use in future)
Is there anything that is missing in this targeted task list?
@raff, I was trying to implement a simple navigation using react-router-dom v4.0.0. I have noticed that in the OWA which I generated through OpenMRS OWA generator has included react-router v.3 by default. It is said that react-router is deprecated and to use react-router-dom. So, I added that dependency to my module and tried to implement the navigation functionality. But I’m stuck on it.
If anyone knows a way to get around with this, please feel free to answer to my question in StackOverflow.
Last Tuesday I had the weekly meeting with my mentor Rafal. There we planned the following work for this week:
Generalized table component for all the reports (Done)
Complete the navigation panel (Done)
Adjust the styling (Done)
Integrate Chart.js
I have created a component for reports to show in tabular format. There is a problem which I’m currently trying to solve that I couldn’t run a report through reporting REST. Reports which accepts a location as a parameter, I couldn’t run them through API.
I have integrated the Jest and SinonJS(mock HTTP calls) for the new OWA UI testing. I have committed what I have done so far.
I have an issue to mock the HTTP call which I make inside the component. This call is actually generated inside the componentDidMount() life cycle method. When I compare it with the cohort builder OWA, they have made this API endpoint as a prop. In this case, they were able to inject a mock at runtime of testing.
Should I follow the same approach of taking out the API endpoint? Then again the users of this component has to provide the API endpoint everytime they are using this react component.
I have implemented the Date picker and used it to take the user inputs. But this particular report is keep redirecting and doesn’t render anything. I couldn’t find out why it is happening like that. Could you please point out what I’m doing wrong here?
I was able to fix that issue. It was because when I simply set the state, I only set the updated the element. Because of that the rest of the elements are getting cleared off from the state. I used the previous state values and set it.
In fact the redirect is happening because the parameters for the reporting rest API call doesn’t made properly.
I’m facing a blocker situation with unit testing. Below is my commit.
When I try to use the snapshot testing, the snapshot file doesn’t have the expected component values. I have even checked it by passing the mock through my actual code flow and it rendered as I was expecting. Can you spot what I’m doing wrong there? @dkayiwa
Hi,
I was able to solve that problem by making the fakeRequestLibrary.js return value to run synchronously. Removed the Promise(). Now I’m facing a different issue when I run the jest.
While I am trying to solve the problem with Jest Test case, I have modified the report column names in referenceMetaData module. Here is my PR,
I was limited to use a single word for those SQLDataSets. Because in usual SQL syntax, we cannot have space separated name for alias. Please let me know if there is anything that needs to be modified.
I have almost finishing up the things right now. I tried to pass an JS array to rowGetter function and it didn’t work. I looked in the official doc and I didn’t find that it supports for arrays. It says it accepts a function. So, currently I’m having an function and which made the snapshot file to be looks like this:
Meanwhile, I tried the test for chart objects and it has no luck on see the things inside the <canvas>. But for now, I have written the tests at least for those.
I have fixed the UI issues which we found on our last meeting. Now I am trying configure the continuous integration to this project. I have registered on bintray and also in Travis CI.
I have added the travis.yml file by following the cohort-builder-owa. But the build keeps failing.