Merge branch 'release/10.5' into dev

pull/8317/head
ulferts 5 years ago
commit 58279e1592
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 2
      app/models/project.rb
  2. 5
      config/constants/api_patch_registry.rb
  3. 2
      config/locales/crowdin/js-sl.yml
  4. 12
      lib/open_project/plugins/acts_as_op_engine.rb
  5. 2
      modules/xls_export/lib/open_project/xls_export/spreadsheet_builder.rb
  6. 18
      modules/xls_export/spec/models/xls_export/work_package/exporter/xls_integration_spec.rb

@ -35,7 +35,7 @@ class Project < ApplicationRecord
include Projects::Copy
include Projects::Storage
include Projects::Activity
include Scopes::Scoped
include ::Scopes::Scoped
# Maximum length for project identifiers
IDENTIFIER_MAX_LENGTH = 100

@ -34,6 +34,11 @@ module Constants
patch_map = patch_maps_by_class[class_name]
path = ":#{path}" if path.is_a?(Symbol)
if Object.const_defined?(class_name)
raise "Adding patch #{block} to #{class_name} after it is already loaded has no effect."
end
patch_map[path] = [] unless patch_map[path]
patch_map[path] << block
end

@ -463,7 +463,7 @@ sl:
task_board_select: '... in izberite <b>Tabela nalog</b> zapis.'
task_board: "The <b>Task board</b> visualizes the progress for this sprint. Add new tasks or impediments with the + icon next to a user story. Via drag'n'drop you can update the status."
boards:
overview: 'Manage your work within an intuitive <b>Boards</b> view.'
overview: 'Organiziraj svoje delo z intuitivnim <b>Board</b> pogledom.'
lists: 'You can create multiple lists (columns) within one Board view, e.g. to create a KANBAN board.'
add: 'Klik na + bo <b>dodal novo kartico</b> na seznam v vaš Board.'
drag: 'Drag & Drop your cards within a list to re-order, or to another list. A double click will open the details view.'

@ -226,13 +226,11 @@ module OpenProject::Plugins
end
def add_api_endpoint(base_endpoint, path = nil, &block)
config.to_prepare do
# we are expecting the base_endpoint as string for two reasons:
# 1. it does not seem possible to pass it as constant (auto loader not ready yet)
# 2. we can't constantize it here, because that would evaluate
# the API before it can be patched
::Constants::APIPatchRegistry.add_patch base_endpoint, path, &block
end
# we are expecting the base_endpoint as string for two reasons:
# 1. it does not seem possible to pass it as constant (auto loader not ready yet)
# 2. we can't constantize it here, because that would evaluate
# the API before it can be patched
::Constants::APIPatchRegistry.add_patch base_endpoint, path, &block
end
def extend_api_response(*args, &block)

@ -142,7 +142,7 @@ module OpenProject::XlsExport
elsif c.class == BigDecimal
c.to_f
else
c.to_s.gsub('_', ' ').gsub("\r\n", "\n").gsub("\r", "\n")
c.to_s.gsub("\r\n", "\n").gsub("\r", "\n")
end
column_array << value
@column_widths[i] = 0 if @column_widths[i].nil?

@ -285,6 +285,24 @@ describe XlsExport::WorkPackage::Exporter::XLS do
end
end
context 'with underscore in subject' do
let(:work_package) do
FactoryBot.create(:work_package,
subject: 'underscore_is included',
project: project,
type: project.types.first)
end
let(:work_packages) { [work_package] }
let(:column_names) { %w[id subject] }
it 'includes the underscore' do
expect(sheet.rows.size).to eq(1 + 1)
expect(sheet.rows[1][1])
.to eql(work_package.subject)
end
end
describe 'empty result' do
let(:work_packages) { [] }

Loading…
Cancel
Save