DEV: replaces topic-notifications-options by DMenu (#30298)

This commit introduces <NotificationsTracking /> which is a wrapper component around <DMenu /> which replaces the select-kit component <TopicNotificationsButton />.

Each tracking case has its dedicated component:

- topic -> `<TopicNotificationsTracking />`
- group -> `<GroupNotificationsTracking />`
- tag -> `<TagNotificationsTracking />`
- category -> `<CategoryNotificationsTracking />`
- chat thread -> `<ThreadNotificationsTracking />`
This commit is contained in:
Joffrey JAFFEUX
2024-12-16 19:59:18 +01:00
committed by GitHub
parent 062e4fb4f3
commit 41df705188
38 changed files with 565 additions and 289 deletions

View File

@ -22,23 +22,19 @@ module PageObjects
def notifications_button
@notifications_button ||=
PageObjects::Components::SelectKit.new(".thread-notifications-button")
PageObjects::Components::NotificationsTracking.new(".thread-notifications-tracking")
end
def notification_level=(level)
notifications_button.expand
notifications_button.select_row_by_value(
::Chat::UserChatThreadMembership.notification_levels[level.to_sym],
)
notifications_button.has_selected_value?(
notifications_button.toggle
notifications_button.select_level_id(
::Chat::UserChatThreadMembership.notification_levels[level.to_sym],
)
has_notification_level?(level)
end
def has_notification_level?(level)
select_kit =
PageObjects::Components::SelectKit.new(".c-navbar__thread-tracking-dropdown.-persisted")
select_kit.has_selected_value?(
notifications_button.has_selected_level_id?(
::Chat::UserChatThreadMembership.notification_levels[level.to_sym],
)
end