Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Make the project attributes rich text display "Expand" link inline.

Dombi Attila10bab9616f8a
diff --git a/app/models/custom_value/formattable_strategy.rb b/app/models/custom_value/formattable_strategy.rb
index dd7c19c3a59..884c9346d1d 100644
--- a/app/models/custom_value/formattable_strategy.rb
+++ b/app/models/custom_value/formattable_strategy.rb
@@ -26,8 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-class
- CustomValue::FormattableStrategy < CustomValue::FormatStrategy
+class CustomValue::FormattableStrategy < CustomValue::FormatStrategy
def formatted_value
OpenProject::TextFormatting::Renderer.format_text value
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 14d76280037..663f0c2b869 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1951,6 +1951,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
label_ifc_model_plural: "Ifc Models"
label_import: "Import"
label_export_to: "Also available in:"
+ label_expand: "Expand"
label_expanded_click_to_collapse: "Expanded. Click to collapse"
label_f_hour: "%{value} hour"
label_f_hour_plural: "%{value} hours"
diff --git a/frontend/src/global_styles/openproject.sass b/frontend/src/global_styles/openproject.sass
index bd808ea1c7b..e2bcd889692 100644
--- a/frontend/src/global_styles/openproject.sass
+++ b/frontend/src/global_styles/openproject.sass
@@ -19,6 +19,7 @@
// Module specific Styles
@import "../../../modules/meeting/app/components/_index.sass"
+@import "../../../modules/overviews/app/components/_index.sass"
@import "../../../modules/storages/app/components/_index.sass"
// Component specific Styles
diff --git a/modules/overviews/app/components/_index.sass b/modules/overviews/app/components/_index.sass
new file mode 100644
index 00000000000..fc1fdcf84e0
--- /dev/null
+++ b/modules/overviews/app/components/_index.sass
@@ -0,0 +1 @@
+@import "./project_custom_fields/sections/project_custom_fields/show_component.sass"
diff --git a/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.rb b/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.rb
index cdbf643354e..c8f13137811 100644
--- a/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.rb
+++ b/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.rb
@@ -77,22 +77,19 @@ module ProjectCustomFields
def render_truncated_preview_and_dialog_for_rich_text_value(truncation_length)
flex_layout do |rich_text_preview_container|
rich_text_preview_container.with_row do
- render(Primer::Beta::Text.new) do
+ render(Primer::Beta::Text.new(classes: 'project-custom-fields-rich-text-preview')) do
format_value(
@project_custom_field_values.first&.value&.truncate(truncation_length),
@project_custom_field
)
- end
- end
- rich_text_preview_container.with_row do
- render_dialog
+ end + render_dialog
end
end
end
def render_dialog
render(Primer::Alpha::Dialog.new(size: :medium_portrait, title: @project_custom_field.name)) do |dialog|
- dialog.with_show_button(scheme: :link) { "Expand" }
+ dialog.with_show_button(scheme: :link) { t(:label_expand) }
# TODO: remove inline style
dialog.with_body(style: "max-height: 500px;") do
format_value(@project_custom_field_values.first&.value, @project_custom_field)
diff --git a/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.sass b/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.sass
new file mode 100644
index 00000000000..dc478209e06
--- /dev/null
+++ b/modules/overviews/app/components/project_custom_fields/sections/project_custom_fields/show_component.sass
@@ -0,0 +1,2 @@
+.project-custom-fields-rich-text-preview :last-child
+ display: inline