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

Revert modification of link_handler and improve work package preview

Nicolas Salgueroca74a90ec36a
diff --git a/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.sass b/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.sass
index 425a3b6866e..be4911d171b 100644
--- a/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.sass
+++ b/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.sass
@@ -14,7 +14,7 @@
box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5)
display: grid
- grid-template: auto auto auto / auto auto 1fr 1fr
+ grid-template: auto auto auto / 150px auto 1fr 1fr
grid-column-gap: 5px
grid-row-gap: 10px
grid-template-areas: "type subject subject subject" "author author author author" "status status . assignee"
@@ -24,12 +24,14 @@
padding: 0px 10px
.type
+ @include text-shortener
grid-area: type
.author
grid-area: author
.subject
+ @include text-shortener
grid-area: subject
.assignee
diff --git a/lib/open_project/text_formatting/matchers/link_handlers/work_packages.rb b/lib/open_project/text_formatting/matchers/link_handlers/work_packages.rb
index a887b78a05e..63b349a8f03 100644
--- a/lib/open_project/text_formatting/matchers/link_handlers/work_packages.rb
+++ b/lib/open_project/text_formatting/matchers/link_handlers/work_packages.rb
@@ -56,20 +56,9 @@ module OpenProject::TextFormatting::Matchers
private
def render_work_package_link(wp_id)
- wp_class = 'issue work_package preview-trigger'
- wp = find_work_package(wp_id)
- if !wp.nil? && wp.closed?
- wp_class += ' closed'
- end
link_to("##{wp_id}",
work_package_path_or_url(id: wp_id, only_path: context[:only_path]),
- class: wp_class)
- end
-
- def find_work_package(wp_id)
- WorkPackage
- .visible
- .find_by(id: wp_id)
+ class: 'issue work_package preview-trigger')
end
end
end