Merge pull request #9833 from opf/fix/project-export

Minor fixes to the project export
pull/9836/head
Henriette Darge 3 years ago committed by GitHub
commit 8b5ab29a95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/models/exports/concerns/csv.rb
  2. 52
      app/views/projects/index.html.erb
  3. 8
      spec/features/projects/export_spec.rb

@ -86,7 +86,7 @@ module Exports
def csv_export_filename
sane_filename(
"#{Setting.app_title} #{title} \
#{format_time_as_date(Time.zone.now, '%Y-%m-%d')}.xls"
#{format_time_as_date(Time.zone.now, '%Y-%m-%d')}.csv"
)
end
end

@ -64,34 +64,34 @@ See COPYRIGHT and LICENSE files for more details.
<%= op_icon("button--icon icon-external-link") %>
<% end %>
</li>
<% if current_user.admin? %>
<li class="toolbar-item drop-down">
<a
href="#"
aria-haspopup="true"
title="<%= t(:label_more) %>"
class="button"
data-qa-selector="project-more-dropdown-menu"
>
<%= op_icon('button--icon icon-show-more') %>
</a>
<ul style="display:none;" class="menu-drop-down-container">
<li class="toolbar-item drop-down">
<a
href="#"
aria-haspopup="true"
title="<%= t(:label_more) %>"
class="button"
data-qa-selector="project-more-dropdown-menu"
>
<%= op_icon('button--icon icon-show-more') %>
</a>
<ul style="display:none;" class="menu-drop-down-container">
<% if current_user.admin? %>
<li>
<%= link_to t('button_configure'), admin_settings_projects_path, target: '_blank', class: 'icon-context icon-settings' %>
</li>
<% end %>
<section data-augmented-model-wrapper
data-modal-class-name="project-export---modal">
<li>
<%= link_to t('button_configure'), admin_settings_projects_path, target: '_blank', class: 'icon-context icon-settings' %>
<%= link_to I18n.t('js.label_export'),
'',
title: I18n.t('js.label_export'),
class: 'modal-delivery-element--activation-link icon-context icon-export' %>
</li>
<section data-augmented-model-wrapper
data-modal-class-name="project-export---modal">
<li>
<%= link_to I18n.t('js.label_export'),
'',
title: I18n.t('js.label_export'),
class: 'modal-delivery-element--activation-link icon-context icon-export' %>
</li>
<%= render partial: 'project_export_modal' %>
</section>
</ul>
</li>
<% end %>
<%= render partial: 'project_export_modal' %>
</section>
</ul>
</li>
<% end %>
<%= render partial: 'projects/filters/form', locals: { query: @query } %>

@ -32,11 +32,15 @@ require 'features/work_packages/work_packages_page'
describe 'project export', type: :feature, js: true do
shared_let(:important_project) { FactoryBot.create :project, name: 'Important schedule plan' }
shared_let(:party_project) { FactoryBot.create :project, name: 'Christmas party' }
shared_let(:admin) { FactoryBot.create :admin }
shared_let(:user) do
FactoryBot.create :user,
member_in_projects: [important_project, party_project],
member_with_permissions: %w[view_project edit_project view_work_packages]
end
let(:index_page) { ::Pages::Projects::Index.new }
let(:current_user) { admin }
let(:current_user) { user }
before do
@download_list = DownloadList.new

Loading…
Cancel
Save