-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.1.0 Initial public beta release (#339)
* fixed indentation on definition tags * fixed broken fix * fixed undo mistake * fixed space issue * ammended house views to use component partial, removed redundant partials * [WEBSITE-774] Member text fixes * [WEBSITE-753] Fixed incorrect links * [WEBSITE-773] Content removed from MP and Lord pages * [WEBSITE-606] Page titles * feature(page-titles): assign each view a page title * fix(page-titles): revert Gemfile * fix(page-titles): revert gemfile * feature(page-titles): remove duplication * fix(page-titles): use display_name on page titles * fix(page-titles): fix failing test for parties * feature(page-titles): match page titles with H1s * feature(page-titles): match page titles with H1s * [WEBSITE-760] Added check for current party member count in houses party view (#311) * [WEBSITE-797] Completed refactor of checking house ids (#313) * Refactored helper module to include four methods. * Refactored views to use helper to check for commons or lords and to retrieve ids. * Refactored tests where necessary. * fix(page-titles): add missing equal sign * [WEBSITE-811] Remove additional list elements from house views (#315) * [WEBSITE-811] Remove additional list elements from house views * [WEBSITE-811] Updated vcr cassettes * [WEBSITE-794] Error checking in constituencies current_member view; error handling in houses party method (#318) * Error handling in houses_controller, method :party to handle no party id. * Error handling in view constituencies/current_member - added check for @seat_incumbency being nil. * [WEBSITE-800 Content change to Current MPs page (#317) * [WEBSITE-800 Content change to Current MPs page * [WEBSITE-804] Content change to House/party pages * [WEBSITE-802] Content changes to Commons parties page * [WEBSITE-813] Removed asset version variable from secrets.yml (#316) * [WEBSITE-832] Fix to current constituencies partial to check if current member exists (#319) * [WEBSITE-813] Update pugin version (#320) * [WEBSITE-833] Content changes to beta homepage * [WEBSITE-817][WEBSITE-818][WEBSITE-819][WEBSITE-833] * [WEBSITE-817][WEBSITE-818][WEBSITE-819][WEBSITE-833] Changes to front-page and parties (#321) * [WEBSITE-833] Content changes to beta homepage * [WEBSITE-817][WEBSITE-818][WEBSITE-819][WEBSITE-833] * [WEBSITE-795] custom error handling component * [WEBSITE-795] custom error handling component * [WEBSITE-816][WEBSITE-815][WEBSITE-828][WEBSITE-829] * [WEBSITE-816][WEBSITE-815][WEBSITE-828][WEBSITE-829] (#324) * [WEBSITE-833] Content changes to beta homepage * [WEBSITE-817][WEBSITE-818][WEBSITE-819][WEBSITE-833] * [WEBSITE-816][WEBSITE-815][WEBSITE-828][WEBSITE-829] * [WEBSITE-799] Page content changes * [WEBSITE-793] Documentation (#323) * Added yard documentation to all helper modules and their methods. * Tidied up and enhanced tests where necessary. * Altered text on current constituencies view for the case where there is no current member. * [WEBSITE-827][WEBSITE-831][WEBSITE-825][WEBSITE-826][WEBSITE-804] * fixed cassette * [WEBSITE-827][WEBSITE-831][WEBSITE-825][WEBSITE-826][WEBSITE-804] (#326) * [WEBSITE-833] Content changes to beta homepage * [WEBSITE-817][WEBSITE-818][WEBSITE-819][WEBSITE-833] * [WEBSITE-816][WEBSITE-815][WEBSITE-828][WEBSITE-829] * [WEBSITE-827][WEBSITE-831][WEBSITE-825][WEBSITE-826][WEBSITE-804] * fixed cassette * fixed constituency translation * added vcr cassette * fixed constituency translation (#327) * [WEBSITE-833] Content changes to beta homepage * [WEBSITE-817][WEBSITE-818][WEBSITE-819][WEBSITE-833] * [WEBSITE-816][WEBSITE-815][WEBSITE-828][WEBSITE-829] * [WEBSITE-827][WEBSITE-831][WEBSITE-825][WEBSITE-826][WEBSITE-804] * fixed cassette * fixed constituency translation * added vcr cassette * Update dependencies in preparation for release * [WEBSITE-795] fix to displaying person error (#330) * [WEBSITE-787] fix for cassettes * [WEBSITE-795][WEBSITE-787][WEBSITE-622] * fixed pluralisation on parties * Made a few small fixes (#335) * Added @seat_incumbency variable to constituencies/members so that current MPs show in view. * Added correct i18n translation to constituencies_current view. * [WEBSITE-764] Custom error handling on a-z listing pages (#338) * Addition of RequestHelper * Addition of code in RequestHelper to handle specific 204 error * Controller updates * Test updates * Update partiament-ruby for SSL support (#340)
- Loading branch information
1 parent
2c572e9
commit 2bfadaf
Showing
213 changed files
with
25,544 additions
and
4,575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PARLIAMENT_BASE_URL=http://localhost:3030 | ||
DATA_URI_PREFIX=http://id.ukpds.org | ||
GTM_KEY=GTM-NNXTVV8 | ||
ASSET_LOCATION_URL=https://s3-eu-west-1.amazonaws.com/web1devci.pugin-website | ||
ASSET_VERSION=1.2.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ passenger.3000.pid | |
.env.sample.* | ||
|
||
/spec/examples.txt | ||
|
||
.yardoc | ||
/doc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
require 'vcard/vcard' | ||
require 'parliament' | ||
require 'houses_id_helper' | ||
require 'houses_helper' | ||
require 'request_helper' | ||
|
||
# Base class for all other controllers | ||
class ApplicationController < ActionController::Base | ||
include VCardHelper | ||
include Parliament | ||
include HouseIdHelper | ||
include HousesHelper | ||
include RequestHelper | ||
|
||
# Prevent CSRF attacks by raising an exception. | ||
# For APIs, you may want to use :null_session instead. | ||
protect_from_forgery with: :exception | ||
|
||
layout 'pugin/layouts/pugin' | ||
|
||
rescue_from Parliament::NoContentError do |error| | ||
# Rescues from a Parliament::NoContentResponseError and raises an ActionController::RoutingError | ||
rescue_from Parliament::NoContentResponseError do |error| | ||
raise ActionController::RoutingError, error.message | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Namespace for helpers of the HousesController. | ||
module HousesHelper | ||
# Checks if house is the House of Commons and sets @commons_id and @lords_id if not already set. | ||
# | ||
# @param [Grom::Node] house a Grom::Node with type http://id.ukpds.org/schema/House. | ||
# @return [Boolean] boolean depending on whether the house has the same id as the House of Commons. | ||
def self.commons?(house) | ||
set_ids | ||
|
||
house.graph_id == @commons_id | ||
end | ||
|
||
# Checks if house is the House of Lords and sets @commons_id and @lords_id if not already set. | ||
# | ||
# @param [Grom::Node] house a Grom::Node with type http://id.ukpds.org/schema/House. | ||
# @return [Boolean] boolean depending on whether the house has the same id as the House of Lords. | ||
def self.lords?(house) | ||
!commons?(house) | ||
end | ||
|
||
# Sets and returns the id for the House of Commons. | ||
# | ||
# @return [String] @commons_id the id for the House of Commons. | ||
def self.commons_id | ||
set_ids | ||
|
||
@commons_id | ||
end | ||
|
||
# Sets and returns the id for the House of Lords. | ||
# | ||
# @return [String] @lords_id the id for the House of Lords. | ||
def self.lords_id | ||
set_ids | ||
|
||
@lords_id | ||
end | ||
|
||
private_class_method | ||
|
||
def self.set_ids | ||
return if @commons_id && @lords_id | ||
houses = Parliament::Request.new.houses.get.filter('http://id.ukpds.org/schema/House').sort_by(:name) | ||
|
||
@commons_id = houses.first.graph_id | ||
@lords_id = houses.last.graph_id | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Namespace for Parliament::Request helper methods. | ||
module RequestHelper | ||
# Handle Parliament::NoContentResponseError errors within a given request. | ||
# | ||
# @param [Parliament::Request] request a built Parliament::Request object that can just be called with #get | ||
# @param [Block] block a block to be executed if a Parliament error is raised. | ||
# | ||
# @return [Hash] a return object in the format: | ||
# { success: true, response: #<Parliament::Response> } for a successful request or | ||
# { success: false, response: nil } for a response that threw an error. | ||
def self.handler(request, &block) | ||
return_object = { success: false, response: nil } | ||
|
||
begin | ||
response = request.get | ||
return_object = { success: true, response: response } | ||
rescue Parliament::NoContentResponseError => e | ||
Rails.logger.warn "Received 204 status from #{e}" | ||
block&.call | ||
end | ||
|
||
return_object | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
class HomeController < ApplicationController | ||
def index | ||
houses_id | ||
end | ||
def index; end | ||
end |
Oops, something went wrong.