Skip to content

Commit

Permalink
Merge pull request #3138 from DFE-Digital/spike-quick-dashboard-remove
Browse files Browse the repository at this point in the history
Remove all candidate facing links to dashboard and redirect from relevant URLs
  • Loading branch information
MylesJarvis authored Apr 24, 2024
2 parents 4a95f47 + 3e3ffb1 commit 03345d6
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 204 deletions.
17 changes: 12 additions & 5 deletions app/views/candidates/booking_feedbacks/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
<div class="govuk-grid-column-two-thirds">
<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">
Thank you for your feedback.
Thank you for your feedback
</h1>
</div>
<h2 class="govuk-heading-m">
View and request more school experience
</h2>
<h2 class="govuk-heading-m">
Get support and advice from a teacher training adviser
</h2>
<p>
<%= link_to "Your requests and bookings", candidates_dashboard_path %>
Get free, ongoing one-to-one support from an adviser with years of teaching experience.
They can help you to find a course, explain funding options and guide you step-by-step through the application process.
</p>
<p>
<%= link_to 'Get a teacher training adviser', 'https://getintoteaching.education.gov.uk/teacher-training-advisers' %>.
</p>
<p>
You can find more information on how to become a teacher at
<%= link_to 'Get Into Teaching', 'https://getintoteaching.education.gov.uk/' %>.
</div>
</div>
13 changes: 8 additions & 5 deletions app/views/candidates/feedbacks/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
<div class="govuk-grid-column-two-thirds">
<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">
Thank you for your feedback.
Thank you for your feedback
</h1>
</div>
<h2 class="govuk-heading-m">
View and request more school experience
</h2>
<h2 class="govuk-heading-m">
Request school experience
</h2>
<p>
<%= link_to 'Your requests and bookings', candidates_dashboard_path %>
To request a placement you can search to find school experience near you.
</p>
<p>
<%= govuk_link_to 'Search for school experience', new_candidates_school_search_path, class: "govuk-!-margin-bottom-0" %>
</p>
</div>
</div>
12 changes: 0 additions & 12 deletions app/views/candidates/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ Visit schools to see how teachers plan lessons, manage classrooms and teach subj
<% end %>
</li>
</ul>

<h2 class="govuk-heading-m" id="subsection-title">
If you're a candidate
</h2>

<ul class="govuk-list govuk-!-font-size-16 govuk-se-spaced-list">
<li>
<%= link_to candidates_dashboard_path, class: "govuk-!-font-weight-bold" do %>
Manage your bookings
<% end %>
</li>
</ul>
</nav>
</aside>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
You can also chat to Get Into Teaching using our
<%= chat_service %>
</p>

<h2 class="govuk-heading-m">View and request more school experience</h2>
<h2 class="govuk-heading-m">
Request school experience
</h2>
<p>
To request a different placement you can search to find school experience near you.
</p>
<p>
<%= link_to 'Your requests and bookings', candidates_dashboard_path %>
<%= govuk_link_to 'Search for school experience', new_candidates_school_search_path, class: "govuk-!-margin-bottom-0" %>
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="govuk-grid-column-two-thirds">
<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">
Your school experience booking has been cancelled by the school
Your school experience booking has already been cancelled by the school
</h1>
</div>

Expand All @@ -21,9 +21,15 @@
Extra details from the school <%= extra_details %>
</p>

<h2 class="govuk-heading-m">View and request more school experience</h2>
<h2 class="govuk-heading-m">
Request school experience
</h2>
<p>
<%= link_to 'Your requests and bookings', candidates_dashboard_path %>
To request a different placement you can search to find school experience near you.
</p>
<p>
<%= govuk_link_to 'Search for school experience', new_candidates_school_search_path, class: "govuk-!-margin-bottom-0" %>
</p>

</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@
between 8:30am and 5:30pm, Monday to Friday.
</p>

<h2 class="govuk-heading-m">
View and request more school experience
</h2>
<%= link_to 'Your requests and bookings', candidates_dashboard_path %>
<h2 class="govuk-heading-m">
Request school experience
</h2>
<p>
To request a different placement you can search to find school experience near you.
</p>
<p>
<%= govuk_link_to 'Search for school experience', new_candidates_school_search_path, class: "govuk-!-margin-bottom-0" %>
</p>

</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
<%= rejection_reasons %>
</p>

<h2 class="govuk-heading-m">
Request school experience
</h2>
<p>
<%= link_to 'Request school experience at other schools', new_candidates_school_search_path %>
To request a different placement you can search to find school experience near you.
</p>
<p>
<%= govuk_link_to 'Search for school experience', new_candidates_school_search_path, class: "govuk-!-margin-bottom-0" %>
</p>

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
<%= govuk_link_to 'Search for school experience', new_candidates_school_search_path, class: "govuk-!-margin-bottom-0" %>
</p>

<%= govuk_button_to "Visit your dashboard", candidates_dashboard_path, method: :get, secondary: true %>

<hr class="govuk-section-break govuk-section-break--l govuk-section-break--visible">

<h2 class="govuk-heading-m">If you're ready to apply for teacher training</h2>
Expand Down
6 changes: 4 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
root to: 'home#index'
get "splash", to: "home#splash"

get '/dashboard', to: redirect('/candidates')

# email confirmation link
get 'confirm/:uuid', to: 'registrations/placement_requests#create', as: :confirm

Expand Down Expand Up @@ -199,8 +201,8 @@
resource :feedback, only: %i[new create show], controller: "booking_feedbacks"
end

get 'signin', to: 'sessions#new'
post 'signin', to: 'sessions#create'
get 'signin', to: redirect('/candidates')
post 'signin', to: redirect('/candidates')
put 'signin', to: 'sessions#update', as: :signin_code
get 'signout', to: 'sessions#sign_out'

Expand Down
2 changes: 1 addition & 1 deletion features/candidates/booking_feedback.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ Feature: Feedback
And I choose 'Positively' from the 'How has your experience affected your decision to apply for teacher training?' radio buttons
And I choose 'No' from the 'Do you want to apply for teacher training?' radio buttons
When I click the 'Submit feedback' button
Then I should see the text 'Thank you for your feedback.'
Then I should see the text 'Thank you for your feedback'
40 changes: 0 additions & 40 deletions features/candidates/dashboard.feature

This file was deleted.

4 changes: 2 additions & 2 deletions features/candidates/feedback.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Feature: Feedback
And I choose 'Satisfied' from the 'Overall, how did you feel about the service you received?' radio buttons
And I enter 'Keep up the good work' into the 'How could we improve the service? (optional)' field
When I click the 'Submit feedback' button
Then I should see the text 'Thank you for your feedback.'
Then I should see the text 'Thank you for your feedback'

Scenario: Recording the referrer
Given I am on the 'find a school' page prior to giving feedback
When I click 'Give feedback', fill in and submit the candidate feedback form
Then I should see the text 'Thank you for your feedback.'
Then I should see the text 'Thank you for your feedback'
And my referrer should have been recorded
32 changes: 3 additions & 29 deletions spec/controllers/candidates/dashboards_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,9 @@

RSpec.describe Candidates::DashboardsController, type: :request do
describe "GET #show" do
it_behaves_like "candidate signed out", -> { get candidates_dashboard_path }

context "when signed in" do
include_context 'candidate signin'

let(:school) { build :bookings_school }
let(:other_school) { build :bookings_school }
let(:placement_requests) { create_list :placement_request, 1, school: school }
let(:current_candidate_placement_requests) do
create_list :placement_request, 2, candidate: current_candidate, school: school
end

before do
# Ensure there are placement requests for other candidates
create_list :placement_request, 2, school: other_school
get candidates_dashboard_path
end

it 'assigns the current contact' do
expect(assigns(:current_candidate)).to eq(current_candidate)
end

it "assigns the placement requests of the current candidate" do
expect(assigns(:placement_requests)).to match_array(current_candidate_placement_requests)
end

it "returns http success" do
expect(response).to have_http_status(:success)
end
it "redirects to /candidates" do
get candidates_dashboard_path
expect(response).to redirect_to("/candidates")
end
end
end
26 changes: 10 additions & 16 deletions spec/controllers/candidates/sessions_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
describe "GET #new" do
before { get candidates_signin_path }

it "returns http success" do
expect(response).to have_http_status(:success)
it "redirects the user to /candidates" do
expect(response).to have_http_status(:redirect)
end
end

Expand All @@ -32,9 +32,8 @@
post candidates_signin_path, params: { candidates_session: valid_creds }
end

it "returns http success" do
expect(response).to have_http_status(:success)
expect(response.body).to match('Verify your school experience sign in')
it "redirects the user to /candidates" do
expect(response).to have_http_status(:redirect)
end
end

Expand All @@ -48,10 +47,8 @@
end
end

it "renders an error page with a link to try again" do
expect(response).to have_http_status(:success)
expect(response.body).to match('We didn’t recognise the email address you entered')
expect(response.body).to match("Try entering your details again.")
it "redirects the user to /candidates" do
expect(response).to have_http_status(:redirect)
end
end

Expand All @@ -62,10 +59,8 @@
end
end

it "renders an error page" do
expect(response).to have_http_status(:success)
expect(response.body).to match('We didn’t recognise the email address you entered')
expect(response.body).to match("To login, you need to be registered with us.")
it "redirects the user to /candidates" do
expect(response).to have_http_status(:redirect)
end
end
end
Expand All @@ -74,9 +69,8 @@
let(:invalid_creds) { { candidates_session: { email: 'invalid' } } }
before { post candidates_signin_path, params: invalid_creds }

it "returns http success" do
expect(response).to have_http_status(:success)
expect(response.body).to match('Get school experience sign in')
it "returns http redirect to /candidates" do
expect(response).to have_http_status(:redirect)
end
end
end
Expand Down
Loading

0 comments on commit 03345d6

Please sign in to comment.