Skip to main content

GSoC’17 Coding period | Week #7 | UC Wishlist




With the last week of the second phase of the Google Summer of Code 2017 underway, the seventh week has come to a close. The previous week saw the completion of the third port for the second regime, i.e., porting ‘View/Update wishlist’.

The earlier week I had summarised the implementation for the third port, i.e, porting ‘View/Update wishlist’ functionality. So, the work done the previous week for the implementation of the mentioned third port can be summarised below:
  • The first thing I did was to define an interface my UcWishlist entity type class can implement and that extends the default ContentEntityInterface alongwith EntityOwnerInterface. So inside of the module's src/Entity folder, create a file called UcWishlistInterface.php.
  • Next,  I focused on the crux of defining my own Content Entity class and created a folder inside the src/ directory called Entity, and within it, a file called UcWishlist.php.
  • What we have here is a simple class defining the entity properties required. This class extends the default ContentEntityBase class and implements the UcWishlistinterface. Using annotations, we are basically telling Drupal about our UcWIshlist entity type. The @ContentEntityType tells Drupal that this is a Content Entity type. Within its definition, we have an array-like structure describing the wish list contents.
  • The next thing I did was to create the form we referenced in the annotations above: for adding, editing and deleting wish list entities. The cool thing is that the form for adding can be reused for editing as well. For that we create a form by the name WishlistViewForm.php in the src/Form directory.
  • As I declared when defining the content entity class, I created a class file responsible for building the overview page of the entities. So straight in the src/ folder of the module I created a UcWishlistListBuilder.php class file extending EntityListBuilder.
The latest port seems to work as planned. However,  the second port, concerning the add to wishlist submit handler displays a minor error while registering products to be added to the wish list. The incumbent errors would be fixed subsequently after the completion of the remaining sole port for the second phase, i.e., ‘Search wishlist’, the porting of which I have already begun and would be completed within the stipulated time.

The third port, therefore, enables users to view a specific wish list (provided required items are added to the wish list through the add to wishlist submit button). On clicking that button the user wish list is automatically updated to include the latest changes. The code for the current status of the port can be found here.

Winding up, these were the objectives and concepts learned during the seventh week of coding phase in GSoC’17 and hope to learn many more new concepts in the coming weeks for the successful completion of the port for the current and final phases.

Cheers!

Comments

Popular posts from this blog

GSoC’17 Coding period | Week #5 | Drupal

The second phase of the Coding Phase officially kicked off the previous week on June 30th, 16:00, marking the conclusion of the First Evaluation period for Google Summer of Code 2017. On the personal front, I would like to state that I progressed successfully through the evaluations by completing the two designated ports for my project ‘Porting UC Wish list to Drupal 8’ , under the able guidance of my mentor, Naveen Valecha . I have also maintained a detailed info for the work done as part of the first phase evaluations in a previous blogpost . The previous week, based on the mentor’s review of the earlier ports done, I had also fixed the coding standards and made some changes to the code, as suggested by him. Meanwhile, based on a comprehensive analysis for the above mentioned ports, the work done briefly the earlier week can be stated as: 'View wishlist' option visuals in D8: 'Email wishlist' option visuals: As of now, I...

GSoC’17 Coding period | Week #4 | Drupal

The fourth week of Google Summer of Code 2017 has come to a close, bringing forth the onset of the First Evaluation Period. The conceptualization developed during the first phase of coding have been of immense help and has provided notable assistance for the completion of the assigned ports. As I had stated in the previous blog posts, this month I had the objective of completing the following ports concerning the first phase of the coding regime: Admin wish list settings Add to wishlist  With the conclusion of week 4, I have completed the port of the administrator wish list settings as well as the ‘ Add to wishlist ’ feature as part of the second port. Also for the ‘ Add to Wishlist ’ functionality to work successfully, my next objective would be to add the functionality to view/access the user wish list, on using the button. This functionality would further be succeeded by the option to update the specific wish list, by displaying the required button ...

GSoC’17 Coding period | Week #10 | Uc Wishlist

With the conclusion of the tenth week of Google Summer of Code 2017, the coding regime is almost halfway through the third phase. Meanwhile, last week saw a stringent buildup on the concept for the remaining ports, which would aid in its gradual completion. I have maintained a detailed structure of the code for the port which can be accessed here . Focusing on the present scenario, the implementation of the 5th port ‘Email wishlist to users’ has almost reached completion. Additionally, the implementation of the last port ‘Add user wish list settings’ is underway, with a significant portion of the port to be accomplished within the coming week. Therefore, based on a comprehensive evaluation of the current status of the module, the work done previous week can be summarised as: Option to email wishlist to others: This feature would enable users or wish list owners to share any wish list with other users or potential customers by emailing it to the respe...