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

Add tri-state to empty state

Klaus Zandersa7403feea550
diff --git a/app/components/shares/project_queries/empty_state_component.rb b/app/components/shares/project_queries/empty_state_component.rb
index 36e986bcb26..0a6a5d7819a 100644
--- a/app/components/shares/project_queries/empty_state_component.rb
+++ b/app/components/shares/project_queries/empty_state_component.rb
@@ -42,12 +42,16 @@ module Shares
attr_reader :strategy, :entity
- def blankslate_config
+ def blankslate_config # rubocop:disable Metrics/AbcSize
@blankslate_config ||= {}.tap do |config|
- if params[:filters].blank?
+ if entity.public?
config[:icon] = :people
- config[:heading_text] = I18n.t("sharing.project_queries.text_empty_state_header")
- config[:description_text] = I18n.t("sharing.project_queries.text_empty_state_description")
+ config[:heading_text] = I18n.t("sharing.project_queries.blank_state.public.header")
+ config[:description_text] = I18n.t("sharing.project_queries.blank_state.public.description")
+ elsif params[:filters].blank?
+ config[:icon] = "share-android"
+ config[:heading_text] = I18n.t("sharing.project_queries.blank_state.private.header")
+ config[:description_text] = I18n.t("sharing.project_queries.blank_state.private.description")
else
config[:icon] = :search
config[:heading_text] = I18n.t("sharing.text_empty_search_header")
diff --git a/app/models/sharing_strategies/project_query_strategy.rb b/app/models/sharing_strategies/project_query_strategy.rb
index dc600fb2c1b..09cb2b6973f 100644
--- a/app/models/sharing_strategies/project_query_strategy.rb
+++ b/app/models/sharing_strategies/project_query_strategy.rb
@@ -70,7 +70,7 @@ module SharingStrategies
end
def empty_state_component
- Shares::ProjectQueries::EmptyStateComponent if @entity.public?
+ Shares::ProjectQueries::EmptyStateComponent
end
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index ff76954e8a2..9a297cefc28 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -3679,8 +3679,13 @@ en:
public_flag:
label: "Share with everyone at %{instance_name}"
caption: "Everyone can view this project list. Those with global edit permissions can modify it."
- text_empty_state_header: "Shared with everyone"
- text_empty_state_description: "Everyone can view this project list. You can also add individual users with extra permissions."
+ blank_state:
+ public:
+ header: "Shared with everyone"
+ description: "Everyone can view this project list. You can also add individual users with extra permissions."
+ private:
+ header: "Not shared: Private"
+ description: "This project list has not been shared with anyone yet. Only you can access this list."
permissions:
view: "View"
view_description: "TODO: Add me"