Commit Graph

3 Commits

Author SHA1 Message Date
Shubham Padia
274fdc5908 input_pill: Add disabled flag to make a pill disabled.
A disabled pill cannot be removed. It will not have the `x` sign inside
it's pill. Pressing backspace on the pill will not remove it. But it
will still be possible to shift focus on the disabled pill using the
backspace button.

We decided to keep disabled not as a property of `item` and instead of
the pill via `InputPill`. This means that a pill is disabled and not an
item. Also, since the item types vary so much between user, user group,
channel and other pills, adding disabled to `InputPill<ItemType>` makes
it much more simpler to add this capability to wherever needed one by
one.

We also need to pass this property to `generate_pill_html` so the
respective functions can respect that property and render the pill
accordingly.

While this feature is not in use at the immediate moment, we've kept it
around since it is likely to be useful in the future.
2025-01-29 12:36:10 -08:00
Shubham Padia
f147e4dd4a Group invalid inputs (#32647)
* css: Extract invalid input outline and shadow colors to variables.

We will use these colors in future for input pills and it would be
convenient to have them in a variable.

* group_setting_pill: Show outline on invalid input.

We could have manipulate the class directly from user_group_pill. But
it felt better to have `show_outline_on_invalid_input` as a param for
the input_pill prototype since we can have a consistent error state for
other pill input boxes if we want to.

* input_pill: Widget should not show as pending after pill creation.

* group_settings: Disable save changes button if pill widget is pending.

This will disable the button for group, realm and stream group settings.

* user_group_create: Don't go to next step with pending group widget.

We just show the red outline and shaking animation as an indication that
a group widget setting is pending when the user tries to go to the add
members step.

* stream_create: Don't go to next step with pending group widget.

Fixes #32113.
We just show the red outline and shaking animation as an indication that
a group widget setting is pending when the user tries to go to the add
subscribers step.
2024-12-10 16:57:48 -08:00
Anders Kaseorg
687f1b1651 tests: Rename the Node tests to *.cjs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00