Project

General

Profile

Defect #31010 ยป 31010.patch

Go MAEDA, 2024-02-05 08:26

View differences:

app/views/queries/_form.html.erb
12 12
<% if User.current.admin? ||
13 13
      User.current.allowed_to?(:manage_public_queries, @query.project) %>
14 14
<p><label><%=l(:field_visible)%></label>
15
  <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PRIVATE %> <%= l(:label_visibility_private) %></label>
15
  <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PRIVATE %> <%= controller.action_name == 'new' ? l(:label_visibility_me) : l(:label_visibility_private) %></label>
16 16
  <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PUBLIC %> <%= l(:label_visibility_public) %></label>
17 17
  <% unless @query.type == 'ProjectQuery' %>
18 18
    <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_ROLES %> <%= l(:label_visibility_roles) %>:</label>
config/locales/en.yml
1046 1046
  label_cross_project_hierarchy: With project hierarchy
1047 1047
  label_cross_project_system: With all projects
1048 1048
  label_gantt_progress_line: Progress line
1049
  label_visibility_private: to me only
1049
  label_visibility_private: to the author only
1050
  label_visibility_me: to me only
1050 1051
  label_visibility_roles: to these roles only
1051 1052
  label_visibility_public: to any users
1052 1053
  label_link: Link
test/functional/queries_controller_test.rb
48 48
      assert_select 'option[value=tracker]'
49 49
      assert_select 'option[value=subject]'
50 50
    end
51
    # Label for VISIBILITY_PRIVATE should be "to me only" for 'new' action,
52
    # but it should be "to the author only" for 'edit' action
53
    assert_select 'label', text: /to me only/
51 54
  end
52 55

  
53 56
  def test_new_global_query
......
619 622

  
620 623
    assert_select 'input[name=?][value="2"][checked=checked]', 'query[visibility]'
621 624
    assert_select 'input[name=query_is_for_all][type=checkbox][checked=checked]'
625
    assert_select 'label', text: /to the author only/
622 626
  end
623 627

  
624 628
  def test_edit_global_private_query
    (1-1/1)