metadata_presenter 3.3.23 → 3.3.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6854382610b99865f2af30a38c5807393211a160d3ab4af1000964daf082caa9
4
- data.tar.gz: 6c9cd5e2ecd9c4057cb59f12fdc34fb551398b490f52f020cea167838011f6f8
3
+ metadata.gz: c820cccd9aed599a87d7f383a7464504fb73470e11ea2aa47c107d8660474833
4
+ data.tar.gz: d73786672c233b5ca1371c65d24844eae9c9f63cbe7e144ed59d3dad71575a48
5
5
  SHA512:
6
- metadata.gz: b9924fc2c8e9b45e8f75468b474c166f78251faa4083d060acacff409c0a96da4b3be773d87970f13affa03d81ebda56c06a071dc7d897ca90254c395ebedf13
7
- data.tar.gz: 0261d65fac2f0f0a07236abe4cfad1fdf06b3199ddebb4ad2c408597ae90bf2c46f08ff7ab1af18137f177ed7cd40d64c393e4599f7f167236032a1e0398b40f
6
+ metadata.gz: 60cd34263a60622ede633dad425c2049b6df5d2dd1163674cc22eb82a68e6eaf07664bb435b93cb31af2c48aacfc3023a387fee84b170ca9b7d3a57d8bbee270
7
+ data.tar.gz: 4dd4eef3fe6c479c1e962bc41ca4f7db41a1e8959a19e9974319d30afa801b7e0e1352248d7184e131b44c4858cdd30a18cc02e443e0397345b14bb0c9296988
@@ -146,7 +146,7 @@ module MetadataPresenter
146
146
  end
147
147
 
148
148
  def sanitize_filename(answer)
149
- sanitize(filename(update_filename(answer)))
149
+ sanitize(filename(normalise_file_extension(answer)))
150
150
  end
151
151
 
152
152
  def filename(path)
@@ -165,15 +165,17 @@ module MetadataPresenter
165
165
  filename
166
166
  end
167
167
 
168
- def update_filename(answer)
169
- jfif_or_jpg_extension?(answer) ? "#{File.basename(answer, '.*')}.jpeg" : answer
170
- end
171
-
172
- def jfif_or_jpg_extension?(answer)
173
- return false if answer.nil?
168
+ def normalise_file_extension(answer)
169
+ return if answer.nil?
174
170
 
175
171
  file_extension = File.extname(answer)
176
- %w[.jfif .jpg].include?(file_extension)
172
+ file_basename = answer.delete_suffix(file_extension)
173
+
174
+ # Handle less common `image/jpeg` MIME type extensions
175
+ file_extension.downcase!
176
+ file_extension = '.jpeg' if %w[.jpg .jpe .jif .jfif].include?(file_extension)
177
+
178
+ [file_basename, file_extension].join
177
179
  end
178
180
 
179
181
  # NOTE: Address component is different to other components in the sense it can
@@ -8,11 +8,11 @@
8
8
  <%= render partial:'metadata_presenter/component/conditional_component_banner'%>
9
9
 
10
10
  <%= render 'metadata_presenter/attribute/section_heading' %>
11
- <%= render 'metadata_presenter/attribute/heading' %>
12
11
 
13
12
  <%= form_for @page_answers, as: :answers, url: @page.url, method: :post, authenticity_token: false do |f| %>
14
13
  <%= hidden_field_tag :authenticity_token, form_authenticity_token -%>
15
14
  <%= f.govuk_error_summary(t('presenter.errors.summary_heading')) %>
15
+ <%= render 'metadata_presenter/attribute/heading' %>
16
16
 
17
17
  <%= render partial: 'metadata_presenter/component/components', locals: {
18
18
  f: f,
@@ -7,7 +7,7 @@
7
7
  <div class="govuk-form-group">
8
8
  <%=
9
9
  f.govuk_email_field :email_confirmation,
10
- label: { size: 'l', text: t('presenter.save_and_return.confirm_email.heading') },
10
+ label: { tag: 'h1', size: 'l', text: t('presenter.save_and_return.confirm_email.heading') },
11
11
  name: "email_confirmation",
12
12
  spellcheck: "false",
13
13
  autocomplete: "email"
@@ -1,11 +1,12 @@
1
1
  <div class="fb-main-grid-wrapper">
2
2
  <div class="govuk-grid-row">
3
3
  <div class="govuk-grid-column-two-thirds">
4
- <h1 id="page-heading" class="govuk-heading-xl"><%= t('presenter.save_and_return.show.heading') %></h1>
5
- <p class="mojf-settings-screen__description"><%= t('presenter.save_and_return.show.description') %></p>
6
-
7
4
  <%= form_for @saved_form do |f| %>
8
5
  <%= f.govuk_error_summary(t('presenter.errors.summary_heading')) %>
6
+
7
+ <h1 id="page-heading" class="govuk-heading-xl"><%= t('presenter.save_and_return.show.heading') %></h1>
8
+ <p class="mojf-settings-screen__description"><%= t('presenter.save_and_return.show.description') %></p>
9
+
9
10
  <div class="govuk-form-group">
10
11
  <%= f.hidden_field(:page_slug, value: page_slug) %>
11
12
  <%=
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '3.3.23'.freeze
2
+ VERSION = '3.3.24'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metadata_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.23
4
+ version: 3.3.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-08 00:00:00.000000000 Z
11
+ date: 2024-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder