Project

General

Profile

Feature #29712 » feature-29712-v2.patch

Mizuki ISHIKAWA, 2018-10-11 06:31

View differences:

lib/redmine/field_format.rb
415 415
      end
416 416

  
417 417
      def edit_tag(view, tag_id, tag_name, custom_value, options={})
418
        view.text_area_tag(tag_name, custom_value.value, options.merge(:id => tag_id, :rows => 8))
418
        if custom_value.custom_field.type == "IssueCustomField" && custom_value.custom_field.full_width_layout? && custom_value.custom_field.text_formatting == 'full'
419
          content = view.content_tag 'span', :id => "#{tag_id}_and_toolbar" do
420
            view.text_area_tag(tag_name, custom_value.value,
421
                              options.merge(:id => tag_id,
422
                                            :rows => 8,
423
                                            :cols => 60,
424
                                            :class => 'wiki-edit'
425
                                            ))
426
          end
427
          content += view.wikitoolbar_for(tag_id, view.preview_issue_url(:project_id => custom_value.customized.project, :issue_id => custom_value.customized.id))
428
        else
429
          view.text_area_tag(tag_name, custom_value.value, options.merge(:id => tag_id, :rows => 8))
430
        end
419 431
      end
420 432

  
421 433
      def bulk_edit_tag(view, tag_id, tag_name, custom_field, objects, value, options={})
test/functional/issues_controller_test.rb
2819 2819
    assert_select 'option', text: /#{t.name}/, count: 0
2820 2820
  end
2821 2821

  
2822
  def test_new_should_have_wikitoolbar_if_full_width_layout
2823
    @request.session[:user_id] = 2
2824
    field = IssueCustomField.create!(:name => 'Long text', :field_format => 'text', :full_width_layout => '1', :text_formatting => 'full', :is_for_all => true, :tracker_ids => [1])
2825

  
2826
    get :new, :params => {
2827
      :project_id => 1
2828
    }
2829
    assert_select "span#issue_custom_field_values_#{field.id}_and_toolbar" do
2830
      assert_select "textarea[name='issue[custom_field_values][#{field.id}]']"
2831
    end
2832
  end
2833

  
2822 2834
  def test_update_form_for_new_issue
2823 2835
    @request.session[:user_id] = 2
2824 2836
    post :new, :params => {
(2-2/5)