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

オープン
#6,770 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, php, typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
PHP
スター
248
フォーク
147
平均マージ
17分
マージ済み PR(30日)
21

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WoltLab/WCF のほかの issue

WoltLab/WCF の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。