diff --git a/app/controllers/campaign_requests_controller.rb b/app/controllers/campaign_requests_controller.rb index 395f7050f..0cea995bd 100644 --- a/app/controllers/campaign_requests_controller.rb +++ b/app/controllers/campaign_requests_controller.rb @@ -36,6 +36,8 @@ def campaign_request_params site_tagline site_metadescription cost_of_campaign + hmg_code + strategic_planning_code ga_contact_email ], ).to_h diff --git a/app/models/support/gds/campaign.rb b/app/models/support/gds/campaign.rb index feea36fdc..649c8087f 100644 --- a/app/models/support/gds/campaign.rb +++ b/app/models/support/gds/campaign.rb @@ -22,6 +22,8 @@ class Campaign :site_tagline, :site_metadescription, :cost_of_campaign, + :hmg_code, + :strategic_planning_code, :ga_contact_email validates :signed_campaign, @@ -37,6 +39,8 @@ class Campaign :site_tagline, :site_metadescription, :cost_of_campaign, + :hmg_code, + :strategic_planning_code, :ga_contact_email, presence: true diff --git a/app/models/zendesk/ticket/campaign_request_ticket.rb b/app/models/zendesk/ticket/campaign_request_ticket.rb index 295fbee8a..5f8615957 100644 --- a/app/models/zendesk/ticket/campaign_request_ticket.rb +++ b/app/models/zendesk/ticket/campaign_request_ticket.rb @@ -83,6 +83,16 @@ def comment_snippets field: :cost_of_campaign, label: "Site build budget / costs (and overall campaign cost, if applicable)", ), + Zendesk::LabelledSnippet.new( + on: @request.campaign, + field: :hmg_code, + label: "HMG code: from approved AMC technical cases. Format: HMGXX-XXX (If not applicable enter n/a)", + ), + Zendesk::LabelledSnippet.new( + on: @request.campaign, + field: :strategic_planning_code, + label: "Strategic Planning Code: from strategic planning phase. Format: CSBXX-XXX (If not applicable enter n/a)", + ), Zendesk::LabelledSnippet.new( on: @request.campaign, field: :ga_contact_email, diff --git a/app/views/campaign_requests/_request_details.html.erb b/app/views/campaign_requests/_request_details.html.erb index 6e8b56adf..5ed1556df 100644 --- a/app/views/campaign_requests/_request_details.html.erb +++ b/app/views/campaign_requests/_request_details.html.erb @@ -220,6 +220,28 @@ +
+ + <%= r.label :hmg_code do %> + HMG code: from approved AMC technical cases. Format: HMGXX-XXX (If not applicable enter n/a) + <% end %> + + + <%= r.text_field :hmg_code, required: false, aria: { required: false }, class: "input-md-6 form-control" %> + +
+ +
+ + <%= r.label :strategic_planning_code do %> + Strategic Planning Code: from strategic planning phase. Format: CSBXX-XXX (If not applicable enter n/a) + <% end %> + + + <%= r.text_field :strategic_planning_code, required: false, aria: { required: false }, class: "input-md-6 form-control" %> + +
+
<%= r.label :ga_contact_email do %> diff --git a/spec/features/campaign_requests_spec.rb b/spec/features/campaign_requests_spec.rb index ddf1f0609..ba1f52e8a 100644 --- a/spec/features/campaign_requests_spec.rb +++ b/spec/features/campaign_requests_spec.rb @@ -59,6 +59,12 @@ [Site build budget / costs (and overall campaign cost, if applicable)] £1200 and tuppence +[HMG code: from approved AMC technical cases. Format: HMGXX-XXX (If not applicable enter n/a)] +HMGXX-XXX + +[Strategic Planning Code: from strategic planning phase. Format: CSBXX-XXX (If not applicable enter n/a)] +CSBXX-XXX + [Contact details for Google Analytics leads (Gmail accounts only)] ga.contact@example.com @@ -101,6 +107,8 @@ site_tagline: "A new one about a new thing", site_metadescription: "pensions, campaign, newcampaign", cost_of_campaign: "£1200 and tuppence", + hmg_code: "HMGXX-XXX", + strategic_planning_code: "CSBXX-XXX", ga_contact_email: "ga.contact@example.com", additional_comments: "Some comment", ) @@ -136,6 +144,8 @@ def user_makes_a_campaign_request(details) fill_in "Site tagline*", with: details[:site_tagline] fill_in "Site metadescription (appears in search results)*", with: details[:site_metadescription] fill_in "Site build budget / costs (and overall campaign cost, if applicable)*", with: details[:cost_of_campaign] + fill_in "HMG code: from approved AMC technical cases. Format: HMGXX-XXX (If not applicable enter n/a)", with: details[:hmg_code] + fill_in "Strategic Planning Code: from strategic planning phase. Format: CSBXX-XXX (If not applicable enter n/a)", with: details[:strategic_planning_code] fill_in "Cabinet Office/No10 only : Contact details for Google Analytics leads (Gmail accounts only)", with: details[:ga_contact_email] fill_in "Additional comments", with: details[:additional_comments] diff --git a/spec/models/support/gds/campaign_spec.rb b/spec/models/support/gds/campaign_spec.rb index c95ecd3a0..526eb3e80 100644 --- a/spec/models/support/gds/campaign_spec.rb +++ b/spec/models/support/gds/campaign_spec.rb @@ -25,6 +25,8 @@ def as_str(date) proposed_url: "example.campaign.gov.uk", site_metadescription: "tag1, tag2", cost_of_campaign: 1200, + hmg_code: "HMGXX-XXX", + strategic_planning_code: "CSBXX-XXX", ga_contact_email: "ga_test@digital.cabinet-office.gov.uk", ) end @@ -42,6 +44,8 @@ def as_str(date) it { should validate_presence_of(:site_tagline) } it { should validate_presence_of(:site_metadescription) } it { should validate_presence_of(:cost_of_campaign) } + it { should validate_presence_of(:hmg_code) } + it { should validate_presence_of(:strategic_planning_code) } it { should validate_presence_of(:ga_contact_email) } it { should validate_acceptance_of(:has_read_guidance_confirmation) }