Project

General

Profile

Feature #3143 » 3143.patch

Dmitry Makurin , 2023-01-11 13:38

View differences:

app/views/issues/_action_menu.html.erb
<div class="contextual">
<%= link_to l(:button_add_notes), edit_issue_path(@issue),
:onclick => 'showAndScrollToAddNotes(); return false;',
:class => 'icon icon-add' if @issue.editable? %>
<%= link_to l(:button_edit), edit_issue_path(@issue),
:onclick => 'showAndScrollTo("update", "issue_notes"); return false;',
:onclick => 'showAndScrollToEditIssue("update", "issue_notes"); return false;',
:class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %>
<%= link_to l(:button_log_time), new_issue_time_entry_path(@issue),
:class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %>
app/views/issues/_edit.html.erb
<%= render :partial => 'conflict' if @conflict %>
<div class="box">
<% if @issue.attributes_editable? %>
<fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend>
<fieldset id="attributes" class="tabular"><legend><%= l(:label_change_properties) %></legend>
<div id="all_attributes">
<%= render :partial => 'form', :locals => {:f => f} %>
</div>
config/locales/en.yml
button_edit: Edit
button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
button_add: Add
button_add_notes: Add notes
button_change: Change
button_apply: Apply
button_clear: Clear
public/javascripts/application.js
$('html, body').animate({scrollTop: $('#'+id).offset().top}, 100);
}
function showAndScrollToEditIssue() {
$('#update h3').show();
$('#attributes').show();
$('#log_time').show();
showAndScrollTo('update', 'issue_notes');
}
function showAndScrollToAddNotes() {
$('#update h3').hide();
$('#attributes').hide();
$('#log_time').hide();
showAndScrollTo('update', 'issue_notes');
}
function toggleRowGroup(el) {
var tr = $(el).parents('tr').first();
var n = tr.next();
test/system/add_notes_button_test.rb
# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2023 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require_relative '../application_system_test_case'
class AddNotesButtonTest < ApplicationSystemTestCase
fixtures :issues, :users, :projects, :members, :member_roles, :roles, :enumerations, :trackers, :projects_trackers,
:enabled_modules, :issue_statuses
def test_add_notes_button
log_user('jsmith', 'jsmith')
visit 'issues/1'
assert has_css? '.contextual .icon-edit'
# Hidden by default
assert has_css? '#update', visible: :hidden
first('.contextual .icon-add').click
# Issue attributes are hidden
assert has_css? '#update', visible: :visible
assert has_css? '#update h3', visible: :hidden
assert has_css? 'fieldset:has(#all_attributes)', visible: :hidden
assert has_css? '#update #log_time', visible: :hidden
# Notes form is visible
assert has_css? '#update #add_notes', visible: :visible
assert has_css? '#update #add_attachments', visible: :visible
first('.contextual .icon-edit').click
assert has_css? '#update', visible: :visible
assert has_css? '#update h3', visible: :visible
assert has_css? 'fieldset:has(#all_attributes)', visible: :visible
assert has_css? '#update #log_time', visible: :visible
end
end
(13-13/14)