GithubHelp home page GithubHelp logo

sk-ys / redmine_issue_note_list Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 186 KB

This is a plugin for Redmine.

License: GNU General Public License v2.0

Ruby 29.21% HTML 21.69% CSS 29.37% JavaScript 19.74%

redmine_issue_note_list's People

Contributors

sk-ys avatar

Watchers

 avatar  avatar

redmine_issue_note_list's Issues

Incorrect item height

If there are too many columns in the issue to display, the item height is incorrect.

Failed to add note

F, [2023-10-20T08:02:35.659199 #2620] FATAL -- : [ade7b25a-1aff-4bce-8140-0db740f2dc91]   
[ade7b25a-1aff-4bce-8140-0db740f2dc91] ActionView::Template::Error (undefined method `updated_on' for #<Journal:0x00000272b1626e40>
Did you mean?  update):
[ade7b25a-1aff-4bce-8140-0db740f2dc91]     1: <% Rails.logger.info @issue.current_journal %>
[ade7b25a-1aff-4bce-8140-0db740f2dc91]     2: <% if !@saved || @issue.current_journal.updated_on.blank? %>
[ade7b25a-1aff-4bce-8140-0db740f2dc91]     3:   alert("<%= l(:issue_note_list_failed_to_add_note) %>");
[ade7b25a-1aff-4bce-8140-0db740f2dc91]     4: <% else %>
[ade7b25a-1aff-4bce-8140-0db740f2dc91]     5:   // replace form to view
[ade7b25a-1aff-4bce-8140-0db740f2dc91]   
[ade7b25a-1aff-4bce-8140-0db740f2dc91] plugins/redmine_issue_note_list/app/views/issue_notes/add_note.js.erb:2
[ade7b25a-1aff-4bce-8140-0db740f2dc91] plugins/redmine_issue_note_list/app/controllers/issue_notes_controller.rb:65:in `add_note'

Template missing when deleting notes

Error message:

Missing template, responding with 404: Missing partial issue_note_list/_update_issue_notes_row, application/_update_issue_notes_row with {:locale=>[:ja, :en], :formats=>[:js, :html, :text, :css, :ics, :csv, :vcf, :vtt, :png, :jpeg, :gif, :bmp, :tiff, :svg, :mpeg, :mp3, :ogg, :m4a, :webm, :mp4, :otf, :ttf, :woff, :woff2, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip, :gzip], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :rsb]}. Searched in:
  * "C:/Redmine/redmine/plugins/view_customize/app/views"
...

This is a mistake in #78.

Add note edit button

Edit date and editor cannot be updated with original edit button. So, need to consider measures.

Related source

JournalsHelper

https://github.com/redmine/redmine/blob/master/app/helpers/journals_helper.rb#L52-L59

      if journal.editable_by?(User.current) 
         links << link_to(l(:button_edit), 
                          edit_journal_path(journal), 
                          :remote => true, 
                          :method => 'get', 
                          :title => l(:button_edit), 
                          :class => 'icon-only icon-edit' 
                         )

JournalsController#Edit

https://github.com/redmine/redmine/blob/master/app/controllers/journals_controller.rb#L84-L90

  def edit 
     (render_403; return false) unless @journal.editable_by?(User.current) 
     respond_to do |format| 
       # TODO: implement non-JS journal update 
       format.js 
     end 
   end

Views/Journals/edit

https://github.com/redmine/redmine/blob/master/app/views/journals/edit.js.erb#L7

  $("#journal-<%= @journal.id %>-notes").after('<%= escape_javascript(render :partial => 'notes_form') %>');

Views/Journals/update

https://github.com/redmine/redmine/blob/master/app/views/journals/update.js.erb

Views/Journals/_note_form

https://github.com/redmine/redmine/blob/master/app/views/journals/_notes_form.html.erb

Support contextmenu

メモ

  • 右クリックイベントは画面内どこでも検知するが、target に .js-contextmenu があり、かつ上位要素の tr に .hascontextmenu が無いとコンテキストメニューは開かない

右クリックイベント処理箇所

https://github.com/redmine/redmine/blob/a519accb99ee8392ffaa6805cec37d7749b8b57d/public/javascripts/context_menu.js#L6

function contextMenuRightClick(event) {
  var target = $(event.target);
  if (target.is('a:not(.js-contextmenu)')) {return;}
  var tr = target.closest('.hascontextmenu').first();
  if (tr.length < 1) {return;}
  event.preventDefault();
  if (!contextMenuIsSelected(tr)) {
    contextMenuUnselectAll();
    contextMenuAddSelection(tr);
    contextMenuSetLastSelected(tr);
  }
  contextMenuShow(event);
}

コンテキストメニュー初期化箇所

https://github.com/redmine/redmine/blob/a519accb99ee8392ffaa6805cec37d7749b8b57d/public/javascripts/context_menu.js#L221

function contextMenuInit() {
  contextMenuCreate();
  contextMenuUnselectAll();
  
  if (!contextMenuObserving) {
    $(document).click(contextMenuClick);
    $(document).contextmenu(contextMenuRightClick);
    $(document).on('click', '.js-contextmenu', contextMenuRightClick);
    contextMenuObserving = true;
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.