File tree Expand file tree Collapse file tree 10 files changed +23
-23
lines changed
input_objects/pages/selection
input_objects/pages/selection Expand file tree Collapse file tree 10 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ class Pages::Selection::BaseOptionsInput < BaseInput
22 include LoggingHelper
33
44 INCLUDE_NONE_OF_THE_ABOVE_OPTIONS = %w[ yes yes_with_question no ] . freeze
5- MAXIMUM_CHOOSE_ONLY_ONE_OPTION = 1000
5+ MAXIMUM_CHOOSE_ONLY_ONE_OPTION = 3000
66 MAXIMUM_CHOOSE_MORE_THAN_ONE_OPTION = 30
77
88 attr_accessor :include_none_of_the_above , :draft_question
Original file line number Diff line number Diff line change 1313 <% if @bulk_options_input . only_one_option? %>
1414 < p > <%= t ( "bulk_options.select_one_option" ) %> </ p >
1515 < p > <%= t ( "bulk_options.longer_than_30_options" ) %> </ p >
16- < p > <%= t ( "bulk_options.up_to_1000_options " ) %> </ p >
16+ < p > <%= t ( "bulk_options.up_to_3000_options " ) %> </ p >
1717 <% else %>
1818 < p > <%= t ( "bulk_options.select_more_than_one_option" ) %> </ p >
1919 < p > <%= t ( "bulk_options.up_to_30_options" ) %> </ p >
Original file line number Diff line number Diff line change 1919 < div class ="govuk-!-margin-bottom-8 ">
2020 <% if @selection_options_input . only_one_option? %>
2121 < p > <%= t ( "selection_options.select_one_option" ) %> </ p >
22- < p > <%= t ( "selection_options.up_to_1000_options " ) %> </ p >
22+ < p > <%= t ( "selection_options.up_to_3000_options " ) %> </ p >
2323 <% else %>
2424 < p > <%= t ( "selection_options.select_more_than_one_option" ) %> </ p >
2525 < p > <%= t ( "selection_options.up_to_30_options" ) %> </ p >
Original file line number Diff line number Diff line change 246246 longer_than_30_options : If your list is longer than 30 options, people will be able to search and find the options by typing into an autocomplete box.
247247 select_more_than_one_option : People will be able to select one or more options from your list.
248248 select_one_option : People will be able to select one option from your list.
249- up_to_1000_options : You can have up to 1 ,000 options.
249+ up_to_3000_options : You can have up to 3 ,000 options.
250250 up_to_30_options : You can have up to 30 options.
251251 cancel : Cancel
252252 contact_details :
834834 pages_selection_type_input :
835835 only_one_option_options :
836836 ' false ' : Your list can have up to 30 options
837- ' true ' : Your list can have up to 1 ,000 options
837+ ' true ' : Your list can have up to 3 ,000 options
838838 label :
839839 account_name_input :
840840 name : Enter your full name
@@ -1808,7 +1808,7 @@ en:
18081808 remove_html : Remove <span class="govuk-visually-hidden">option %{option_number}</span>
18091809 select_more_than_one_option : People will be able to select one or more options from your list.
18101810 select_one_option : People will be able to select one option from your list.
1811- up_to_1000_options : You can have up to 1 ,000 options.
1811+ up_to_3000_options : You can have up to 3 ,000 options.
18121812 up_to_30_options : You can have up to 30 options.
18131813 selection_type :
18141814 reduce_your_options_warning :
Original file line number Diff line number Diff line change 77 attributes :
88 bulk_selection_options :
99 maximum_choose_more_than_one_option : You cannot have more than 30 options
10- maximum_choose_only_one_option : You cannot have more than 1 ,000 options
10+ maximum_choose_only_one_option : You cannot have more than 3 ,000 options
1111 minimum : Enter at least 2 options
1212 uniqueness : All your options must be unique. ‘%{duplicate}’ currently appears in your list more than once.
1313 include_none_of_the_above :
Original file line number Diff line number Diff line change 1010 selection_options :
1111 blank : Add text for all of your options
1212 maximum_choose_more_than_one_option : You cannot have more than 30 options
13- maximum_choose_only_one_option : You cannot have more than 1 ,000 options
13+ maximum_choose_only_one_option : You cannot have more than 3 ,000 options
1414 minimum : Enter at least 2 options
1515 uniqueness : All your options must be unique
Original file line number Diff line number Diff line change 2626 context "when only_one_option is true for the draft_question" do
2727 let ( :only_one_option ) { "true" }
2828
29- it "is valid if there are between 2 and 1000 unique selection values" do
29+ it "is valid if there are between 2 and 3000 unique selection values" do
3030 input . bulk_selection_options = ( 1 ..2 ) . to_a . join ( "\n " )
3131
3232 expect ( input ) . to be_valid
3333 expect ( input . errors . full_messages_for ( :bulk_selection_options ) ) . to be_empty
3434
35- input . bulk_selection_options = ( 1 ..1000 ) . to_a . join ( "\n " )
35+ input . bulk_selection_options = ( 1 ..3000 ) . to_a . join ( "\n " )
3636
3737 expect ( input ) . to be_valid
3838 expect ( input . errors . full_messages_for ( :bulk_selection_options ) ) . to be_empty
3939 end
4040
41- it "is invalid if more than 1000 Bulk selection options are provided" do
42- input . bulk_selection_options = ( 1 ..1001 ) . to_a . join ( "\n " )
41+ it "is invalid if more than 3000 Bulk selection options are provided" do
42+ input . bulk_selection_options = ( 1 ..3001 ) . to_a . join ( "\n " )
4343 error_message = I18n . t ( "activemodel.errors.models.pages/selection/bulk_options_input.attributes.bulk_selection_options.maximum_choose_only_one_option" )
4444 expect ( input ) . not_to be_valid
4545
Original file line number Diff line number Diff line change 6666 end
6767
6868 context "when only_one_option is true for the draft_question" do
69- it "is invalid if more than 1000 selection options are provided" do
70- input . selection_options = ( 1 ..1001 ) . to_a . map { |i | OpenStruct . new ( name : i . to_s ) }
69+ it "is invalid if more than 3000 selection options are provided" do
70+ input . selection_options = ( 1 ..3001 ) . to_a . map { |i | OpenStruct . new ( name : i . to_s ) }
7171 error_message = I18n . t ( "activemodel.errors.models.pages/selection/options_input.attributes.selection_options.maximum_choose_only_one_option" )
7272 expect ( input ) . not_to be_valid
7373
7474 expect ( input . errors . full_messages_for ( :selection_options ) ) . to include ( "Selection options #{ error_message } " )
7575 end
7676
77- it "is valid if there are 1000 unique selection values" do
78- input . selection_options = ( 1 ..1000 ) . to_a . map { |i | { name : i . to_s } }
77+ it "is valid if there are 3000 unique selection values" do
78+ input . selection_options = ( 1 ..3000 ) . to_a . map { |i | { name : i . to_s } }
7979
8080 expect ( input ) . to be_valid
8181 end
Original file line number Diff line number Diff line change 2323 context "when only_one_option is true" do
2424 let ( :only_one_option ) { "true" }
2525
26- it { expect ( input . maximum_options ) . to eq 1000 }
26+ it { expect ( input . maximum_options ) . to eq 3000 }
2727 end
2828
2929 context "when only_one_option is false" do
Original file line number Diff line number Diff line change 6060 expect ( rendered ) . not_to have_text ( "You can add up to" )
6161 end
6262
63- context "when there are fewer than 1000 options" do
64- let ( :selection_options ) { ( 1 ..999 ) . to_a . map { |i | OpenStruct . new ( name : i . to_s ) } }
63+ context "when there are fewer than 3000 options" do
64+ let ( :selection_options ) { ( 1 ..2999 ) . to_a . map { |i | OpenStruct . new ( name : i . to_s ) } }
6565
6666 it "has an add another button" do
6767 expect ( rendered ) . to have_button ( I18n . t ( "selection_options.add_another" ) )
6868 end
6969
7070 it "does not have inset text stating you cannot add more options" do
71- expect ( rendered ) . not_to have_css ( ".govuk-inset-text" , text : "You cannot add any more options as you have reached the maximum of 1000 options." )
71+ expect ( rendered ) . not_to have_css ( ".govuk-inset-text" , text : "You cannot add any more options as you have reached the maximum of 3000 options." )
7272 end
7373 end
7474
75- context "when there are 1000 options" do
76- let ( :selection_options ) { ( 1 ..1000 ) . to_a . map { |i | OpenStruct . new ( name : i . to_s ) } }
75+ context "when there are 3000 options" do
76+ let ( :selection_options ) { ( 1 ..3000 ) . to_a . map { |i | OpenStruct . new ( name : i . to_s ) } }
7777
7878 it "does not have an add another button" do
7979 expect ( rendered ) . not_to have_button ( I18n . t ( "selection_options.add_another" ) )
8080 end
8181
8282 it "has inset text stating you cannot add more options" do
83- expect ( rendered ) . to have_css ( ".govuk-inset-text" , text : "You cannot add any more options as you have reached the maximum of 1000 options." )
83+ expect ( rendered ) . to have_css ( ".govuk-inset-text" , text : "You cannot add any more options as you have reached the maximum of 3000 options." )
8484 end
8585 end
8686 end
You can’t perform that action at this time.
0 commit comments