mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-02 01:53:03 +08:00
This simplifies the admin search and adds some basic accessibility Simplification: * Removes the filters for now, both in the modal and full-screen * Removes the link to full-screen from the modal * Simpler input placeholder text * Positioned to sit higher on the page, similar to a command palette Accessibility: * Results (or lack of) announced for screenreaders after query Bonus: * Makes the modal input sticky on scroll * Combined some styles shared between this and the chat menu (modifier + k) under a `--quick-palette` class Before:  After:  --------- Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
21 lines
496 B
Ruby
21 lines
496 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Modals
|
|
class AdminSearch < PageObjects::Modals::Base
|
|
MODAL_SELECTOR = ".admin-search-modal"
|
|
|
|
def search(query)
|
|
find(".admin-search__input-field").fill_in(with: query)
|
|
end
|
|
|
|
def find_result(type, position)
|
|
all(".admin-search__result[data-result-type='#{type}']")[position]
|
|
end
|
|
|
|
def input_enter
|
|
find(".admin-search__input-field").send_keys(:enter)
|
|
end
|
|
end
|
|
end
|
|
end
|