Commit Graph

11818 Commits

Author SHA1 Message Date
Tim Abbott c5ed782581 markdown: Remove unnecessary null check.
This null check has been nonfunctional at least since we removed
moment.js from the project.

Fixes an issue reported in #18273.
2021-04-27 23:20:44 -07:00
Tim Abbott 807cbdff7d emoji: Remove unnecessary toggle_reaction check for undefined.
This function requires two arguments; checking for the event being
undefined is code leftover from a previous implementation.

Fixes an issue reported in #18273.
2021-04-27 23:20:32 -07:00
Tim Abbott a6f4230895 settings: Remove broken default streams error handler.
For unknown reasons, 6f7b973d3b
introduced an invalid semi-duplicate call to ui_report.error that
passed the wrong number of parameters.

We should just call `ui_report.error`, which already had logic to
handle the distinction between 40x and 50x errors.

Fixes an issue reported in #18273.
2021-04-27 23:19:04 -07:00
Tim Abbott 9dd88e845a compose_actions: Remove useless conditional.
get_focus_area can never return undefined.

Fixes an issue reported in #18273.
2021-04-27 23:13:40 -07:00
100RABHpy 5df6f6f0c1 compose: Fix bug in draft when stream is not set.
Fixes #18052
When we select a draft with no stream, topic of
drafts gets disappeared. This commit fixes this bug.

In the restore_draft function of drafts.js, we were
explicitly removing the topic of the draft when the stream is
not set.

This was bit reluctant to me, like why we're removing
the topic when the stream is not set. After discussing this on
the Zulip organization chat, I came to know that all code for
drafts is added in commit 1929cc5190.
And as this is a big commit, this microcode would not have
gotten much scrutiny and might get missed.

So removing this feature is not an issue. Also, it may be a bad
design decision to delete topic when we restore drafts. So we should
remove this feature.
2021-04-27 21:56:34 -07:00
100RABHpy 0713484cfc compose: Fix bug in draft when topic is not set.
When we select a draft with no topic, we typically got navigated to an
empty narrow, because the topic field was empty. Rather than
navigating to a view that will show "Nothing's been sent here yet!",
we should not navigate at all.

Initially, in the restore_draft function of the drafts.js
we were only checking that stream is empty or not,
now we also check for the topic, and if both are set,
we navigate to related context; otherwise, we don't navigate.
2021-04-27 21:55:58 -07:00
Tim Abbott 50f00d3e97 emails: Add unsubscribe link infrastructure for marketing emails.
This is intended to be used in any marketing emails that we send with
the send_custom_email infrastructure.
2021-04-27 21:36:09 -07:00
Abhijeet Prasad Bodas fc53d2c66a topic muting: Clean up live update code.
Previously, we used to do a kind of "local echo"
whenever the user muted/unmuted a topic. Meaning,
we used to do most of the UI update work before making
the API call to mute the topic, instead of after
receiving the `muted_topics` event. This behavior
has been so since the beginning of time
(b4b6fa14d3) and isn't ideal because:
1. If the request fails on the backend, the UI
could end up in an incorrect state.
2. Adds code complexity.
3. Makes it difficult to catch bugs related to
live-update (like the one fixed by
f725711ff2).
4. Isn't consistent with other parts of the
codebase, which do the UI update while handling
events.

This commit makes it so that all the UI update
work is done only after recieving the `muted_topics`
event.

The only possible issue with this strategy could
be users sending another duplicate request in the small
time span before receiving the event. But that isn't
a big problem, because all requests involved here are
idempotent, and the worst that can happen is a HTTP 400.
2021-04-27 17:53:06 -07:00
Abhijeet Prasad Bodas 2c4505d322 settings/muted-topic: Move list-create code to designated file.
This code better fits in `settings_muted_topics`.
2021-04-27 17:53:06 -07:00
Abhijeet Prasad Bodas eff16c934c settings/muted-topics: Fix unnecessary use of stopImmediatePropogation.
We do not have any other click handlers for the
`settings-unmute-topic` class, so `stopPropogation`
should be sufficient.
2021-04-27 17:53:06 -07:00
Tim Abbott 63e3d3dd36 settings: Capitalize notification sound names with CSS. 2021-04-27 16:43:28 -07:00
akshatdalton b573964bfa notifications: Add support for `None` option in `Notification sound`.
This commit adds support for a `None` option in the dropdown menu
of `Notification sound`. When this option is selected, no audible
notification is sent to the user.

`None` will appear as the first option in the dropdown menu, since
this is not categorized as a playable audio.

This new option is added so that folks can disable audio notifications
without losing their other notification configuration (like for PMs, mentions).

Necessary test case is added for this new option.

Fixes #16090.
2021-04-27 16:42:16 -07:00
Nyior 8e2042d378 security: Add tooling to nag users if a Zulip server is very old.
This will help ensure that users upgrade their Zulip server.

Essentially rewritten by tabbott.

Fixes part of #17826.
2021-04-27 12:10:48 -07: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
Tim Abbott 9eb6188dd8 hotspots: Remove useless and malformed alt text.
Since it was introduced in 5ce0db9f43,
we've had alt text for the hotspots illustration with an invalid
translation tag.

Fix this by removing the alt text, since the image has no functional
effect and so the right answer should it fail to load or the user is
visually impaired is to ignore it.
2021-04-27 11:12:24 -07:00
Aman Agrawal 4f3cae7d65 compose_control_buttons: Rename giphy_api_available to giphy_enabled. 2021-04-27 10:06:25 -07:00
Aman Agrawal 1a525be3a3 compose_control_buttons: Convert titles to tooltips. 2021-04-27 10:06:25 -07:00
Aman Agrawal 7772ef187e compose: Make close compose icon more visible.
Users may not know there is a way to close the compose box especially
in night mode since the close icon blends with the background.
2021-04-27 10:06:25 -07:00
Aman Agrawal 1b844a8d1c message_edit: Deduplicate control buttons.
Deduplicate control buttons by re-using the
compose_control_buttons.

A link to `help` overlay was added to `message_edit_form`
as a part of this process.

This fixes a bug that when video provider is set to `Jitsi`
from `none` in organization settings while message_edit_form
is open, the video icon is not displayed since
it was not present in the message_edit_form DOM even if
compose.update_video_chat_button_display tries to display it.
It is fixed since the `.video_link` element is always present
in DOM of `message_edit_form` now.
2021-04-27 10:06:25 -07:00
Aman Agrawal 4c60585820 giphy: Get message_id for `compose_giphy_logo` from `.message_row`. 2021-04-27 10:06:25 -07:00
Aman Agrawal 4a55296377 emoji_picker: Get message_id from `.message_row` for `.emoji_map`. 2021-04-27 10:06:25 -07:00
Aman Agrawal 54b31df1b6 emoji_map: Convert from id to class.
Since it can present in multiple elements, we use it as a class.
2021-04-27 10:06:25 -07:00
Aman Agrawal 9816da629b message_edit: Get `message_id` from `message_row` for `video_link`.
We remove `data-message-id` from `.video_link` in `message_edit_form`
and get message_id from `message_row` when it is required.
2021-04-27 10:06:25 -07:00
Aman Agrawal 84a7f08acc compose: Use `class` to find `markdown_preview` related elements.
We convert the following elements to use a class instead of
id for accessing them across the codebase:

* markdown_preview
* undo_markdown_preview
* markdown_preview_spinner
* message_edit_content
* preview_content

Converted them together since changes to one impacted the other in
some modules like click_handlers.

Also, added a function in rows to get `message_row`.
2021-04-27 10:06:25 -07:00
Aman Agrawal 8ebced2791 compose: Use `compose_upload_file` class for upload file icon.
We use `.compose_upload_file` across compose and message_edit_form
for file upload icon. This will help us share common code between
`compose` and `message_edit_form`.
2021-04-27 10:06:25 -07:00
Aman Agrawal 7ae04a6ba8 compose: Use `file_input` class for file input element.
In both compose and `message_edit_form` we use `file_input`
class to identify the file `input` element. This will help
to more easily share common elements between compose and message_edit.
2021-04-27 10:06:25 -07:00
Aman Agrawal eae1829ead message_edit_form: Convert from `id` to `class`.
Since we can have multiple instances of `message_edit_form`, it
makes sense to have it as a class.

We track the message_edit_form by setting an id to
`form` element dependent on message_id.
2021-04-27 10:06:25 -07:00
Abhijeet Prasad Bodas 3e9b4a2090 mute user: Hide from right sidebar users list.
This commit makes it so that muted users never appear
in the right sidebar buddy list, filter text or not.

The hiding is done in the frontend only, and we still
recieve presence data from the server as before, so
no extra work is required on unmuting someone, other
than to rerender the user list.
Long term if we find that there are too many muted users,
we may want to optimize how we send presence data, but
that is unlikely to happen.

The other less extreme option is to gray out muted users,
but that cannot be done because it would conflict
with the graying out we do for non-recipients when the
compose box is open.
2021-04-26 17:44:18 -07:00
Abhijeet Prasad Bodas 4f9c6889d1 buddy_data: Rename `get_user_id_list` to `get_filtered_user_id_list`. 2021-04-26 17:42:44 -07:00
Abhijeet Prasad Bodas aa47ca0ac0 buddy_data: Move all user_id filtering code to `filter_user_ids`.
This makes the naming more intuitive and gives us a
single place to add more conditions on filtering
user_ids, with the current motivation being filtering
muted users, the logic for which will be added in further
commits.
2021-04-26 17:42:39 -07:00
Abhijeet Prasad Bodas 5860fb050a buddy_data: Move no filter text logic to `filter_user_ids`.
This is a prep change for eventually moving all
filtering logic to `filter_user_ids`.
2021-04-26 17:37:26 -07:00
Abhijeet Prasad Bodas 2c30b543e7 buddy_data: Move related functions to be together.
This is a direct code move which puts all the functions
related to `user_id` lists near the bottom of the file.
This will make the file slightly easier to read.
2021-04-26 17:37:23 -07:00
sahil839 9e19490c52 settings: Add full members option in frontend for invite_to_realm_policy.
This commit adds 'admins and full members' option in frontend for
invite_to_realm_policy.
2021-04-26 17:28:01 -07:00
sahil839 84c8ef3505 settings: Remove extra space from options of invite_to_realm_policy. 2021-04-26 17:07:58 -07:00
nikhilmaske-2001 32bde79b61
confirm_dialog: Use the Confirm and Cancel labels.
Long labels like "Yes, Unsubscribe this stream" can
be confusing for translators and it can also create bad
strings that can end with like 4 long words in German.
It is better to have the simple options like "Confirm"
and "Cancel". This commit fixes this issue by changing
the text to "Confirm".

Fixes #17926.
2021-04-26 16:36:21 -07:00
Tim Abbott c3247128ff lint: Fix prettier issues with last commit. 2021-04-26 14:50:58 -07:00
aryanshridhar 29df7dc9c1 realm_emoji: Add warning modal before overriding default emoji.
Previously, realm emojis can override default emojis in emoji-picker,
if the user sets an exisitng emoji name to his/her custom emoji.

For clear understanding--
If a user sets an realm emoji with name `smile`, this leads to the
newly realm emoji override the existing default emoji `smile`.

To address such behaviour, Added a warning modal which requires
the user confirmation before overriding the default emoji.

Fixes #16913.
2021-04-26 14:42:10 -07:00
aryanshridhar 747209a8ca realm_emoji: Shift realm_emoji request call in a function.
Relocated the post request in a new `add_realm_emoji`
function to built an better abstraction for `settings_emoji`.
2021-04-26 14:41:49 -07:00
Tim Abbott 3fd33fdcce templates: Move user_groups_admin to settings/. 2021-04-26 09:37:38 -07:00
aryanshridhar 8c43c4a9aa template: Move `admin_user_list` template to `settings` folder.
Moved `admin_user_list` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
rather than the `/templates/settings` folder.

Fixes #18227
2021-04-26 09:37:34 -07:00
aryanshridhar c199229aa9 template: Move `admin_user_group_list` template to `settings` folder.
Moved `admin_user_group_list` template to `/templates/settings/` folder
as earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder.
Also modified the node tests to reflect the new changes.
2021-04-26 09:37:30 -07:00
aryanshridhar a82827ca75 template: Move `admin_tab` template to `settings` folder.
Moved `admin_tab` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder instead.
2021-04-26 09:37:27 -07:00
aryanshridhar 63d34500b0 template: Move `admin_settings_modals` template to `settings` folder.
Moved `admin_settings_modals` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder.
2021-04-26 09:37:24 -07:00
aryanshridhar 17133b5b1e template: Move `admin_profile_field_list` template to `settings` folder.
Moved `admin_profile_field_list` template to `/templates/settings/` folder
as earlier, it was inaccurately placed within the `/templates` folder
rather than the `/templates/settings` folder.
Also modified the node tests to reflect the new changes.
2021-04-26 09:37:20 -07:00
aryanshridhar 19699720bc template: Move `admin_linkifier_list` template to `settings` folder.
Moved `admin_linkifier_list` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
rather than the `/templates/settings` folder.
2021-04-26 09:37:17 -07:00
aryanshridhar 27934dca7e template: Move `admin_invites_list` template to `settings` folder.
Moved `admin_invites_list` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder instead.
2021-04-26 09:37:14 -07:00
aryanshridhar 19ffacf05d template: Move `admin_human_form` template to `settings` folder.
Moved `admin_human_form` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder.
2021-04-26 09:37:11 -07:00
aryanshridhar 983762726d template: Move `admin_export_list` template to `settings` folder.
Moved `admin_export_list` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
rather than the `/templates/settings` folder.
2021-04-26 09:37:08 -07:00
aryanshridhar 6b58fdb39d template: Move `admin_emoji_list` template to `settings` folder.
Moved `admin_emoji_list` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder.
2021-04-26 09:37:05 -07:00
aryanshridhar 54d46c27d6 template: Move `admin_default_stream_list` template to `settings` folder.
Moved `admin_default_stream_list` template to `/templates/settings/`
folder as earlier, it was inaccurately placed within the `/templates`
folder and should have been within the `/templates/settings` folder
instead.
2021-04-26 09:37:01 -07:00
aryanshridhar 0e1c0d8be0 template: Move `admin_bot_form` template to `settings` folder.
Moved `admin_bot_form` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and `settings` folder is specifically for storing administrative
UI templates.
2021-04-26 09:36:54 -07:00
Anders Kaseorg 6060d0d364 docs: Add missing space to compound verbs “log in”, “set up”, etc.
Noun: backup, checkout, cleanup, login, logout, setup, shutdown, signup,
timeout.

Verb: back up, check out, clean up, log in, log out, set up, shut
down, sign up, time out.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
Anders Kaseorg e3f2ffa681 docs: Capitalize “Markdown” consistently.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
Anders Kaseorg 178736c8eb docs: Fix spelling errors caught by codespell.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
PIG208 7b60ce1d70 js: Make alert_popup shared.
It allows the click handler for the "x" button, and the stacktrace
toggler to be shared between webapp and the portico pages.

Reimplements #17801.
2021-04-26 09:27:49 -07:00
PIG208 a84eea9b84 static: Make alert.css shared between app and portico.
This involves in two changes for styling.
1. The alert class is moved from alert.css to app_components.css as this
class serves nothing but to default .alert elements to be hidden. This
is only required in the webapp but not portico pages (where .alert
elements are preferred to be shown by default).
2. The import statement for alert.css is moved from app.js to common.js,
so that both the webapp and the portico pages can share the styles. This
will be fine to share the styles as .alert-display, .alert-animations,
.alert-box are more specific then .alert and they use nested class to
define styles for inner elements.

Undoes #17936 properly.
2021-04-26 09:27:05 -07:00
Aman Agrawal 4c4c2e46fb stream_creation_form: Fix footer padding overlapping with text. 2021-04-25 08:54:08 -07:00
Aman Agrawal 384156c307 stream_create: Use ListWidget to render list of all users.
This improves the UX of creating a stream for atleast 1000+ users
realm by showing the the stream creation form much faster than
before.

Search, user addition, scrolling worked smoothly on 15k+
users realm as tested on dev setup.

Also, simplebar is used to replace the default scrollbar.

Fixes #16805
2021-04-25 08:54:08 -07:00
scjess 7a58446c82 message_events: Support undefined stream_name.
When moving a topic within a stream that is deactivated, the stream
may not be present in stream_data.  Avoid throwing an exception in
this situation by leaving stream_name as undefined; existing logic
seems to anticipate that as a possibility, so we don't need a broader
change.

Longer term, we may want to just send to clients basic data about
archived streams that the user has access to.

Fixes: #17271
2021-04-25 08:44:21 -07:00
Anders Kaseorg bf056c8990 js: Extract password_quality module; remove zxcvbn from globals.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:08:52 -07:00
Anders Kaseorg 2864c93ba8 copy_and_paste: Use ES module from Turndown.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:08:52 -07:00
Anders Kaseorg 41dd50948a js: Consistently use ES module from SimpleBar.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:08:52 -07:00
Anders Kaseorg cef2ecf004 i18n: Pass language name with every response.
With a comment added by tabbott on live-update considerations.

See https://chat.zulip.org/#narrow/stream/9-issues/topic/FormatJS.20error.20in.20standalone.20pages/near/1168413 for context.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:00:27 -07:00
akshatdalton 1229945add refactor: Add helper function to handle muting/unmuting of a topic.
This commit adds a helper function: `mute_or_unmute_topic`
in `click_handlers.js` to mute and unmute a topic. This function
is called when a user mutes/unmutes a topic from its recipient bar
or `recent topics`.

This is a prep commit for `Allow unmuting of a topic from its recipient bar`.

Related issue: #15223.
2021-04-24 12:21:43 -07:00
Nikhil Maske 9f5efd208f topic_edit: Fix the behaviour of always_visible_topic_edit button.
The bug happens in the case when the topic name is not set and the
user clicks on always_visible_topic_edit button results into unusual
behaviour of the always_visible_topic_edit button. To fix this, this
commit fix the behaviour by hiding and showing the
always_visible_topic_edit button in the appropiate situations, at the
same time we hide/show similar buttons.

Fixes #17813.
2021-04-23 15:04:17 -07:00
Tim Abbott 78c7d749d9 passwords: Set title/aria-label attributes dynamically.
This allows us to use different "Show password" and "Hide password"
for these labels, which is more consistent with how other products
implement this.

It also lets us delete N duplicate copies of these strings in the HTML.
2021-04-23 15:01:37 -07:00
Tim Abbott ebcd587ee5 settings: Use consistent width for account settings modals.
The password change modal, in particular, was way too narrow to
display its error messages comfortably.
2021-04-23 15:01:37 -07:00
Tim Abbott 1d575007a3 settings: Improve error message for password change.
The "Save failed" standard text is appropriate for many of our
settings, but for changing one's password, we can go with just the
"Wrong password" part provided by the server.
2021-04-23 15:01:37 -07:00
Gaurav Pandey e80ddfe4e6 settings: Add show password feature to forms in settings modal.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Gaurav Pandey a9fcafc433 reset_confirm: Add show password feature to reset confirm page.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Gaurav Pandey 91c73025d2 register: Add show password feature to password fields.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Gaurav Pandey fa235e60ff login: Add show password feature to login page.
The show password feature is a functionality to
toggle the visibility of the password fields in forms
so that one can check if they have entered the correct
password or not. We implement this using an eye icon
toggling which converts input field type from password
to text and vice-versa.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Aman Agrawal 2ceda13e31 tippy: Fix weird looking arrow for playground and copy code tooltips.
They were taking the height of the code block, we don't want them to,
hence we explicitly set their height to 0.
2021-04-23 11:59:18 -07:00
Aman Agrawal 9350bbd976 tippy: Fix font-family for copy code and playground tooltips. 2021-04-23 11:59:18 -07:00
Aman Agrawal 489daa7f7c tippy: Append tooltips to the parent of the `reference`.
This allows us to hide tooltips automatically when the
parent container is hidden while tooltip is active.

In an overlay, when a tooltip is active and `esc` is pressed,
the tooltip will remain active without this commit.

This has side effects of some properties of parent applying to
tooltips if property is directly set to `div`. Through manual testing,
only area where this was found was fixed.
2021-04-23 11:59:18 -07:00
Aman Agrawal 3410ff2e64 buddy_tooltips: Destroy tooltips if `reference` is not visible.
We destroy the tooltips for which `reference` was either removed
from DOM or is hidden.

We only need to do this for tooltips
contained in simplebar containers for which tooltips can
overflow the boundary of the simplebar container.

There are 4 approaches we could have done this:
1. Asked tippy.js maintainers to do this for us.
In https://github.com/atomiks/tippyjs/issues/938 the
maintainer said that it is the responsibility of
the user to do so.

2. Tracked whenever we update the DOM for such elements and hide
tooltips when we were hiding the `reference` elements. This had
various problems like it is hard trigger events when certain elements have
been removed from DOM when `html()` method is used to render
new content.

3. Run an `optimized` periodic job to destroy tooltips when
`reference` elements are hidden. This isn't a good method to
do this since it sucks power and adds latency.

4. Use a `MutationObserver` on the parent element and watch
for changes. This methods seems to work well with no bad
side effects. We use this approach.
2021-04-23 11:59:15 -07:00
Aman Agrawal fc18ec4c04 tippy: Insert tooltip element directly in `.message_reaction`.
Instead of inserting tooltip inside `body`, we directly insert
it inside the `reference` element. This helps us to automatically
hide the tooltip when we hide the `reference` element.

This avoids the bug of tooltip persisting when the message reaction
is removed while the tooltip is active.

To reproduce:
* React 👍 to a message.
* Hover over the reaction.
* Press `+` from keyboard.

You will see reaction tooltip persisting while the reaction is hidden,
also "Add emoji" icon is displayed with tooltip.

Doing the same for elements which are inside a simplebar container
and for which tooltips can span outside the simplebar container,
makes the tooltips not visible or cut at the edges of simplebar
container since simplebar containers have overflow set to `hidden`.
This is something that cannot fixed as per
https://github.com/Grsmto/simplebar/issues/347

So, for simplebar contained elements we insert the tooltip to
`body`.

`reference` element: Element for which tooltip is displayed.
2021-04-23 11:56:22 -07:00
Abhijeet Prasad Bodas bbbaa109ec settings: Add UI page for managing muted users.
This page is temporarily hidden except in the development environment,
because the "muted users" feature is incomplete.
2021-04-21 10:17:44 -07:00
Abhijeet Prasad Bodas e56db79af4 mute user: Add dev-only UI to mute/unmute a user.
Since the "mute users" feature isn't complete yet,
this UI is shown only in development setups.
Ideally we should have had this commit after the whole
feature was completed and merged, but doing so makes it
difficult to test and merge subparts of the feature one by
one (which is a better workflow, while we still decide what
exactly we want this feature to do).

This commit adds a new button in the user info popover
to mute or unmute the user, and uses a confirmation
dialog while muting, because muting a user accidently can lead
to the muter losing out on a lot of information.

TODOs when making this UI visible in production-
1. Make a /help page and link to it from the confirmation
dialog and the API docs.
2021-04-21 10:14:27 -07:00
Mateusz Mandera 977a2f7fa0 emails: Rename "missed message email" to "message notification email". 2021-04-21 10:10:54 -07:00
Anders Kaseorg dd3fa4ac52 templates: Mark all void tags as self-closing.
This reverses the policy that was set, but incompletely enforced, by
commit 951514dd7d.  The self-closing tag
syntax is clearer, more consistent, simpler to parse, compatible with
XML, preferred by Prettier, and (most importantly now) required by
FormatJS.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-21 09:49:34 -07:00
Sumanth V Rao a6d950f73e templates: Move admin_playground_list inside templates/settings. 2021-04-20 14:40:43 -07:00
Anders Kaseorg d381b4463e templates: Fix <br> → <br /> to be parseable by FormatJS.
Fixes #18220.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-20 14:39:53 -07:00
Wesley Aptekar-Cassels 367cf897fa shared: Bump version to 0.0.5. 2021-04-20 17:19:12 +08: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
ryanreh99 e4d5ea69a0 refactor: Remove redundant typeahead_helper.sort_recipientbox_typeahead.
This commit removes`typeahead_helper.sort_recipientbox_typeahead`
which was introduced in 639ec9380a
for the private message recipient box when it used to accept comma
separated text input for recipients. All it doew was cleaning away
invalid recipients from string, like:
"a, , b" was cleaned to [a, b].

This can be now removed because it was now used only in
pill_typeahead.setup code path, and the pills code already handles
invalid cases by filtering out all falsy (invalid) recipients.
2021-04-19 17:41:50 -07:00
Aman Agrawal 57c657962e compose: Move control buttons into a file of their own.
These buttons are common with message_edit_form.hbs, we will
be sharing this file among compose and message_edit_form.
2021-04-19 16:54:54 -07:00
Aman Agrawal 11b09bba83 compose: Replace `message-control-button` with `compose_control_button`.
This is both more correct and also fixes this element having had a
name very similar to message_control_button, which refers to an
element in the message_controls section of a rendered message.
2021-04-19 16:54:10 -07:00
Aman Agrawal 70d444a8eb compose: Move to `hbs` file and append it to DOM on init.
We move compose.html to compose.hbs file while keeping
`#compose` still in `home.html` as a hanger
where append rest of the elements.

This will provide us with two benefits:
* We could share common elements between message_edit_form and
compose.
* We can insert compose directly in any element. We may decide to
do it for recent topics.
2021-04-19 16:53:30 -07:00
Aman Agrawal 4472986fae click_handlers: Delegate compose events to body.
This allows us to not rely on compose elements being present in
the DOM when we register these events.
2021-04-19 16:49:53 -07:00
Sumanth V Rao 0ecf5d0e83 settings_playground: Add UI to list all playgrounds.
Adds a setting UI to list all configured playgrounds
in a realm. The filter functionality can be used to
search playgrounds by its name or language.

Default sort is provided on the 'pygments_language'
field.

Front tests added to maintain server_event_dispatch
coverage. The `settings_playgrounds.js` file is added
to coverage exclusion list since it is majorly UI
based and will be tested using puppeteer tests (in
following commits).
2021-04-19 12:54:59 -07:00
Sumanth V Rao 32390e0c87 playgrounds: Hook up configured playgrounds to be used in code blocks.
To prevent breaking of the hardcoded playgrounds, we resort
to checking if realm_playgrounds is empty and falling back
to the hard-coded list if so. This logic is removed in the
followup commit which introduces the UI to add a playground.
2021-04-19 11:23:10 -07:00
Wesley Aptekar-Cassels da0c616b69 shared: Move PollData into shared. 2021-04-19 06:34:08 -04:00
Wesley Aptekar-Cassels 42f328fec6 PollData: Pass in function for rendering user names.
This will make it easier to share this code with the mobile app, which
does not use people.js.
2021-04-19 06:34:08 -04:00
Wesley Aptekar-Cassels 331927bbbe PollData: Use options object, rather than positional args. 2021-04-19 06:34:08 -04:00
Wesley Aptekar-Cassels bef67d7bf1 PollData: Pass in current user ID.
This will make it easier to share this code with the mobile codebase,
which does not use the people.js logic.
2021-04-19 06:34:08 -04:00
Wesley Aptekar-Cassels 7718d2b137 PollData: Change error reporting to be generic.
This is in preparation for moving this code to @zulip/shared for use in
the mobile app, where we will want to use Sentry for reporting errors,
rather than blueslip.

The way I've done this only allows for reporting one type of error
(currently, blueslip.warn), but seeing as we only have one place we
report an error, that seems like something we can fix if we want more
error levels at a later date.
2021-04-19 06:34:08 -04:00
Abhijeet Prasad Bodas 1ffd8b0205 ui: Use unicode U+2026 instead of literal "..." characters.
The unicode horizontal ellipsis is visually nicer.
b40e50f295 removed many of these,
by changing the text itself.
This commit handles the remaining few.
2021-04-17 09:07:46 -07:00
Vishnu KS ab771e4b19 support: Show the first human user in realm search result. 2021-04-16 13:22:02 -07:00