Replace `UserAction::getSearchResultList()` with an RPC endpoint and modernize the user search JS

Đang mở
#6,770 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi

Hướng nghiên cứu

Start by reading UserAction::getSearchResultList() and validateGetSearchResultList(), then trace the listed consumers in ts/WoltLabSuite/Core/Ui/User/Search/Input.ts, ts/WoltLabSuite/Core/Ui/ItemList/User.ts, and the ACL and user form templates. Compare the existing GetMentionSuggestions endpoint and its TypeScript wrapper for the proposed RPC shape. Done means consumers use the new endpoint, deprecated wrappers preserve the listed compatibility behavior, and the legacy WCF.Search.User code is removed while UserAction remains for BC.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

UserAction is deprecated. The only part still actively used is getSearchResultList() / validateGetSearchResultList().

JS consumers

  • ts/WoltLabSuite/Core/Ui/User/Search/Input.ts (UiUserSearchInput, a subclass of Ui/Search/Input)
    • ts/WoltLabSuite/Core/Ui/Acl/Simple.ts (shared_aclSimple.tpl): users + groups, excluded values
    • ts/WoltLabSuite/Core/Ui/Acl/List.ts (shared_aclPermissionJavaScript.tpl, Form/Builder/Field/Acl.ts): users ± groups
  • ts/WoltLabSuite/Core/Ui/ItemList/User.ts (init()/getValues() on top of Ui/ItemList)
    • shared_userFormField.tpl (UserFormField)
    • search.tpl (author filter of the extended search)
    • also used by third-party packages, e.g. to select conversation participants
  • WCF.Search.User in wcfsetup/install/files/js/WCF.js (deprecated since 3.0, jQuery-based)

Already modernized

Mentions no longer use this action. The editor uses GET /core/messages/mention-suggestions (GetMentionSuggestions, Api/Messages/MentionSuggestions). That leaves the scope=mention branch in getSearchResultList() without a caller in core.

Proposal

  1. New RPC endpoint, e.g. GET /core/users/search (name TBD), with a typed parameter class:
    • query (non-empty, prefix match)
    • includeGroups: bool
    • restrictGroupIDs: int[]
    • excludedUsernames/excludedGroupIDs, or have the client filter the results instead (see open questions)
      It returns structured data (type, userID/groupID, name, avatarTag for users), following GetMentionSuggestions, instead of a generic label + HTML icon. Add a matching ts/WoltLabSuite/Core/Api/Users/… wrapper.
  2. Modernize the JS:
    • Build a replacement for Ui/User/Search/Input and Ui/ItemList/User on top of the new endpoint, possibly as a Component/User/… module.
    • Migrate Ui/Acl/Simple, Ui/Acl/List, shared_userFormField.tpl and search.tpl.
    • Keep Ui/ItemList/User and Ui/User/Search/Input as thin deprecated wrappers backed by the endpoint, so that third-party code keeps working, including getValues() and the csvPerType / …GroupIDs shadow input.
  3. Deprecate/remove legacy code:
    • Remove WCF.Search.User (deprecated since 3.0).
    • Leave UserAction::getSearchResultList() in place for BC for now and remove it together with UserAction. Drop ISearchAction from UserAction and the scope=mention handling.
Ngôn ngữ chính
PHP
Star
248
Fork
147
Merge trung bình
17 phút
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WoltLab/WCF

Tất cả issue của WoltLab/WCF

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.