Commit Graph

4 Commits

Author SHA1 Message Date
Steve Howell 1bf9a9e84a node tests: Directly test user_group_pill helpers.
We also sort user_ids to be deterministic.
2022-02-22 16:29:36 -08:00
m-e-l-u-h-a-n a2c7f35e5c refactor: Add type field to pill items.
Item field is added to the pill items, this is done to utilize
it wherever possible, to distinguish between diffrent types
of pill items(stream|user_groups|users).

It is also a preparatory commit to support expanding of stream
and user group pills.
2021-04-27 12:07:57 -07:00
m-e-l-u-h-a-n be7021268a setting(stream): Support user group pills when typeahead is unused.
This extra commit adds support for creating user group pills
in cases that do not use typeahead like, pasting the group
name, copying it from the user group pill.

This completes the remaining work required to support
addition of all members of a user groups to stream.

Fixes #15186.
2021-04-19 17:41:50 -07:00
m-e-l-u-h-a-n ce4cf66f3f setting(streams): Add pill support to subscribe all members of group.
We update the pills typeahead logic to also include user group
results and pass the "user_group" key in `opts` to enable this
option for Add subscriber form.

The changes includes:
* Exporting the `query_matches_name_description` function, to
  deduplicate the typeahead `matcher` logic.
* Creating a `people.is_known_user` function, to deduplicate
  the typeahead `sorter` logic.
* Add a new `user_group_pill.js`, to allow adding user group
  pills in input widgets that support pills.

This has been tested manually as well as by adding some new
node tests.
2021-04-19 17:41:50 -07:00