Commit Graph

12952 Commits

Author SHA1 Message Date
Ganesh Pawar e6e601077f dialog_widget: Append dialog_widget to the body element.
We attach the DOM for the modal to the body element
to avoid style interference from other elements and having to choose
a separate parent element for every single dialog_widget.
2021-10-26 18:20:17 -07:00
YashRE42 0ddf319709 click_handlers: Do not close compose box when clicking inputs.
Previously, there existed a bug where clicking an open message edit
box when the compose box was open would not focus the message edit
contents, but would instead:

- focus the message edit content,
- close the compose box,
- and unfocus the message edit content.

That first bug was fixed in 4e1525d7c4
which eliminated the unfocus part of that problem, but closing the
compose box is undesirable here anyway, since often it can be useful
to have compose open while interacting with the sidebar filter widgets
or working on editing a message.
2021-10-26 18:15:30 -07:00
Tim Abbott c60f83120b css: Fix missing whitespace in poll CSS.
a8b529b3ed hadn't been rebased since we
added the relevant linter rule.
2021-10-26 18:09:40 -07:00
YashRE42 bf4945a1e2 click_handlers: Correct line reference made by comment.
Click_handler.js was created in commit
e5467d3268 by moving code from ui.js.

While making this change, some handlers were rearranged, but the part
of this comment saying "... code above" was never changed. This commit
changes that part of the comment to refer to the correct handler
(which is labeled by a comment as MAIN CLICK HANDLER).
2021-10-26 17:54:56 -07:00
Tim Abbott 4e1525d7c4 compose: Fix buggy refocusing of compose box on close.
The `make_compose_box_original_size` function is designed in such a
way that it should only be called when it actually needs to resize the
compose box. In 3 of the 4 places that called it, we checked whether
the compose was already the original size; this fixes the 4th to do
the same.
2021-10-26 17:54:56 -07:00
Ganesh Pawar 8730bd8b94 delete avatar: Improve accessibility by converting <span> to <button>.
Since it's a button, it doesn't need the "keydown" event. So,
removed it. This fixes the bug where pressing any key while the
avatar's delete_button was in focus would pop up the modal.
It was introduced in e5d0448505.
2021-10-26 17:51:38 -07:00
Aryaman 9d045d7470
streams: Increase margin in the hint for adding streams.
This prevents this hint from looking wrong in languages where the
string ends up longer.

Fixes #19848.
2021-10-26 15:50:56 -07:00
nooblag a8b529b3ed widgets: Improve visual style for Polls. 2021-10-26 15:14:46 -07:00
Tim Abbott e6a3f49ba8 portico: Remove obsolete content: none markdown CSS.
This made it impossible to e.g. use Font Awesome icons inside a `<ul>`
list item (they worked correctly inside `<ol>` list items).

This line was apparently added in
17ad591eb4.  The original thinking
behind this line is not clear in the original PR, but is likely a
forgotten relic from experiments with a custom unordered list bullet
styling.
2021-10-26 15:12:38 -07:00
Ganesh Pawar fe7a1c0722 dialog_widget: Extract out `close_modal()`. 2021-10-22 16:08:26 -07:00
Ganesh Pawar e1070fe3d0 dialog_widget: Pass the event object to the `on_click` function. 2021-10-22 16:08:25 -07:00
Ganesh Pawar 3051b1afa3 dialog_widget: Use $t_html for html_heading. 2021-10-22 16:08:25 -07:00
isakhagg adb612a0b4 settings: Rearrange display settings.
This provides a cleaner organization for our display settings, to make
browsing them more intuitive for new users.

We still need to update the /help/ documentation following this migration.

Fixes #19960.
2021-10-21 15:23:19 -07:00
Jonny Tran ddf4053a73 composebox_typeahead: Remove redundant options from the `/` typeahead.
Removes the `/day` and `/night` options from the typeahead menu while
still allowing the commands to be used. Typing `/day` and `/night`
will now suggest `/light` and `/dark`, respectively. Also changes the
`Dark mode` and `Light mode` popups that appear after using the
corresponding command.

Fixes #18318.
2021-10-21 10:50:27 -07:00
rht bb8504d925 lint: Fix typos found by codespell. 2021-10-19 16:51:13 -07:00
iampranavdhar 5b7bb5142f compose: Fix alignment of close button in warning banner.
A bug in the compose.css code resulted in showing the close button in
the banner in a wrong way.  The previous logic to center the button
vertically didn't actually achieve our goals, since in cases where the
text line-wraps to two lines, it'd look oddly out of place.

Fixes #19770.
2021-10-19 12:22:45 -07:00
Soumyajyoti Dey 140c0fd599
popovers: Position status emoji to left of label.
This matches the design present in the right sidebar, where statuses
are primarily displayed to users.

Fixes #19998.
2021-10-19 12:21:45 -07:00
Gaurav Pandey 1c1a1e2cad api: Remove encoding of string in update_user endpoint.
* Remove unnecessary json_validator for full_name parameter.
* Update frontend to pass the right parameter.
* Update documentation and note the change.

Fixes #18409.
2021-10-18 19:03:43 -07:00
Anders Kaseorg b36cecf33b fold_dict: Fix @typescript-eslint/member-ordering.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-10-17 07:15:09 -07:00
Anders Kaseorg ea88ec9e06 styles: Fix stylelint rule-empty-line-before.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-10-17 07:15:09 -07:00
Pradyumna Sinha ec5ded3f2a message_edit: Reinit topic input box typeahead in message edit UI.
This fixes an issue where the auto-complete dropdown doesn't reflect
the changed stream in the message edit UI.

We add an unlisten method to the typeahead library to support this
reinitialization cleanly and in a way that can be readily reused in
the future.

Fixes #19874.
2021-10-15 17:17:09 -07:00
Morgan Njaw d9ec90f088 settings_display: Make setting type selector row sticky. 2021-10-15 11:00:30 -07:00
anurastogiji 5de556cbc8 message_edit: Expand breadcrumb checkbox spacing in topic edit UI.
For background, the .topic_move_breadcrumb_messages and
.message_edit_breadcrumb_message classes is applied to these checkboxes.

We add margin-top of 10px to the second checkbox to space them
appropriately. Additionally, we can remove some unnecessary complexity
from the template/CSS.

With a tweak from tabbott to remove the break-row logic as well.

Fixes #19947.
2021-10-14 15:38:53 -07:00
Anders Kaseorg cab0f9c219 people: Fix small avatar URL generation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-10-14 12:47:43 -07:00
Aman Agrawal 1a3d67ad0c subscription_settings: Make the `+` button more visible.
Fixes #18844
2021-10-12 15:38:47 -07:00
Tim Abbott 5191c41799 message_list: Avoid losing place when sending messages.
It can be pretty annoying to lose your place when replying to an old
message, even though every other chat application does this. And it
doesn't really buy us much; the user can always scroll down if they
want to, we have a helpful notification about where their message is
(which could be improved), and then we don't need to add some sort of
new complicated logic to avoid marking messages as read unexpectedly,
which the existing logic for this block badly needed.

(It had existing logic of that form dating from the pre-unread counts
pointer era).

Fixes #11462.
2021-10-12 15:34:27 -07:00
Tim Abbott 53d9b5b307 message_list: Fix buggy failure to scroll after sending message.
The from_scroll=true setting has been present since essentially the
beginning of time (6ae117ea5f), and has
moved around a number of times since.  It's possible that it was
correct with the UI model as originally implemented, but the behavior
it creates now is that sending a message in the home view does not
move the cursor, and sending in a narrow does, without any intent
behind that behavior.

Further, the logic for controlling whether to display a "Scroll down"
notification clearly expects that this code path will actually trigger
a scroll to the current message, which would be the case without the
from_scroll setting.
2021-10-12 15:34:27 -07:00
Aman Agrawal 40ed1b2d07 for-page: Increase font size of list content.
This is as per a conclusion after discussion that 18px looks
better for this content.
2021-10-12 15:30:53 -07:00
anurastogiji ebeb9c4440
popovers: Add newline between checkboxes in `Move topic` menu.
This is cleaner UI and avoids the spacing looking weird if both fit on a line at
a given zoom level.

Fixes #19875.
2021-10-11 09:06:00 -07:00
Sahil Batra 38cf2d07a6 settings_display: Refactor code to use a single handler.
This commit refactors the display settings code to use
a single handler similar to what we do in notification
settings. We still keep default language and emojiset
setting as they are handled differently and they do
not call 'change_display_setting' directly on changing
input.

We refactor the 'change_display_setting' to directly
accept status element as parameter and not class as
a string. We also add a common class to the subsection
div such that we can get status element for each of
them easily.
2021-10-08 13:46:22 -07:00
Sahil Batra 78da9d21f3 settings: Remove unnecessary check of for_realm_settings.
We do not need to check for_realm_settings variable for
left_side_userlist handler since realm-level defaults
now uses save-discard widget and we return early in
that case and thus for_realm_settings will always be
false at this point.
2021-10-08 13:46:22 -07:00
Aman Agrawal e2aae71f12 landing_page: Fix overflowing text on firefox in plans container.
This usually happens due to different defaults set by
different browsers for certain properties.
2021-10-08 11:22:45 -07:00
Sahil Batra 6aa5b3be51 settings: Fix streams incorrectly appearing in notification settings.
There is a bug when a newly created stream appears in the notification
settings table if user changes any setting in 'Streams' row of the
table even though user has not changed the notification setting of
the stream and thus the stream should follow the global-level values.

The stream is correctly not added to the table if user changes the
setting after reloading once after creating the stream.

The bug is due to the notification settings of the new-stream being
set to the user's global settings at time of stream creation which
are not overridden since the stream-creation event contains only
stream fields and not subscription fields. And the newly created
stream is not present in the table after reload because during
initialization of the client-level data structures the notification
setting values are overridden by the values stored in server.

This commit fixes create_sub_from_server_data code to initially have
the notification settings set as null in the sub object which are
overridden by the correct value during initialization. This keeps
the notification setting values as null just after stream creation.

Fixes #19933.
2021-10-08 10:31:20 -07:00
Tim Abbott ed5d345aed drafts: Fix buggy "Saved as draft" notice flashing on send.
This fixes a bug introduced in
459ce92109, where "Saved as draft" would
flicker every time you send a message that was locally echoed.
2021-10-08 09:28:05 -07:00
Dinesh e2df0d171f user_settings: Add send_read_receipts setting.
This will be useful to let users enable/disable
sharing read receipts once we add that feature.

Note: Added "I've" to IGNORED_PHRASES in
tools/lib/capitalization.py to avoid capitalization
errors for the label text of this setting.
2021-10-07 17:46:05 -07:00
Dinesh b41918e74e typing_notifications: Send requests only if send_private_typing_notifications. 2021-10-07 17:40:32 -07:00
Dinesh 6d2b8f5ca9 user_settings: Add settings to configure sending typing notifications.
Note: These are not functional in enabling/disabling sending of
typing notifications with this commit.

Refactored the privacy settings update to keep the code less
duplicated along with making the addition of new settings easier.
2021-10-07 17:39:21 -07:00
Dinesh bb3953e02c Remove `$("#user_presence_enabled").val(page_params.presence_enabled);`.
This isn't necessary as `settings_checkbox.hbs` template used
for presence enabled setting in `account_settings.hbs` takes
care of checking/unchecking this checkbox.
2021-10-07 16:39:51 -07:00
Dinesh 9d3dc7426d typing_notifications: Show several users are typing if num of typists > 3.
I believe we intended to show 'several users are typing...' only
if number of typists are more than 3 but not 2.

The variable name MAX_USERS_TO_DISPLAY_NAME and commit message of
dba21d201c which added this also
suggests the same.
2021-10-07 16:32:08 -07:00
Sahil Batra 98415808ba settings: Remove patch_url from user_settings_panel.
We remove patch_url from settings_notifications.user_settings_panel
since realm-level defaults section uses save-discard widget and its
code is separate from user notification settings and we can directly
use "/json/settings" as url in user settings code.
2021-10-07 14:23:24 -07:00
Sahil Batra b626513a15 settings: Remove patch_url from realm_default_settings_panel.
We do not need patch_url field in realm_default_settings_panel
because we use save-discard widget in realm-level defaults section
which is handled separately from user display settings.
2021-10-07 14:23:24 -07:00
Sahil Batra 30766ec482 settings: Remove patch_url from user_settings_panel.
We remove patch_url from settings_display.user_settings_panel
since realm-level defaults section uses save-discard widget
and its code is separate from user display settings and we
can directly use "/json/settings" as url in user settings code.
2021-10-07 14:23:24 -07:00
Sahil Batra d9034dfda2 settings: Do not pass settings_panel parameter to change_display_setting.
We don't need container element and patch_url in change_display_setting
since this function is only used for user-display settings and not for
realm-level settings which now uses save-discard widget. So we do not
pass settings_panel as parameter to change_display_setting.
2021-10-07 14:23:24 -07:00
Sahil Batra 9bc2813138 settings: Remove language_modal_elem from user_settings_panel.
We added language_modal_elem to settings_display.user_settings_panel
object considering there would be realm-level default_language
setting and we would need to access the modal element using a
variable to avoid code duplication. But now we have decided that
we do not want the setting and we would instead use browser's
language to set the language for new user, so now we do not need
this variable and we can instead use id of the modal directly.
2021-10-07 14:23:24 -07:00
Johan Ehinger bac64070c1 invitations: Display expiration times in settings > invitations.
Fixes #19680.
2021-10-07 11:58:47 -07:00
YashRE42 306011a963 css: Remove commented out css. 2021-10-07 10:29:08 -07:00
YashRE42 b4c237825e right_sidebar: Highlight search icon when hovering userlist_header.
Clicking the entire userlist_header opens the user filter, however,
previously only hovering over the user_filter_icon would cause a
highlight effect. This commit changes the behaviour so that hovering
over the userlist_header would also cause the same highlight effect on
user_filter_icon.
2021-10-07 10:29:08 -07:00
YashRE42 cf49d85a5b search: Make search_button color consistent with gear icon.
This commit changes the color, opacity and hover effect of the
search_button ( the x icon) to be consistent with other elements in
the search box, the message_view_header and the gear icon to thr
right.
2021-10-07 10:29:08 -07:00
YashRE42 1c674f15be search: Make search_icon hover consistent with message_view_header.
This commit ensures that the search_icon within the search box has the
same color, opacity and hover effect as on the search_icon in the
message_view_header when search is closed.
2021-10-07 10:29:08 -07:00
YashRE42 f3b31fa972 message_view_header: Fix hover effect related to links in description.
This handler was broken during refactor
78d511fd03, as we can see from the
original implementation in 30065b4ee8,
the intent is that hovering over any link within the
narrow_description should not cause the search_icon to change color ie
the hover effect should not be used. This is so because it aligns
with the fact that clicking the links would not open the search bar.

However, during the refactor this was incorrectly switched to forcing
the effect to be applied when we hover over links in the
narrow_description.

This commit reverts to the original and intended behaviour, and also
switches to using opacity rather than color, in accordance with the
changes from the previous commit
(316d499ac74c2caddb57c98a43d9b776b1b32d98).
2021-10-07 10:29:08 -07:00
YashRE42 fb6c34356c message_view_header: Make search_icon hover effects consistent.
In commit 5d91a34119 we change the
behaviour of a hover effect on search_icon to use opacity rather than
a change in color. This change made the search_icon hover consistent
with the gear icon to the right of it, it had the additional benefit
of reducing the need to define a hover effect in night_mode.css.

However, some rules targeting search_icon were leftover that still
used color, this commit changes one in zulip.scss to use opacity and
removes one from night_mode.css that is no longer necessary.
2021-10-07 10:29:08 -07:00
YashRE42 4afcd15baa message_view_header: Remove usage of nth-last-child selector.
This commit aims to remove all usage of the nth-last-child selector
related to the message_view_header, continuing the change from
65acbfa4c4.
2021-10-07 10:29:08 -07:00
Sahil Batra 89be686d9e settings: Remove unnecessary if condtions checking for_realm_settings.
This commit removes unnecessary if condtions which are checking
for_realm_settings value which are basically present to handle
the code which is only for user-level settings, but since we
now return early for the realm-level defaults code we do not
need these conditions.

This is done in a separate commit just to make the original commit
adding save/discard widget easy to review.
2021-10-07 10:16:28 -07:00
Sahil Batra 8528914131 settings: Fix live update code for realm-level user defaults section.
Previously, on receiving udpate event of realm-level default setting,
we updated the whole page, but this might be problematic now in case
where user has edited settings in two subsections with save/discard
button still present and if user clicks on save button of one
subsection then the setting in other subsection also resets to its
original value as whole page is updated.

So, this commit changes the behavior to only update the changed
setting and not affecting other settings similar to what we do
in 'Organization settings' and 'Organization permissions' sections.

We also do not call 'settings_display.report_emojiset_change' when
realm-level default of emojiset setting is updated because we now
uses save/discard widget.
2021-10-07 10:16:28 -07:00
Sahil Batra eed0a14ab0 settings: Use save-discard widget in realm-level defaults section.
This commit adds save-discard widget in the realm-level defaults
section. We use most of the functions used in settings_org.js
by passing for_realm_default_settings and add conditionals
according to it.

Some of the major changes wrt to the organzation settings code
are -

- We use element name attribute here to get the setting name from
element instead of id. We can add id for the elements here but
there is a problem doing so for the emojiset setting as for the
radio buttons we use four different input elements and all being
for the same setting.

- Added separate cases in discard_property_element_changes and
get_input_element_value to handle the radio buttons.

- We do not need get_complete_data_for_subsection here because
all settings are controlled by single field in DB and single
element in UI and thus we can simply get changed setting values
from populate_data_for_request.

- Added org-subsection-parent to the subsection container and
prop-element to the input and select elements so that we can
use the existing code.

- Modified get_subsection_property_elements to just return the
input element which is selected for emoji-settings subsection and
not all the input elements because we only need the selected value
of emojiset. We need other elements also when discarding the changes
but we handle it separately.
2021-10-07 10:16:27 -07:00
Sahil Batra 87a759c32d settings_org: Move save-discard widget click handlers to a function.
This commit moves all the click handlers used for controlling the
behavior of save/discard widgets to a separate function such that
it can be used for realm-level default section also. This function
has container and patch_url as parameters.
2021-10-07 10:12:10 -07:00
Sahil Batra 71ba76d05e settings: Adjust sequence of click handlers in notification settings.
This commit reorders the click handlers in notification settings,
such that we can easily move the click handlers for realm-default
settings to settings_realm_user_settings_defaults.js by returning
early.
2021-10-07 10:12:10 -07:00
Sahil Batra a7b14756ec settings_org: Use admin-realm-form class in save-discard click handlers.
We use 'admin-realm-form' class as selector in save-discard click
handlers instead of 'organization' which includes all the organization
settings sections, but save/discard widget is used only for some
sections and all of them are inside the form with class 'admin-realm-form'.

This will also help us to avoid code duplication when changing the realm
level defaults section to use save-discard widget.
2021-10-07 10:12:10 -07:00
Sahil Batra 774026396b settings_org: Add patch_url parameter to save_organization_settings.
This commit adds patch_url parameter to save_organization_settings
function such that we can use the same function for realm-level
defaults section also as those settings are updated using different
endpoint.
2021-10-07 10:12:10 -07:00
Sahil Batra 4e14a98772 settings: Change name attribute of emojiset_choice element to emojiset.
This commit changes the name attribute of emojiset_choice element from
emojiset_group to emojiset such that we can use the name attribute to
get the name of setting from element.
2021-10-07 10:12:10 -07:00
Sahil Batra 4e901d56ae settings: Do not initialize save_organization_settings in build_page.
We directly declare the save_organization_settings function instead
of first declaring a variable and then setting it in the build_page
function. This is a prep commit for using save/discard widget in
realm-level defaults section.
2021-10-07 10:12:10 -07:00
Sahil Batra 7dc29f170d settings: Use save discard widget for showing indicator.
We use save discard widget to show saving/failed indicators
in the realm-level privacy and other settings subsections.
2021-10-07 10:12:10 -07:00
Sahil Batra a377f02fb7 settings: Use save discard widget for showing indicator.
We use save discard widget to show saving/failed indicators
in the user and realm-level notification settings.
2021-10-07 10:12:10 -07:00
Sahil Batra f777a74523 settings: Use save discard widget for showing indicator.
We use save discard widget to show saving/failed indicators
in the user and realm-level display settings.
2021-10-07 10:12:10 -07:00
Sahil Batra fa991b21a5 settings: Add option to show only indicator in save-discard widget.
This commit adds an option to show only indicator and not save/discard
buttons using the settings_save_discard_widget. This is a prep commit
for using save/discard buttons in the realm-level defaults section
while keeping the original behavior of showing only indicator in the
user-level settings.
2021-10-07 10:12:10 -07:00
Sahil Batra 3be2273316 settings: Fix incorrect use of two class attributes for same element. 2021-10-07 10:12:10 -07:00
Aman Agrawal 86c3c5d6f1 for-pages: Increase line height of feature list items. 2021-10-07 09:05:07 -07:00
Eeshan Garg 7882a1a7f4 for/open_source: Add illustration for building inclusive commmunities. 2021-10-06 17:42:56 -07:00
Eeshan Garg c00aaee8ae for-open-source: Add streams and topics screenshots. 2021-10-06 17:42:56 -07:00
Eeshan Garg 8fab13bb6c invites: Handle long invite URL overflow properly.
Fixes #19764.
2021-10-06 17:38:12 -07:00
AnshVM f30e439ee3
message_edit: Hide recipient bar resolve topic if user lacks permission.
Previously, the "resolve/unresolve topic" checkmark option was displayed in recipient bars 
was presented to users regardless of whether they had permission to resolve topics in that
stream, which was confusing.

Fixes #19880.
2021-10-05 16:46:58 -07:00
Aman Agrawal 3b29c61409 auth: Add login buttons for web public access.
For users who are not logged in and for those who don't have
'prefers_web_public_view' set in session, we redirect them
to the default login page where they can choose to login
as spectator or authenticated user.
2021-10-05 16:30:40 -07:00
Aman Agrawal cc8cb5432e channel: Simplify password change tracking.
Move the password tracking variables from setup to channel module.
Track password_change requests in channel.
Directly use xhr object to store `password_changes` information.
Tests modified to accomodote this change by converting strings to
objects.
2021-10-05 10:23:43 -07:00
Aman Agrawal 8433ce90dc channel: Ask spectator to login for unauthenticated requests.
Get complete coverage for channel.
2021-10-05 10:23:43 -07:00
Aman Agrawal 50812ead0f setup: Move 401 error check to channel.
Channel already handles all the requests and general errors related to
them; so, channels seems the right place for this check.
2021-10-05 10:11:10 -07:00
Tim Abbott 387237f263 stream settings: Fix exception for users who cannot create streams.
The previous logic, introduced in
fa928d5cd1, crashed when visiting
"manage streams" in the case that the user didn't have permission to
create any streams at all.

We remove the more complex logic.

This isn't the right long term fix, because it means users who can
only create public streams just get a vague "Insufficient permission"
error when trying to create a private stream (and vice versa), but is
sufficient to fix the critical bug of "manage streams" failing to load.

Fixes #19895.
2021-10-04 22:01:04 -07:00
Eeshan Garg 763b3c27d6 corporate: Add contact support page. 2021-10-01 17:30:01 -07:00
Aman Agrawal c750d0e404 compose: Trim selected text before formatting.
We remove new line and space characters around the selected
text and then apply the requested formatting.
2021-10-01 16:45:51 -07:00
Aman Agrawal 58172fe21a compose: Allow user to undo formatting.
For text that already has the formatting that the user is
trying to apply, we undo the formatting. This gives a nice
experience of applying and removing the formatting from text
on the same button press.
2021-10-01 16:45:50 -07:00
Ganesh Pawar fa928d5cd1 streams: Split setting for stream creation policy.
Users wanted a feature where they could specify
which users can create public streams and which users can
create private streams.

This splits stream creation code into two parts,
public and private stream creation.

Fixes #17009.
2021-10-01 10:26:42 -07:00
Aman Agrawal 0df7c6f1b0 copy_code_button: Attach tooltip to body to avoid overlap with parent.
Having tooltip `appendTo` to parent causes it to be trimmed by
the size of parent container if the parent doesn't have enough
size to include the tooltip. To fix this, we append tooltip
to `document.body`.
2021-10-01 10:04:17 -07:00
Tim Abbott b3ef57657c i18n: Fix misplaced end of translation tag. 2021-09-30 16:08:34 -07:00
Tim Abbott 171703e480 Revert "settings_data: Check for invalid policy values."
This change doesn't have proper test coverage and also doesn't work as
intended, since due to the structure of the function, we'll only
complain about invalid policy values for members in unlikely situations.

This reverts commit c69a968ffe.
2021-09-30 15:08:55 -07:00
Tim Abbott c69a968ffe settings_data: Check for invalid policy values. 2021-09-30 14:59:31 -07:00
sahil839 1e1f08fa4e settings: Add moderators and members option to msg-delete dropdown.
This commit adds moderators, full members and members options to
the delete_own_message_policy dropdown.
2021-09-30 14:59:31 -07:00
sahil839 909a3cde76 realm: Replace allow_message_deleting with delete_own_message_policy.
This commit replaces 'allow_message_deleting' boolean setting
with an integer setting 'delete_own_message_policy'. We have a
separate dropdown now for deciding which user-roles can delete
messages sent by themselves and the time-limit setting droddown
is different.

This new setting has two options - everyone and admins only. Other
options including moderators will be added further.

We also remove the "Never" option from the original time-limit
dropdown, as admins are always allowed to delete message. This
never option resembled the case of only admins being allowed to
delete but this state is now resembled by setting the dropdown
to "admins only" and we also disable the time-limit dropdown in
this case as admins are allowed to delete irrespective of limit.

Note, this setting is only for deleting messages sent by the
deleting user themselves, and only admins are allowed to delete
messages sent by others as before.
2021-09-30 14:59:31 -07:00
sahil839 b13bfa09c5 message: Make zero invalid value for message_content_delete_limit_seconds.
We make zero invalid value for message_content_delete_limit_seconds and
for handling the case of "Allow to delete message any time", the API-level
value of message_content_delete_limit_seconds is "anytime" and "None"
as the DB-level value. We also use these values for message retention
setting, so it helps maintain consistency.
2021-09-30 14:45:39 -07:00
Tim Abbott 4368b9d186 ui: Change 'Edit topic' label to 'Move message'. 2021-09-30 13:35:31 -07:00
Sahil Batra 42bd2a85f9 settings: Fix bug of empty subsection heading being visible.
We should also hide the 'Other emails' heading in realm-level
defaults section when digest emails organization setting is
disabled because there is no other setting in this subsection
after we removed the enable_login_emails setting in d1732fb.
2021-09-30 11:15:10 -07:00
nooblag ed023db0f4 rendered_markdown: Improve headings.
* Switch from underline to a smaller range of font sizes to indicate
  h5/h6 headings.
* Provide margin-top for headings while avoiding problematic behavior
  for messages that start with a heading.
2021-09-29 15:45:03 -07:00
Tim Abbott ad6a175c95 css: Increase font size of solutions headings.
11px is really just too small to be readable.
2021-09-29 15:32:53 -07:00
AnushaNathRoy b6fc670134 right sidebar: Display text when no users match search. 2021-09-29 15:10:31 -07:00
optimm d7ee69373c compose: Fix reduced space below compose box after expanding it.
When expanding the compose box to full screen size, the buttons below
the compose box would unexpectedly jump because of how the 100% height
interacted with padding in the default box-sizing model.

Switching to border-box fixes this.

Fixes part of #19353.
2021-09-29 15:07:04 -07:00
Sahil Batra d1732fb9da settings: Remove realm-level default of enable_login_emails setting.
This commit does not remove the 'enable_login_emails' field from
RealmUserDefault table but it is just not used and cannot be
changed from UI or API similar to 'enable_marketing_emails' setting.
2021-09-28 12:41:09 -07:00
Sahil Batra 8b638648dc settings: Remove inline-block from subsection-parent elements.
This commit removes inline-block class from the subsection-parent
elements in notification settings because we do not need different
subsections to be inline. This was working correctly till now
because the widths of the subsections were large enough to not
be able to fit in same line.
2021-09-28 12:40:09 -07:00
Sahil Batra e67b4cf499 settings: Show message to reload only for user settings.
We incorrectly show message to reload in the savings indicator
for realm-level default of left_side_userlist setting. It should
be shown only for user-level setting since no change will take
place for the user changing realm-level default.
2021-09-28 12:40:09 -07:00
Priyansh Garg da2bdec4ad compose: Collapse compose-box after sending message.
Previously, after sending a message from the full-sized compose-box,
the compose-box remained in expanded state covering the entire middle
part. Instead, it should return to the original state after the
message is sent.

There's a subtle race that would cause the "Scroll down to see your
message" compose notification to appear incorrectly, because the
full-size compose box occluded the entire message feed at the time the
message was locally echoed, even though it would no longer do so after
collapsing.

We address that by shrinking the compose box immediately before doing
a local echo, in addition to the primary code path in
`clear_compose_box`.  Care is taken to ensure that we avoid shrinking
the compose box when sending a message that cannot be locally echoed
and gets an error from the server.

Tested on my Ubuntu development environment, by sending empty message,
valid message and slash commands. The compose-box only shrunk on
sending valid messages.

Fixes part of #19353.
2021-09-28 11:36:51 -07:00
Aman Agrawal bed7c672ce stream_create: Allow web public stream creation. 2021-09-27 14:46:24 -07:00
Aman Agrawal 3f9a404fb4 stream_create: Use `switch` instead of multiple `else-if`.
This change was forced by our linter in the previous commit.
2021-09-27 14:46:24 -07:00
isakhagg 9d291c9d3f tooltip: Add "download" text to tooltips on files.
Fixed #19740.
2021-09-27 10:54:37 -07:00