Skip to content
This repository was archived by the owner on Apr 10, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Desktop.ini
# Application
.rvmrc
/tmp

# vsCode
.vscode
4 changes: 4 additions & 0 deletions app/views/imports/_add_issues_fields_mapping.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<p>
<label for="import_mapping_tags"><%= l(:field_tags) %></label>
<%= mapping_select_tag @import, 'tags' %>
</p>
1 change: 1 addition & 0 deletions lib/redmine_tags/hooks/views_issues_hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class ViewsIssuesHook < Redmine::Hook::ViewListener
render_on :view_issues_sidebar_planning_bottom, partial: 'issues/tags_sidebar'
render_on :view_issues_bulk_edit_details_bottom, partial: 'issues/bulk_edit_tags'
render_on :view_layouts_base_html_head, partial: 'tags/header_assets'
render_on :view_issues_fields_mapping_bottom, partial: 'imports/add_issues_fields_mapping'
end
end
end
31 changes: 31 additions & 0 deletions lib/redmine_tags/patches/issue_import_patch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module RedmineTags
module Patches
module IssueImportPatch
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
alias_method :extend_object_without_tags, :extend_object
alias_method :extend_object, :extend_object_with_tags
end
IssueImport::AUTO_MAPPABLE_FIELDS.store('tags', 'field_tags')
end

module InstanceMethods
def extend_object_with_tags(row, item, issue)
extend_object_without_tags(row, item, issue)

if tags = row_value(row, 'tags')
issue.tag_list = tags
issue.save_tags
end

issue
end
end
end
end
end

base = IssueImport
patch = RedmineTags::Patches::IssueImportPatch
base.send(:include, patch) unless base.included_modules.include?(patch)