Skip to content

Commit

Permalink
Merge pull request #87 from Christine-horrocks/WEBDEV-833_Add-objecti…
Browse files Browse the repository at this point in the history
…on-end-period-to-laid-things

WEBDEV-854_Update-SI-PNSI-with-objection-end
  • Loading branch information
katylouise authored Oct 19, 2018
2 parents bc8ba4f + 86d33a6 commit 8a93760
Show file tree
Hide file tree
Showing 21 changed files with 391 additions and 339 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ GEM
nokogumbo (2.0.0)
nokogiri (~> 1.8, >= 1.8.4)
parallel (1.12.1)
parliament-grom-decorators (1.0.2)
parliament-grom-decorators (1.0.3)
parliament-ntriple (0.4.0)
grom (~> 1.0)
parliament-opensearch (0.7.0)
Expand Down Expand Up @@ -236,7 +236,7 @@ GEM
tins (1.17.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.2018.5)
tzinfo-data (1.2018.6)
tzinfo (>= 1.0.0)
unicode-display_width (1.4.0)
vcr (4.0.0)
Expand Down
24 changes: 19 additions & 5 deletions app/serializers/page_serializer/laid_thing_show_page_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def initialize(request: nil, laid_thing:, data_alternates: nil)
@laying_body = @laid_thing.try(:laying).try(:body)
@laying_person = @laid_thing.try(:laying).try(:person)
@procedure = @work_package.try(:procedure)
@business_item = @work_package.try(:business_item)
@procedure_step = @business_item.try(:procedure_step) if @business_item

super(request: request, data_alternates: data_alternates)
end
Expand Down Expand Up @@ -50,9 +52,9 @@ def work_package_list_components
components << ComponentSerializer::CardComponentSerializer.new(
name: 'card__generic',
data: {
small: ComponentSerializer::SmallComponentSerializer.new({ content: 'laid-thing.work-package' }).to_h,
heading: work_package_card_heading,
paragraph: work_package_paragraphs
small: ComponentSerializer::SmallComponentSerializer.new({ content: 'laid-thing.work-package' }).to_h,
heading: work_package_card_heading,
list_description: work_package_list_description
}
).to_h
end
Expand All @@ -62,8 +64,20 @@ def work_package_card_heading
ComponentSerializer::HeadingComponentSerializer.new(content: link_to(title, work_package_path(@work_package.try(:graph_id))), size: 2).to_h
end

def work_package_paragraphs
ComponentSerializer::ParagraphComponentSerializer.new(content: [{ content: "Procedure: #{@procedure.try(:procedureName)}" }]).to_h
def work_package_list_description
ComponentSerializer::ListDescriptionComponentSerializer.new(items: list_description_items).to_h
end

def list_description_items
[].tap do |items|
items << { 'term': { 'content': 'Procedure' }, 'description': [{ 'content': @procedure.try(:procedureName) }] }
items << if @business_item && @business_item.try(:date)
{
'term': { 'content': @procedure_step.try(:procedureStepName) },
'description': [{ 'content': l(@business_item.try(:date)) }]
}
end
end
end

def heading1_component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def meta_info
[].tap do |items|
web_link = @laid_thing.try(:workPackagedThingHasWorkPackagedThingWebLink)
items << create_description_list_item('laid-thing.web-link', [link_to(web_link, web_link)]) if web_link

items << create_description_list_item('statutory-instruments.show.made-date', [l(@statutory_instrument.made_date)])
items << create_description_list_item('laid-thing.laid-date', [l(@laid_thing&.laying&.date)])
items << create_description_list_item('statutory-instruments.show.coming-into-force-date', [l(@statutory_instrument.coming_into_force_date)])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,22 @@ main-components:
- term:
content: laid-thing.web-link
description:
- content: <a href="https://www.gov.uk/eu-withdrawal-act-2018-statutory-instruments/the-airport-charges-amendment-eu-exit-regulations-2018">https://www.gov.uk/eu-withdrawal-act-2018-statutory-instruments/the-airport-charges-amendment-eu-exit-regulations-2018</a>
- content: <a href="https://www.gov.uk/eu-withdrawal-act-2018-statutory-instruments/the-airports-groundhandling-amendment-eu-exit-regulations-2018">https://www.gov.uk/eu-withdrawal-act-2018-statutory-instruments/the-airports-groundhandling-amendment-eu-exit-regulations-2018</a>
- term:
content: laid-thing.laid-date
description:
- content: 19 July 2018
- term:
content: proposed-negative-statutory-instruments.show.preceding-title
description:
- content: <a href="/statutory-instruments/C1234567">statutoryInstrumentPaperName
- 1</a>
- content: <a href="/statutory-instruments/D1234567">statutoryInstrumentPaperName
- 2</a>
- term:
content: laid-thing.laying-body
description:
- content: groupName - 1
- name: section__section
data:
components:
Expand All @@ -133,13 +141,21 @@ main-components:
heading:
name: heading
data:
content: <a href="/work-packages/7xwjxL0R">proposedNegativeStatutoryInstrumentPaperName
content: <a href="/work-packages/xyYZNFHJ">proposedNegativeStatutoryInstrumentPaperName
- 1</a>
size: 2
paragraph:
name: paragraph
list-description:
name: list__description
data:
- content: 'Procedure: procedureName - 1'
items:
- term:
content: Procedure
description:
- content: procedureName - 1
- term:
content: procedureStepName - 1
description:
- content: 9 October 2018
footer-components:
- name: footer
data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,34 +99,23 @@ main-components:
content: statutoryInstrumentPaperName - 1
context:
content: statutoryInstrumentPaperPrefix - 1 statutoryInstrumentPaperYear
- 1/538
- 1/488
- name: list__description
data:
meta: true
items:
- term:
content: laid-thing.web-link
description:
- content: <a href="http://www.legislation.gov.uk/uksi/2018/538/made">http://www.legislation.gov.uk/uksi/2018/538/made</a>
- content: <a href="http://www.legislation.gov.uk/uksi/2018/488/made">http://www.legislation.gov.uk/uksi/2018/488/made</a>
- term:
content: laid-thing.laid-date
description:
- content: 1 May 2018
- content: 20 April 2018
- term:
content: statutory-instruments.show.coming-into-force-date
description:
- content: 1 June 2018
- term:
content: statutory-instruments.show.following-title
description:
- content: <a href="/proposed-negative-statutory-instruments/C1234567">proposedNegativeStatutoryInstrumentPaperName
- 1</a>
- content: <a href="/proposed-negative-statutory-instruments/D1234567">proposedNegativeStatutoryInstrumentPaperName
- 2</a>
- term:
content: laid-thing.laying-person
description:
- content: F31CBD81AD8343898B49DC65743F0BDF - 1
- content: 18 May 2018
- term:
content: laid-thing.laying-body
description:
Expand All @@ -152,13 +141,21 @@ main-components:
heading:
name: heading
data:
content: <a href="/work-packages/zhi6ZHnQ">statutoryInstrumentPaperName
content: <a href="/work-packages/EgDK23iB">statutoryInstrumentPaperName
- 1</a>
size: 2
paragraph:
name: paragraph
list-description:
name: list__description
data:
- content: 'Procedure: procedureName - 1'
items:
- term:
content: Procedure
description:
- content: procedureName - 1
- term:
content: procedureStepName - 1
description:
- content: 8 June 2018
footer-components:
- name: footer
data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ main-components:
- term:
content: laid-thing.web-link
description:
- content: <a href="https://www.gov.uk/eu-withdrawal-act-2018-statutory-instruments/the-airport-charges-amendment-eu-exit-regulations-2018">https://www.gov.uk/eu-withdrawal-act-2018-statutory-instruments/the-airport-charges-amendment-eu-exit-regulations-2018</a>
- content: <a href="https://www.gov.uk/eu-withdrawal-act-2018-statutory-instruments/the-airports-groundhandling-amendment-eu-exit-regulations-2018">https://www.gov.uk/eu-withdrawal-act-2018-statutory-instruments/the-airports-groundhandling-amendment-eu-exit-regulations-2018</a>
- term:
content: laid-thing.laid-date
description:
Expand Down Expand Up @@ -126,13 +126,21 @@ main-components:
heading:
name: heading
data:
content: <a href="/work-packages/7xwjxL0R">proposedNegativeStatutoryInstrumentPaperName
content: <a href="/work-packages/xyYZNFHJ">proposedNegativeStatutoryInstrumentPaperName
- 1</a>
size: 2
paragraph:
name: paragraph
list-description:
name: list__description
data:
- content: 'Procedure: procedureName - 1'
items:
- term:
content: Procedure
description:
- content: procedureName - 1
- term:
content: procedureStepName - 1
description:
- content: 9 October 2018
footer-components:
- name: footer
data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,23 @@ main-components:
content: statutoryInstrumentPaperName - 1
context:
content: statutoryInstrumentPaperPrefix - 1 statutoryInstrumentPaperYear
- 1/538
- 1/488
- name: list__description
data:
meta: true
items:
- term:
content: laid-thing.web-link
description:
- content: <a href="http://www.legislation.gov.uk/uksi/2018/538/made">http://www.legislation.gov.uk/uksi/2018/538/made</a>
- term:
content: statutory-instruments.show.made-date
description:
- content: 1 May 2018
- content: <a href="http://www.legislation.gov.uk/uksi/2018/488/made">http://www.legislation.gov.uk/uksi/2018/488/made</a>
- term:
content: laid-thing.laid-date
description:
- content: 30 April 2018
- content: 20 April 2018
- term:
content: statutory-instruments.show.coming-into-force-date
description:
- content: 1 June 2018
- term:
content: statutory-instruments.show.coming-into-force-note
description:
- content: statutoryInstrumentPaperComingIntoForceNote - 1
- content: 18 May 2018
- term:
content: statutory-instruments.show.following-title
description:
Expand Down Expand Up @@ -141,13 +133,21 @@ main-components:
heading:
name: heading
data:
content: <a href="/work-packages/zhi6ZHnQ">statutoryInstrumentPaperName
content: <a href="/work-packages/EgDK23iB">statutoryInstrumentPaperName
- 1</a>
size: 2
paragraph:
name: paragraph
list-description:
name: list__description
data:
- content: 'Procedure: procedureName - 1'
items:
- term:
content: Procedure
description:
- content: procedureName - 1
- term:
content: procedureStepName - 1
description:
- content: 8 June 2018
footer-components:
- name: footer
data:
Expand Down
Loading

0 comments on commit 8a93760

Please sign in to comment.