GSoC 2017 | Week 4: Port Vote Up/Down

This marks the end of week 4 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 fix the PR and carry out the related changes as described in previous week's post

I did the following things:

  • Moved the widget files to /widgets directory.

    Here, I clubbed the widget plugin templates, stylesheets, javascripts and images unnder a common folder named widgets.
  • Defined methods named 'alter template variables' and 'ajax render'

    I ported the D7 version of these two methods and defined them in the Interface class file of the `VoteUpDownWidget` plugin type. 
  • Create tests and VotingAPI integration 

    So earlier we decided to have two tests named 'VoteUpDownWidgetBaseTest' and 'VoteUpDownWidgetManagerTest'. These two testing the corresponding classes. But, later on I found out that we can't have the VoteUpDownWidgetBaseTest as of now as it has functions like `getVotes()` which is yet to be defined in the base module. So, we decided to postpone it to a later stage.
    Voting API for Drupal 8 has absolutely scarce or no documentation. Actually, we needed to create endpoints like 'vote/<entity_id>/<vote_value>' and I had to learn about routing and creating API in D8. So, it was something pending and was transferred to the next week's agenda.
  • Rebase the repo

    I had to rebase the repo on 8.x-1.x in order to remove the unnecessary commits.

Project progress

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

Directory structure

The code written for the week could be found here

Agenda for next week

The agenda for the next week is to remove the methods which are, as of now, dependent on undeveloped code and integrate the VotingAPI be creating API endpoints. Apart from this, we have to fix some coding standards and add the SVG files back to the widgets. Any bugs if found, will be rectified. Hence, the agenda for the month will be complete.