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.
This commit is contained in:
m-e-l-u-h-a-n
2021-04-27 20:26:20 +05:30
committed by Tim Abbott
parent 0a9678980f
commit a2c7f35e5c
8 changed files with 32 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ export function create_item_from_stream_name(stream_name, current_items) {
}
const item = {
type: "stream",
display_value: display_pill(sub),
stream_id: sub.stream_id,
stream_name: sub.name,
@@ -58,6 +59,7 @@ export function get_user_ids(pill_widget) {
export function append_stream(stream, pill_widget) {
pill_widget.appendValidatedData({
type: "stream",
display_value: display_pill(stream),
stream_id: stream.stream_id,
stream_name: stream.name,