mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-12 14:37:01 +08:00
Currently, if a user is part of a group in `experimental_new_new_view_groups`, they will see tabs for All, Topics, and Replies underneath the New tab in the /new topic list. However, if one of the tabs has no topics (i.e. no more unread replies or no more new topics), we hide the tabs entirely. This can be confusing and inconsistent for members. This commit changes the behavior so that the tabs are always shown. Also, we change the text and route of the empty topic list CTA based on the subtab the user is on: * Topics subtab, when there are new Replies: * Button text: Browse new replies * Button points to the Replies subtab * Replies subtab, when there are new Topics: * Button text: Browse new topics * Button points to Topics subtab * All subtab, or any subtab when there are no new topics of any kind: * Button text: Browse latest topics * Button points to /latest
15 lines
302 B
Ruby
15 lines
302 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Components
|
|
class EmptyState < PageObjects::Components::Base
|
|
def has_cta_text?(text)
|
|
has_css?(".empty-state__cta", text: text)
|
|
end
|
|
|
|
def click_cta
|
|
find(".empty-state__cta").click
|
|
end
|
|
end
|
|
end
|
|
end
|