Commit Graph

14409 Commits

Author SHA1 Message Date
Lauryn Menard cdcef8b814 analytics: Remove "Aggregation" labels from stats page. 2022-10-07 11:34:01 -07:00
Lauryn Menard 396c7c3046 analytics: Remove unused CSS styling for `hr` tags.
There are no `<hr>` HTML tags in the stats / analytics page, so
removes the unused CSS rules for these elements.
2022-10-07 11:34:01 -07:00
evykassirer 61a782d252 drafts: Don't update draft count when successfully sending messages.
Fixes #21757.

Previously the draft count would briefly increase between the action
of sending a message and the success of sending that message.
Now the draft count will only increase if the message fails to send.
2022-10-07 11:26:36 -07:00
Lauryn Menard df7a1cec93 analytics: Add summary statistic for upload/storage space in use.
Adds the realm's used storage space for attachments to the stats
view `page_params`. This information is then added to the summary
statistics section of the analytics page after being formatted by
`stats.js`.

Uses the emoji test image to create an `Attachment` in the database
for the analytics realm. Even though it doesn't create a message
to claim the attachment, it still is sent as storage space used
data for the analytics `/stats/` page.
2022-10-07 10:08:09 -07:00
Aman Agrawal 87316a777a css: Fix background color of date_row in unread PMs.
This was a regression introduced in the commit
a80500cf5d
where we forgot to change the color of for unread PM date rows
while change the color for the date row of unread stream messages.
2022-10-07 09:54:42 -07:00
Aman Agrawal 06a9ceb911 popovers: Hide mark as unread button for spectators.
Since spectators cannot mark messages as unread, hide this button
in message actions popover.
2022-10-07 09:53:37 -07:00
Sahil Batra da8817889b settings: Check "display_profile_in_summary" for Pronouns type field.
While creating a pronouns type field, "display_in_profile_summary"
checkbox is checked by default for "Pronouns" type field if the
limit is not reached.

Fixes #21271.
2022-10-06 17:56:26 -07:00
Sahil Batra 12ba5cb814 settings: Add default label and hint when creating "Prounouns" custom field.
Label and hint can be edited, but we just fill it by default values for
convenience.
2022-10-06 17:56:26 -07:00
Sahil Batra aaa5d5cb0e settings: Show typeahead for pronouns type custom profile field.
User can add any pronouns in this field, but we just show some
commonly used pronouns as suggestions in typeahead.
2022-10-06 17:56:26 -07:00
Aman Agrawal ab9c5ae482 actions_popover: Only wrap content to next line on small width.
Fixes #23017

We try to keep the width of actions popover at `max-content` till
small widths.
2022-10-06 16:58:33 -07:00
Sahil Batra 3f010bbcc4 settings_org: Add missing closing square bracket.
Due to closing bracket not being present, discard
button of "Theme" subsection of default user settings
resulted in error.
2022-10-06 13:46:13 -07:00
evykassirer 553723e5d4 compose: Offer narrow to compose target button for private messages.
We already offer this for stream messages, but had been blocked on
adding it for private messages for visual design reasons. The dark
theme had a natural place to put this, since it had a box around the
private message recipient box; but the light theme didn't.

We add a border to the light theme private message recipient box to
allow us to add the same button to private messages, and implement
that button.

Fixes #21962.
2022-10-05 11:11:28 -07:00
Yogesh Sirsat 05a56fd764 user_info_popover: Fix missing translation tags. 2022-10-04 17:20:03 -07:00
Tim Abbott f0b8ae4fbe message_fetch: Fix calling pm_list.update_private_messages twice.
This also adds a comment noting a remaining performance bug we have in
this code path, namely fetching messages for a streams narrow will do
unnecessary work.
2022-10-04 16:46:08 -07:00
evykassirer c321f57785 settings: Explain that Google blob emojis are deprecated.
Part of fixing #19371.
2022-10-04 12:29:35 -07:00
Zixuan James Li 07050394b9 reload: Remove get_reload_topic.
This finishes up the work from 057ee6633a.
We had this "get_reload_topic" helper for user that has "topic"
encoded as "subject" from a older release. This is unlikely to cause
problem now because we no longer use "subject" for reloading since 2018.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-04 11:59:22 -07:00
Zixuan James Li 1e64aa9b79 drafts: Remove support for legacy drafts with "subject".
This removes the temporary get_draft_topic helper from utils and remove
references to draft.subject.

This finishes up the work from
9861cdfeb6. Since 2018 we had stopped
referring to the "subject" property, it is considered safe to remove
this code now. It's impossible to directly upgrade to the current
release without substantial downtime for upgrading the OS, so this
logic is unlikely to provide any future benefit.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-04 11:57:47 -07:00
Aman Agrawal 19ee1e92e7 msg_actions_popover: Allow keyboard navigation to mark as unread button.
We missed defining `tabindex` in the HTML element of the button.
2022-10-04 10:07:06 -07:00
Sofia B 2a4ec505e4
settings: Remove the "i" for "Message retention".
Fixes part of #22892.
2022-10-03 14:28:20 -07:00
Sahil Batra d6b85404d2 message_edit: Focus on dropdown-widget if only changing stream is allowed.
Previously, content box was focused inspite of it being disabled in case
when only stream editing was allowed. Now we instead focus on the stream
down.
2022-10-03 11:43:25 -07:00
Sahil Batra 6d5118674d popovers: Remove should_display_view_source from actions_popover_content.
Instead of having a separate field, we can use in if condition on
view_source_menu_item itself to determine whether to show the view
source option or not.
2022-10-03 11:43:25 -07:00
Sahil Batra 1dd89b8f9b popovers: Show "Move message" menu always when moving message is allowed.
Previously "Move message" option was not shown when content editing
was also allowed and also when only moving messaages between streams
was allowed but not topic edits.

Now we show "Move message" option when editing topics or moving
messages between streams is allowed irrespective of whether content
editing is allowed or not.
2022-10-03 11:43:25 -07:00
Akarsh Jain 67d7efefdc message_actions: Split the View source / Move message option into two menu options.
Split the View source / Move message option into two menu options that
take you to the same UI: Move message and View message source.
Previously, it was confusing to have this double option,
and hard to parse it at a glance.

-View message source uses the current icon.

-Move message uses the arrows icon from the Move topic menu option.

-New option order: (1) Move message, (2) Quote and reply or forward,
 (3) View message source.

Also remove the "Topic editing only" and "View source" text on the
bottom right of the message edit UI along with the tooltips. Only
the timer text is shown (along with tooltip) when content editing
is allowed.
2022-10-03 11:43:25 -07:00
Alya Abbott 5465e2d4d4 help center: Edit "Create your organization profile" info.
- Remove unnecessary screenshot with old Zulip branding.
- In the intro, clarify how the organization profile picture is used.
- Extract org profile intro into an included file.
- Describe the Preview organization profile button.
2022-10-03 11:33:30 -07:00
Aman Agrawal a80500cf5d css: Don't add unread indicator to the date row of first unread row.
Fixes #23030

If the first unread `.message_row` has a date_row, we don't show
unread indicator on it.
2022-10-03 11:31:35 -07:00
Aman Agrawal d00dc1188c communities: Hide catalog section and adjust spacing based on feedback.
Catalog section is hidden for now since there are not enough
orgs listed on the live page.
2022-09-30 11:45:30 -07:00
Aman Agrawal 12fe9b78de integrations: Keep 50px space between content and window.
I am not sure why we didn't want no space between them for
768px to  65px. It looks better with this change.
2022-09-30 11:45:30 -07:00
Ganesh Pawar 5b75fcd3e7 settings: Convert `form` to `div` in `Full name` input.
This prevents the web app from being reloaded when the user presses
`Enter`.

Fixes #22906
2022-09-29 17:11:15 -07:00
Ganesh Pawar 6b80f010f5 delete attachments: Add confirmation dialog.
Fixes #22814
2022-09-29 17:10:26 -07:00
Tim Abbott c99a40803b message_edit: Add 'message' to tooltip for view source.
Fixes part of #22537.
2022-09-29 11:20:02 -07:00
Akarsh Jain 72cc5d6bd2 message_actions: Rename Edit to Edit message and Collapse to Collapse message.
This commit renames Edit to Edit message and Collapse to Collapse message
for better readability and to match the Delete message and
Copy link to message options.
2022-09-29 10:29:51 -07:00
Yogesh Sirsat 544b88e7ec user_info_popover: Not displaying "Manage this bot" for system bots. 2022-09-29 10:19:21 -07:00
Lauryn Menard 842da9e10a analytics: Add messages sent in last 30 days summary statistic. 2022-09-29 09:06:29 -07:00
Lauryn Menard 954b0475fe analytics: Add total messages sent summary statistic. 2022-09-29 09:06:29 -07:00
Lauryn Menard 7f1a060c4d analytics: Add summary statistics section and user statstics.
Adds a section to the top of the stats page for organization
summary statistics. Also, adds the first two statistics to that
section for total users in the organization and users that have
been active in the past 15 days.
2022-09-29 09:06:29 -07:00
Lauryn Menard 06445dc5e1 analytics: Use flexbox for charts in stats page.
Reworks the stats page to use CSS Flexbox. Also centers the main
page header and reorganizes the order of the charts on the page.
2022-09-29 09:06:29 -07:00
Lauryn Menard a6232cfc69 templates: Use help link widget in invite user modal.
Updates the help center link in the invite user modal to use the
help_link_widget.
2022-09-28 16:03:40 -07:00
Tim Abbott b8a4bf6f40 settings: Remove 'useful for testing' from label.
This label is unnecessary and creates the potential for an incorrect
assumption that it's only useful for testing, when in fact it's a
reasonable configuration overall.
2022-09-27 10:43:51 -07:00
Sahil Batra fda471ab80 settings: Italicize text inside parens for presence_enabled setting. 2022-09-27 10:43:51 -07:00
Sahil Batra f151a4aa11 settings: Add option in settings_checkbox to show some text in parens.
There are cases where we add some text in italics inside parens along
with the label in checkbox settings.

This commit adds option to settings_checkbox template so that we can
directly use it and not require to duplicate the settings_checkbox
code and thus we now use settings_checkbox template for
enable_read_receipts setting.
2022-09-27 10:43:51 -07:00
evykassirer 8dca83265d messagebox: Undo regression that removed higlights for mentions.
Regression introduced in 3f66a9ef2b

CZO discussion https://chat.zulip.org/#narrow/stream/9-issues/topic/mention.20highlighting.20broken/near/1441212
2022-09-26 12:50:24 -07:00
Taiki 106b19ea42 css: Apply same margin to all 4 types of icons in message_view_header.
This `margin-left: 5px` was missing for globe icon. This change
ensures that all the 4 types of icons that are displayed have
the same margin.
2022-09-26 12:29:28 -07:00
Lauryn Menard aeb01cfeb3 analytics: Remove unused click handler in populate messages by client.
Removes a click handler in `populate_messages_sent_by_client` for
anchor links that start with a hash.

I think this goes back to when there was a sidebar navigation on
the stats page, which no longer exists. The only anchor link in
the current html is to the help center documentation and not part
of the Plotly charts.
2022-09-26 12:28:11 -07:00
Taiki 4ba9853481
stream settings: Fix buggy background color in narrow windows.
For some reason, the CSS declared a different background color for this element
only with a narrow window media CSS query. Change this color to the default 
background for the rest of this modal.

Fixes #22991.
2022-09-26 11:41:59 -07:00
Steve Howell 8fc811dfa9 unread: Add UI support for marking messages as unread.
Fixes #2676.

Co-authored-by: Aman Agrawal <amanagr@zulip.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2022-09-23 16:45:43 -07:00
Tim Abbott e7b97e25c9 message_list: Fix messages marked as read during rendering.
I found a highly reproducible bug using the "Mark as unread" feature,
which triggers a rerender via message_list.rerender_view().

The reproducer was as follows:
* Navigate to a narrow by going to All messages and using the `S` hotkey.
* Mark as unread to mark several messages as unread in that view.
* Notice that the message that had been selected in home_message_list
  is immediately marked as read again.

What was happening is that the reselect_selected_id call for
message_lists.home (All messages) was incorrectly re-marking the
currently selected message as read, even though (1) that view was not
visible and (2) this was an internal rendering change that could not
be the first time the message was selected.

Because only the current message_list has marking messages as read
blocked, it's still able to mark the currently selected message as
read.

All the callers of reselect_selected_id are internal rendering code
paths that are not intended to be user-visible; as a result, they
should not change the unread state either.

The bug fixed here is a potential root cause of #16986, but I haven't
had a chacne to confirm it.
2022-09-23 16:45:43 -07:00
Tim Abbott 1b18f1fb5d message_list: Move and deduplicate reselect_selected_id functions.
redo_selection and reselect_selected_id did the same thing: Reselect
the currently selected message as a result of internal rendering. I
combine the useful features of both -- not crashing if no message is
selected (id -1) and passing the `from_rendering` option, to avoid
potentially triggering an additional rerender.
2022-09-23 16:45:43 -07:00
Sahil Batra eba390c6b2 settings_org: Convert to number before parseFloat in parse_time_limit.
We now first convert the element value to number using "Number()"
function and then call parseFloat in parse_time_limit function.

If we do not do so and the input element contains something like
"24a", it will be converted to 24 after parseFloat and will result
in an unexpected behavior where the save-discard widget will not
appear if the custom value input is changed from "24" to "24a",
since the value is considered as same as before.

But now "24a" will return NaN and save-discard widget will
appear with save button disabled.
2022-09-23 16:24:16 -07:00
Sahil Batra 711536f53a settings: Fix custom time limit input validation.
Previously, typing something like "24aa" in message edit limit
custom input box would not disable the "Save changes" button
and clicking on it would set the limit to 24 minutes because
"24aa" was parsed to 24 by parseInt which is a valid value.

We now fix this to first convert the input to number using
"Number()" function and then use parseInt. "Number()" function
returns NaN for input like "24a" and other inputs containing
alphabet characters and thus it is considered as invalid value
and "Save changes" button is disabled.
2022-09-23 16:24:16 -07:00
Sahil Batra 37fefb374c settings: Refactor code of realm-default of notification batching period.
Previously realm-level default of email notification batching period
setting was handled as a special case in populate_data_for_request.

But now we have added some functions to handle time limit settings and
this commit changes the email notification batching setting to be
handled similarly.
2022-09-23 16:24:16 -07:00
Sahil Batra e53a76bc03 settings: Rename get_message_edit_or_delete_limit_setting_value function.
This commit renames get_message_edit_or_delete_limit_setting_value
function to get_time_limit_setting_value, so that we can use the
same function to get value for email notification batching setting
value.
2022-09-23 16:24:16 -07:00
Sahil Batra 009e06d868 settings: Extract a function to set msg edit and delete limit setting.
Since set_msg_edit_limit_dropdown and set_msg_delete_limit_dropdown
have almost same code except the ID of elements, we extract a common
function set_time_limit_setting and both the above functions call
this new function only.

We can use this function for topic edit limit setting which will be
added in further commits.
2022-09-23 16:24:16 -07:00
Sahil Batra 55cf61eaf3 settings: Do not show save-discard widget till custom input is not changed.
We now show save-discard widget on changing the message edit and delete
limit setting dropdown from any value to "Custom" only after value inside
the custom input is changed. This makes sense as the setting value is
not actually changed unless the custom input is not changed and also
makes the behavior consistent with realm-level default of notification
batching period setting.

After this change, the dropdown element and custom input element are not
considered as different setting elements for code purposes and are
treated as single setting like the realm-level default of notification
batching period setting. And thus we remove the prop-element class
from the custom input elements of these settings.
2022-09-23 16:24:16 -07:00
Sahil Batra 6b876bdf70 settings: Send only changed settings to server for msg edit subsection. 2022-09-23 16:24:16 -07:00
Sahil Batra ed070000e8 settings: Extract function to show/hide custom input.
This commit extracts a function to show or hide the custom
input of message edit and delete limit setting and to set
the initial value of custom input while showing it.
2022-09-23 16:24:16 -07:00
Sahil Batra 3fa7e68058 settings_config: Change time_limit_dropdown_values to a list.
This commit changes time_limit_dropdown_values from map to
list like we have email_notifications_batching_period_values.

This change will help us in further commits for refactoring
the message edit and delete settings related code.
2022-09-23 16:24:16 -07:00
Sahil Batra 17aba277c5 settings: Change id and name of message delete limit dropdown.
We change the id and name of message delete limit dropdown to
"id_realm_message_content_delete_limit_seconds" and
"realm_message_content_delete_limit_seconds" respectively.

This is a prep commit for sending only changed settings in
message editing section to the API.
2022-09-23 16:24:16 -07:00
Sahil Batra 1e9c65b759 settings: Change id and name of message edit limit dropdown.
We change the id and name of message edit limit dropdown to
"id_realm_message_content_edit_limit_seconds" and
"realm_message_content_edit_limit_seconds" respectively.

This is a prep commit for sending only changed settings in
message editing section to the API.
2022-09-23 16:24:16 -07:00
Sahil Batra 0dfcc14ebb settings_org: Rename changed_val variable to proposed_val.
This commit renames changed_val variable to proposed_val
in check_property_changed function for better readability.
2022-09-23 16:24:16 -07:00
Tim Abbott 155787512f css: Modal read receipts CSS to modal.css. 2022-09-23 16:21:31 -07:00
Riken Shah ff899e5c31 read_receipts: Disable showing read receipts for Notification Bot msgs.
The implementation is simple, we just check if the
the message sender is a notification bot to decide if we
should show the read receipts list.

We also update the modal content styling to match the padding at the
top of the modal.

Fixes #22905
2022-09-23 16:20:25 -07:00
Tim Abbott 80e4dcb042 settings: Remove trailing period for reactions setting.
All of our other settings labels don't have a trailing period.
2022-09-23 12:27:54 -07:00
Lauryn Menard d5b7551f09 frontend: Implement 'invisible mode' feature.
Transitions the frontend of the web app to no longer use the
user status `away` field for setting a user's activity status
to be 'unavailable' (which is now a deprecated way to access
a user's `presence_enabled` setting).

Instead we now directly use and update the user's `presence_enabled`
setting for this feature.

Renames frontend code related to the feature to `invisible_mode`
vs `away`.

We lose node test coverage in `user_status.js` because we are now
using `channel.patch` to send these user setting updates to the
server.

Removes the temporary updates to `server_events_dispatch.py` (and
related tests) made in a previous commit, since we no longer have
or need the `away_user_ids` set.
2022-09-23 12:27:54 -07:00
Lauryn Menard 5accbf38bf frontend: Update `away_user_ids` for presence_enabled update events.
Because the web app has the capacity to update the presence_enabled
user setting directly, we need to temporarily ensure that the
user profile popover is also updated to the correct text/value.

This can be removed once the web app client transitions to use
the presence_enabled setting for the 'invisible_mode' feature.
2022-09-23 12:27:54 -07:00
Yogesh Sirsat 5248f1c40b settings_bots: Change text "profile picture" to "avatar". 2022-09-23 12:06:51 -07:00
Yogesh Sirsat 601bd796a1 bots: Live update add new bot button on changing bot_creation_policy. 2022-09-23 12:06:51 -07:00
Yogesh Sirsat 0b3dd4755e settings_bots: Make it possible to add new bots from org settings.
Adding an "Add a new bot" button to Organization settings > Bots,
which opens a `Add a new bot` form modal from `settings_bots.js`.

Fixes #20309.
2022-09-23 12:06:51 -07:00
Yogesh Sirsat 6db88f0d39 settings_bots: Move "Add a new bot" tab inside a modal.
"Add a new bot" tab from personal `settings > bots` moving this
into a modal form, so we can trigger this form from other places
too without duplicating the code.

Fixes part of #20309.
2022-09-23 12:06:51 -07:00
evykassirer bca41fd29f reload: Preserve unused reload tokens for a week.
Previously, we deleted all reload tokens on each reload, which
created a race condition if there were multiple tabs open.

Now, we continue to delete tokens after using them, but if a
token is not used it is preserved for a week before being deleted.

Fixes #22832.
2022-09-23 10:59:59 -07:00
Aman Agrawal 5ef1b1f5da portico: Fix footer text overflow in different languages.
Fixes #22946
We fix width of footer sections and let the text overflow within.
2022-09-23 10:49:48 -07:00
Mateusz Mandera a359362845 delete_topic: Add retry logic in the webapp. 2022-09-22 15:01:43 -07:00
Tim Abbott 09c6ee6468 settings: Fix redraw_bots_list when adding/removing bots.
The ListWidget component needs to be provided with an updated list of
elements to display in order for it to show new items when
rerendering.
2022-09-22 12:31:28 -07:00
David Rosa 4549529714 help: Document "Mark messages as read on scroll" mobile app feature.
Adds section on how to configure whether messages are automatically
marked as read.
Adds instructions to manually mark all messages as read, or mark all
messages in a stream or topic as read.
Adds the all messages tab image icon.

Fixes: #22915.
2022-09-22 10:36:41 -07:00
Aman Agrawal 5d76f67247 rendered_markdown: Fix alignment of icons in code blocks. 2022-09-22 10:35:33 -07:00
Sahil Batra 086147fdc4 settings: Move display_in_profile_summary checkbox to center.
We move display_in_profile_summary checkbox in the custom
profile fields table to center. We also need to move heading
subsequently to the center.
2022-09-21 11:06:54 -07:00
Yogesh Sirsat a3094d0f26 custom_profile_fields: Toggle new "display_in_profile_summary" field.
Custom profile fields table `CSS` changed to fit the new "Display"
column of checkboxes, checkboxes are for select/deselect custom
profile field to display in profile popover.

New option "Display in profile summary" added in create and edit
custom profile fields form, with the help of this the user can
pick max of 2 custom profile fields except for `LONG_TEXT` and
`USER` fields to display in his user profile popover.

Checkboxes will go in a disabled state, with an explanatory tooltip,
if we've already passed the limit of 2 fields with this setting
enabled.

Fixes #21215.
2022-09-20 17:03:57 -07:00
yogesh sirsat cd71fdea60 popovers: Display custom profile fields in user profile popover.
Displaying custom profile fields in user profile popover, as mentioned
in the issue.

In `popovers.js` filtering out only those custom profile fields, which
are not `LONG_TEXT` or `USER` fields and their values are not empty.

Custom profile fields rendering in profile popover the same way use
similar rendering logic as in the user's full profile modal.

Fixes: #21215
2022-09-20 17:03:57 -07:00
Lauryn Menard 9177ac7a4c buddy-data: Remove unimplemented `user_circle_status` description.
In #11882, the alternate tooltip text/behavior for user status
circles was removed from the implementation, but not from the
buddy list data.

This commit removes the `buddy_data.status_description` function
and related frontend tests. There are no remaining instances of
`user_circle_status` in the codebase.

Prep commit for transitioning from 'unavailable' user status
feature to 'invisible mode' user presence feature.
2022-09-20 10:04:11 -07:00
Sahil Batra b3b6449034 settings: Enable and disable the save button in change_save_button_state.
We now enable and disable save button when changing inputs for custom time
limit settings in change_save_button_state function only which shows or hide
the save-discard widget instead of handling them in "change" event handlers.

This fixes the bug of save button flashing to its enabled state from
disabled state before hiding after clicking on "Discard" as now button
is re-enabled only after save-discard widget is hidden and it is disabled
if required before being shown.

Note that there is still a bug for message edit and delete limit settings
where the save button flashes to enabled state when setting is changed to
the original value instead of clicking on "Discard". This bug is not present
for email notification batching setting in a follow-up PR.

This commit also renames update_save_button_state function to
enable_or_disable_save_button to avoid confusion with
change_save_button_state function.
2022-09-19 20:20:53 -07:00
Sahil Batra a446f05c98 settings: Disable save btn for invalid values of batching period setting.
We disable the "Save changes" button for invalid values in custom
input of realm-level default of email notification batching period
setting.
2022-09-19 20:20:53 -07:00
Sahil Batra fa63045b49 settings: Rename dropdown value for custom option for msg limit settings.
This commit renames dropdown value for custom option for message edit
and delete limit settings to "custom_period" to make it consistent
with the value for email notification batching setting and thus
we can avoid code duplication in further commits.
2022-09-19 20:20:53 -07:00
Sahil Batra 25223539d1 settings_org: Move update_save_button_state function to module level.
We would use update_save_button_state for realm-level default of
notification batching setting also in further commits.
2022-09-19 20:20:53 -07:00
Sahil Batra 2933f079b8 settings: Modify update_save_button_state to use it for other settings.
This commit modifies update_save_button_state such that it can be used
for other time-limit settings too.
2022-09-19 20:20:53 -07:00
Lauryn Menard 7a0d659f14 templates: Add HTML title element to templates that extend base/portico.
Adds HTML title elements to templates that extend either `base.html`,
`portico.html` or `portico_signup.html`, and that are not website
portico landing pages that will use the `PAGE_TITLE` variable to set
the HTML title element (see following commit in series).

Also, updates some templates for missing translation tags.

As a general rule, we want the title element (and page content)
translated. Exceptions that are updated in this commit are templates
used in the development environment, analytics templates that are used
by staff and templates related to Zephyr.
2022-09-19 20:17:17 -07:00
Aman Agrawal 683a5e7c23 view_code_in_playground: Fix tooltip being partially hidden. 2022-09-19 14:11:53 -07:00
Lauryn Menard 5441ec7d16 buddy-data: Remove unused `get_my_user_status` function.
As of 297379029d, the data for the current user's buddy list
row no longer uses the '(unavailable)' or '(you)' text generated by
`buddy_data.get_my_user_status`. This commit removes the function
and related frontend tests.

Remaining instances of `my_user_status` in the codebase are related
to the CSS rule in `right_sidebar.css`, which is still relevant.

Prep commit for transitioning from 'unavailable' user status
feature to 'invisible mode' user presence feature.
2022-09-19 14:09:21 -07:00
Purushottam Tiwari 4db6c51fb1 stream_edit: Fix warning in confirm dialog modal from sub-unsub modal. 2022-09-18 16:02:08 -07:00
Ganesh Pawar a1ac78f34e delete custom emoji: Add confirmation dialog.
Fixes part of #22812.
2022-09-17 11:55:33 -07:00
Ganesh Pawar 4c32972274 modals: Add `data-simplebar` to `login` and `api key` modal.
c439b9d3af added `data-simplebar` to
the `dialog_widget` module, but these modals don't use it. So, add it
separately.
2022-09-17 11:45:36 -07:00
Yogesh Sirsat 2a9145c212 user_profile: Initialize user type fields only when necessary. 2022-09-16 17:51:34 -07:00
Yogesh Sirsat 9416427dc2 settings_bots: Open bots streams tab from personal settings > bots.
UI in settings for bot owners to unsubscribe their bots from streams,
Personal settings > Bots > Bot info card > hashtag icon.

Fixes: #22460
2022-09-16 17:51:34 -07:00
yogesh sirsat d3b4b1cefd stream_bots: Display unsubscribe button on bots full profile modal.
Displaying unsubscribe button on bots full profile modal, allowing bot
owners to ubsubscribe their bots from streams.

Admins can also unsubscribe any bot from any subscribed streams from
bots full profile modal.

Fixes part of: #21402
2022-09-16 17:51:34 -07:00
Yogesh Sirsat 23fbd38b4c bots: Display full user profile modal for bots.
This commit can display a full user profile modal for bots too,
by clicking on "View Full Profile" in the profile info popover
same as normal users.

Fixes part of: #21402
2022-09-16 17:51:34 -07:00
yogesh sirsat 45307affc0 popovers: Text change from "Owner" to "Bot Owner" in profile popover. 2022-09-16 17:51:34 -07:00
Sahil Batra 05b7ca01c4 settings: Disable "Joining the organization" settings for admins.
This commit disables the settings in "Joining the organization"
subsection for admins as they can be changed by only owners.

We also move the tooltip mentioning "Only owners can change..."
to the subsection heading.
2022-09-16 15:27:52 -07:00
Sahil Batra 6ddc83d034 settings: Fix typo in id of "Joining the organization" subsection. 2022-09-16 15:27:52 -07:00
Yogesh Sirsat 8d04e2b4c3 custom_profile_fields: Display deleted options in confirmation modal.
While editing custom profile fields, when user delete option(s) of
select type profile field, display that deleted option(s) in delete
option confirmation modal.

Follow-up: 21878
2022-09-16 15:04:01 -07:00
Yogesh Sirsat 1c2b90eae9 custom_profile_fields: Update text of delete options confirmation modal. 2022-09-16 15:04:01 -07:00
Yogesh Sirsat 2328dc0d4e custom_profile_fields: Confirmation modal for delete profile field. 2022-09-16 15:04:01 -07:00
Yogesh Sirsat c4233d2472 custom_profile_fields: Display success status after add/edit fields.
Display success status "Saved" for consistency in settings UI, after
successful request of Add or Edit custom profile fields.

Follow-up: #21878
2022-09-16 15:04:01 -07:00
Aman Agrawal 155540c0e3 popovers: Fix alignment of icons in sidebar and msg action popovers.
The regression was introduced in c8f346b5e5.
Reverted the change that caused the regression and introduced a
new fix.
2022-09-16 11:47:44 -07:00
Aman Agrawal 2aaf3c3c76 Revert "popovers: Align icons and content in middle."
This reverts commit 948dc3a629.
2022-09-16 11:47:44 -07:00
Anders Kaseorg 82f9014970 stream_list: Fix another “subscribed” typo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-15 16:55:15 -07:00
Aman Agrawal 948dc3a629 popovers: Align icons and content in middle.
The icons like `x` for delete message were displayed below the
text in alignment due to a regression.
2022-09-15 12:14:15 -07:00
Ganesh Pawar 0b2c149268 edit user: Place deactivate button outside the `form` element in modal.
Pressing `Enter` on an input in the `Manage user/bot` form triggers
a click on the `Deactivate` button. This commit prevents that.

Fixes #22961.
2022-09-15 12:13:35 -07:00
Ganesh Pawar c439b9d3af modal: Make the modal content scrollable instead of the whole modal.
Earlier, if the content of the modal (apart from the header and footer)
overflowed, the whole modal would become scrollable which would hide
the modal header and footer on scrolling. This commit makes only
the modal content scrollable and keeps the modal header and
footer static.
2022-09-14 15:45:36 -07:00
Ganesh Pawar 7f8f954897 bots: Remove redundant overflow CSS.
This was added to avoid the `owner` dropdown field from being
only partially visible in the `Manage bot` modal. But, now the
`owner` field is moved up in the modal so this isn't needed.
2022-09-14 15:45:36 -07:00
aadiljaleel 654bab1d19
popovers: Replace full profile avatar border with box-shadow.
This makes the visual border appear outside the image, not overlapping its edges.

Fixes: #21265
2022-09-14 09:26:53 -07:00
Tim Abbott 0da9fdf28f Revert "read_receipts: Use 'one person' instead of '1 person'."
This approach will be confusing for translators for languages where
the same conjugation is required "21" as for "1".

This reverts commit 53cf974b89.
2022-09-13 11:54:19 -07:00
Ganesh Pawar f58620c7ec org settings: Move invitations required checkbox to the top.
This commit moves the
"Invitations are required for joining this organization" checkbox
in `Organization permissions` settings to the top.
2022-09-13 11:39:21 -07:00
Yogesh Sirsat ce14df0f4f custom_profile_fields: Display data of default external type while edit.
Display values of "name" and "hint" field in non-editable way while
editing default external account type profile fields.
2022-09-13 11:38:47 -07:00
Yogesh Sirsat c1cf691080 custom_profile_fields: Remove redundant empty val set from edit form. 2022-09-13 11:38:47 -07:00
Lauryn Menard 04fd1c8773 keyboard-shortcuts: Simplify `adjust_mac_shortcuts`.
Since we are updating the help center documentation to use `<kbd>`
HTML elements when documenting keyboard keys and shortcuts, we no
longer need to support `<code>` HTML elements in
`adjust_mac_shortcuts`.
2022-09-13 11:21:10 -07:00
Lauryn Menard fe7d7b48db help-docs: Use `<kbd>` HTML elements for references to keyboard keys.
Updates references to keyboard keys in the help center docs to use
`<kbd>` HTML elements, which also means updating them to be as the
key would appear on a keyboard.

Previously, uppercase and lowercase letters were used to indicate
when/if the `Shift` key was being used, and even that was not
consistent throughout the documentation.

For CSS styling, adds a similar rule for `<kbd>` elements that is
used in `/static/styles/app_components.css`. And updates the CSS
class used in `/static/js/portico/help.js` for `adjust_mac_shortcuts`
accordingly.

Also, takes advantage of revising these pages for making small
updates for current help center documentation practices.
2022-09-13 11:16:14 -07:00
Lauryn Menard 899f535b39 forms: Update create organization part of registration form.
Adds a legend to the "org-registration" fieldset where the user
inputs info about the new organization. Previously, there was only
a legend for the "user-registration" fieldset. Also, increases
the opacity of CSS rule for the legend color so that they are
more visible.

Removes the hint text about what the organization URL value is
used for since it is pretty clear from the field's name.
2022-09-13 10:41:03 -07:00
yogesh sirsat f3578912fa custom_profile_fields: Disable "External account type" select field.
Disable "External account type" select field from External account type
profile field edit form, doing it because this select field is not
editable and it is incorrectly looks like editable.
2022-09-12 14:29:11 -07:00
Yogesh Sirsat aa7fddbc1d custom_profile_fields: Display data of default external type fields.
Display default values of "name" and "hint" field in uneditable way
while creating new default external account type profile fields.
2022-09-12 14:29:11 -07:00
N-Shar-ma ca2c0f7e21 i18n: Internationalized placeholder text "Question" for `/poll`. 2022-09-11 14:10:07 -07:00
N-Shar-ma 20620e68a4 compose: Add format hinting for spoilers.
Until now, whenever typeahead autocompleted the spoiler syntax, there
was no indication if and how a visible header to the hidden content
could be added.

Now when autocompleting, the word "Header" is added as a placeholder
and highlighted, hinting at the format.

Fixes: #20868.
2022-09-11 14:10:07 -07:00
N-Shar-ma c4d9d1d33b typeahead: Simplify code path for highlighting after selection.
This makes the implementation more readable, and also dependant only
on the `highlight` object, not the detail that previously only slash
commands, which have an `item.placeholder`, used this code path.
2022-09-11 14:10:06 -07:00
Tim Abbott 53cf974b89 read_receipts: Use 'one person' instead of '1 person'. 2022-09-11 12:47:27 -07:00
Zixuan James Li 7565dec728 read_receipts: Add a link to the help docs of read receipts.
Because we are also rendering a link here, the message can no longer be
plain text.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-09-11 12:42:30 -07:00
Zixuan James Li a6b017f0c6 read_receipts: Alter translation string in accordance with Transifex.
This is a proposed fix to allow the pluralization forms to correctly
show up in Transifex's UI for the translators.

Context can be found here:
https://chat.zulip.org/#narrow/stream/58-translation/topic/ICU.20Message.20syntax/near/1431813

This is a followup to #22837.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-09-11 12:42:30 -07:00
sayamsamal c8f346b5e5 icons: Change mute icon from bell to speaker.
This icon is more standard, and lets us use a speaker icon for other
applications.

Fixes #21751
2022-09-09 17:32:19 -07:00
evykassirer 3f66a9ef2b messagebox: Add classnames to mark which messages contain which mentions.
This is part of redesigning messages (#22059). This commit adds
classnames to messages with mentions, differentiating direct mentions
from wildcard mentions from usergroup mentions, and this set us up
for a future commit where we'll have those different kinds of messages
be displayed in different colors.
2022-09-09 17:05:26 -07:00
Tim Abbott f765d7f523 Revert "message_edit: Use `disabled` instead of `readonly` to disable controls."
This appears to have broken "Copy and close" in "View source".

This reverts commit 73cfab8ba8.
2022-09-09 16:34:43 -07:00
David Rosa 33a618d169 integrations: Add generic bot macro to relevant docs.
There are a handful of integration docs that instruct users to create
a bot and select the "Generic bot" type without using a helper macro.

Adds a new macro to replace these instructions, including a screenshot
of the latest UI for selecting a bot type.
2022-09-09 16:31:33 -07:00
David Rosa 620854d437 integrations: Add incoming webhook macro to relevant docs.
Several integration docs instruct the user to create a bot, but don't
specify that the type of bot should be "Incoming webhook".

Renames create-a-bot.md -> create-an-incoming-webhook.md for clarity,
and replaces all incomplete instructions with this macro.
Renames bot_types.png -> bot_types_incoming_webhook.png and updates
the image with a screenshot of the latest UI.
2022-09-09 16:31:33 -07:00
David Rosa 217915a50c integrations: Remove "Yo".
The Yo company shut down in 2016.
https://en.wikipedia.org/wiki/Yo_(app)#History

Removes `yo` instances from `zerver/lib/integrations.py`.
Removes `zerver/webhooks/yo`.
Removes `static/images/integrations/yo-app`.
2022-09-09 16:31:33 -07:00
Raghav Luthra 4dad9fa158 user_settings: Add user setting to control the user list style.
Added a user_list_style personal user setting to the bottom of
Settings > Display settings > Theme section which controls the look
of the right sidebar user list.

The radio button UI includes a preview of what the styles look like.

The setting is intended to eventually have 3 possible values: COMPACT,
WITH_STATUS and WITH_AVATAR; the final value is not yet implemented.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2022-09-09 16:30:54 -07:00
Tim Abbott 5f626428de realm_user_settings_defaults: Fix alphabetization of fields. 2022-09-09 16:30:54 -07:00
Mateusz Mandera 95bc77ae4f help center: Update "SAML authentication" to follow help center guidelines.
Co-authored-by: Alya Abbott <alya@zulip.com>
2022-09-09 10:30:05 -07:00
Sahil Batra a4004e05a6 settings: Add help link with realm default of read receipts setting. 2022-09-09 09:31:04 -07:00
Sahil Batra bf97760544 settings: Add help link with user read receipts setting. 2022-09-09 09:31:04 -07:00
Anders Kaseorg 7d485aa58f docs: Correct more “webapp” to “web app”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-08 20:23:28 -07:00
Het Patel 2151ef3a8f
search help: Fix incorrectly using "email" as the example email address.
Fixes part of #22866.
2022-09-08 11:06:32 -07:00
Purushottam Tiwari 7879f78917 user groups: Implement edit features in user group settings overlay.
Follow up for #22214.
2022-09-07 12:09:28 -07:00
Purushottam Tiwari b1c81e2e02 user groups: Implement General tab functionalities for group settings.
There will be one more follow up commit to this, that will
add support for editing memberships of user groups and will
complete preliminary version for user group edit settings.

Follw up for #22214.
2022-09-07 12:09:28 -07:00
Ganesh Pawar 10a0bf4de4
settings: Add confirmation dialog to delete linkifiers.
Fixes part of #22812.
2022-09-07 11:29:18 -07:00
Ganesh Pawar bc317c0d0c
settings: Add confirmation dialog to delete data exports.
Fixes part of #22812.
2022-09-07 11:28:42 -07:00
Ganesh Pawar 92b4bb7ffc
settings: Add confirmation dialog to delete code playgrounds.
Fixes part of #22812.
2022-09-07 11:28:08 -07:00
Lauryn Menard 7f738803f0 help-docs: Rename organization language help center file.
Renames article about organization language used for automated
messages and invitation emails. Creates URL redirect and updates
links in repository (web app, help center and api documentation).

Prior to this change, the article was named:
'change-the-default-language-for-your-organization'.

Fixes #21949.
2022-09-07 09:45:37 -07:00
Anders Kaseorg 143a3350fa dependencies: Upgrade JavaScript dependencies.
jQuery is held at 3.6.0 due to
https://github.com/jquery/jquery/issues/5105.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-06 15:02:29 -07:00
Riken Shah 39a3944951 timepicker: Fix hours and minutes input getting squeeze in safari.
This issue is probably with the upstream bug in
`flatpickr` but we can fix it for us by specifying minimum
height to the input.

Fixes #22698
2022-09-06 12:57:24 -07:00
Sahil Batra bef9592d49 settings: Move custom input div inside the main setting div.
This commit moves "dependent-block" div inside the main
setting "input-group" div as the custom input is part of
that setting only. Also this will help in further refactoring
of settings code which will be done in next couple of PRs.

There are no changes visually, the space between settings
and inputs remain same.
2022-09-06 11:14:02 -07:00
Tim Abbott 03d385c1da pm_list: Remove unnecessary topic popover calls.
This was incorrectly copied from the topic_list logic in the original
implementation of a left sidebar private messages widget in
fd66d9f703.
2022-09-02 12:42:57 -07:00
rixant af1de04f97 user_status_ui: Add "At the office" option. 2022-09-02 09:00:10 -07:00
Tim Abbott 43a57494f9 settings: Fix incorrectly resolved merge conflict.
In 7b4f7b4a85, we replaced
do_settings_change the dialog_widget.send_api_request.

When 0a278c39d2 was rebased past that
change, the merge conflict was resolved incorrectly, resulting in
duplicate API requests.
2022-09-01 14:36:25 -07:00
Christopher Chong f1a3cdc4c6 integrations: Add Azure DevOps webhook integration. 2022-09-01 14:01:13 -07:00
jai2201 294be1661c unread: Use consistent background-color for unread count pills.
Change the background-color of all unread count pills in dark theme
to have 1 consistent type of color in complete application,
similar to how we have in light theme.

Fixes #21358.
2022-09-01 13:55:55 -07:00
jai2201 73cfab8ba8 message_edit: Use `disabled` instead of `readonly` to disable controls.
Currently when a user does not have the permission to edit the topic/content
of a message, the edit UI/view source UI correctly shows a greyed
out topic/message-content input field, however these fields incorrectly have a
click behavior, so to fix this we now would want to use `disabled` prop instead
of `readonly` attribute as `readonly` controls can still function and are still
focusable whereas disabled controls can not receive focus and are unclickable.

Fixes #22565.
2022-09-01 11:20:20 -07:00
Zixuan James Li 971729a338 read_receipts: Add pluralization for read_receipts.
Note that we do not include the situation when no one
has read the message yet. Though the ICU MessageFormat
has the capability to do that, that case has already
been handled in the if block.

Fixes #22830.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-09-01 11:19:06 -07:00
Het Patel b6a4e38c9d
settings: Fix styling of preview organization profile button.
Fixes #22743.
2022-08-30 22:58:56 -07:00
Khushiyant 8609c441ff images: Move Giphy images into proper subdirectories.
The logo were only used in the integration documentation and belong in
static/images/integrations/giphy/; the in-app image is given its own
directory.

Fixes #22464.
2022-08-30 22:40:59 -07:00
Khushiyant bfd38b3297 images: Move error/loading images into subdirectories.
Fixes part of #22464.
2022-08-30 22:40:59 -07:00
Aman Agrawal bc937168cd left_sidebar: Remove outline from streams scrolling container.
Simplebar sets tabindex for `simplebar-content-wrapper` which
makes it focusable. The outline which comes with it when focused
is annoying, so we remove the outline.
2022-08-30 22:29:31 -07:00
Aman Agrawal 379c6acbea portico: Add page to list open organizations.
Fixes #22020
2022-08-30 16:02:06 -07:00
Aman Agrawal cf274577f4 landing_pages: Remove unwanted underline on link focus.
When a user clicks on a link it triggers `:focus` and an
underline is displayed. This is not intentional.

Also, for keyboard users, we have a surrounding outline box
for focus, so this underline is redundant in that case too.
2022-08-30 16:02:06 -07:00
Aman Agrawal 5d3c6aa857 integrations: Round top borders and remove box shadow.
This makes it look good with the new footer.
2022-08-30 16:02:06 -07:00
Kartik Srivastava 0d9b1547ce user_topics: Rename set_muted_topics to set_user_topics.
We should now rename set_muted_topics to set_user_topics as with
the new user_topic event, there will be various types of user-topic
configurations to handle other than just muting topics.
2022-08-29 17:24:08 -07:00
Kartik Srivastava 03d9418010 user_topics: Use user_topics page_param instead of muted_topics.
Since we are replacing muted_topics with user_topics, the web app
should now be using the user_topics page_param to construct the
muted_topics map. Also, the UI should now use the user_topic event
instead of muted_topics to handle topic updates.

This updates user_topics.js to use the new user_topics page_param to
initialize the muted topics map. This also replaces the "muted_topics"
clause in server_events_dispatch.js with a "user_topic" clause.
2022-08-29 17:24:08 -07:00
Kartik Srivastava cf4bbf1ba5 user_topics: Add set_user_topic helper function.
As we plan to move towards using `user_topics` instead of
`muted_topics`, this helper method will be used to set an
individual `user_topic` event in the corresponding data
structure in the web app.
2022-08-29 17:24:08 -07:00
Lauryn Menard f03eed5231 keyboard-shortcuts: Document browse back and forward in history.
Documents in help center `/keyboard-shortcuts` and in the app `?`
menu the shortcuts used by browsers for navigating back and forward
through the open tab's history, which are made to work in Zulip.

Also, updates `adjust_mac_shortcuts` to update the shortcut keys
for users with Mac user agents.

Fixes #18542.
2022-08-29 15:20:49 -07:00
jai2201 663e9fe3fc unread: Indicate which topics have unread @-mentions.
Fixes #21637.
2022-08-29 12:49:08 -07:00
jai2201 fee877e99c unread: Indicate which streams have unread @-mentions.
Fixes part of #21637.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2022-08-29 12:49:08 -07:00
Tim Abbott 9aabe628ff bucketer: Store bucket_keys in reverse_lookup maps.
This makes it possible to fetch the bucket_key, not just the bucket
itself, given an item_id.
2022-08-29 12:49:08 -07:00
Eeshan Garg 5925ce16b1 demo-orgs: Disable billing and upgrade for demo organizations.
Disables submit buttons on billing / upgrade page for demo
organizations since they will need to become permanent
organizations before upgrading to Zulip Cloud Standard.

Also creates an alert banner on the same page that links to
the help center article on demo organizations.

Updates sub-headers on demo organizations help center
article to match link text and to follow general convention
of using imperative verb forms in help center subheaders.

Part of #19523.

Co-authored by: Lauryn Menard <lauryn@zulip.com>
2022-08-29 11:43:45 -07:00
Lauryn Menard 8a20884230 tippy: Initialize tippy in portico.
As a prep-commit for updating the billing / corporate pages for
demo organizations, initialize tippy.js with a default setting
for portico pages to use in general.
2022-08-29 11:43:45 -07:00
Lauryn Menard d5f4a93d6c bots: Refer to notification bot messages as automated notices.
Updates in-app and documentation references to automated messages
sent by the notification bot as automated notices (or automated
messages where more appropriate/clear), instead of notifications.

Also, makes some small related revisions / general clean ups to
`resolve-a-topic.md`.

Fixes #22188.
2022-08-29 10:54:08 -07:00
Anders Kaseorg 0612c29b02 dropdown_list_widget: Skip redundant jQuery object reconstruction.
Followup to #22747.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-26 12:17:08 -07:00
Anders Kaseorg 864abac946 js: Use jQuery .first() when appropriate.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-26 12:17:08 -07:00
evykassirer 69685c2864 drafts: Create a section to show drafts from the current conversation.
Fixes #21716.

By allowing users to view drafts that are addressed to their current narrow,
we hope to help them more easily find and continue previously drafted
messages.
2022-08-25 23:12:31 -07:00
evykassirer bc2149d1ef people: Extract emails_to_full_names_string helper.
This code that previously lived in a larger function is needed by
another function in PR #22127.
2022-08-25 17:48:50 -07:00
Sean Heckathorne 6728ee1f0e compose: Clear preview UI when recipient change clears compose box.
Previously, we cleared the preview element only when cancelling
compose, which meant the compose box would be left in an invalid
state, showing a preview from a no longer active draft, if switching
recipients with it open.

Fix this by moving the call to clear the preview state to clear_box,
which is called in both the hide_box (close compose) and change
recipient code paths for clearing compose after not having sent a
message.

Fixes #22703.
2022-08-25 16:07:44 -07:00
nickgiann 011233d016 digest: Add header above plain text view of digest.
This commit adds a header above the plain text view of the digest to
be more clear about what the user is seeing.

A bit hacky, but the page is an internal development tool.

Fixes #21165.
2022-08-25 16:00:43 -07:00
Anders Kaseorg d123056000 settings_config: Add specialize_stream_notification_setting table.
This fixes a bug in commit 513207523c
(#21284) where handle_global_notification_updates would throw an error
on wildcard_mentions_notify because our API isn’t as symmetric as it
should be.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-25 13:02:48 -07:00
Anders Kaseorg 5387e56da7 settings_config: Add generalize_stream_notification_setting table.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-25 13:02:48 -07:00
Anders Kaseorg 77599d4db1 sub_store: Extract StreamSpecificNotificationSettings type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-25 13:02:48 -07:00
Anders Kaseorg 4240b0400b user_settings: Extract {Stream,Pm}NotificationSettings types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-25 13:02:48 -07:00
Anders Kaseorg 804be2f2a5 settings_config: Remove incorrect ‘Type’ suffix on type names.
‘Type’ only makes sense as a suffix on a type *of types*.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-25 13:02:48 -07:00
David Rosa 682367a3fd help: Document "View user profile" mobile app feature.
Adds instructions for mobile app users.
2022-08-25 11:05:07 -07:00
David Rosa a1e9ac145d help: Add info icon to mobile stream settings macro.
Replaces the unicode character ⓘ with the corresponding
SVG image icon that matches the mobile app's info button.
2022-08-25 11:05:07 -07:00
Tim Abbott 4ac4573c52 unread_ops: Harden against bugs involving recent topics.
In theory, this function should never be called when Recent Topics is
visible. But if it somehow is, ensure that we don't access
message_lists.current without first checking whether it's visible.
2022-08-24 16:13:56 -07:00
Tim Abbott 50f6d7ff73 message_lists: Avoid setting message_lists.current in recent topics.
The original change in 5f127c85f7 was
intended to make the loop in message_lists.js not include a
potentially stale message_lists.current in the event that one is
viewing recent topics.

We revert that change and instead do the simpler thing of explicitly
checking whether we're viewing recent topics.

I was not able to prove this code was responsible for incidents this
week where all messages were marked as read while working in "Recent
topics", but is suspicious.

Likely the correct thing is to set message_lists.current to undefined
in this code path; I'm pretty sure it's an orphaned message list that
is no longer visible when viewing topics.
2022-08-24 16:13:56 -07:00
David Rosa 104fd6566a help: Document "Private messages" mobile app feature.
Adds step-by-step instructions for mobile app users including the
corresponding image icons for the buttons that they should tap on
their screen.

Makes individual SVG image icons, for the help center docs, available
in `/static/images/help/`, instead of importing the entire set of
icons as dependencies.

Adds the icons for the "PMs" tab from https://feathericons.com, and
"Checkmark" and "Send" buttons from https://materialdesignicons.com.
Adds a new nested CSS selector to `.markdown img` so that the default
white border for images does not get applied to these icons.
2022-08-24 15:21:42 -07:00
Purushottam Tiwari 6242604b9d user groups: Fix hashchange logic for user group settings.
We were not handling hashchange for user group settings
under diffrent conditions. So this commit adds logic for
handling various diffrent cases of hashchange for user
group settings. We also take care that #groups only in
development environment.
2022-08-23 17:40:02 -07:00
Purushottam Tiwari c0acffb8a8 user groups: Set up right panel for user group edit.
This is preparatory commit that does basic UI set up for
user group edit in group settings overlay. This allows us to
write proper hashchange logic for user group settings overlay
under diffrent situations.
The work in this commit will be extended in further commits
to add proper UI and group edit logic.
2022-08-23 17:40:02 -07:00
Purushottam Tiwari a8c3be7fee user groups: Add new UI support for user group creation.
Add support for creation of user groups using right panel
of new user group settings overlay being developed as part
of https://github.com/zulip/zulip/issues/19526.

In further commits we will add support for editing user
groups using right panel of the overlay.

This commit also introduces a minor bug related hashchange
for #groups which would be a quick fix once we have UI
for group edit on #groups overlay.
2022-08-23 17:40:02 -07:00
Purushottam Tiwari c1cb5a6ef1 user groups: Set up right panel for user group settings overlay.
This is a preparatory commit to set up basic UI for right panel
in user group settings overlay. At this point we only ensure
the proper display of the two panels under different screen sizs.

Actual functionality for user group creation and user group
edit will be added in subsquent commits.
2022-08-23 17:39:52 -07:00
Purushottam Tiwari 072996141f user groups: Add filter for group list in group settings overlay. 2022-08-23 17:30:39 -07:00
Purushottam Tiwari 76aae8c5a0 user groups: Add user group rows in left for user group overlay. 2022-08-23 17:30:39 -07:00
Purushottam Tiwari 656f6a0fe9 user groups: Add overlay for user group settings.
Dedicated overlay for user group settings is added as part of
addressing zulip#19526.

The newely added overlay is currently empty and more UI
related to settings is to be added in further commits.
2022-08-23 17:30:39 -07:00
Purushottam Tiwari ff2db9c235 user groups: Rename settings_user_groups to settings_user_groups_legacy.
A preparatory commit to have legacy user group settings logic
as we move forward to redesign the user group settings.

This is done so that current user group settings are functional
while we are working on the redesign, and also to make it clear
that most of the code in this file will be deleted and developers
should avoid spending much time on it.
2022-08-23 17:30:39 -07:00
Sahil Batra 526914a996 settings: Set the custom input elem value to original value when hiding.
We now set the value inside custom input element of message and delete
limit setting to the original setting value when hiding the input in
process of changing the setting.

This fixes the bug of the save-discard button not hiding on doing
the following changes -
- Change the setting value from Anytime (or any other option) to custom.
- The save-discard widget appears. Now write something in custom input
box.
- Then change the setting value to the original value, which in this
case can be considered Anytime as mentioned above.

The save-discard widget should be hidden after above steps because
the setting value is changed to its already set value, but it does
not without doing the changes in this commit because
check_property_changed returns true for custom input element.
2022-08-23 16:17:25 -07:00
Sahil Batra ba0c5a2380 settings: Fix save button not being re-enabled correctly.
The "Save changes" button was not re-enabled if the initial
setting value was "Anytime" and then setting is changed to
"Custom" (which disabled the button since input is empty) and
then followed by changing to some other option.

This commit fixes the above mentioned bug. This bug was
introduced in #21837 where we added the functionality to
disable the save button.
2022-08-23 16:17:25 -07:00
Sahil Batra f3c15affd7 settings: Extract code for disabling save button in a function.
This is a prep commit so that we can reuse the function to enable
or disable the save button when changing the message edit and delete
setting dropdown.
2022-08-23 16:17:25 -07:00
Sahil Batra 1da7086c35 settings: Fix save button being disabled even for valid values.
On changing either one of message edit or delete limit setting
from "Any time" to "Custom", the "Save changes" button is not
enabled even after entering valid input.

We can see this bug if both the edit or delete limit setting is
set to "Anytime" initially and one of the setting is changed to
"Custom".

This is because the custom input for "Any time" case is empty even
though it is hidden and the check for disabling the button was
not checking whether the input is hidden or not.

This commit changes the code to consider the value in custom input
box only if the input is visible, i.e. the dropdown value is set to
"Custom".

This bug was introduced in #21837 where we added the functionality
to disable the save button.
2022-08-23 16:17:25 -07:00
Sahil Batra 1990a1ff99 settings: Hide save-discard widget correctly when setting is not changed.
This commit fixes the bug where save-discard was not hidden when message
edit or delete setting is first changed from "Anytime" to any other value
and then again to "Any time". The save-discard widget should be hidden
since the setting is value was "Any time" already.

The bug was because check_property_changed returned true for
"realm_message_content_edit_limit_minutes" and
"realm_message_content_delete_limit_minutes" for above case as value of
setting in page_params for "Any time" case is "null" and
get_input_element_value returned "undefined" as the custom input box is
empty for "Any time" case.

This bug was introduced in #21837 where we changed the input box to be
empty for "Any time" case.
2022-08-23 16:17:25 -07:00
Lauryn Menard 3de4fd5fbb recent-topics: Check topic exists when trying to revive focus.
When a message is deleted, if it was the only message in the topic
and it was the previously focused message in recent topics, then
the topic is no longer in the recent topics data.

In this case, we revive the focus to the adjacent message or, if it
was the last message in the view, the focus is reset to the search
bar.
2022-08-23 15:59:06 -07:00
Israel Ebonko 1f286ab283 integration: Add wekan integration.
Fixes #13086

Co-authored-by: Ganesh Pawar (ganpa3) <pawarg256@gmail.com>
2022-08-22 15:37:22 -07:00
Ganesh Pawar 544e472ec3 user profile modal: Don't close settings when opening modal.
Fixes #22572.
2022-08-22 15:32:18 -07:00
Sahil Batra cb15767df3 settings: Update label for realm-level default of send_read_receipts. 2022-08-20 15:38:34 -07:00
Anders Kaseorg 3e7d7ee86a integrations_dev_panel: Remove unused idempotent flag.
Followup to commit fde9b1d366 (#22753).

(This was a misuse of “idempotent”.  “Idempotent” means that
performing the request more than once in a row has the same effect as
performing it once; it says nothing about whether the response is
cacheable.)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-19 16:45:09 -07:00
Anders Kaseorg d923096882 channel: Remove pending_requests list.
It’s been unused since commit 2eacc7317d
removed the only caller of abort_all and commit
ef815e9e79 removed abort_all itself.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-19 12:17:40 -07:00
Anders Kaseorg c84f35644d channel: Stop monkey-patching password change counts into XHR objects.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-19 12:17:40 -07:00
Anders Kaseorg fde9b1d366 channel: Remove idempotent retry loop.
This was added by commit 7f174213ed, and
appears to have been designed for responses that are *successful* but
falsy. Logically, these should not implicitly represent a failure to
be retried if it were.

Note from tabbott: The background is that this idempotent retry loop
was a hacky workaround for a bug we never understood but saw daily in
production. Especially during server restarts / client reloads,
something would result in 200 responses with no data being seen by the
frontend, despite the Django server not having received/processed the
request. Fortunately, this strange failure mode appears to have
stopped happening in late 2019, so we can delete this hack.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-19 12:14:41 -07:00
Tim Abbott bc0ca5f769 read_receipts: Fix rendering of avatars for some Gravatar users.
The previous logic was just using the `.avatar_url` field on objects
returned by `people.js`, which can be null/undefined.
2022-08-18 18:10:06 -07:00
Anders Kaseorg 89d22d143c message_edit: Repair incorrectly moved with_first_message_id function.
Commit 9aa5082d63 (#20673) incorrectly
changed the name of the error callback passed to channel.get.  This
prevented reporting of errors while moving a topic.  Fix it.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-18 17:39:25 -07:00
Anders Kaseorg b0dba411d9 js: Skip redundant jQuery object reconstruction.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-18 16:11:13 -07:00
evykassirer 747ea8e84d copy-paste: Fix edge cases on message selection for copying.
When we detect that multiple messages are selected, copying will copy the
entirety of each message that is selected. [more conversation on that
here](https://chat.zulip.org/#narrow/stream/6-frontend/topic/triple.20click.20.2B.20copy.20paste.20bug/near/1398292).

This commit fixes a bug where we would select the entirety of a message
following a selection even when none of that last message's text was
selected (only some HTML element in the messages's container).

Fixes #18706.
2022-08-18 15:20:21 -07:00
evykassirer 96b2e18b0d copy-paste: Separate intial_end_tr logic into its own function.
Creates a new function get_end_tr_from_endc. This will make it
easier to add more logic to this function to fix a bug (#22350).
2022-08-18 15:20:21 -07:00
evykassirer 358416349e copy-paste: Stop treating selections with extra whitespace as multi-line.
A message selection that goes off the end of the last message in a topic
could still be a selection of only one message. We shouldn't assume that
it's multiple messages, and so there shouldn't be an assignment of
`skip_same_td_check = true`.
2022-08-18 15:20:21 -07:00
Tim Abbott 303bbee2a2 message_lists: Remove cases for table_name being undefined.
The table_name property was only ever undefined for the
special all_messages_list object.

In 6f764ce4b3, we downgraded that object
to only have a MessageListData; as a result, we now never construct a
MessageList or MessageListView without `table_name` set correctly.
2022-08-18 12:30:30 -07:00
Aman Agrawal b8661b6633 message_lists: Add a function to return rendered message_lists.
This function returns home message_list and the current narrowed
message_list if it is different than home.
2022-08-18 12:30:30 -07:00
Aman Agrawal 5f127c85f7 recent_topics_ui: Set current msg_list to home when RT is visible.
`current` should ideally be `undefined` here to reflect the
correct narrow state but to make sure background updates of
message_list go smoothly, we set it to home.
2022-08-18 12:30:30 -07:00
Sahil Batra 5cc5d15de1 settings_org: Reuse code to enable or disable delete limit setting.
This commit reuses set_delete_own_message_policy_dropdown to enable
or disable the time limit settings based on change in
delete_own_message_policy dropdown.
2022-08-18 11:50:50 -07:00
Sahil Batra 3a6de60fe0 settings_org: Pass value to set_delete_own_message_policy_dropdown.
This is a prep commit for deduplicating code and using this same
function set_delete_own_message_policy_dropdown for disabling or
enabling the limit setting while changing policy dropdown.
2022-08-18 11:50:50 -07:00
N-Shar-ma 87cb449d08 search_suggestions: Fix bug where space in stream names did not show.
For multi word stream names, searching for particular phrases, like
the entirety of any word in it, caused no space to show before and/or
after that word. For example, searching for `core` resulted in
`**core**team` (the space between `core` and `team` missing).

The cause of this bug was that the immediate container was `div` with
`display: flex` and so spaces at the ends of its immediate child
elements: text nodes and `strong`  elements - were not respected. This
is fixed now by wrapping all the `description_html` text in a `span`
element (while the optional user_pill_context stays in another `span`
as before).
2022-08-18 11:22:08 -07:00
Anders Kaseorg e0b593f67e js: Use .empty() instead of .html("").
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-17 16:04:55 -07:00
YashRE42 de663184f3 message_view_header: Color web public stream globe icon.
We forgot to change the selector here when we switched from a fa globe
icon to a .zulip-icon, which resulted in the new globe icon only having
the default color.
This commit makes the appropriate change.
2022-08-17 12:09:12 -07:00
Lauryn Menard a85d589254 stream_events: Use `is_muted` event instead of `in_home_view` event.
Updates `stream_events.js` to use the subscription update event that
is now being sent for the `is_muted` stream property, instead of the
event sent for the `in_home_view` property.

Because the server is still sending events for `in_home_view`, keeps
it as a property processed by `update_property` function, but does
nothing with the event. Adds temporary test for coverage.
2022-08-16 16:52:15 -07:00
Kartik Srivastava 47e5ccf086 user_topics: Rename muted_topics.js to user_topics.js. 2022-08-16 14:39:24 -07:00
N-Shar-ma 87a6c3924b compose: Allow ctrl + enter to send in preview mode as well.
When the user chose to send the composebox message on pressing ctrl +
enter instead of just enter, it only worked in writing mode but not in
the preview mode.

This change makes ctrl + enter send the message even in preview mode,
when that setting is chosen.

Fixes: #21670.
2022-08-16 14:35:47 -07:00
Tim Abbott 745b96ea46 compose: Fix enter returning user to preview mode.
I'm not sure whether the bug this fixes was a regression resulting
from d6d3683da0, or an old bug, but
focusing the compose box is not sufficient to end preview mode; we
should be calling the function that's explicitly for that.
2022-08-16 14:34:11 -07:00
Oliver Pham 2ed650f596 search_suggestion: Show profile pictures in autocomplete suggestions.
Because the typeahead.js list items are currently just text, a user's
full name and avatar should be displayed in `input_pill`. To use
`input_pill`, a separate Handlebars partial view was created to
provide a mandatory container (`<div class="pill-container">`) for
`input_pill` and a flex container (`<div class="search_list_item">`)
for vertically aligning the text.

The description of each suggestion (i.e `description_html`) is
rendered as raw HTML, so every special character (e.g. whitespace)
should be HTML-escaped. This enables highlighting the substring in
each search suggestion that matches the query.

Fixes: #20267
2022-08-16 14:17:42 -07:00
N-Shar-ma 9cc8a2bc80 refactor: Change hilite to highlight_query in search_suggestion.
This is a prep commit for #20494.
2022-08-16 13:56:33 -07:00
N-Shar-ma d63e127f5c refactor: Change highlight_person to person_highlighter in search.
This is a prep commit for #20494.
2022-08-16 13:56:33 -07:00
N-Shar-ma 865023802e refactor: Change description to description_html in search suggestions.
This is a prep commit for #20494.
2022-08-16 13:56:33 -07:00
N-Shar-ma e52268aeee documentation (user): Document `/poll` in `?` help widget.
To make it easier for users to make polls, their syntax is documented
using an example along with its (non dynamic) rendered version.

Fixes: #18588.
2022-08-16 13:55:56 -07:00
N-Shar-ma 7115895bbc documentation (user): Remove redundant 2nd line from /me documentation. 2022-08-16 13:55:56 -07:00
N-Shar-ma d6d3683da0 compose: Focus 'Write` button on entering preview mode.
Till now, switching back to writing mode after preview mode, needed
the user to first focus on the `Write` (unpreview) button by tabbing
to it (if using keyboard) and then select it.

To make things easier, especially when using keyboard, now the `Write`
button will be automatically focused on entering preview mode, so
going back to writing mode only needs one 'Enter` keystroke.
2022-08-16 13:46:32 -07:00
N-Shar-ma 08e111501d compose: Refocus composebox when clearing prevew mode.
When switching back to writing mode after preview mode, the composebox
would be out of focus and so the the cursor would semingly get lost.

Now on clearing the preview mode, the composebox is focused and so the
cursor is seen blinking at it's original position.
2022-08-16 13:46:32 -07:00
Anders Kaseorg e8a30060ee js: Enable no-jquery/no-constructor-attributes.
https://github.com/wikimedia/eslint-plugin-no-jquery/blob/master/docs/rules/no-constructor-attributes.md

The motivation for this rule is a subtle caveat buried in the
documentation:

https://api.jquery.com/jquery/#jQuery-html-attributes

“While the second argument is convenient, its flexibility can lead to
unintended consequences (e.g. $( "<input>", {size: "4"} ) calling the
.size() method instead of setting the size attribute).”

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-16 13:42:28 -07:00
Tim Abbott b05e70899d message_edit: Don't send topic/stream changes if inputs readonly.
This makes the logic for whether to send content, topic, and stream
changes obviously parallel.
2022-08-15 19:13:34 -07:00
Aman Agrawal c5489c9d2b message_edit: Don't send content to server if msg edit is disabled.
We ensure that if message edit is disabled, then we don't send
content in request to the server.

Refactored by tabbott to match the existing pattern for how we do this
for topic/stream edits.
2022-08-15 19:13:34 -07:00
Ganesh Pawar e758ec400b alert word: Convert inline form to modal. 2022-08-15 19:07:38 -07:00
Tim Abbott 4a34b7d18e left-sidebar: Make Subscribe to more streams more informative.
The "Subscribe to more streams" widget has always had this tension
between "Subscribe" vs. "Create" in a way that felt like whatever we
wrote could be confusing. To address this, we enhance the component to
advertise whether additional existing streams that the user can
subscribe to actually exist or not.

- When the user has N>0 streams they can subscribe to, we display
"Browse N more streams".

- When the user has no streams they can subscribe to (i.e. they're
already susbcribed to all the ones they could join) but the user has
permission to create streams, we show a "Create a stream" link.

- If the user doesn't have permission to subscribe to or create any
streams, we don't show a link at all.

Fixes #21865.

Co-authored-by: Jai soni <jai_s@me.iitr.ac.in>
2022-08-15 12:32:43 -07:00
jai2201 d557933a76 dipatch: Remove a stale comment.
This stopped being true in 1d7d686.
2022-08-14 22:56:03 -07:00
Tim Abbott e083a4bf46 drafts: Fix draft controls being offscreen on mobile web.
This was caused by an interaction with the controls being positioned
absolutely -103px from the right edge of the element, which is clearly
a hack.

Replace that with a simple `float: right` construction, with the top
padding aligned.

Fixes #22512.
2022-08-14 09:07:11 -07:00
Tim Abbott b67ff652de css: Remove Bootstrap legend CSS.
We inline this into the CSS for the one element where we use it.
2022-08-13 17:36:08 -07:00
Tim Abbott 1e018f9c23 css: Remove legacy bootstrap control* CSS.
We've removed all use of these CSS classes from the codebase.
2022-08-13 17:18:32 -07:00
Tim Abbott 0b350f23af settings: Remove useless .controls CSS.
These settings widgets have not had an object with the .controls CSS
class at least since they were given independent template files.
2022-08-13 17:11:36 -07:00
Tim Abbott e30e8c0e6d settings: Fix settings inputs broken in mobile sizes.
In 84e307581f, we removed the HTML that
these CSS rules applied to. (We incorrectly only tested that commit in
desktop sizes).

Also, the width: 100% rule both did not have sufficient priority to
apply, and also exceeded the size of the input. Fix this with a hacky
!important, since there's a good chance we'll replace these inputs
with a modal or something.
2022-08-13 17:11:36 -07:00
Ganesh Pawar d9410f37c1 signup: Remove stale highlighting function.
This function was introduced in
447dc0029a74c8ff47d13fa40ce97dc10f20b522; but we haven't been using
this highlighting feature; and the last control-group was removed from
the signl page in dc2bdb2aad.
2022-08-13 17:09:10 -07:00
Ganesh Pawar f6f85f98a7 portico: Remove usage of `control-group` and `control-label` class. 2022-08-13 14:59:37 -07:00
Sahil Batra 44266987ec settings: Disable the save button if custom time limit input is invalid.
We disable the "Save changes" button if the custom time input for
edit and delete time limit is 0, -ve values or empty.
2022-08-12 18:09:53 -07:00
Sahil Batra b5ff903ddc settings: Make custom input empty for "Anytime" case.
We set the custom input box empty for "Anytime" case for
message edit and delete limit settings. We also keep the
"Save changes" button disabled when changing from "Anytime"
to "Custom" since the input box is still empty.
2022-08-12 18:09:53 -07:00
Sahil Batra 3c1fbeb3c7 settings: Enable or disable delete limit setting before saving.
We enable or disable the delete limit setting immediately on
changing the "Who can delete their own message" dropdown
before saving the changes.
2022-08-12 18:09:53 -07:00
Sahil Batra f52e4ee602 settings_config: Use time_limit_dropdown_value for delete limit values.
Since, we removed the "never" option for edit-limit setting in
previous commits, we can now use same list for both edit-limit
and delete-limit setting values.
2022-08-12 18:09:53 -07:00
Sahil Batra 0c67c7d269 settings: Add checkbox for whether message editing is allowed or not.
This commit adds a checkbox for allow_message_editing setting and
thus we also remove the "Never" option from the time limit dropdown
as unchecking the newly added checkbox will mean the same.

We also disable the time limit input if message editing is not
allowed.

This commit also changes the label for time limit dropdown.

Fixes part of #21739.
2022-08-12 18:09:53 -07:00
Sahil Batra a1f40ccda5 message_edit: Make zero invalid value for message_content_edit_time_limit_seconds.
This commit changes the code to consider zero as an invalid value for
message_content_edit_time_limit_seconds. Now to represent the setting that
user can edit the message anytime, the setting value will be "None" in
database and "unlimited" will be passed to API from clients.
2022-08-12 18:09:53 -07:00
Sahil Batra 864fe7befb settings: Rename "Message editing" to "message and topic editing".
Fixes part of #21739.
2022-08-12 18:09:53 -07:00
N-Shar-ma cfa4973441 typeahead: Fix thin blue line bug when there is space after `>`.
When the user added space/s right after the topic typehead symbol `>`,
a thin blue line would be selected at the top of the typeahead menu.

To avoid this and to make stream and topic typeaheads' behaviour more
consistent with each other, space/s right after `>` is not allowed,
like it is not allowed right after `#`.

Fixes: #19124.
2022-08-12 16:47:06 -07:00
jai2201 aa700ff59d pm_list: Handle narrow functions separately for pm_section.
This commit is a preparatory commit for #20870, it introduces
`handle_narrow_deactivated` and `handle_narrow_activated`
functions in pm_list.js, separately from top_left_corner.js,
to reduce the complexity of handling private messages section
separately.
2022-08-12 15:26:00 -07:00
Dinesh 48d2783559 read_receipts: Add support for displaying read receipts.
Adds an API endpoint for accessing read receipts for other users, as
well as a modal UI for displaying that information.

Enables the previously merged privacy settings UI for managing whether
a user makes read receipts data available to other users.

Documentation is pending, and we'll likely want to link to the
documentation with help_settings_link once it is complete.

Fixes #3618.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2022-08-12 13:16:35 -07:00
Tim Abbott 828867c733 overlays: Allow calling open_modal with a modal already open.
Previously, our modal system prevented opening a modal when one was
already open. It appears this was implemented to work around the fact
that we're using Micromodal selectors to determine if a modal is open
(and those don't update until after an animation frame).

We'd like to support opening the full user profile and manage user
modals while read receipts is open. While we could work around this in
that place, it feels like one needs a lot of documentation in order to
add a setTimeout in those code paths.

So we instead make open_modal support this, with a guard to prevent
infinite recursion in case of future bugs.

Note that dialog_widget was already closing modals before opening the
next one, so this is a behavior change only for our 3 modals that do
not use dialog_widget.

(I'm not sure why the `dialog_widget` modals did not already require a
delay, but likely there's some CSS difference).

We likely will want to redo this to instead use a better state
tracking system.

See https://chat.zulip.org/#narrow/stream/49-development-help/topic/close.20and.20open.20another.20modal.20immediately
for discussion.
2022-08-12 13:16:35 -07:00
Dinesh 63d71ecb0c popovers: Use e.currentTarget for .view_user_profile event listener.
The previous version with e.target would give the element that was
clicked lying inside an element with '.view_user_profile'.

One would usually expect "data-user-id" to be attached to the
same element with ".view_user_profile" instead of any of its children.
So, to just look for "data-user-id" in the element with that class,
instead of any of its chidren, this commit changes e.target to
e.currentTarget.
2022-08-12 13:16:35 -07:00
Sahil Batra 43fb872f3f settings: Add UI for changing read receipts realm_user_default.
Fixes #22657.
2022-08-12 11:25:35 -07:00
Sahil Batra 894879d1fe settings: Change label of send_read_receipts setting.
The previous label was ambiguous and suggested one needed to have sent
a message in a given conversation to see read receipts.
2022-08-12 11:25:16 -07:00
Sahil Batra 8302337aa9 settings: Add tooltip for user read receipts setting.
We show tooltip for user read receipts setting mentioning
that the organization has disabled read receipts setting
when an organization does so. We hide the tooltip when
organization read receipts setting is enabled.

We also fix the alignment of "i" icons with label and headings
at various places by moving it 1 pixel below. There may be
some places where it is not fixed, but those will be fixed
separately.
2022-08-12 11:21:44 -07:00
Sahil Batra 103115dad6 settings: Add checkbox for enable_read_receipts setting. 2022-08-12 11:21:43 -07:00
Anders Kaseorg 1f9573d527 Revert "pm_list: Handle narrow functions separately for pm_section."
This reverts commit 46b289cbda.

This commit didn’t pass Node tests independently of the PR #21726 that
it was split from, because pm_list is mocked.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-11 18:12:12 -07:00
jai2201 46b289cbda pm_list: Handle narrow functions separately for pm_section.
This commit is a preparatory commit which introduces
`handle_narrow_deactivated` and `handle_narrow_activated`
functions in pm_list.js, separately from top_left_corner.js,
to reduce the complexity of handling private messages section
separately.
2022-08-11 17:39:04 -07:00
evykassirer 3ddb2b1457 drafts: Move padding from draft rows to whole list.
This is a refactor with no visible change. It allows other elements
to more easily be added to the draft list and have the same padding.
2022-08-11 16:36:56 -07:00
Rishabh-792 91a0e14778 settings: Fix text alignment in save and discard buttons.
The text inside save/discard widget buttons was misaligned with
respect to the icon in the button. To align it properly, we add
vertical-align and a reduced line-height property to the span.

Fixes: #20583.
2022-08-11 16:12:18 -07:00
Biki-das c387e7c2ec settings: Fixes alignment of save/discard widget with text.
Resolves the issue by aligning the buttons with the text.

It's not entirely clear why text-bottom is the correct alignment, but
visually it seems to be correct.

Fixes: #20583.
2022-08-11 16:06:03 -07:00
jai2201 1986b37a04 message_edit: Close message edit UI after message is moved.
Currently, if we navigate to some other topic/stream
while the message is being moved, the message edit UI
still remains open as we do not get its `row` in
`message_lists.current` since the message has not moved yet
to the stream/topic we navigated.

Hence the correct thing to do would be to delete
the message_id from `currently_editing_messages` if it
exists there but we cannot find the row.

Fixes #21724.
2022-08-09 16:24:44 -07:00
Adam Sah 56b2b838ee narrow: /streams/public should not have bookends.
Fixes #18280.
2022-08-09 16:21:39 -07:00
Tim Abbott 7d77f496bd message_events: Fix buggy variable reuse.
Previously, the topic_edited and stream_changed variables were
incorrectly used outside the loop over events, in a way that meant
we'd use the values of these from the last event, when we clearly
meant to use whether, for example, the current stream was changed.

In practice, it's rare for a client to process multiple message edit
events at the same time, but this will happen anytime a client is
offline for a few minutes during which several edits occur.
2022-08-09 16:06:21 -07:00
Tim Abbott d0fb83c2eb message_events: Reorder to better organize variables. 2022-08-09 16:06:21 -07:00
Tim Abbott 675c42f40b message_events: Use new_stream_id consistently and add comments. 2022-08-09 16:06:21 -07:00
Tim Abbott 95c1f3b696 update_messages: Add old_stream_id variable for readability.
Having a parallel to new_stream_id seems better than accessing the
original event object directly for only one of these.
2022-08-09 16:06:21 -07:00
evykassirer 4c8079c49a drafts: Update drafts when topics are moved.
We've for years done this for the currently open compose box state,
and it seems very natural to do this for drafts as well.

Fixes #22068.
2022-08-09 16:06:21 -07:00
Ganesh Pawar 29288993e8 invites: Remove stale use of `control-group` class.
The invitee emails html doesn't contain the `control-group`
class.
2022-08-09 10:36:27 -07:00
Ganesh Pawar 84e307581f minor: Remove usage of `control-group` and `control-label` class. 2022-08-09 10:36:27 -07:00
Ganesh Pawar 91723afbae minor: Remove stale `control-label` CSS.
None of the removed classes/id's make use of the `control-label`
class.
2022-08-09 10:36:27 -07:00
Tim Abbott 98c7427bfc message_edit: Remove Bootstrap cruft from message edit form.
* Remove likely useless use of `controls` Bootstrap class.
* Remove outer control-group elements, which just added 10px bottom margin, and
  were always used with .no-margin, which removed that margin :).
* Rename message-edit-timer-control-group to message-edit-timer, since
  it isn't a control-group.
2022-08-06 22:28:40 -07:00
Tim Abbott 9c1c0016ed css: Clean up message edit form CSS somewhat.
* Remove Bootstrap `form-horizontal` class and !important override
  required by it.
* Standardize on 10px bottom margins; this fixes subtle bugs in some
  sizes.
2022-08-06 22:28:40 -07:00
anurastogiji 1921dce7c7 message_edit: Swap propagate_mode with checkboxes in message edit form.
Previously, we had you select where to send notifications before
specifying which messages you're moving, which seems like the wrong
decision hierarchy.

Fixes #19973.
2022-08-06 22:28:40 -07:00
madrix01 c1b5021d84 stream_list: Sort muted to end of sections and add labels.
The stream list left sidebar currently has 3 sections:
* Pinned (+ Muted pinned streams)
* Active (+ Muted active streams)
* Inactive streams

Previously, these sections were separated by horizontal lines, which
did not provide an easy way to discern why there were sections. We add
labels to these section dividers to help with this.

Additionally, within each section, we now sort all muted streams to
the bottom, so that they general minimal clutter.

Fixes #19812.
2022-08-06 21:59:23 -07:00
Julia Bichler 0a278c39d2 settings: Send email after deactivating user.
This adds a feature where an admin can choose to send an email
with custom content to an user after they deactivated them.

Fixes #18943.
2022-08-06 21:41:53 -07:00
Yogesh b8a760b14e compose: Improve tooltip on compose box "x" button.
In compose box, the "x" button tooltip text changed to
"Cancel compose and save draft" except when unsent
message length is short(<3).

Also in help(?) > keyboard shortcuts, text for `Esc`
changed to "Cancel compose and save draft".

The help center page updated with the above changes.

Fixes #21599.
2022-08-06 20:46:46 -07:00
madrix01 45743ea195 recent_topics: Improve keyboard navigation around unread count.
Following c31ab1bcb5, the keyboard
navigation in Recent Topics has been buggy, because the number of
columns with actionable elements now varies with whether the topic
has any unreads.

Fix the keyboard dead reckoning logic to understand that there's a
different number of columns depending on whether the unread count is
present.

This does not fully make the experience nice, but it's enough to tide
us over for now.

Fixes: #21654.
2022-08-06 19:54:34 -07:00
Tim Abbott 7767ed217d recent_topics: Fix overly wide unread count focus outline. 2022-08-06 19:54:29 -07:00
madrix01 c5fed915cf recent_topics: Extract arrow key navigation into seperate functions.
This is preperatory commit for #21654.
We extract the logic for arrow key navigation when focused on table to
separate functions so it is easy to add more functionality in future
and will not clutter the switch block.

Fixes a part of: #21654
2022-08-06 19:35:12 -07:00
evykassirer 99d1c5a1f3 compose: Ensure we don't warn unresolved topic if not composing for a topic.
In future commits, it will become possible to have a non-null
`compose_state.topic()` while in private message view, because
we'll be keeping that state for switching between the stream
and private message views. See #21853 for further context.
We don't want to warn about a resolved topic unless the topic
is actively visible in the compose box.
2022-08-06 19:31:41 -07:00
N-Shar-ma e671decd29 typeahead: Update characters allowed before @-mentions.
Now the following characters are allowed before @-mentions, stream
references (starting with #) and emojis (starting with :) - space, (,
{, [, ", ', /, <.

Earlier only the opening brace type characters and space was allowed.
2022-08-06 19:29:39 -07:00
yogesh sirsat 87ba3c1549 custom_profile_fields: Convert edit profile field form into a modal.
This allows this component to follow existing design patterns, rather
than being its own unusual element with various quirks.

The implementation is approximately the same as before I just migrated
"Edit custom profile field" form into modal, like "Add new custom
profile field" form modal.

Fixes: #21634
2022-08-05 17:26:56 -07:00
yogesh sirsat 5c8fcee0a3 custom_profile_fields: Remove unnecessary field_form objects.
This commit is a preparatory commit of "custom_profile_fields: Edit
custom profile field form into modal."

The object returned by get_profile_field_info, which contained jQuery
objects for the profile-field-row and profile-field-form elements, was
just a source of unnecessary indirection, since none of the functions
consuming it accessed the row.
2022-08-05 17:26:56 -07:00
yogesh sirsat f885535a7c custom_profile_fields: Add form ID to add new custom profile field form.
This makes it easy to support submitting this form when pressing enter
by passing the `form_id` parameter to `dialog_widget.launch()`.
2022-08-05 17:26:56 -07:00
yogesh sirsat 526b55c6fc custom_profile_fields: Convert new profile field form to a modal.
This lets us remove this fairly ugly user interface widget, which was
inconsistent with the rest of the settings UI.

The implementation is approximately the same as before I just migrated
"Add new custom profile field" form into a modal, status update
notifications about these forms will be displayed inside their modal,
and made some little design changes as discussed on CZO.

Fixes part of: #21634
2022-08-05 17:26:56 -07:00
yogesh sirsat c60cdc46e3 custom_profile_fields: Change class from control-group to input-group.
This is a preparatory commit for commit "Edit custom profile
field form into modal."

Above mentioned commit will use class input-group instead of
control-group so here we are already changing it to input-group.
2022-08-05 17:26:56 -07:00
yogesh sirsat d0f5b38f65 custom_profile_fields: Control-group to input-group class correction.
There is no control-group class to hide/show in custom profile fields
list instead there is input-group class, kind of little typo I guess
from this 9e343f1 commit.
2022-08-05 17:26:56 -07:00
Ganesh Pawar 5697f7f269 archive stream: Update modal text.
Fixes #22658.
2022-08-05 15:55:13 -07:00
Julia Bichler 2f399d3470 stream settings: Live update the stream privacy icon.
This live updates the stream privacy icon in the general stream
settings after changing the privacy setting of the stream.
2022-08-03 17:46:06 -07:00
evykassirer 1167bb79ef compose: Match top right buttons' color to other compose buttons. 2022-08-03 17:08:01 -07:00
evykassirer 0524e1b40d compose: Rename show_box to show_compose_box.
This lets us remove a comment to clarify this.
2022-08-03 17:05:15 -07:00
Aman Agrawal ac8d984f7c tippy: Hide tooltip for inline images if the reference is removed.
Spamming the `s` shortcut when hovered on an image can cause the
tooltip to be displayed at the top left corner. This is caused by
original reference of the tooltip being removed from DOM. The
re-rendering is happening so quickly that tippy is not able to hide
the tooltip in time.
2022-08-03 16:20:11 -07:00
Aman Agrawal a43c4afb0b tippy: Move MutationObserver logic into a function.
So that it can be used elsewhere in the code.
2022-08-03 16:19:23 -07:00
Aman Agrawal 06deeb3239 bottom_whitespace: Extract to a dedicated handlebars template.
We'll be supporting changes its content in coming commits.
2022-08-03 16:14:42 -07:00