metadata_presenter 2.18 → 2.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f510cf174501cb63991c19c4315d049dbdde45cc1710dc5c0dae3f739c2908a
4
- data.tar.gz: e3b761015334f2e86e683e2cc286b1771350920e8ac48d538584db3f26df8586
3
+ metadata.gz: f6e7b4e7fd337ae076ffb1f5334defaf9436fbcc77f0c4366aee799edc6c5199
4
+ data.tar.gz: e47c4cb945ead4661ed176046452e25e690ef143868f727d9fcb6179e3ad6741
5
5
  SHA512:
6
- metadata.gz: ed4b94152f503bd888a2e767824a60093c802a9ed83cb6b0cdbc1e7f502bda18279f6eb794dceaea8dd6a61f2331428c56cb2208c22087197a286a7ee447afb8
7
- data.tar.gz: 19dce7610b5c923d456ea795020755c5f3b95f8fec3071387fe930284f99dbd5210c799438694ebbe51b85afbe888e11ce221264483c9d04274fb34819ad12a7
6
+ metadata.gz: a47979a086e2119602ece95d2858c42f8d585f827634f3356049de5bfabbe1f5cbdf841f824552cd4fe3954819ee3b2706fca227365cdaf61ade6e31aea71c6c
7
+ data.tar.gz: eb159c9f5b98043e263da7c3c8bb5c7f3b0a5d77c7dfc52ce6fde550be8e735958f81e726a7442a22916b6698aef7f7c91f591ad0c329812ece88eeccfea6a99
@@ -101,6 +101,10 @@ module MetadataPresenter
101
101
  render template: 'errors/404', status: :not_found
102
102
  end
103
103
 
104
+ def internal_server_error
105
+ render template: 'errors/500', status: :internal_server_error
106
+ end
107
+
104
108
  def redirect_to_page(url)
105
109
  redirect_to File.join(request.script_name, url)
106
110
  end
@@ -1,6 +1,5 @@
1
1
  module MetadataPresenter
2
2
  class SaveAndReturnController < EngineController
3
- # before_action :check_feature_flag
4
3
  helper_method :secret_questions, :page_slug, :confirmed_email
5
4
 
6
5
  def show
@@ -8,7 +7,7 @@ module MetadataPresenter
8
7
  end
9
8
 
10
9
  def page_slug
11
- params[:page_slug] || params[:saved_form][:page_slug]
10
+ session['saved_form']['page_slug'] || params[:page_slug]
12
11
  end
13
12
 
14
13
  def confirmed_email
@@ -41,11 +40,12 @@ module MetadataPresenter
41
40
  @email_confirmation.assign_attributes(confirmation_params[:email_confirmation], session['saved_form']['email'])
42
41
 
43
42
  if @email_confirmation.valid?
44
- # save_form_progress returns the uuid of the saved form as 'id'
45
- # user to generate email link, for now not assigned because rubocop
46
- # save_form_progress.body['id']
47
- # TODO: rescue failed POST
48
- # send_email(uuid, confirmation_params[:email_confirmation])
43
+ response = save_form_progress
44
+ if response.status != 200
45
+ internal_server_error and return
46
+ end
47
+
48
+ # send_email(response.body['id'], confirmation_params[:email_confirmation])
49
49
  redirect_to '/save/progress_saved'
50
50
  else
51
51
  render :email_confirmation, status: :unprocessable_entity
@@ -0,0 +1,100 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>There is a problem with MoJ Forms - MoJ Forms</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ /* CSS generated using the UseCSS browser extension: https://chrome.google.com/webstore/detail/css-used/cdopjfddjlonogibjahpnmjpoangjfff/related?hl=en */
8
+ /* Generated from a live MoJ forms 404 page */
9
+ .govuk-body-m{color:#0b0c0c;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25;margin-top:0;margin-bottom:15px;}
10
+ .govuk-main-wrapper{display:block;padding-top:20px;padding-bottom:20px;}
11
+ .govuk-main-wrapper--auto-spacing:first-child{padding-top:30px;}
12
+ .govuk-template__body{margin:0;background-color:#fff;}
13
+ .govuk-width-container{max-width:960px;margin-right:15px;margin-left:15px;}
14
+ .govuk-header{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.1428571429;border-bottom:10px solid #fff;color:#fff;background:#0b0c0c;}
15
+ .govuk-header__container{position:relative;margin-bottom:-10px;padding-top:10px;border-bottom:10px solid #1d70b8;}
16
+ .govuk-header__container:after{content:"";display:block;clear:both;}
17
+ .govuk-header__logotype{display:inline-block;margin-right:5px;}
18
+ .govuk-header__logotype:last-child{margin-right:0;}
19
+ .govuk-header__logotype-crown{position:relative;top:-1px;margin-right:1px;fill:currentcolor;vertical-align:top;}
20
+ .govuk-header__logotype-crown-fallback-image{width:36px;height:32px;border:0;vertical-align:bottom;}
21
+ .govuk-header__link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none;}
22
+ .govuk-header__link:link,.govuk-header__link:visited{color:#fff;}
23
+ .govuk-header__link:active,.govuk-header__link:hover{color:hsla(0,0%,100%,.99);}
24
+ .govuk-header__link:hover{text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:.1em;}
25
+ .govuk-header__link:focus{outline:3px solid transparent;color:#0b0c0c;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;}
26
+ .govuk-header__link--homepage{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;display:inline-block;margin-right:10px;font-size:30px;line-height:1;}
27
+ .govuk-header__link--homepage:link,.govuk-header__link--homepage:visited{text-decoration:none;}
28
+ .govuk-header__link--homepage:active,.govuk-header__link--homepage:hover{margin-bottom:-3px;border-bottom:3px solid;}
29
+ .govuk-header__link--homepage:focus{margin-bottom:0;border-bottom:0;}
30
+ .govuk-header__service-name{display:inline-block;margin-bottom:10px;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:18px;font-size:1.125rem;line-height:1.1111111111;}
31
+ .govuk-header__content,.govuk-header__logo{box-sizing:border-box;}
32
+ .govuk-header__logo{margin-bottom:10px;padding-right:50px;}
33
+ .govuk-skip-link{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline;font-size:14px;font-size:.875rem;line-height:1.1428571429;display:block;padding:10px 15px;}
34
+ .govuk-skip-link:active,.govuk-skip-link:focus{position:static!important;width:auto!important;height:auto!important;margin:inherit!important;overflow:visible!important;clip:auto!important;-webkit-clip-path:none!important;clip-path:none!important;white-space:inherit!important;}
35
+ .govuk-skip-link:link,.govuk-skip-link:visited{color:#0b0c0c;}
36
+ .govuk-skip-link:hover{color:rgba(11,12,12,.99);}
37
+ .govuk-skip-link:active,.govuk-skip-link:focus{color:#0b0c0c;}
38
+ .govuk-skip-link:focus{outline:3px solid #fd0;outline-offset:0;background-color:#fd0;}
39
+ .govuk-visually-hidden{padding:0!important;border:0!important;}
40
+ .govuk-visually-hidden{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;}
41
+ #main-content{min-height:55vh;}
42
+ .govuk-link{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:underline;}
43
+ .govuk-link:focus{outline:3px solid transparent;background-color:#fd0;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;}
44
+ .govuk-link:link{color:#1d70b8;}
45
+ .govuk-link:visited{color:#4c2c92;}
46
+ .govuk-link:hover{color:#003078;}
47
+ .govuk-link:active,.govuk-link:focus{color:#0b0c0c;}
48
+ @media (min-width:40.0625em){
49
+ .govuk-body-m{font-size:19px;font-size:1.1875rem;line-height:1.3157894737;}
50
+ .govuk-body-m{margin-bottom:20px;}
51
+ .govuk-main-wrapper{padding-top:40px;padding-bottom:40px;}
52
+ .govuk-main-wrapper--auto-spacing:first-child{padding-top:50px;}
53
+ .govuk-width-container{margin-right:30px;margin-left:30px;}
54
+ .govuk-header{font-size:16px;font-size:1rem;line-height:1.25;}
55
+ .govuk-header__link--homepage{display:inline;}
56
+ .govuk-header__link--homepage:focus{box-shadow:0 0 #fd0;}
57
+ .govuk-header__service-name{font-size:24px;font-size:1.5rem;line-height:1.25;}
58
+ .govuk-header__logo{width:33.33%;padding-right:15px;float:left;vertical-align:top;}
59
+ .govuk-header__content{width:66.66%;padding-left:15px;float:left;}
60
+ .govuk-skip-link{font-size:16px;font-size:1rem;line-height:1.25;}
61
+ }
62
+ @media (min-width:1020px){
63
+ .govuk-width-container{margin-right:auto;margin-left:auto;}
64
+ }
65
+ @media (forced-colors:active){
66
+ .govuk-header__logotype{forced-color-adjust:none;color:linktext;}
67
+ }
68
+ </style>
69
+ </head>
70
+
71
+ <body class="govuk-template__body">
72
+ <header class="govuk-header" role="banner" data-module="govuk-header">
73
+ <a href="#main-content" class="govuk-skip-link" data-module="govuk-skip-link">Skip to main content</a>
74
+ <div class="govuk-header__container govuk-width-container">
75
+ <div class="govuk-header__logo">
76
+ <a href="/" class="govuk-header__link govuk-header__link--homepage">
77
+ <span class="govuk-header__logotype">
78
+ <svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 132 97" height="30" width="36">
79
+ <path fill="currentColor" fill-rule="evenodd" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7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.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
80
+ <image src="{{ params.assetsPath | default('/assets/images') }}/govuk-logotype-crown.png" xlink:href="" class="govuk-header__logotype-crown-fallback-image" width="36" height="32"></image>
81
+ </svg>
82
+ <span class="govuk-header__logotype-text">
83
+ GOV.UK
84
+ </span>
85
+ </span>
86
+ </a>
87
+ </div>
88
+ </div>
89
+ </header>
90
+
91
+ <div class="govuk-width-container govuk-body-m">
92
+ <main class="govuk-main-wrapper govuk-main-wrapper--auto-spacing" id="main-content" role="main">
93
+ <!-- This file lives in public/500.html -->
94
+ <h1>Sorry, there is a problem with this form</h1>
95
+ <p>Try again later.</p>
96
+ <p>If you were in the middle of completing the form, your data has not been saved.</p>
97
+ </main>
98
+ </div>
99
+ </body>
100
+ </html>
@@ -16,7 +16,7 @@
16
16
 
17
17
  <p class="mojf-settings-screen__description"><%= t('presenter.save_and_return.confirm_email.description') %></p>
18
18
 
19
- <%= f.govuk_submit t('presenter.save_and_return.show.continue') %><% end %> <%= link_to t('presenter.save_and_return.show.cancel'), :back %>
19
+ <%= f.govuk_submit t('presenter.save_and_return.show.continue') %><% end %> <%= link_to t('presenter.save_and_return.show.cancel'), page_slug, class: "govuk-button govuk-button--secondary" %>
20
20
  </div>
21
21
  </div>
22
22
  </div>
@@ -38,7 +38,7 @@
38
38
  %>
39
39
  </div>
40
40
 
41
- <%= f.govuk_submit t('presenter.save_and_return.show.continue') %><% end %> <%= link_to t('presenter.save_and_return.show.cancel'), :back %>
41
+ <%= f.govuk_submit t('presenter.save_and_return.show.continue') %><% end %> <%= link_to t('presenter.save_and_return.show.cancel'), page_slug, class: "govuk-button govuk-button--secondary" %>
42
42
  </div>
43
43
  </div>
44
44
  </div>
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '2.18'.freeze
2
+ VERSION = '2.18.2'.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: '2.18'
4
+ version: 2.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-06 00:00:00.000000000 Z
11
+ date: 2023-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder
@@ -326,6 +326,7 @@ files:
326
326
  - app/validators/metadata_presenter/word_count.rb
327
327
  - app/validators/saved_progress_validator.rb
328
328
  - app/views/errors/404.html
329
+ - app/views/errors/500.html
329
330
  - app/views/layouts/metadata_presenter/application.html.erb
330
331
  - app/views/metadata_presenter/analytics/_cookie_banner_confirmation.html.erb
331
332
  - app/views/metadata_presenter/analytics/_cookie_banner_request.html.erb