weekly CheckIn 7th

iFlameing
Published: 07/21/2019

What did you do this week?

I have completed MVP in starting week of 2nd Phase, I moved on writing test for the added feature. I have to read lot's of documentation of jest and Plone CMS API for writing test and setting mock up data. I have written test for may function which is used for creating Gatsby Node from fetching data from Plone CMS. I also remove some redundant code which is not used more in gatsby-node.js file. You can see my pull request by visiting below link.

https://github.com/collective/gatsby-source-plone/pull/200

https://github.com/collective/gatsby-source-plone/pull/201

https://github.com/collective/gatsby-source-plone/pull/204

https://github.com/collective/gatsby-source-plone/pull/208

https://github.com/collective/gatsby-source-plone/pull/214

What is coming up next?

One or more test Which is left in the code base. After that every line is tested and all code is cover with test.  The test for breadcrumbs node is left and is completed in next one or two days :)

Did you get stuck anywhere?

Writing test for async code and setting the mock behaviour of fetching data is a tedious task. I have to manipulate some function to pass the test. It is most intense task which I have done in my gsoc period. But after reading the documentation of jest and some googling I am able to write the test. Other than this I am having a great time :)

If you find anything interesting please comment. I love to hear some feedback !!! :)

 

View Blog Post

Weekly CheckIn 6th

iFlameing
Published: 07/14/2019

What did you do this week?

In this week I started writing the test for the gatsby-node API. I read lot's of documentation regarding jest because our previous test is written using this framework. I also do some research regarding the unit test and converting our whole source code into typescript. But we came to the conclusion that first, we write a unit test for all the function and if time permits we devote our entire time working rewriting whole source plugin. I have written a test for makecontentNode function which converts the fetched content into Gatsby Node.  You can see the pr below 

https://github.com/collective/gatsby-source-plone/pull/200

What is coming up next?

I will try to test all the code which is written in gatsby-node.js. so, we can accept more test to come in next week.

 

Did you get stuck anywhere?

I faced some difficulty regarding setting up mock data for the test but fetching up some Plone CMS API I am able to gather the test data. Other than that I am having a good time :)

 

View Blog Post

3rd Blog Post After First Evaluation

iFlameing
Published: 07/08/2019

I successfully passed the first evaluation, Hooray! So after first evaluation I started working on issue related to the permission based update of node. After the addition of create, modified and delete feature I encounter with another problem now I have to handle the node based on permission. Plone CMS provide the feature of making field public or private. If the field is public then we have to create the node otherwise we don't. When a field is changed from private to public we get a websocket event modified and I have to handle this case into modified case. For handling this issue I have to change the logic of modified event and I am able to do it after some hard work. Then I started working on updating the Plone Collection after a long silence from the Plone CMS. It is done because we don't have currently any feature that we can detect whether a Plone collection is changed or not. After learning how polling is done I implemented it successfully. I learned how we can use SetTimeout and how we can reset it. After reading the documentation on MDN and helped from my mentor I successfully Imlemented it. Now I am working on test for the added feature of previous month.

 

Auto Updating Plone Collections

https://github.com/collective/gatsby-source-plone/pull/194

Removing and creating field based on Permission

https://github.com/collective/gatsby-source-plone/pull/192

Thanks for reading! I am happy to hear any feedback :)

View Blog Post

2nd Blog Post

iFlameing
Published: 07/06/2019

sorry, For the late post. But in this Post I am going to explain what I had done between 10th June to 24th June 2019.  I started from where I left, I added the update functionality but using my own function which is causing redundancy in code base. I developed a strong concept of javascript generator function. After having generator concept understanding gatsby-source-plone code base become very easy. I refactored my code and use the existing generator function for creating the node. During these period I think I read every page of gatsby docs, each and every method it provide and how we can use it. It is very hard task to read all the api exposed by gatsby and remember them and use them whenever it needed. I have to read API details each day but I feel myself lucky because I have a strong understanding how Gatsby works inside.

After the implementation of update now I moved towards updating the modified node. Whenever a node is modified in Plone CMS I received a websocket events containing the modified node id and its parent id. I have to recreate the modified node and its parent node. It is a lot of task. But I have implemented it just in a week. I work almost 8 to 9 hours per day to complete this feature.

Adding the modified feature I feel very relaxed and self motivated because I have completed 2 milestone in 2 weeks which is a big win for me. Then I started with my third milestone that is handing the delete node. I had to remove the node which is deleted in Plone CMS. I received the similar websocket event as above a node id which is deleted and it parent Id. I also implement this feature in a week. But this time I struggle a most because I encounter a error which I didn't understand why it is happening. The error is related to deleting the folder. Deleting folder gives me continuous websocket event for its child. when I am trying the fetch the parents of child, It is already deleted from the Plone CMS. I got an error, after talking to mentor I figured out Implementing try catch block and changing some logic. At this time the first evaluation started I am hoping to get passed it easily :)

Thanks for reading if you find anything interesting please! comment. Happy to hear your feedback :) 

View Blog Post

1st Blog Post

iFlameing
Published: 07/06/2019

Sorry, For my late blog post But I am going to explain all the thing which I done before 10th June 2019. So, As coding period start I started with reading the gatsby-source-filesystem code base because I have to implement same feature provided by gatsby-source-filesystem. Reading code written by others is big challenge but as I am doing open source for past 6 months I daily read code which is written by other. And reading code is a way better than writing code without knowing properly about the things which you want to implement. You will learn best practice which is famous in community learn new things on daily basis. So, I started reading the update part of gatsby-source-filesystem and the code base of gatsby-source-plone for implementing the update the function when something changes in Plone CMS.

I started implementing the update nodes when something changes in Plone CMS but I don't the generator function of javascript clearly, and it is frequently used in code base of gatsby-source-plone. so, I started reading about the generator function of javascript on MDN but I didn't stop here I created My own function and implement the update functionality. My mentor Asko Soukka helped me in understanding the project and codebase of gatsby-source-plone i.e what is flow of code base.

During the implementation I read many library like socket.io, expresss. Created a dummy server using express framework because Plone doesn't have websocket support during the first week of coding period. But my mentor provide the websocket support in Plone withing one week and we replaces the dummy server after that. During these days I have to read lot's of things and implement but I am happy with myself about what I am doing :)

Thanks for reading if you find anything interesting and you want to know more please! comment and happy to hear your feedback :)

 

View Blog Post