Skip to content

A platform for community discussion. Free, open, simple.

UX: Rename Site Traffic Explorer modal action (#42845)

Alan Guo Xiang Tan9e34082221a9
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 071c82fce7a..8b5820bde63 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -7294,6 +7294,7 @@ en:
remove_filter_value: "Remove %{value}"
clear_all: "Clear all"
apply: "Apply"
+ apply_filters: "Apply filters"
filter_by:
one: "Filter by %{label}, %{count} pageview"
other: "Filter by %{label}, %{count} pageviews"
diff --git a/frontend/discourse/admin/components/site-traffic-explorer-breakdown-modal.gjs b/frontend/discourse/admin/components/site-traffic-explorer-breakdown-modal.gjs
index 3a16ac16aea..3a2c4656046 100644
--- a/frontend/discourse/admin/components/site-traffic-explorer-breakdown-modal.gjs
+++ b/frontend/discourse/admin/components/site-traffic-explorer-breakdown-modal.gjs
@@ -63,7 +63,7 @@ export default class SiteTrafficExplorerBreakdownModal extends Component {
<DButton
class="btn-primary"
@action={{this.applyFilters}}
- @label="admin.site_traffic_explorer.apply"
+ @label="admin.site_traffic_explorer.apply_filters"
/>
</:footer>
</DModal>
diff --git a/spec/system/page_objects/pages/admin_site_traffic_explorer.rb b/spec/system/page_objects/pages/admin_site_traffic_explorer.rb
index ea248bb187c..46f4d2af076 100644
--- a/spec/system/page_objects/pages/admin_site_traffic_explorer.rb
+++ b/spec/system/page_objects/pages/admin_site_traffic_explorer.rb
@@ -196,6 +196,7 @@ module PageObjects
selector = "[data-test-site-traffic-apply-filters]"
has_css?(selector, count: 1) &&
+ has_css?("#{selector} .d-button-label", exact_text: "Apply", count: 1) &&
has_css?(
"#{selector} .site-traffic-explorer__filter-apply-pending-count",
exact_text: count.to_s,
@@ -204,7 +205,7 @@ module PageObjects
end
def has_no_apply_filters?
- has_no_button?("Apply", exact: false)
+ has_no_css?("[data-test-site-traffic-apply-filters]")
end
def apply_filters
@@ -260,7 +261,7 @@ module PageObjects
def apply_expanded_filters
within(".site-traffic-breakdown-modal[role='dialog']") do
- find_button("Apply", exact: true).click
+ find_button("Apply filters", exact: true).click
end
self
end