GSoC 2017 | Week 3: Port Vote Up/Down

This marks the end of week 3 of GSoC's coding period. My Project is Port Vote Up/Down to Drupal 8. More information about my project and GSoC can be found here. I am working with marvil07 and Palashvijay4O this summer.

Agenda for the week

The agenda for Week 3 was to create rest of four plugins following the previous week's work and create a test for the plugins. 

I did the following things:

  • Removed the vud_widget and moved the corresponding files to vud module.

    My mentor suggested that another widget sub module vud_widget need not be created and hence the vud_widget plugin type must be initialised by the base vud module. For this, I moved the following files and folders:
    • src 
    • css
    • templates
    • js
    • vud_widget.services.yml
    • vud_widget.libraries.yml
  • Next, I created rest of the four plugins


    I created the following four plugins:
    • alternate 
    • updown
    • upanddown
    • thumbs
  • The last part was to create a plugin


    My mentor asked me to create the 'plain' widget first. For this, I had to create the following files:
    • vud_widget.libraries.yml(location: root): This file contains configuration for the libraries used by various plugins ranging from css to js to dependencies
    • plain.php(location: root/src/Plugin/VoteUpDownWidget): This is the main plugin file. It contains the plugin schema and builds the view for the widget.
    • plain.html.twig(location: root/templates): This file contains the html twig template for the plugin.
    • plain.css: This file contains the css stylesheets corresponding to the plugin as specified in the libraries.yml file.

Project progress

By the end of this week, the directory structure looks like this:

Directory structure fo vud_widget

Note: Default values are assumed in various places. They will be replaced with functional code, once the vud module is ported and votingAPI is implemented.

The code written for the week could be found here

Agenda for next week

The agenda for the next week is to port the remaining widgets(i.e. updown, thumbs, voteupdown, etc) to Drupal 8. 

This marks the end of week 3 of GSoC's coding period. My Project is Port Vote Up/Down to Drupal 8. More information about my project and GSoC can be found here. I am working with marvil07 and Palashvijay4O this summer.

Agenda for the week

The agenda for Week 3 was to create rest of four plugins following the previous week's work and create a test for the plugins. 

I did the following things:

  • Removed the vud_widget and moved the corresponding files to vud module.

    My mentor suggested that another widget sub module vud_widget need not be created and hence the vud_widget plugin type must be initialised by the base vud module. For this, I moved the following files and folders:
    • src 
    • css
    • templates
    • js
    • vud_widget.services.yml
    • vud_widget.libraries.yml
  • Next, I created rest of the four plugins


    I created the following four plugins:
    • alternate 
    • updown
    • upanddown
    • thumbs
  • The last part was to create a test for the plugins

    I created a functional test for the plugins. The name of the class file is VoteUpDownWidgetTest.php (this test doesn't work as of now as there needs a field to exist to implement plugins.

Project progress

By the end of this week, we are done with the plugin types and plugins.

The code written for the week could be found here

PR can be found here: https://github.com/marvil07/vote_up_down/pull/4

Agenda for next week

The agenda for the next week is to resolve the issues in the PR and write tests. 

Tags