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

Provide Blankslates for empty tabs

Henriette Darge937c83e4ae76
diff --git a/app/components/work_packages/date_picker/dialog_content_component.html.erb b/app/components/work_packages/date_picker/dialog_content_component.html.erb
index 38183585d7d..03bc38a9280 100644
--- a/app/components/work_packages/date_picker/dialog_content_component.html.erb
+++ b/app/components/work_packages/date_picker/dialog_content_component.html.erb
@@ -114,15 +114,23 @@
tab_content.with_text { I18n.t("work_packages.datepicker_modal.tabs.#{tab[:key]}") }
tab_content.with_counter(count: tab[:relations].count)
tab_content.with_panel do
- render(border_box_container(padding: :condensed)) do |box|
- tab[:relations].visible.each do |relation|
- box.with_row(scheme: :default) do
- render(WorkPackageRelationsTab::RelationComponent.new(work_package:,
- relation: (relation unless tab[:is_child_relation?]),
- child: (relation if tab[:is_child_relation?]),
- editable: false))
+ if tab[:relations].any?
+ render(border_box_container(padding: :condensed)) do |box|
+ tab[:relations].visible.each do |relation|
+ box.with_row(scheme: :default) do
+ render(WorkPackageRelationsTab::RelationComponent.new(work_package:,
+ relation: (relation unless tab[:is_child_relation?]),
+ child: (relation if tab[:is_child_relation?]),
+ editable: false))
+ end
end
end
+ else
+ render(Primer::Beta::Blankslate.new(border: true)) do |component|
+ component.with_visual_icon(icon: :book, size: :medium)
+ component.with_heading(tag: :h2) { I18n.t("work_packages.datepicker_modal.tabs.blankslate.#{tab[:key]}.title") }
+ component.with_description { I18n.t("work_packages.datepicker_modal.tabs.blankslate.#{tab[:key]}.description") }
+ end
end
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 550018b9af1..9c46d343666 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -729,6 +729,16 @@ en:
dates: "Dates"
predecessors: "Predecessors"
successors: "Successors"
+ blankslate:
+ predecessors:
+ title: "No predecessors"
+ description: "This work package does not have any predecessors."
+ successors:
+ title: "No successors"
+ description: "This work package does not have any successors."
+ children:
+ title: "No children"
+ description: "This work package does not have any children."
x_descendants:
one: "One descendant work package"