Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add consultation schema and examples #445

Merged
merged 17 commits into from Nov 30, 2016
Merged

Add consultation schema and examples #445

merged 17 commits into from Nov 30, 2016

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Nov 29, 2016

  • Add details and links schema for consultations
  • Add examples of:
    • Closed consultation
    • Closed consultation with outcome
    • Closed consultation with outcome and public feedback
    • Open consultation
    • Open consultation with ways to respond
    • Unopened consultation with open date set in the future

There are no known features missing from the schema.

Examples are rendered with this PR: alphagov/government-frontend#201

Paired with @binaryberry

Story: https://trello.com/c/QseqtCaJ/509-consultations-migration-basic-content-schema-examples-and-front-end-work-large

Gemfile Outdated
@@ -6,3 +6,7 @@ gem 'rake'
gem 'rspec'
gem 'govuk-dummy_content_store', '0.0.5'
gem 'foreman', '0.78.0'

group :test do
gem 'pry-byebug'

This comment has been minimized.

@andrewgarner

andrewgarner Nov 29, 2016
Contributor

Maybe cherry-pick this out into its own PR as isn't related directly to this group of changes?

This comment has been minimized.

@fofr

fofr Nov 29, 2016
Author Contributor

@binaryberry thoughts?

This comment has been minimized.

@binaryberry

binaryberry Nov 29, 2016
Contributor

In other GOV.UK repos I've found both examples of this being done within a dedicated PR, and examples of it being done within a PR that was doing something else.
PRs create a fair bit of noise (github notifications) and overhead (additional item to deploy), which I feel are not worth having for just adding a debugging gem. IMO avoiding this is more important than having a commit not directly related to the PR here.
That being said, it's a matter of opinion and dedicated PRs have happened before, so if one of you has strong feelings about it, I can remove it to not block this PR.

This comment has been minimized.

@andrewgarner

andrewgarner Nov 29, 2016
Contributor

One benefit would be that we could easily revert our changes without unintentionally causing a side effect to anything else that subsequently uses byebug.

This comment has been minimized.

@binaryberry

binaryberry Nov 29, 2016
Contributor

Fair enough - now removed that commit from this PR and opened #446.

"first_public_at": "2016-09-05T14:00:00+01:00",
"opening_date": "2016-09-05T14:00:00+01:00",
"closing_date": "2016-10-31T17:00:00+01:00",
"change_history": [

This comment has been minimized.

@andrewgarner

andrewgarner Nov 29, 2016
Contributor

Only body, government and political are required attributes of details so we shouldn't expect to see an empty change_history.

This comment has been minimized.

@fofr

fofr Nov 29, 2016
Author Contributor

This is an interesting one. Removing change_history causes the frontend to break. Which means the frontend should be more resilient.

This comment has been minimized.

@fofr

fofr Nov 29, 2016
Author Contributor

Fixed in f7981a8

This comment has been minimized.

@andrewgarner

andrewgarner Nov 29, 2016
Contributor

👍

"change_history": [
],
"tags": {
"browse_pages": [],

This comment has been minimized.

@andrewgarner

andrewgarner Nov 29, 2016
Contributor

Again browse_pages are not required so should we include an empty attribute?

This comment has been minimized.

@fofr

fofr Nov 29, 2016
Author Contributor

There's hidden complexity here: #292

"final_outcome_documents": [
"<section class=\"attachment embedded\" id=\"attachment_1763883\">\n<div class=\"attachment-thumb\">\n<a aria-hidden=\"true\" class=\"thumbnail\" href=\"/government/uploads/system/uploads/attachment_data/file/560439/Employee_Share_Schemes-NIC_elections-summary_responses.pdf\"><img alt=\"\" src=\"https://assets.digital.cabinet-office.gov.uk/government/uploads/system/uploads/attachment_data/file/560439/thumbnail_Employee_Share_Schemes-NIC_elections-summary_responses.pdf.png\" /></a>\n</div>\n<div class=\"attachment-details\">\n<h2 class=\"title\"><a aria-describedby=\"attachment-1763883-accessibility-help\" href=\"/government/uploads/system/uploads/attachment_data/file/560439/Employee_Share_Schemes-NIC_elections-summary_responses.pdf\">Employee Share Schemes: NIC elections - consulation response</a></h2>\n<p class=\"metadata\">\n<span class=\"type\"><abbr title=\"Portable Document Format\">PDF</abbr></span>, <span class=\"file-size\">258KB</span>, <span class=\"page-length\">7 pages</span>\n</p>\n\n\n<div data-module=\"toggle\" class=\"accessibility-warning\" id=\"attachment-1763883-accessibility-help\">\n<h2>This file may not be suitable for users of assistive technology.\n<a class=\"toggler\" href=\"#attachment-1763883-accessibility-request\" data-controls=\"attachment-1763883-accessibility-request\" data-expanded=\"false\">Request an accessible format.</a>\n</h2>\n<p id=\"attachment-1763883-accessibility-request\" class=\"js-hidden\">\nIf you use assistive technology (eg a screen reader) and need a\nversion of this document in a more accessible format, please email <a href=\"mailto:?body=Details%20of%20document%20required%3A%0A%0A%20%20Title%3A%20Employee%20Share%20Schemes%3A%20NIC%20elections%20-%20consulation%20response%0A%20%20Original%20format%3A%20pdf%0A%0APlease%20tell%20us%3A%0A%0A%20%201.%20What%20makes%20this%20format%20unsuitable%20for%20you%3F%0A%20%202.%20What%20format%20you%20would%20prefer%3F%0A%20%20%20%20%20%20&amp;subject=Request%20for%20%27Employee%20Share%20Schemes%3A%20NIC%20elections%20-%20consulation%20response%27%20in%20an%20alternative%20format\"></a>.\nPlease tell us what format you need. It will help us if you say what assistive technology you use.\n\n</p>\n</div>\n</div>\n</section>"
],
"tags": {

This comment has been minimized.

@andrewgarner

andrewgarner Nov 29, 2016
Contributor

Again, these are optional according to the schema.

@binaryberry binaryberry force-pushed the adding-consultations branch from f7981a8 to 879b9b8 Nov 29, 2016
Copy link
Contributor

@gpeng gpeng left a comment

We need to add policies and topics (and maybe browse pages but I'm not 100% sure on that) to links. When that's done I don't think tags are required.

"closing_date": "2016-10-31T17:00:00+01:00",
"tags": {
"browse_pages": [],
"topics": ["5d37acc4-7631-11e4-a3cb-005056011aef"],

This comment has been minimized.

@gpeng

gpeng Nov 30, 2016
Contributor

I don't think these are required here but they (topics and policies) should be in the links. email-alert-api checks both https://github.com/alphagov/email-alert-api/blob/master/app/workers/notification_worker.rb#L40-L49

This comment has been minimized.

@fofr

fofr Nov 30, 2016
Author Contributor

Topics and policy areas are included in the base links:
https://github.com/alphagov/govuk-content-schemas/blob/master/formats/base_links.json

And policies are in links.json:
77d4b9f#diff-15d8cbec358c915366ee6cbc4bd4e147R6

This comment has been minimized.

@fofr

fofr Nov 30, 2016
Author Contributor

I believe this line was copied directly from the live content item placeholder.

This comment has been minimized.

@gpeng

gpeng Nov 30, 2016
Contributor

Discussed offline... There is another example containing topics and policies links. We are going to leave the tags in the examples for now and test removing them from the presented item in Whitehall.

@fofr
Copy link
Contributor Author

@fofr fofr commented Nov 30, 2016

This will need a rebase and new examples run against this: #448

@gpeng
gpeng approved these changes Nov 30, 2016
@andrewgarner
Copy link
Contributor

@andrewgarner andrewgarner commented Nov 30, 2016

I'll rebase @fofr

Tatiana Soukiassian and others added 17 commits Nov 24, 2016
The closing date has been set to the distant future to ensure its state
remains open for a long time.
A consultation with an opening date in the future. Set to the distant
future for the purposes of this example.
This is provided automatically from metadata.json. Other access limited
formats don’t include it.
Email is instead provided in the “consultation_participation” hash
Consultations can have a set of attachments showing the public’s
feedback. These come with the already present detail which describes
the feedback.
* Use correct document type
* Add missing first public at field
* Include nation applicability to match live example
* Make image references absolute
* Include a list of public_feedback_documents
* Remove incorrect policies links, rename policy_areas to organisations
For readability the hash is a set of ways to respond. This is
consistent with the current front-end rendering.

consultation_participation is the name of the model in Whitehall.
The front-end failed because when public_updated_at differs from
first_public_at it expects a change_history. The example was incorrect
in that this difference in dates without a change log cannot happen.
@andrewgarner andrewgarner force-pushed the adding-consultations branch from 879b9b8 to c437cd6 Nov 30, 2016
@andrewgarner andrewgarner merged commit 22ad937 into master Nov 30, 2016
22 checks passed
22 checks passed
Verify business-support-finder against content schemas Build #303 succeeded on Jenkins
Details
Verify calendars against content schemas Build #304 succeeded on Jenkins
Details
Verify collections against content schemas Build #1387 succeeded on Jenkins
Details
Verify collections-publisher against content schemas Build #1374 succeeded on Jenkins
Details
Verify contacts-admin against content schemas Build #1507 succeeded on Jenkins
Details
Verify contacts-frontend against content schemas Build #1048 succeeded on Jenkins
Details
Verify content-tagger against content schemas Build #320 succeeded on Jenkins
Details
Verify finder-frontend against content schemas Build #1524 succeeded on Jenkins
Details
Verify government-frontend against content schemas Build #1533 succeeded on Jenkins
Details
Verify govuk_schemas_gem against content schemas Build #220 succeeded on Jenkins
Details
Verify hmrc-manuals-api against content schemas Build #1191 succeeded on Jenkins
Details
Verify licence-finder against content schemas Build #150 succeeded on Jenkins
Details
Verify manuals-frontend against schema examples Build #1367 succeeded on Jenkins
Details
Verify manuals-publisher against content schemas Build #1480 succeeded on Jenkins
Details
Verify policy-publisher against content schemas Build #1537 succeeded on Jenkins
Details
Verify publisher against content schemas Build #1443 succeeded on Jenkins
Details
Verify specialist-frontend against content schemas Build #1284 succeeded on Jenkins
Details
Verify specialist-publisher against content schemas Build #605 succeeded on Jenkins
Details
Verify static components against schema examples Build #909 succeeded on Jenkins
Details
Verify travel-advice-publisher against content schemas Build #1202 succeeded on Jenkins
Details
Verify whitehall against content schemas Build #1595 succeeded on Jenkins
Details
default Build #1384 succeeded on Jenkins
Details
@andrewgarner andrewgarner deleted the adding-consultations branch Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.