DEV Community

Pavel Belokon
Pavel Belokon

Posted on

Planning for my last issue for OSD

Due to a lack of time, I am planning to work on a feature/enhancement implementation for this project Track Your Regions.

I chose this project because the project owner was very helpful and understanding. For example, there were times when I did not know how to perform certain tasks with Git, and he provided assistance. He also suggested which tickets I should work on and explained them. I participated in discussions, and I have been working on this project since release 0.3. So, I believe this aligns well with the communication requirements of this release.

The plan is to work on this issue which involves creating a fallback mechanism for regions without geometry data. In my last pull request (PR), I noticed this issue, and the creator explained to me that there was no fallback yet. He mentioned that there is an issue opened for that.

There are three things that I have to do:

  • Add a conditional rendering in the RegionMap component that checks if the selected region has geometry data.

Add conditional rendering in the RegionMap component that checks if the selected region has geometry data.

After checking the RegionMap component when we fetch the geometry data using the fetchSelectedRegionGeometry() method, we can determine if the region has geometry by checking the returned object:

regionGeometryCache.current.push({
          id: selectedRegion.id,
          hierarchyId: selectedHierarchy.hierarchyId,
          geometry: response.geometry,
});
Enter fullscreen mode Exit fullscreen mode

Based on that, I can create a conditional component with React useState, but this may change after the PR review.

  • If the selected region lacks geometry data, render a button that calls the getGeometry function with force set to true.

This is related to the first requirement. I just have to show the button based on whether there is geometry, and then call getGeometry().

  • Test the new functionality with different regions to ensure it works as expected.

Lastly, I will test the work I did by checking which can be done by using regions with geometry data and without it. It can also be validated by the owner.

I will start with this draft, and with 4 days left to work on this, I will begin by creating a draft PR with basic implementation on the 9th, then address feedback from the reviews, test it on the 10th, and probably polish it on the 11th.

Top comments (0)