mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-07 12:53:27 +08:00
When searching for groups in the admin panel, each keystroke was triggering a full page reload due to `refreshModel: true` on the filter query parameter. This made the search experience jarring and unusable for fast typers. Changes: - Remove `refreshModel: true` from filter query param - Add client-side filtering that manually fetches filtered groups - Maintain server-side filtering and pagination support - Keep URL sync for bookmarking/sharing Demo: https://github.com/user-attachments/assets/431c6632-d459-417d-9e33-a01e7624e260
26 lines
571 B
Ruby
26 lines
571 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class AdminGroups < AdminBase
|
|
def visit
|
|
page.visit("/admin/groups")
|
|
self
|
|
end
|
|
|
|
def search(filter)
|
|
find(".groups-header-filters input").fill_in(with: filter)
|
|
self
|
|
end
|
|
|
|
def has_groups?(groups)
|
|
page.has_css?(".group-info-name", count: groups.length, wait: 5) &&
|
|
all(".group-info-name", wait: 5).map(&:text) == groups
|
|
end
|
|
|
|
def has_no_groups?
|
|
page.has_no_css?(".group-info-name")
|
|
end
|
|
end
|
|
end
|
|
end
|