Skip to content

Commit

Permalink
Add tri-state to empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Zanders committed Jul 3, 2024
1 parent 18c1f1a commit dbc0580
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 7 additions & 3 deletions app/components/shares/project_queries/empty_state_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ def initialize(strategy:)

def blankslate_config
@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")
Expand Down
2 changes: 1 addition & 1 deletion app/models/sharing_strategies/project_query_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def additional_body_components
end

def empty_state_component
Shares::ProjectQueries::EmptyStateComponent if @entity.public?
Shares::ProjectQueries::EmptyStateComponent
end
end
end
9 changes: 7 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit dbc0580

Please sign in to comment.