-
Notifications
You must be signed in to change notification settings - Fork 2
[239] FaF - check you answers #781
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
684df76
Add locale strings and contact info view
EdwinKruglov 31a6c01
Move contact info content to step 2
EdwinKruglov b3ef049
check answers page
d-a-v-e 18e6de1
merge develop => feature/239
d-a-v-e dd46a42
model specs
d-a-v-e 17045ab
fix failing spec
d-a-v-e aa9d6ad
remove unused controller actions
d-a-v-e bac9d85
Merge branch 'develop' into feature/239-check-answers
d-a-v-e afa6e69
Merge branch 'develop' into feature/239-check-answers
d-a-v-e File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,3 @@ | ||
| class FrameworkRequest < ApplicationRecord | ||
| validates :first_name, :last_name, :email, :school_urn, :message_body, presence: true | ||
| end |
This file contains hidden or 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,11 @@ | ||
| class FafPresenter < BasePresenter | ||
| # @return [String] | ||
| def full_name | ||
| "#{first_name} #{last_name}" | ||
| end | ||
|
|
||
| # @return [String] | ||
| def school_name | ||
| Support::Organisation.find_by(urn: school_urn)&.name || "n/a" | ||
| end | ||
| end |
This file contains hidden or 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,60 @@ | ||
| <div class="govuk-grid-row"> | ||
| <div class="govuk-grid-column-two-thirds"> | ||
|
|
||
| <h1 class="govuk-heading-l"><%= I18n.t("faf.check_answers.header") %></h1> | ||
|
|
||
| <dl class="govuk-summary-list"> | ||
| <div class="govuk-summary-list__row"> | ||
| <dt class="govuk-summary-list__key"> | ||
| <%= I18n.t("faf.check_answers.details.name") %> | ||
| </dt> | ||
| <dd class="govuk-summary-list__value"> | ||
| <%= @faf_presenter.full_name %> | ||
| </dd> | ||
| <dd class="govuk-summary-list__actions"> | ||
| <%= link_to I18n.t("generic.button.change_answer"), edit_faf_path(@faf, step: 0), class: "govuk-link", id: "edit-name" %> | ||
| </dd> | ||
| </div> | ||
| <div class="govuk-summary-list__row"> | ||
| <dt class="govuk-summary-list__key"> | ||
| <%= I18n.t("faf.check_answers.details.email") %> | ||
| </dt> | ||
| <dd class="govuk-summary-list__value"> | ||
| <%= @faf_presenter.email %> | ||
| </dd> | ||
| <dd class="govuk-summary-list__actions"> | ||
| <%= link_to I18n.t("generic.button.change_answer"), edit_faf_path(@faf, step: 0), class: "govuk-link", id: "edit-email" %> | ||
| </dd> | ||
| </div> | ||
| <div class="govuk-summary-list__row"> | ||
| <dt class="govuk-summary-list__key"> | ||
| <%= I18n.t("faf.check_answers.details.school") %> | ||
| </dt> | ||
| <dd class="govuk-summary-list__value"> | ||
| <%= @faf_presenter.school_name %> | ||
| </dd> | ||
| <dd class="govuk-summary-list__actions"> | ||
| <%= link_to I18n.t("generic.button.change_answer"), edit_faf_path(@faf, step: 0), class: "govuk-link", id: "edit-school" %> | ||
| </dd> | ||
| </div> | ||
| <div class="govuk-summary-list__row"> | ||
| <dt class="govuk-summary-list__key"> | ||
| <%= I18n.t("faf.check_answers.details.problem") %> | ||
| </dt> | ||
| <dd class="govuk-summary-list__value"> | ||
| <%= @faf_presenter.message_body %> | ||
| </dd> | ||
| <dd class="govuk-summary-list__actions"> | ||
| <%= link_to I18n.t("generic.button.change_answer"), edit_faf_path(@faf, step: 0), class: "govuk-link", id: "edit-message" %> | ||
| </dd> | ||
| </div> | ||
| </dl> | ||
|
|
||
| <p class="govuk-body"> | ||
| <%= I18n.t("faf.check_answers.response_time") %> | ||
| </p> | ||
|
|
||
| <%= button_to I18n.t("faf.check_answers.button.send"), faf_submission_path(@faf), class: "govuk-button", method: :patch, data: { disable_with: "Submitting..." } %> | ||
|
|
||
| </div> | ||
| </div> |
This file contains hidden or 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,8 +1,36 @@ | ||
| <span class="govuk-caption-l"> | ||
| step 2 | ||
| </span> | ||
| <h1 class="govuk-heading-l"> | ||
| Step 2 | ||
| </h1> | ||
|
|
||
| <br> | ||
| <%= content_for :title, I18n.t("faf.contact_info.title") %> | ||
|
|
||
| <div class="govuk-grid-row"> | ||
| <div class="govuk-grid-column-two-thirds"> | ||
| <span class="govuk-caption-l"><%= I18n.t("faf.contact_info.caption") %></span> | ||
| <h1 class="govuk-heading-l"><%= I18n.t("faf.contact_info.heading") %></h1> | ||
| <p class="govuk-body"><%= I18n.t("faf.contact_info.body.if_incorrect") %></p> | ||
|
|
||
| <ul class="govuk-list govuk-list--bullet"> | ||
| <li><%= I18n.t("faf.contact_info.body.login_correct_account") %></li> | ||
| <li><%= link_to I18n.t("faf.contact_info.body.amend_details"), dsi_url(subdomain: "profile", path: "/edit-details"), class: "govuk-link" %></li> | ||
| </ul> | ||
|
|
||
| <dl class="govuk-summary-list"> | ||
| <div class="govuk-summary-list__row"> | ||
| <dt class="govuk-summary-list__key"> | ||
| <%= I18n.t("faf.contact_info.body.description_list.name") %> | ||
| </dt> | ||
| <dd class="govuk-summary-list__value"> | ||
| <%= @current_user.full_name if @current_user %> | ||
| </dd> | ||
| </div> | ||
|
|
||
| <div class="govuk-summary-list__row"> | ||
| <dt class="govuk-summary-list__key"> | ||
| <%= I18n.t("faf.contact_info.body.description_list.email") %> | ||
| </dt> | ||
| <dd class="govuk-summary-list__value"> | ||
| <%= @current_user.email if @current_user %> | ||
| </dd> | ||
| </div> | ||
| </dl> | ||
|
|
||
| <%= form.submit I18n.t("faf.contact_info.button.continue"), class: "govuk-button", role: "button" %> | ||
| </div> | ||
| </div> | ||
This file contains hidden or 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,8 @@ | ||
| <span class="govuk-caption-l"> | ||
| step 3 | ||
| </span> | ||
| <h1 class="govuk-heading-l"> | ||
| Step 3 | ||
| </h1> | ||
|
|
||
| <br> |
This file contains hidden or 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 hidden or 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 hidden or 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,14 @@ | ||
| class CreateFrameworkRequests < ActiveRecord::Migration[6.1] | ||
| def change | ||
| create_table :framework_requests, id: :uuid do |t| | ||
| t.timestamps | ||
|
|
||
| t.string :first_name | ||
| t.string :last_name | ||
| t.string :email | ||
| t.string :school_urn | ||
| t.string :message_body | ||
| t.boolean :submitted, default: false | ||
| end | ||
| end | ||
| end |
This file contains hidden or 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 hidden or 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,10 @@ | ||
| FactoryBot.define do | ||
| factory :framework_request do | ||
| first_name { "David" } | ||
| last_name { "Georgiou" } | ||
| school_urn { "000001" } | ||
| email { "email@example.com" } | ||
| message_body { "please help!" } | ||
| submitted { false } | ||
| end | ||
| end |
This file contains hidden or 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,22 @@ | ||
| RSpec.feature "FaF - check your answers" do | ||
| before do | ||
| faf = create(:framework_request) | ||
| visit "/procurement-support/#{faf.id}" | ||
| end | ||
|
|
||
| context "when the user is not signed in" do | ||
| it "loads the page" do | ||
| expect(find("h1")).to have_text "Send your request" | ||
| end | ||
| end | ||
|
|
||
| context "when the user is signed in" do | ||
| before do | ||
| user_is_signed_in | ||
| end | ||
|
|
||
| it "loads the page" do | ||
| expect(find("h1")).to have_text "Send your request" | ||
| end | ||
| end | ||
| end |
This file contains hidden or 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,11 @@ | ||
| require "rails_helper" | ||
|
|
||
| RSpec.describe FrameworkRequest, type: :model do | ||
| describe "validations" do | ||
| it { is_expected.to validate_presence_of(:first_name) } | ||
| it { is_expected.to validate_presence_of(:last_name) } | ||
| it { is_expected.to validate_presence_of(:email) } | ||
| it { is_expected.to validate_presence_of(:school_urn) } | ||
| it { is_expected.to validate_presence_of(:message_body) } | ||
| end | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought, although is there perhaps some value in creating some logic in the _form.html.erb as a conditional for which button type to display, to prevent duplication across the step pages?