Skip to content

Commit

Permalink
Revert "Merge branch 'master' into feature/routes_wizard_layout"
Browse files Browse the repository at this point in the history
This reverts commit 37f7bac, reversing
changes made to d4fbd6a.
  • Loading branch information
spencerldixon committed Jan 17, 2025
1 parent 0444e27 commit d788cfa
Show file tree
Hide file tree
Showing 233 changed files with 2,368 additions and 2,189 deletions.
3 changes: 3 additions & 0 deletions .env.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ CLARITY_ID: i4a0ipfunv
VWO_ID: 713156
FAST_IMAGE_TIMEOUT: 0.25
SIZE_IMAGES: 1
BIGQUERY_TABLE_NAME: events
BIGQUERY_PROJECT_ID: get-into-teaching
BIGQUERY_DATASET: git_website_events_development
GET_AN_ADVISER: 1
GET_AN_ADVISER_FEEDBACK: 1
3 changes: 3 additions & 0 deletions .env.preprod
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ VWO_ID=713156
SKYLIGHT_ENV=test
FAST_IMAGE_TIMEOUT=0.25
SIZE_IMAGES=1
BIGQUERY_TABLE_NAME=events
BIGQUERY_PROJECT_ID=get-into-teaching
BIGQUERY_DATASET=git_website_events_preprod
GET_AN_ADVISER=1
GET_AN_ADVISER_FEEDBACK=1
3 changes: 3 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ VWO_ID=713156
SKYLIGHT_ENV=production
FAST_IMAGE_TIMEOUT=0.25
SIZE_IMAGES=1
BIGQUERY_TABLE_NAME=events
BIGQUERY_PROJECT_ID=get-into-teaching
BIGQUERY_DATASET=git_website_events_production
GET_AN_ADVISER=1
GET_AN_ADVISER_FEEDBACK=0
3 changes: 3 additions & 0 deletions .env.rolling
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ VWO_ID=713156
SKYLIGHT_ENV=dev
FAST_IMAGE_TIMEOUT=0.25
SIZE_IMAGES=1
BIGQUERY_TABLE_NAME=events
BIGQUERY_PROJECT_ID=get-into-teaching
BIGQUERY_DATASET=git_website_events_rolling
GET_AN_ADVISER=1
GET_AN_ADVISER_FEEDBACK=1
9 changes: 2 additions & 7 deletions .github/workflows/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ runs:
with:
creds: ${{ inputs.AZURE_CREDENTIALS }}

- uses: google-github-actions/auth@v2
with:
project_id: get-into-teaching
workload_identity_provider: projects/574582782335/locations/global/workloadIdentityPools/get-into-teaching-app/providers/get-into-teaching-app

- name: Get Short SHA
id: sha
shell: bash
Expand Down Expand Up @@ -116,8 +111,8 @@ runs:
APP_LABEL="get-into-teaching-app-${{inputs.environment}}"
HOST="getintoteaching.education.gov.uk"
fi
az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --overwrite-existing
kubelogin convert-kubeconfig -l spn
POD_NAME=$(kubectl get pods -n ${{ env.NAMESPACE }} -l app=${APP_LABEL} -o jsonpath="{.items[0].metadata.name}")
kubectl exec -n ${{ env.NAMESPACE }} $POD_NAME -- bundle exec rails runner "TrackPageModificationsJob.perform_later(host: '${HOST}')"
kubectl exec -n ${{ env.NAMESPACE }} $POD_NAME -- bundle exec rails runner "TrackPageModificationsJob.perform_later(host: '${HOST}')"
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
permissions:
contents: write
deployments: write
id-token: write
issues: write
packages: write
pull-requests: write
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/destroy_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
jobs:
destroy:
name: Destroy
permissions:
id-token: write
environment:
name: review
runs-on: ubuntu-latest
Expand All @@ -28,11 +26,6 @@ jobs:
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- uses: google-github-actions/auth@v2
with:
project_id: get-into-teaching
workload_identity_provider: projects/574582782335/locations/global/workloadIdentityPools/get-into-teaching-app/providers/get-into-teaching-app

- name: Setup Environment Variables
id: variables
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lychee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2.2.0
uses: lycheeverse/lychee-action@v2.1.0
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down
26 changes: 13 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ GEM
dotenv-rails (3.1.2)
dotenv (= 3.1.2)
railties (>= 6.1)
erb_lint (0.7.0)
erb_lint (0.5.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
rainbow
rubocop (>= 1)
rubocop
smart_properties
erubi (1.13.1)
erubi (1.13.0)
et-orbi (1.2.11)
tzinfo
factory_bot (6.5.0)
Expand Down Expand Up @@ -336,7 +336,7 @@ GEM
invisible_captcha (2.3.0)
rails (>= 5.2)
iso_country_codes (0.7.8)
json (2.9.1)
json (2.7.2)
jwt (2.7.1)
kaminari (1.2.2)
activesupport (>= 4.1.0)
Expand All @@ -363,7 +363,7 @@ GEM
loaf (0.10.0)
railties (>= 3.2)
logger (1.6.0)
loofah (2.24.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -382,7 +382,7 @@ GEM
method_source (1.1.0)
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.25.4)
minitest (5.25.2)
mixlib-cli (2.1.8)
mixlib-config (3.0.27)
tomlrb
Expand All @@ -401,17 +401,17 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.18.1)
nokogiri (1.16.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.18.1-x86_64-linux-gnu)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
observer (0.1.1)
os (1.1.4)
package_json (0.1.0)
pagy (9.0.5)
parallel (1.26.3)
parser (3.3.6.0)
parallel (1.25.1)
parser (3.3.4.0)
ast (~> 2.4.1)
racc
pg (1.5.4)
Expand Down Expand Up @@ -487,7 +487,7 @@ GEM
redis (>= 3, < 6)
redlock (1.3.2)
redis (>= 3.0.0, < 6.0)
regexp_parser (2.10.0)
regexp_parser (2.9.2)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
Expand Down Expand Up @@ -606,7 +606,7 @@ GEM
spring (>= 4)
stoplight (3.0.2)
redlock (~> 1.0)
strscan (3.1.2)
strscan (3.1.0)
text (1.3.1)
thor (1.3.2)
timeliness (0.4.5)
Expand All @@ -616,7 +616,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unicode-display_width (2.6.0)
unicode-display_width (2.5.0)
vcr (6.3.1)
base64
victor (0.3.4)
Expand Down
18 changes: 0 additions & 18 deletions app/components/calls_to_action/routes_component.html.erb

This file was deleted.

23 changes: 0 additions & 23 deletions app/components/calls_to_action/routes_component.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/components/header/extra_navigation_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</li>
<li class="extra-navigation__link extra-navigation__calendar">
<%= link_to("/events", class: "link--black") do %>
Upcoming events<span class="icon icon-calendar hide-on-narrow" aria-hidden="true"></span><span class="icon icon-calendar-white hide-on-narrow" aria-hidden="true"></span>
Find an event<span class="icon icon-calendar hide-on-narrow" aria-hidden="true"></span><span class="icon icon-calendar-white hide-on-narrow" aria-hidden="true"></span>
<% end %>
</li>
<%= tag.li(class: %w[extra-navigation__link extra-navigation__search]) do %>
Expand Down
20 changes: 20 additions & 0 deletions app/controllers/blog/tag_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Blog::TagController < ApplicationController
include PaginatablePosts

layout "layouts/blog/index"

POSTS_PER_PAGE = 10

def show
@front_matter = {
"title" => "Blog posts about #{params[:id].tr('-', ' ')}",
"noindex" => true,
}

breadcrumb "Blog", blog_index_path
breadcrumb @front_matter["title"], request.path

@tag = params[:id]
@posts = paginate_posts(::Pages::Blog.posts(@tag))
end
end
35 changes: 35 additions & 0 deletions app/controllers/blog_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
class BlogController < ApplicationController
include PaginatablePosts

caches_page :show

layout "layouts/blog/index"

def index
@front_matter = {
"title" => "Get Into Teaching Blog",
"description" => "Read about the real life experiences of teachers and teachers in training, as well as tips on how to start your journey into the classroom.",
}

breadcrumb "Blog", blog_index_path

@posts = paginate_posts(::Pages::Blog.posts)
end

def show
@post = ::Pages::Blog.find(request.path)

begin
@post.validate!
rescue ::Pages::ContentError => e
raise e unless helpers.display_content_errors?

add_content_error(e)
end

breadcrumb "Blog", blog_index_path
breadcrumb @post.title, request.path

render template: @post.template, layout: "layouts/blog/post"
end
end
1 change: 1 addition & 0 deletions app/controllers/sitemap_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class SitemapController < ApplicationController
# This will keep it consistent with how canonical-rails behaves and ensure search engines are happy.
OTHER_PATHS = %w[
/events
/blog
/events/about-get-into-teaching-events
/mailinglist/signup/name
].freeze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def crm_store
end

def set_step_page_title
@page_title = "Get a free adviser"
@page_title = "Get an adviser"

if @current_step&.title
@page_title += ", #{@current_step.title.downcase} step"
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/answer_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module AnswerHelper
def format_answer(answer)
case answer
when Date
answer = answer.to_formatted_s(:govuk_zero_pad)
answer = answer.to_formatted_s(:govuk_date)
when Time
answer = answer.in_time_zone.to_formatted_s(:govuk_time)
end
Expand Down
15 changes: 15 additions & 0 deletions app/helpers/blog_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module BlogHelper
def format_blog_date(date_string)
Date.parse(date_string).to_formatted_s(:govuk_zero_pad)
end

def thumbnail_image_from_post(images)
first_image_params = images.values.first.symbolize_keys

if first_image_params.key?(:thumbnail_path)
first_image_params[:path] = first_image_params[:thumbnail_path]
end

render Content::ImageComponent.new(**first_image_params.slice(:path))
end
end
20 changes: 20 additions & 0 deletions app/helpers/structured_data_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@ def structured_data(type, data)
end
end

def blog_structured_data(page)
frontmatter = page.frontmatter
author_name = frontmatter[:author]

data = {
headline: frontmatter[:title],
image: frontmatter[:images]&.values&.map { |h| asset_pack_url(h["path"]) },
datePublished: frontmatter[:date],
keywords: frontmatter[:keywords],
author: [
{
"@type": author_name.present? ? "Person" : "Organization",
name: author_name || "Get Into Teaching",
},
],
}.compact

structured_data("BlogPosting", data)
end

def government_organization_structured_data
data = {
"@context": "https://schema.org",
Expand Down
Loading

0 comments on commit d788cfa

Please sign in to comment.