From 608623e184f7ec4b6e2535afb597fc283dec10c4 Mon Sep 17 00:00:00 2001 From: ishikawa999 Date: Tue, 19 Dec 2023 00:29:40 +0000 Subject: [PATCH 1/2] Support Rails7.1 ( Fix name attribute ) --- app/helpers/custom_message_settings_helper.rb | 2 +- app/views/custom_message_settings/_messages.html.erb | 2 +- init.rb | 2 +- test/functional/custom_message_settings_controller_test.rb | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/helpers/custom_message_settings_helper.rb b/app/helpers/custom_message_settings_helper.rb index 326088c..3fab8dd 100644 --- a/app/helpers/custom_message_settings_helper.rb +++ b/app/helpers/custom_message_settings_helper.rb @@ -16,7 +16,7 @@ def normal_mode_input_fields(setting, lang) custom_messages_hash.each do |k, v| content += content_tag(:p) do content_tag(:label, k) + - text_field_tag("settings[custom_messages[#{k}]]", v.to_s) + + text_field_tag("settings[custom_messages][#{k}]", v.to_s) + link_to_function('', '$(this).closest("p").remove();', class: 'icon icon-del clear-key-link') end end diff --git a/app/views/custom_message_settings/_messages.html.erb b/app/views/custom_message_settings/_messages.html.erb index 3987440..d8486d4 100644 --- a/app/views/custom_message_settings/_messages.html.erb +++ b/app/views/custom_message_settings/_messages.html.erb @@ -40,7 +40,7 @@ function AddMessageInputField(key, val){ $('').attr({ type: 'text', value: val.replace(/.*: /, ''), - name: 'settings[custom_messages[' + key + ']]' + name: 'settings[custom_messages][' + key + ']' }).appendTo($('#edit-custom-messages .tabular p:first')); $('').attr({ class: 'icon icon-del clear-key-link', diff --git a/init.rb b/init.rb index 4064bc4..ccf72cc 100644 --- a/init.rb +++ b/init.rb @@ -6,7 +6,7 @@ p = Redmine::Plugin.register :redmine_message_customize do name 'Redmine message customize plugin' - version '0.1.8' + version '1.1.9' description 'This is a plugin that allows messages in Redmine to be overwritten from the admin view' author 'Far End Technologies Corporation' url 'https://github.com/farend/redmine_message_customize' diff --git a/test/functional/custom_message_settings_controller_test.rb b/test/functional/custom_message_settings_controller_test.rb index 2b54b6b..05c9e90 100644 --- a/test/functional/custom_message_settings_controller_test.rb +++ b/test/functional/custom_message_settings_controller_test.rb @@ -22,6 +22,7 @@ def test_edit assert_select 'a#tab-normal' assert_select 'a#tab-yaml' end + assert_select 'div#edit-custom-messages input[name=?]', 'settings[custom_messages][label_home]' end def test_edit_except_admin_user @request.session[:user_id] = 2 From d37a24e1d49f78210c50a3e7ee2fc10a1a102cbf Mon Sep 17 00:00:00 2001 From: ishikawa999 Date: Tue, 19 Dec 2023 01:22:09 +0000 Subject: [PATCH 2/2] Update version --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index ccf72cc..592fb2b 100644 --- a/init.rb +++ b/init.rb @@ -6,7 +6,7 @@ p = Redmine::Plugin.register :redmine_message_customize do name 'Redmine message customize plugin' - version '1.1.9' + version '0.1.9' description 'This is a plugin that allows messages in Redmine to be overwritten from the admin view' author 'Far End Technologies Corporation' url 'https://github.com/farend/redmine_message_customize'