Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#48274] Work packages export modal with settings & Job status modal #16364

Merged
merged 90 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
cde8111
[#48274] Work packages export modal with settings
as-op Jul 31, 2024
209c131
obey rubocop
as-op Aug 7, 2024
e4f3247
remove unused code
as-op Aug 7, 2024
9c2fb38
do not overwrite rails before_action callbacks
as-op Aug 8, 2024
c58a4b9
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
as-op Aug 8, 2024
0a0ab1c
use I18n, start adjusting dialog spec, start deconstructing angular d…
as-op Aug 8, 2024
03e3492
remove unused import
as-op Aug 12, 2024
2a0f074
remove mismatched require
as-op Aug 12, 2024
a1508b9
use full written boolean "true" as parameter
as-op Aug 12, 2024
94cce56
obey eslint
as-op Aug 12, 2024
db87b6c
obey eslint
as-op Aug 12, 2024
661f295
obey eslint
as-op Aug 12, 2024
8d3b3f0
loop through query options without UI
as-op Aug 12, 2024
d01f37d
obey rubocop
as-op Aug 12, 2024
03c4ee4
obey eslint
as-op Aug 12, 2024
fa76ee0
obey eslint
as-op Aug 12, 2024
c836b72
moved csv tests from export_spec
as-op Aug 12, 2024
ce1f1e5
obey rubocop
as-op Aug 12, 2024
ccd9858
fix spec sorting
as-op Aug 12, 2024
b74d355
add gantt export route
as-op Aug 13, 2024
6803558
fix flickering spec by stable sorting
as-op Aug 13, 2024
ad88b1c
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
as-op Aug 13, 2024
91535d9
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
as-op Aug 13, 2024
30f0cbc
remove usage of BIM bcf download of the angular export form
as-op Aug 13, 2024
2255176
Remove angular export form
as-op Aug 13, 2024
c8eb1ba
obey eslint
as-op Aug 13, 2024
4e12b47
remove unused code
as-op Aug 13, 2024
e3eb6d9
set paddings from figma
as-op Aug 13, 2024
eb4c437
Enterprise diamond icon in disabled gantt option (workaround for not …
as-op Aug 13, 2024
1025711
add optional inputCaption below autocompleter input
as-op Aug 13, 2024
d9ba709
split export dialog pdf settings to enable independent values
as-op Aug 13, 2024
dcf48f4
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
as-op Aug 13, 2024
7b723f6
obey eslint
as-op Aug 13, 2024
d1477c7
dom node ids configurable
as-op Aug 14, 2024
a482270
use individual ids in angular component
as-op Aug 14, 2024
7e6e898
show descriptions option to dialog settings for xls
as-op Aug 14, 2024
fda4cfe
Merge branch 'refs/heads/dev' into feature/48274-work-packages-export…
as-op Aug 14, 2024
bc5d3a9
add select & reorder component for long text fields in PDF report
as-op Aug 14, 2024
b699fec
pdf report engine: add tests for long text custom fields
as-op Aug 15, 2024
52c4a8c
pdf report engine: show long text custom fields by parameter setting
as-op Aug 15, 2024
e6a4b67
pdf report engine: restore single wp export behaviour
as-op Aug 15, 2024
a2ed636
fix incomplete spec
as-op Aug 15, 2024
f7e41ec
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
as-op Aug 15, 2024
e12a8f3
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
as-op Aug 19, 2024
8ef1a0c
more flexible boolean parameter parsing
as-op Aug 19, 2024
2272e9a
remove enterprise icon css workaround; instead concat icon to label
as-op Aug 19, 2024
9b31c03
add primer/turbo job status modal dialog
as-op Aug 20, 2024
2d1e11e
replace hr tags with Primer wrappers
as-op Aug 20, 2024
6483cce
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
as-op Aug 20, 2024
b7e5462
implement other background job use cases
as-op Aug 20, 2024
20fb30e
obey eslint
as-op Aug 20, 2024
580350f
obey eslint
as-op Aug 20, 2024
1e92544
remove angular job status modal
as-op Aug 20, 2024
149ad49
obey eslint
as-op Aug 20, 2024
1480a92
fix specs; refactor modal body getters
as-op Aug 21, 2024
1a63fff
fix specs
as-op Aug 21, 2024
fdffe85
refactor body content into Blankslate
as-op Aug 21, 2024
7059f42
move i18n
as-op Aug 21, 2024
ec833a4
change I18n values to the values used in the Figma template
as-op Aug 21, 2024
c075a6e
fix expected strings in specs
as-op Aug 21, 2024
d910d66
add mime type for download, so PDF can be handled differently
as-op Aug 21, 2024
5273b5f
remove debug fragment
as-op Aug 21, 2024
e6a835e
add missing changes
as-op Aug 21, 2024
de10091
wait for a job to appear
as-op Aug 21, 2024
14538ed
prioritize job.message
as-op Aug 21, 2024
fae553a
do not open redirects in new tab
as-op Aug 21, 2024
0eeb5a9
show icon only without EEE token; resolves https://github.com/opf/ope…
as-op Aug 22, 2024
bc8e4c8
show the specified icons, use color role constants
as-op Aug 22, 2024
c4c6413
sync text with Figma
as-op Aug 22, 2024
d482c5b
remove not needed and not working spacing; resolves https://github.co…
as-op Aug 22, 2024
8e7a9ce
add OpenProject::Common::DividerComponent; resolves https://github.co…
as-op Aug 22, 2024
b7c6d4b
silence rubocop
as-op Aug 22, 2024
fde8c54
show "job not found error" the same way as other errors; resolves htt…
as-op Aug 22, 2024
69af0d8
show close button in non-pending states; resolves https://github.com/…
as-op Aug 22, 2024
31e2fc2
fix spec
as-op Aug 22, 2024
9aa7c86
loading indicator css animation is restarted on turbo frame reload. M…
as-op Aug 22, 2024
2462ee6
stop polling and progress if job not found
as-op Aug 22, 2024
84a5b51
implement error handling for job status dialog calling
as-op Aug 22, 2024
d3b0437
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
as-op Aug 22, 2024
a33ce8e
obey eslint
as-op Aug 22, 2024
0509a2c
obey eslint
as-op Aug 22, 2024
1adff15
Change color of normal `hr` separators
HDinger Aug 23, 2024
df8d63d
Merge branch 'dev' into feature/48274-work-packages-export-modal-with…
as-op Aug 26, 2024
905b041
fix listing not allowed columns in query
as-op Aug 26, 2024
b7086d6
fix(angular): missing refactoring for removing static dragula area name
as-op Aug 26, 2024
cf07948
consistent route pattern; resolves review: https://github.com/opf/ope…
as-op Aug 26, 2024
0963c52
move style into sass; resolves review: https://github.com/opf/openpro…
as-op Aug 26, 2024
5d1637f
loading indicator as stimulus target; resolves review: https://github…
as-op Aug 26, 2024
9d58ad5
obey eslint
as-op Aug 26, 2024
f0ab7e6
consistent route pattern; add missing change to angular helper
as-op Aug 26, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2010-2024 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# 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.
#
# See COPYRIGHT and LICENSE files for more details.
# ++

module WorkPackages
module Exports
class BaseExportSettingsComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable
include WorkPackagesHelper

attr_reader :query

def initialize(query)
super

@query = query
end

def selected_columns
query
.columns
.map { |s| { id: s.name, name: s.caption } }
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<%=
flex_layout do |container|
container.with_row do |_columns|
helpers.angular_component_tag "opce-draggable-autocompleter",
inputs: {
options: work_packages_columns_options,
selected: selected_columns,
protected: protected_work_packages_columns_options,
name: 'columns',
id: 'columns-select-export-csv',
dragAreaName: 'columns-select-export-csv',
inputLabel: I18n.t(:"queries.configure_view.columns.input_label"),
inputPlaceholder: I18n.t(:"queries.configure_view.columns.input_placeholder"),
dragAreaLabel: I18n.t(:"queries.configure_view.columns.drag_area_label"),
appendToComponent: true
}
end
end
%>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2010-2024 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# 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.
#
# See COPYRIGHT and LICENSE files for more details.
# ++

module WorkPackages
module Exports
module CSV
class ExportSettingsComponent < BaseExportSettingsComponent
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<%= render(Primer::Alpha::Dialog.new(
title: I18n.t('export.dialog.title'),
size: :xlarge,
id: MODAL_ID,
data: {
"application-target": "dynamic",
controller: "work-packages--export--dialog"
}
)) do |dialog| %>
<% dialog.with_header(variant: :large) %>
<% dialog.with_body do %>
<% flex_layout do |modal_body| %>
<% modal_body.with_row do |_format| %>
<%= render(Primer::Beta::Text.new(tag: "legend", font_size: :normal, mb: 2, font_weight: :bold)) { I18n.t('export.dialog.format.label') } %>
<%= render(Primer::Alpha::SegmentedControl.new(ml: 0, mb: 2, "aria-label": I18n.t('export.dialog.format.label'), size: :medium)) do |component|
export_formats_settings.each do |format|
component.with_item(
label: format[:label], icon: format[:icon], selected: format[:selected],
data: {
"work-packages--export--dialog-format-param": format[:id],
action: "click:segmented-control#select click->work-packages--export--dialog#formatChanged"
})
end
end %>
<hr/>
<% end %>
<% export_formats_settings.each do |format| %>
<% modal_body.with_row(
classes: format[:selected] ? nil : "d-none",
data: { format: format[:id], "work-packages--export--dialog-target": "formatTab" }
) do |_format_tabs| %>
<%= primer_form_with(
url: export_format_url(format[:id]),
id: "#{EXPORT_FORM_ID}-#{format[:id]}",
data: {
"application-target": "dynamic",
action: "submit->work-packages--export--form#submitForm",
controller: "work-packages--export--form",
}
) do |form| %>
<input type="hidden" name="query" value="<%= query_params %>">
<%= render(format[:component].new(query)) %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% dialog.with_footer do %>
<%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
<%= render(Primer::ButtonComponent.new(
data: {
"close-dialog-id": MODAL_ID,
"work-packages--export--dialog-target": "submit"
},
scheme: :primary, type: :submit,
form: "#{EXPORT_FORM_ID}-#{export_formats_settings.find { |e| e[:selected] }[:id]}")) { I18n.t('export.dialog.submit') } %>
<% end %>
<% end %>
69 changes: 69 additions & 0 deletions app/components/work_packages/exports/modal_dialog_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# frozen_string_literal: true

# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2010-2024 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# 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.
#
# See COPYRIGHT and LICENSE files for more details.
# ++

module WorkPackages
module Exports
class ModalDialogComponent < ApplicationComponent
MODAL_ID = "op-work-packages-export-dialog"
EXPORT_FORM_ID = "op-work-packages-export-dialog-form"
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers

attr_reader :query, :project, :query_params

def initialize(query:, project:)
super

@query = query
@project = project
@query_params = ::API::V3::Queries::QueryParamsRepresenter.new(query).to_h.to_json
end

def export_format_url(format)
@project.nil? ? index_work_packages_path(format:) : project_work_packages_path(project, format:)
end

def export_formats_settings
[
{ id: "pdf", icon: :"op-pdf",
label: I18n.t("export.dialog.format.options.pdf.label"),
component: WorkPackages::Exports::PDF::ExportSettingsComponent,
selected: true },
{ id: "xls", icon: :"op-xls",
label: I18n.t("export.dialog.format.options.xls.label"),
component: WorkPackages::Exports::XLS::ExportSettingsComponent },
{ id: "csv", icon: :"op-file-csv",
label: I18n.t("export.dialog.format.options.csv.label"),
component: WorkPackages::Exports::CSV::ExportSettingsComponent }
]
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<%=
flex_layout(data: {
"application-target": "dynamic",
controller: "work-packages--export--pdf--settings"
}) do |container| %>

<%= container.with_row do %>
<%= render(Primer::Alpha::RadioButtonGroup.new(
mb: 3,
as-op marked this conversation as resolved.
Show resolved Hide resolved
full_width: true,
name: "pdf_export_type",
label: I18n.t("export.dialog.pdf.export_type.label"))) do |component|
pdf_export_types.each do |entry|
component.radio_button(label: entry[:label],
value: entry[:value],
checked: current_pdf_export_type == entry[:value],
disabled: entry[:disabled] ? true : nil,
data: {
"work-packages--export--pdf--settings-name-param": entry[:value],
action: "work-packages--export--pdf--settings#typeChanged"
},
caption: entry[:caption])
end
end %>
<hr/>
<% end %>

<% container.with_row(
mt: 2,
classes: %w[table report].include?(current_pdf_export_type) ? nil : "d-none",
data: {
table: true,
report: true,
"work-packages--export--pdf--settings-target": "fields"
}) do |_columns|
helpers.angular_component_tag "opce-draggable-autocompleter",
inputs: {
options: work_packages_columns_options,
selected: selected_columns,
protected: protected_work_packages_columns_options,
name: 'columns',
id: 'columns-select-export-pdf',
inputLabel: I18n.t(:"queries.configure_view.columns.input_label"),
inputPlaceholder: I18n.t(:"queries.configure_view.columns.input_placeholder"),
dragAreaName: 'columns-select-export-pdf',
dragAreaLabel: I18n.t(:"queries.configure_view.columns.drag_area_label"),
appendToComponent: true
}
end %>

<%= container.with_row(
classes: current_pdf_export_type == "report" ? nil : "d-none",
data: {
report: true,
"work-packages--export--pdf--settings-target": "fields"
}) do |_pdf_report_images| %>
<hr/>
<%= render(Primer::Alpha::CheckBox.new(name: 'show_images',
checked: true,
label: I18n.t("export.dialog.pdf.include_images.label"),
caption: I18n.t("export.dialog.pdf.include_images.caption"),
disabled: current_pdf_export_type != "report",
visually_hide_label: false)) %>
<% end %>
<% if gantt_chart_allowed? %>
<%= container.with_row(classes: current_pdf_export_type == "gantt" ? nil : "d-none",
data: {
gantt: true,
"work-packages--export--pdf--settings-target": "fields"
}) do |_pdf_gantt_paper_size| %>

<% gantt_selects.each do |entry| %>
<%= render(Primer::Alpha::Select.new(
name: entry[:name],
label: entry[:label],
caption: entry[:caption],
size: :medium,
disabled: current_pdf_export_type != "gantt",
value: entry[:options].find { |e| e[:default] }[:value])
) do |component|
entry[:options].each do |entry|
component.option(label: entry[:label], value: entry[:value])
end
end %>
<% end %>
<% end %>
<% end %>
<% end %>
Loading
Loading