mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
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:
committed by
Tim Abbott
parent
0a9678980f
commit
a2c7f35e5c
@@ -22,6 +22,7 @@ export function create_item_from_email(email, current_items) {
|
||||
// so we just create a pill where the display value
|
||||
// is the email itself.
|
||||
return {
|
||||
type: "user",
|
||||
display_value: email,
|
||||
email,
|
||||
};
|
||||
@@ -42,6 +43,7 @@ export function create_item_from_email(email, current_items) {
|
||||
// We must supply display_value for the widget to work. Everything
|
||||
// else is for our own use in callbacks.
|
||||
const item = {
|
||||
type: "user",
|
||||
display_value: user.full_name,
|
||||
user_id: user.user_id,
|
||||
email: user.email,
|
||||
@@ -61,6 +63,7 @@ export function append_person(opts) {
|
||||
const avatar_url = people.small_avatar_url_for_person(person);
|
||||
|
||||
pill_widget.appendValidatedData({
|
||||
type: "user",
|
||||
display_value: person.full_name,
|
||||
user_id: person.user_id,
|
||||
email: person.email,
|
||||
|
||||
Reference in New Issue
Block a user