metadata_presenter 2.17.40 → 2.17.42
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 +4 -4
- data/app/controllers/metadata_presenter/save_and_return_controller.rb +26 -0
- data/app/models/metadata_presenter/saved_form.rb +11 -0
- data/app/views/metadata_presenter/page/checkanswers.html.erb +1 -1
- data/app/views/metadata_presenter/page/content.html.erb +1 -1
- data/app/views/metadata_presenter/page/multiplequestions.html.erb +1 -1
- data/app/views/metadata_presenter/page/singlequestion.html.erb +1 -1
- data/app/views/metadata_presenter/save_and_return/show.html.erb +43 -0
- data/config/locales/en.yml +17 -1
- data/config/routes.rb +3 -0
- data/lib/metadata_presenter/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d097ef739287d7b20f2023cee3a56965d6e81ba28c54144162369f198ec0bd60
|
4
|
+
data.tar.gz: c383a7078042f8933c59d51965db8a09f8335d68971062b13fd9ad6b065a8973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4464292d0a45447d553ae22e7007c4a71bc164b6f96b9254d748b9468e343a4dca102cf214c51411343df9001e92991d5c2ceac8e1e926108abdbc4d4ac2f22
|
7
|
+
data.tar.gz: d56962d232025286f75935328178ad4a3b296742070033bc6f222ba52476ec15bea61211eaddf2dd395bdeb4d05e80a8f045e967c86b1ecb0e5b453b81a6b191
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module MetadataPresenter
|
2
|
+
class SaveAndReturnController < EngineController
|
3
|
+
before_action :check_feature_flag
|
4
|
+
helper_method :secret_questions
|
5
|
+
|
6
|
+
def show
|
7
|
+
@saved_form = SavedForm.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def create; end
|
11
|
+
|
12
|
+
def secret_questions
|
13
|
+
[
|
14
|
+
OpenStruct.new(id: 1, name: I18n.t('presenter.save_and_return.secret_questions.one')),
|
15
|
+
OpenStruct.new(id: 2, name: I18n.t('presenter.save_and_return.secret_questions.two')),
|
16
|
+
OpenStruct.new(id: 3, name: I18n.t('presenter.save_and_return.secret_questions.three'))
|
17
|
+
]
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def check_feature_flag
|
23
|
+
redirect_to '/' and return if ENV['SAVE_AND_RETURN'] != 'enabled'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -86,7 +86,7 @@
|
|
86
86
|
|
87
87
|
<button <%= 'disabled' if editable? %> data-prevent-double-click="true" class="fb-block fb-block-actions govuk-button" data-module="govuk-button" data-block-id="actions" data-block-type="actions">
|
88
88
|
<%= t('presenter.actions.submit') -%>
|
89
|
-
</button>
|
89
|
+
</button> <% if ENV['SAVE_AND_RETURN'] == 'enabled' %><a href="<%= save_path %>" class="govuk-button" data-module="govuk-button" data-component="save-button"><%= t('presenter.save_and_return.save') %></a><% end %>
|
90
90
|
<% end %>
|
91
91
|
|
92
92
|
</div>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
content_components: @page.supported_content_components
|
26
26
|
} %>
|
27
27
|
|
28
|
-
<%= f.govuk_submit(disabled: editable?) %>
|
28
|
+
<%= f.govuk_submit(disabled: editable?) %> <% if ENV['SAVE_AND_RETURN'] == 'enabled' %><a href="<%= save_path %>" class="govuk-button" data-module="govuk-button" data-component="save-button"><%= t('presenter.save_and_return.save') %></a><% end %>
|
29
29
|
<% end %>
|
30
30
|
</div>
|
31
31
|
</div>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
}
|
19
19
|
%>
|
20
20
|
|
21
|
-
<%= f.govuk_submit(disabled: editable?) %>
|
21
|
+
<%= f.govuk_submit(disabled: editable?) %> <% if ENV['SAVE_AND_RETURN'] == 'enabled' %><a href="<%= save_path %>" class="govuk-button" data-module="govuk-button" data-component="save-button"><%= t('presenter.save_and_return.save') %></a><% end %>
|
22
22
|
<% end %>
|
23
23
|
</div>
|
24
24
|
</div>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
</div>
|
21
21
|
<% end %>
|
22
22
|
|
23
|
-
<%= f.govuk_submit(disabled: editable?) %>
|
23
|
+
<%= f.govuk_submit(disabled: editable?) %> <% if ENV['SAVE_AND_RETURN'] == 'enabled' %><a href="<%= save_path %>" class="govuk-button" data-module="govuk-button" data-component="save-button"><%= t('presenter.save_and_return.save') %></a><% end %>
|
24
24
|
<% end %>
|
25
25
|
</div>
|
26
26
|
</div>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div class="fb-main-grid-wrapper">
|
2
|
+
<div class="govuk-grid-row">
|
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
|
+
<%= form_for @saved_form do |f| %>
|
8
|
+
<%= f.govuk_error_summary %>
|
9
|
+
<div class="govuk-form-group">
|
10
|
+
<%=
|
11
|
+
f.govuk_email_field :email,
|
12
|
+
label: { text: t('presenter.save_and_return.show.email') },
|
13
|
+
hint: {
|
14
|
+
data: { "fb-default-text" => default_text('hint') },
|
15
|
+
text: t('presenter.save_and_return.show.email_hint')
|
16
|
+
},
|
17
|
+
name: "email",
|
18
|
+
spellcheck: "false",
|
19
|
+
autocomplete: "email"
|
20
|
+
%>
|
21
|
+
<%=
|
22
|
+
f.govuk_collection_radio_buttons :secret_question,
|
23
|
+
secret_questions,
|
24
|
+
:id,
|
25
|
+
:name,
|
26
|
+
legend: { text: t('presenter.save_and_return.show.secret_question') },
|
27
|
+
hint: {
|
28
|
+
data: { "fb-default-text" => default_text('hint') },
|
29
|
+
text: t('presenter.save_and_return.show.secret_question_hint')
|
30
|
+
},
|
31
|
+
bold_labels: false
|
32
|
+
%>
|
33
|
+
<%=
|
34
|
+
f.govuk_text_field :secret_answer,
|
35
|
+
label: { text: t('presenter.save_and_return.show.secret_answer') },
|
36
|
+
name: "secret_answer"
|
37
|
+
%>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<%= f.govuk_submit t('presenter.save_and_return.show.continue') %><% end %> <%= link_to t('presenter.save_and_return.show.cancel'), :back %>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
data/config/locales/en.yml
CHANGED
@@ -36,10 +36,26 @@ en:
|
|
36
36
|
payment_enabled: You still need to pay
|
37
37
|
continue_to_pay_button: Continue to pay
|
38
38
|
application_complete: 'Application complete'
|
39
|
+
save_and_return:
|
40
|
+
save: 'Save for later'
|
41
|
+
show:
|
42
|
+
heading: 'Save for later'
|
43
|
+
description: 'We will send you a one-off link that you can use to resume this form within 28 days.'
|
44
|
+
email: 'Email address'
|
45
|
+
email_hint: 'Where we will send the link'
|
46
|
+
secret_question: 'Pick a security question'
|
47
|
+
secret_question_hint: 'We will use this to verify your identity when you return'
|
48
|
+
secret_answer: 'The answer to your security question'
|
49
|
+
continue: 'Continue with saving'
|
50
|
+
cancel: 'Cancel saving and resume form'
|
51
|
+
secret_questions:
|
52
|
+
one: "What is your mother's maiden name?"
|
53
|
+
two: 'What is the last name of your favourite teacher?'
|
54
|
+
three: 'What is the name of the hospital where you were born?'
|
39
55
|
footer:
|
40
56
|
cookies:
|
41
57
|
heading: "Cookies"
|
42
|
-
body: "This form saves small files (known as 'cookies') onto your device.\r\n \r\nCookies are used to:\r\n \r\n* remember your progress\r\n* measure how you use the form so it can be updated and improved based on your needs\r\n \r\nThese cookies are not used to identify you personally.\r\n \r\nYou will normally see a message on the form before we store a cookie on your computer. Essential cookies are necessary for the form to work but you can still complete the form if you choose not to accept analytics cookies.\r\n \r\nFind out more about [how to manage cookies](https://www.aboutcookies.org/).\r\n \r\n## Essential cookies\r\n \r\nEssential cookies are required to make this form work and keep your information secure while you use it.\r\n \r\nWe use the following essential cookies: \r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_fb\\_runner\\_session | Saves your current progress on this computer and tracks inactivity periods | After
|
58
|
+
body: "This form saves small files (known as 'cookies') onto your device.\r\n \r\nCookies are used to:\r\n \r\n* remember your progress\r\n* measure how you use the form so it can be updated and improved based on your needs\r\n \r\nThese cookies are not used to identify you personally.\r\n \r\nYou will normally see a message on the form before we store a cookie on your computer. Essential cookies are necessary for the form to work but you can still complete the form if you choose not to accept analytics cookies.\r\n \r\nFind out more about [how to manage cookies](https://www.aboutcookies.org/).\r\n \r\n## Essential cookies\r\n \r\nEssential cookies are required to make this form work and keep your information secure while you use it.\r\n \r\nWe use the following essential cookies: \r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_fb\\_runner\\_session | Saves your current progress on this computer and tracks inactivity periods | After 30 minutes of inactivity or when you close your browser |\r\n| analytics | Remembers whether you accept or reject analytics cookies on this form | After 1 year |\r\n \r\n## Analytics cookies\r\n \r\nAnalytics cookies collect information about how you use this form. This helps us make sure the form is meeting the needs of its users and to help us make improvements.\r\n \r\nWe use Google Analytics to learn about:\r\n \r\n* the pages you visit\r\n* how long you spend on each page\r\n* how you got to the form\r\n* what you click on while you are using the form\r\n \r\nWe do not collect or store your personal information (for example your name or address) so this information can't be used to identify who you are. We do not allow third parties to use or share our analytics data.\r\n \r\nThis form may use different versions of Google Analytics and could save some or all of the following cookies:\r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_ga | Helps us count how many people visit this form | 2 years |\r\n| \\_gid | Helps us count how many people visit this form | 1 day |\r\n| \\_ga\\_\\<container-id> | Used to persist session state | 2 years |\r\n| \\_gac\\_gb\\_\\<container-id> | Contains campaign-related information | 90 days |\r\n| \\_gat | Used to throttle request rate | 1 minute |\r\n| \\_dc\\_gtm\\_\\<property-id>| Used to throttle request rate | 1 minute |\r\n| AMP\\_TOKEN | Contains a token that can be used to retrieve a Client ID from AMP Client ID service | 30 seconds to 1 year |\r\n| \\_gac\\_\\<property-id> | Contains campaign related information | 90 days |\r\n \r\nYou can use a browser addon to [opt out of Google Analytics cookies](https://tools.google.com/dlpage/gaoptout) on all websites."
|
43
59
|
url: 'cookies'
|
44
60
|
privacy:
|
45
61
|
heading: "Privacy notice"
|
data/config/routes.rb
CHANGED
@@ -10,6 +10,9 @@ MetadataPresenter::Engine.routes.draw do
|
|
10
10
|
|
11
11
|
get 'session/expired', to: 'session#expired'
|
12
12
|
|
13
|
+
get 'save', to: 'save_and_return#show'
|
14
|
+
post 'saved_forms', to: 'save_and_return#create'
|
15
|
+
|
13
16
|
post '/', to: 'answers#create'
|
14
17
|
match '*path', to: 'answers#create', via: :post
|
15
18
|
match '*path', to: 'pages#show',
|
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.17.
|
4
|
+
version: 2.17.42
|
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-03-
|
11
|
+
date: 2023-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_design_system_formbuilder
|
@@ -257,6 +257,7 @@ files:
|
|
257
257
|
- app/controllers/metadata_presenter/engine_controller.rb
|
258
258
|
- app/controllers/metadata_presenter/file_controller.rb
|
259
259
|
- app/controllers/metadata_presenter/pages_controller.rb
|
260
|
+
- app/controllers/metadata_presenter/save_and_return_controller.rb
|
260
261
|
- app/controllers/metadata_presenter/service_controller.rb
|
261
262
|
- app/controllers/metadata_presenter/session_controller.rb
|
262
263
|
- app/controllers/metadata_presenter/submissions_controller.rb
|
@@ -287,6 +288,7 @@ files:
|
|
287
288
|
- app/models/metadata_presenter/previous_page.rb
|
288
289
|
- app/models/metadata_presenter/route.rb
|
289
290
|
- app/models/metadata_presenter/row_number.rb
|
291
|
+
- app/models/metadata_presenter/saved_form.rb
|
290
292
|
- app/models/metadata_presenter/service.rb
|
291
293
|
- app/models/metadata_presenter/traversed_pages.rb
|
292
294
|
- app/models/metadata_presenter/uploaded_file.rb
|
@@ -357,6 +359,7 @@ files:
|
|
357
359
|
- app/views/metadata_presenter/page/singlequestion.html.erb
|
358
360
|
- app/views/metadata_presenter/page/standalone.html.erb
|
359
361
|
- app/views/metadata_presenter/page/start.html.erb
|
362
|
+
- app/views/metadata_presenter/save_and_return/show.html.erb
|
360
363
|
- app/views/metadata_presenter/session/_timeout_fallback.html.erb
|
361
364
|
- app/views/metadata_presenter/session/_timeout_warning_modal.html.erb
|
362
365
|
- app/views/metadata_presenter/session/expired.html.erb
|