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

Aperta
#6,770 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, php, typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
PHP
Stelle
248
Fork
147
Merge medio
17m
PR unite (30g)
21

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WoltLab/WCF

Tutte le issue di WoltLab/WCF

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.