Commit Graph

13157 Commits

Author SHA1 Message Date
Ganesh Pawar d62e44fcba stream_privacy_setting_modal: Migrate modal to dialog_widget. 2021-11-10 10:23:31 -08:00
Aman Agrawal 9af4d5a155 reminder: Don't ack server for reminder / scheduled messages. 2021-11-10 09:12:23 -08:00
Aman Agrawal 3237196687 reminder: Fix incorrect method applied on object.
The intention here is to apply `find` on the array of values
in the object.
2021-11-10 09:12:23 -08:00
Aman Agrawal 59a62573ed popover_menus: Simplify check for any active popovers. 2021-11-10 09:12:23 -08:00
isakhagg 7edbf673e4 poll: Handle duplicate poll options.
Fixes #20164.
2021-11-10 09:07:03 -08:00
Ganesh Pawar 6bc291cdf2 edit_bot: Remove unnecessary CSS from bot owner button.
Fixes #20201.
2021-11-10 09:02:08 -08:00
Aman Agrawal a8c488bc56 compose: Use calendarContainer to check if flatpickr is open.
`calendarContainer` is defined for flatpickr instance if it is
open.

This also fixes a bug where the flatpickr doesn't open when
user tries to toggle it using the global time icon in compose.
2021-11-10 09:00:59 -08:00
Manan Rathi aac8ceadf9 user docs: Add documentation for /todo.
Fixes #20141.

Co-authored-by: Alya Abbott <alya@zulip.com>
2021-11-09 10:16:47 -08:00
Tim Abbott 4aedb129ea settings: Add comments for default settings update_page. 2021-11-09 10:05:08 -08:00
Sahil Batra f49980098d settings: Fix live update code for twenty_four_hour_time setting.
We need to handle live-update of twenty_four_hour_time setting
separately in update_page because the database value of this
setting is boolean but we use dropdown in the frontend for this
setting with option values as "true" and "false" strings.
2021-11-09 10:03:23 -08:00
Sahil Batra 4a1153b06c settings: Fix bug in "Default user settings" section.
There was no heading for "Time format" setting in the
"Default user settings" section and thus no save-discard
widget to update the setting. This commit fixes the bug
and changes the heading to be only "Time" since there is
no realm-level default of language setting.

This bug was introduced in adb612a0b4.
2021-11-09 10:03:23 -08:00
Ganesh Pawar 41ddf29e76 move_topic_to_stream: Migrate modal to dialog_widget. 2021-11-09 10:02:43 -08:00
Aman Agrawal 05bd417de4 flatpickr: Visual improvements.
* Fix time input buttons not positioned correctly.
On <768px screens:
* Center align flatpickr.
* Remove bottom arrow.

We should ideally have a semi-transparent black background
for flatpickr on mobile but it is hard to do so with flatpickr
being inserted into DOM by an external library.
2021-11-09 09:40:52 -08:00
Aman Agrawal 8c46fde342 flatpickr: Show the same picker on mobile as on desktop.
Flatpickr tries to show a different picker for mobile which
is not visible for some reason. We display the same picker
on mobile which we know works for our use case.

Docs: https://flatpickr.js.org/options/

```
Set disableMobile to true to always use the non-native picker.
By default, flatpickr utilizes native datetime widgets unless
certain options (e.g. disable) are used.
```
2021-11-09 09:40:52 -08:00
Sahil Batra 041711dcbd streams: Add padding between subscriber-list columns.
This commit adds 5px of padding between columns of
subscriber-list such that the list doesn't look too
bad on narrow widths. This does not completely fixes
the issue on narrow widths but is atleast a small
improvement.
2021-11-09 15:11:02 +05:30
Sahil Batra 46660e5daa streams: Show "hidden" in subscriber-list when email is not accessible. 2021-11-09 13:26:31 +05:30
Sahil Batra 305131c7d7 settings: Show "hidden" in users list when email is not accessible. 2021-11-09 13:22:44 +05:30
YashRE42 a150b9b0ae recent_topics: Don't rely on ":visible" to avoid forced reflow.
Previously, navigating from any stream to the recent topics view would
cause a forced reflow every time we checked `is_visible()` because it
would call `$("#recent_topics_view").is(":visible")`.

The reason for this is related to how browsers ship frames, the
process follows these steps:
JavaScript > style calculations > layout > paint > composite.
(The layout step is called Reflow in firefox.)

Typically, the browser will handle these steps in the most optimal
manner possible, delaying expensive operations until they're needed.

However, it is possible to cause the browser to perform a layout
earlier than necessary. An example of this is what we previously did:

When we call `top_left_corner.narrow_to_recent_topics()`, we ask to
add a class via `.addClass()`, this schedules a Style Recalculation,
then, when we call `message_view_header.make_message_view_header()` it
calls `recent_topics_util.is_visible()` which calls
`$("#recent_topics_view").is(":visible")`.

Before the browser can get this value, it realizes that our dom was
invalidated by `.addClass()` and so it must execute the scheduled
Style Recalculation and cause a layout.

This is called a forced synchronous layout.

This commit adds a JavaScript variable representing the visible state,
in order to prevent the above behavior.

This commit reduces the main thread run time of
`build_message_view_header` from 131.81 ms to 5.20 ms.

Unfortunately we still have the case where
`recent_topics_ui.revive_current_focus()` calls
`recent_topics_ui.set_table_focus()` which causes a reflow.

However, by eliminating this reflow we still save ~100ms.
(It's important to note that we only save this sometimes, as other
things can still cost us a reflow.)

Further reading: https://developers.google.com/web/fundamentals/
performance/rendering/avoid-large-complex-layouts-and-layout-thrashing
2021-11-08 18:30:44 -08:00
Sahil Batra c8b00941f2 stream_settings: Add user-id column in subscriber-list. 2021-11-08 18:10:25 -08:00
Sahil Batra e3aed119ec stream_settings: Add heading row in subscriber list. 2021-11-08 18:10:25 -08:00
Sahil Batra 2105b5eda8 settings: Add user-id column to bot list. 2021-11-08 18:10:25 -08:00
Sahil Batra 36c1a1f1ee settings: Add user-id column in active and deactivated users list. 2021-11-08 18:10:25 -08:00
Ganesh Pawar edf7c0fb5a edit_bot: Migrate modal to dialog_widget. 2021-11-08 17:34:42 -08:00
Ganesh Pawar 8cc781f0c8 change_stream_info_modal: Migrate modal to dialog_widget.
The CSS changes make the description input box a more likely size for
what currently makes sense for stream descriptions.
2021-11-08 17:27:27 -08:00
Ganesh Pawar 8c7d320422 message_edit_history: Migrate modal to dialog_widget. 2021-11-08 17:24:31 -08:00
Aman Agrawal ffba7c7352 open-source: Stop quote used as image for feature from overflowing.
In small screens, the quote used as a standin for image used
to overflow from screen as it didn't had responsive size set.
This image has additional bound of `max-width: 100%` which
stops them from overflowing which the quote did not.
2021-11-06 06:18:06 -07:00
Anders Kaseorg 2080278758 styles: Use legacy color notations for older browser compatibility.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Anders Kaseorg 22d68831d7 styles: Fix function-url-quotes.
Fixed manually.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Anders Kaseorg 17e72da336 styles: Fix declaration-block-no-redundant-longhand-properties.
Fixed manually.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Anders Kaseorg 52ad928d3e styles: Fix shorthand-property-no-redundant-values.
Generated by stylelint --fix.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Anders Kaseorg c732a63b2f upload_widget: Convert $e.get(0) to $e[0].
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Vishnu KS 6c06858e02 billing: Migrate to Stripe hosted checkout page. 2021-11-05 17:23:10 -07:00
Andrew McAfee 4f63378e7f settings: Add UI option for custom notification batching period.
PR #19576 added a settings option for selecting a notification batching
period. We want to extend that UI option with the ability to select
a custom period.

Tweaked by tabbott to have the natural model that picking a value
present in the dropdown live-updates to remove the custom input,
rather than only having the custom input disappear on reload.

Fixes #19713.
2021-11-05 12:21:55 -07:00
Andrew McAfee 8c7e144e47 settings: Refactor notifications update_page to use switch.
Changes suggested by timabbott: https://github.com/zulip/zulip/pull/19944#discussion_r727565978

Facilitates additional changes for issue #19713.
2021-11-05 11:49:30 -07:00
Aman Agrawal 1484812f4b message_view_header: Hide subscriber count for spectators.
While we figure out a plan in #19842 to display
subscriber count for spectators without doing a heavy query
to the database, we hide this section in navbar.
2021-11-03 16:02:53 -07:00
Aman Agrawal a40a5c0bdb user_info_popover: Show relevant info for spectators and hide buttons.
We add the date joined info to the popover and hide all the buttons
since none are relevant for a spectator.
2021-11-02 11:26:19 -07:00
Tim Abbott d76b4744bf popovers: Use user ID for computing medium avatar URLs. 2021-11-02 11:26:19 -07:00
Aman Agrawal eb396b6190 popovers: Don't try to fetch small avatar using email.
It's always better to use the user ID than the email for fetching data
about an object whose unique ID we have, which should be all of them.
And it's also cleaner code to use the standard people.js method; tabbott
checked that indeed all callers get their `user` objects from `people.js`.

Since we restrict spectators from having access to avatars using
email to avoid someone brute forcing a user's email, this removes
a 401 response from the server in spectator view when trying
to open user info popover.

Additionally, this fixes the cached-fetching behavior documented in
the comments we add about the way we construct URLs.
2021-11-02 11:26:19 -07:00
Aman Agrawal d763ccf0d6 left_sidebar: Hide vdots for All messages and stream buttons.
Since the options in those popovers are non-accessible to the
spectator, it is better to hide the vdots instead of
displaying empty menu.
2021-11-02 11:26:19 -07:00
Aman Agrawal d6541c4724 message_fetch: For spectators, add web-public to narrow.
Without this, server will return a 401 error.
2021-11-02 11:26:19 -07:00
Sahil Batra e6106cb334 invites: Update error message when max limit for the day is reached.
This commit updates the error message returned when the maximum
invite limit for the day. We update the error returned by API to
only mention that the limit is reached and add the suggestion
to use multi-use link or contact support in the message shown
in webapp.
2021-11-01 16:36:26 -07:00
Kevin Scott 64f099d2f5 compose: Add compose box button to insert global times.
Fixes #20045.
2021-11-01 16:20:05 -07:00
Tim Abbott 862061fa53 lint: Fix JS style in last commit. 2021-11-01 11:07:01 -07:00
YashRE42 c696b78eec refactor: Extract "load_and_set_favicon" in favicon.js.
This is a prep commit to reduce duplication when implementing custom
favicons.
2021-11-01 10:54:56 -07:00
Lauryn Menard 73710e1cf0 user_settings: Add option to disable escape key navigation to default view.
Add `escape_navigates_to_default_view` as a bool setting in
UserBaseSettings model and implement it as a checkbox that toggles
the hotkey implementation of escape to the default view in the
advanced user display settings.

With /help/ documentation edits from Alya Abbott.

Fixes #20043.
2021-10-29 18:15:30 -07:00
Ganesh Pawar fce3261c30 deprecated_feature_notice: Migrate modal to dialog_widget. 2021-10-29 16:09:39 -07:00
Sahil Batra 9e9740ab65 settings: Add user-id readonly field in edit-user UI. 2021-10-29 16:08:35 -07:00
Sahil Batra 9f99dee687 user_profile: Show user_id in full user-profile modal. 2021-10-29 16:08:35 -07:00
Sahil Batra fcc1548a74 settings: Fix css for custom profile fields in edit user form.
Previously the edit user modal element was appended inside the
settings overlay itself, so the styles for .custom_user_field
elements nested inside #settings_page were sufficient both for
edit user UI and profile section in personal settings.

e6e60107 changed the code to append edit user modal to body
element and thus existing css was no longer applied to custom
profile fields with custom_user_field class in edit user modal.

This commit fixes to have same styles for .custom_user_field
elements in #edit_user_form.
2021-10-29 14:44:31 -07:00
Ganesh Pawar d14312b18e modal: Remove focus ring from submit button. 2021-10-29 14:43:07 -07:00
YashRE42 47f81f6974 minor: Fix typo in narrow.js activate - "heading" was "headig". 2021-10-27 14:22:10 -07:00
Ganesh Pawar 14b07669cc dialog_widget: Add support for rendering a single footer button. 2021-10-26 18:20:17 -07:00
Ganesh Pawar c429c5d70e dialog_widget: Add support for having a custom id on the container element. 2021-10-26 18:20:17 -07:00
Ganesh Pawar 1e8bfa710e dialog_widget: Migrate modal to Micromodal.
Also removed the `danger_submit_button` config option
from the dialog_widget since it isn't needed in the new modals.
2021-10-26 18:20:17 -07:00
Ganesh Pawar 6a07a90499 dialog_widget: Remove the `fade` parameter.
A user wouldn't differentiate between a "normal" modal and a "settings"
modal. If one shows up instantly, one would expect all the others to do
the same. The difference between Bootstrap fade and non-fade is pretty
noticeable (300 ms for fading).

This is a prep commit for the Micromodal migration which will have 120ms
as the animation time which wouldn't feel slow.
2021-10-26 18:20:17 -07:00
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
Sahil Batra c233ee9935 settings: Migrate twenty_four_hour_time setting to RealmUserDefault.
This commit removes the existing default_twenty_four_hour_time field in
Realm table which was used to set the twenty_four_hour_time setting of
new user on joining and instead we now use the twenty_four_hour_time
field of RealmUserDefault table for the same.

With some tweaks by tabbott to clarify the documentation.
2021-09-23 10:44:42 -07:00
Anders Kaseorg f8c2e7c7b0 i18n: Fix @typescript-eslint/unbound-method.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-22 18:06:06 -07:00
Anders Kaseorg abee9258c6 js: Fix @typescript-eslint/restrict-template-expressions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-22 18:06:06 -07:00
Anders Kaseorg f7a7cfea62 js: Fix @typescript-eslint/restrict-plus-operands.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-22 18:06:06 -07:00
Anders Kaseorg af1e34b348 timerender: Use date-fns for absolute_time.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-22 18:06:06 -07:00
Anders Kaseorg a0f8cf2d6f blueslip: Use built-in date formatting.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-22 18:06:06 -07:00
Anders Kaseorg ba610440ab js: Fix @typescript-eslint/no-floating-promises.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-22 18:06:06 -07:00
Tim Abbott db928c545b css: Make muted topic rows somewhat more visible. 2021-09-21 16:53:10 -07:00
Alya Abbott b773048031 user docs: Add documentation for configuring new user defaults.
Also remove a redundant link on customize-settings-for-new-users page.
2021-09-21 16:43:35 -07:00
Sahil Batra a44e7a1a60 settings: Pass a single object to settings_notifications functions.
We refactor the code for user notification settings and realm-level
defaults of notification settings to pass a single object consisting
of container element, settings object, url and for_realm_settings
bool variable, to the functions, instead of passing them as separate
variables.
2021-09-21 14:56:27 -07:00
Sahil Batra e43d469e9a settings: Pass a single object to settings_display functions.
We refactor the code for user display settings and realm-level
defaults of display settings to pass a single object consisting
of container element, settings object, url and for_realm_settings
bool variable, to the functions, instead of passing them as
separate variables.
2021-09-21 14:56:27 -07:00
Sahil Batra 145e020af8 settings: Add live update code for user presence-enabled setting. 2021-09-21 14:56:27 -07:00
Sahil Batra ba1fe77996 settings: Add UI for realm-level default of enter_sends settings. 2021-09-21 14:56:25 -07:00
Sahil Batra 22ec3c7993 settings: Add UI for realm-level default of presence-enabled setting. 2021-09-21 14:39:13 -07:00
Sahil Batra 28b20e4440 settings: Use id of the container to find status element.
This commit changes the code to use container id in the
selector of the status element of presence_enabled setting
such that the correct element is selected because we will
add another element with same class in the realm-level
presence_enabled setting.
2021-09-21 14:39:13 -07:00
Aman Agrawal 8c50a08066 stream_edit: Live update UI when a stream becomes web public. 2021-09-21 10:22:33 -07:00
Aman Agrawal faf43b7a3e left_sidebar: Hide private messages button for spectators. 2021-09-21 10:12:09 -07:00
Aman Agrawal 6d558a84f8 recipient_row: Hide resolve topic icon for spectators. 2021-09-21 10:12:09 -07:00
Aman Agrawal ab63bb638a popovers: Hide most irrelevant options for spectators.
This simplifies the UI for these popovers to not have tons of options
that cannot be accessed.
2021-09-21 10:10:54 -07:00
Aman Agrawal c6db2a330b stream_edit: Use `switch` instead of multiple `else-if`.
This is a prep-commit which simplifies changes when we add
web public streams condition here. Since our linter forces us
use switch then, we use it beforehand to simplify changes.
2021-09-21 10:05:30 -07:00
Anders Kaseorg 7f9e5e2aad favicon: Fix embedded number font for Webpack 5 asset modules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-16 17:20:30 -07:00
Tim Abbott 26d9854a5a settings: Deduplicate notification settings labels. 2021-09-16 16:07:32 -07:00
Sahil Batra 1682ec46dd settings: Add live update code for realm-default notification settings. 2021-09-16 15:46:41 -07:00
Sahil Batra d4c8284d24 settings: Add UI for realm-level defaults of notification settings.
This commit adds UI for realm-level defaults of user notification
settings. We do not have "Send test notification" option here.
2021-09-16 15:46:41 -07:00
Sahil Batra 8b9b0638c6 settings_config: Pass settings object as parameter to all_notifications.
We pass user_settings object to all_notifications and
get_notifications_table_row_data such that we can use these
functions for realm-level settings also.
2021-09-16 15:46:41 -07:00
Sahil Batra de1aa25059 notifications: Refactor update_notification_sound_source.
The container element and settings object are passed as
parameters to update_notification_sound_source. This change
is done so that we can use the same function for updating
the realm-level notification sound source.
2021-09-16 15:46:41 -07:00
Sahil Batra 079e45c7cf settings: Use variable for notification sound element.
This commit changes the click handler for playing
notification sound to use a variable instead of
directly using the element id such that we can
use the same code for realm-level settings also
by just setting the variable accordingly.
2021-09-16 15:46:41 -07:00
Sahil Batra 1252d1602b settings: Refactor notification settings frontend code.
This commit creates a new module user_notification_settings.js
for user-level notification settings and the settings_notification.js
will be used as a common module for both user-level and realm-level
settings.
We also add parameters to the functions in settings_notifications.js
to pass container elem and settings object for the same purpose.
2021-09-16 15:46:41 -07:00
Sahil Batra 791d09ccd0 settings: Use form element in handler for notification settings.
Notification settings uses '.on("change", "input, select")' to
handle changes to all types of input elements. But for realm-level
settings page, both display and notification settings have the
same container unlike the user-level settings, so we use inner
form element ".notification-settings-form" such that this handler
is for changing input of notification settings and not display
settings.
2021-09-16 15:46:41 -07:00
Sahil Batra 9551551b00 settings: Use settings_object variable instead of user_settings.
We set settings_object variable to user_settings object and then
use settings_object everywhere. This change will help us in using
the same code for realm-level settings also by setting the
appropriate value for settings_object.
2021-09-16 15:46:41 -07:00
Sahil Batra ebab2a89fb settings: Refactor change_notification_setting to have url parameter.
We refactor the change_notification_setting function to have a url
parameter instead of directly using "/json/settings" directly.

This change will help us in using the same code for realm-level
settings also.
2021-09-16 15:46:41 -07:00
Sahil Batra 44c820da3a settings: Fix live update code of notification settings.
We add code for live updating notification batching period
setting. This commit also adds 'continue' statement in the
else-if condition of update_page function such that we do
not execute the code of checkbox settings for notification
sound and email batching period settings.

We also update the other_notification_settings list in
settings_config.ts to remove email_notifications_batching_period
and instead have email_notifications_batching_period_seconds
which is the correct name of setting used in backend and in
the events sent to the clients such that the live-update is
done correctly.
2021-09-16 15:46:41 -07:00
Sahil Batra 90e4740455 settings: Use class instead of id for email batching period setting.
This commit removes the id from email notification batching period
setting dropdown and adds class such that we can use same template
for the realm-level settings as well. We also add 'setting_'
prefix as we do for other settings and modify the JS code accordingly.
2021-09-16 15:46:41 -07:00
Sahil Batra 67d534869c settings: Use container variable for accessing top-level element.
This change was missed in 032d347b4f.
2021-09-16 15:46:40 -07:00
Sahil Batra 1b530e74d2 settings: Disable realm-level defaults of user settings for non-admins. 2021-09-16 15:46:40 -07:00
Tim Abbott 687c4b9d66 css: Improve EDITED styling for non-English languages.
In some non-English languages, including Russian, the translation of
EDITED does not properly fit.  The best solution is probably something
bigger or having translators abbreviate this string, but it's worth at
least this minimal change to fix extremely ugly overlap behavior for
this widget.

Actual CSS written by Greg Price.
2021-09-16 13:18:19 -07:00
Sahil Batra 3242a61894 user_groups: Hide system user groups from UI.
We do not have any system user groups as of
now, but this commit is just a prep commit
to prevent any change in user-facing pages
to avoid confusion till this feature is
completed.

This change was initially made in 6117c38,
but it was reverted in 1543775a due to merge
conflicts with the typescript migration of
user_groups.js.
2021-09-16 13:11:03 -07:00
Alya Abbott 310b8736af user docs: Add a bunch of "getting started" content. 2021-09-16 11:41:43 -07:00
Tim Abbott 1b760d9fb5 compose: Clarify subscribe-other-user button label.
This change was inspired by the problem of translators needing to
translate "Subscribe" to languages that use different forms depending
on the identity of the noun being subscribed.  In most places in the
app, a button with that as the entire label should be translated in
the "subscribe myself" form; but in this one it should be "subscribe
someone else".

Thinking about this, the current label is a bit misleading in English
for someone who ignores the error message text and just reads the
button, so the best fix is to just change the string, which of course
also makes things unambiguous for translators as well.
2021-09-16 11:09:53 -07:00
Alya Abbott 9df8fbde48 user docs: Document message notification email custom batching.
Also adjust the label slightly for better readability.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2021-09-15 17:39:51 -07:00
Priyank Patel 397821660f ts: Convert sub_store module to TypeScript.
We also upgrade @babel/preset-typescript to the latest version to
get support for constant enums.
2021-09-15 17:19:39 -07:00
Priyank Patel 0d91472c64 ts: Convert timerender module to TypeScript. 2021-09-15 17:19:39 -07:00
Tim Abbott 1543775ac6 user_groups: Temporarily remove is_system_group check.
This effectively reverts 6117c3824a,
which merge conflicted with the typescript migration on this file, and
this commit is easier to undo.
2021-09-15 17:19:21 -07:00
Priyank Patel 9de3b2f4fd ts: Convert user_groups module to TypeScript. 2021-09-15 16:53:17 -07:00
Priyank Patel 3e6141d03f user_groups: Remove suppress_errors support for get_user_group_from_id. 2021-09-15 16:52:35 -07:00
evykassirer 251436f835 stream settings: Add whitespace before disabled attribute.
Fixes #19641. There was no whitespace between the 'checked' and 'disabled'
attribute, leading to muted checked checkboxes being neither checked nor
disabled (since `checkeddisabled='disabled'` didn't do anything).
This bug was introduced in 747e797.

This change adds a new line before the disabled template code, so that both
the checked and disabled attributes are added properly.

Tested manually to ensure the following cases didn't change when reopening
the stream settings view:

* unchecked disabled checkboxes
* checked enabled checkboxes
* checked disabled checkboxes
2021-09-15 12:29:46 -07:00
Tim Abbott 9c623a1b3e settings: Add periods to end of bot permissions strings.
This improves consistency with how all of our other settings tip
elements are written.
2021-09-15 09:59:20 -07:00
Sahil Batra 06f46cc146 settings: Add live update code for realm-level defaults settings.
This commit adds code for live-updating the realm-level default
settings page which contains only display settings as of now.

This commit also adds realm_user_settings_defaults object to
zpage_params so that we can write the tests.
2021-09-15 09:56:33 -07:00
Sahil Batra 96d6bf28db settings: Add UI for realm-level defaults of display settings.
This commit adds a new module settings_defaults.js which calls
the functions in settings_display passing appropriate container
element and settings object as parameters.
We also add one more parameter for_realm_settings to some of the
functions in settings_dislay to differentiate between the user
and realm-level settings.
2021-09-15 09:56:32 -07:00
Sahil Batra a440c93030 settings: Add realm_user_settings_defaults module. 2021-09-15 09:50:31 -07:00
Sahil Batra 6bae097bf1 settings: Refactor settings_display.js code.
This commit refactors the code in settings_display.js
by modifying the functions to receive the container
element and settings object as parameter such that
we can use the same functions for realm-level
settings by passing appropriate container element
and settings object.

This change is needed as settings_display will be
used as a common module for user settings and realm
level settings.

We also rename the default_language_name variable in
settings_display to user_default_language_name as we
would add a separate variable for realm-level setting
in future.
2021-09-15 09:50:31 -07:00
Sahil Batra e127cde3c1 settings: Make separate object for display settings labels.
This object will also be used for labels of realm-level
default of display settings.
2021-09-15 09:50:31 -07:00
Sahil Batra 6e169be933 settings: Fix the sticky behavior of saving indicator.
We want the saving indicator to be sticky in the cases
where we ask user to reload after changing settings.
This used to work correctly before 9e08c6db93, as
'if(remove_after)' returned false if remove_after was
null, but the condition was changed in 9e08c6db93
to 'if(remove_after !== undefined)' and thus the
condition returned true when remove_after was null.
This commit change the remove_after value to undefined
for sticky cases.
2021-09-15 09:47:08 -07:00
Tim Abbott e7c62c4190 stream_data: Rephrase descriptions of stream permissons.
The previous phrasing used incorrect terminology (E.g. "stream
members", not "stream subscribers", which is really confusing given
that we have a "member" role which is also relevant in this text).
2021-09-14 11:29:32 -07:00
Aman Agrawal 7c8e19758a stream_data: Add web_public as a stream privacy mode.
Show web_public descriptions for web public streams.

(Temporarily limited to development environments, since this feature
is not available yet).
2021-09-14 11:12:47 -07:00
Sahil Batra cc65ed103c settings: Use correct object in notification settings template.
In commit 40f4316, we changed the code to pass user settings
with settings_object variable, but this change was missed
during rebasing.
2021-09-14 10:13:44 -07:00
Jonny Tran 87cd743f99
settings_overlay: Change privacy icon to a lock.
This avoids duplication with the `fa-user` for the user's profile, and is also just
more intuitive for account/security settings.

Fixes #19737.
2021-09-14 10:13:16 -07:00
Rohitt Vashishtha 9299ad7843 styles: Remove incorrect css block for datepicker input.
This block didn't work consistently across .night-mode and
.color-scheme-automatic classes, and the default style for
this field already works for the day and night themes both.
2021-09-13 17:12:49 -07:00
Rohitt Vashishtha ddcea9c64b postcss: Cleanly import flatpickr dark theme.
We add postcss-import for night_mode.css only. This plugin inlines
the imports of external files, instead of letting the file go via
our usual webpack toolchain.

We do this so that we can use the postcss-prefixwrap plugin to scope
the third-party CSS properly and use it inside our night-mode class.

Fixes #10607.

[anders@zulip.com: Replace postcss-wrap with postcss-prefixwrap.]

Co-authored-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-13 17:12:49 -07:00
Anders Kaseorg d840d80ed4 tsconfig: Enable noImplicitOverride.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-13 10:10:34 -07:00
Sahil Batra 0c11ced0a0 settings: Refactor settings_display.js to use settings_object variable.
This commit changes the settings_display.js code to reference the
user_setings object using settings_object variable. This will help
to easily use the same code for realm-level defaults where instead
of user_settings realm_user_settings_defaults object will be used.
2021-09-13 08:32:31 -07:00
Sahil Batra 40f4316972 settings: Pass user settings using settings_object variable.
Instead of passing user settings directly as user_settings
variable to the settings templates, we pass them using
settings_object variable.

This change is important so that we can use the exisiting
display_settings and notification_settings template for
realm-level default settings by passing realm-level
settings using settings_source variable.
2021-09-13 08:32:31 -07:00
Sahil Batra afeb4b2113 settings: Add condition for time and default language settings UI.
We would have the UI for default language and time settign only for
user settings for now and not for realm-level settings because we
still need to migrate the backend to support the new model and will
be done in further commits.
2021-09-13 08:32:31 -07:00
Sahil Batra cb9109dccf templates: Add condition for showing stream notification settings.
We need to show the stream-specific notification settings only in
user notification settings and not for realm-level default settings.
This commit is a prep commit and adds a condition to make sure that
stream-specific settings are shown only for user-settings.
2021-09-13 08:32:31 -07:00
Jonny Tran e682152e98 lightbox: Fix alignment of x button in image view menu.
Fixes #19711.
2021-09-13 08:31:11 -07:00
Sahil Batra 6651842dc6 settings: Split email notification settings.
This commit splites email notification settings in two
parts - one with heading "Email message notifications"
containing batchning period, message-content and
organization-name settings and the other with heading
"Other emails" containing login, digest and marketing
emails settings.

Fixes #19717.
2021-09-12 16:43:55 -07:00
Sahil Batra 60112405ba settings: Restructure 'Personal settings > Notifications' section.
We remove the 'Other notification settings' heading and increase the
font size of 'Desktop message notifications' and 'Mobile message
notifications' headings as these are now on the same level with
'Notification triggers' heading.

We also add status elements to show saving indicator along the mobile,
desktop and email headings which was previously shown with the
"Other notification settings" heading.
2021-09-12 16:43:55 -07:00
Sahil Batra 14e383ad7a settings: Rename headings in notification settings UI.
This commit renames 'desktop' and 'mobile' headings in
notification settings UI to 'desktop message notifications'
and 'mobile message notifications' respectively.
2021-09-12 16:43:55 -07:00
Riken Shah fbf5c41a56 buddy_list: Show still image for animated emojis.
This commit changes the behavior of how we show
animated emojis in the buddy list. We now show still
image of animated emoji and when hovered show the
animated emoji.

Fixes #19521
2021-09-12 16:24:29 -07:00
Eeshan Garg 9c501f3efc navbar_alerts: Add alerts for demo org deadlines.
This commit displays a banner at the top for demo orgs letting the
user know that the org will be automatically deleted in the
specified number of days. The alerts are prioritized as follows:

- If there are <=7 days left till deletion, the alert is prioritized
  above desktop notification queries and is colored red.
- If there are more then 7 days left till deletion, the alert is
  prioritized below desktop notification queries.

This is a part of #19523.
2021-09-10 16:31:54 -07:00
Sahil Batra 270a082ecb settings: Increase width of message edit and delete limit setting.
This commit increases the width of message edit and delete limit
dropdowns to 325px to make them consistent with most of the other
settings in the page and also such that there is enough space
for all options in German translation.
2021-09-10 14:29:32 -07:00
Sahil Batra 3a036d7532 settings: Fix width of edit_topic_policy dropdown.
We increase the width of edit_topic_policy dropdown
such that there is enough space for all the options
in German translation.
2021-09-10 14:29:32 -07:00
Sahil Batra 1b5b7b8c2b settings: Specify moderators in dropdown options.
We change the label of various organization settings
to specify moderators.

Labels for 'admins only', 'admins and moderators'
and 'nobody' are still same.

The updated labels are -
- 'Admins, moderators and full members'
- 'Admins, moderators and members'
- 'Admins, moderators, members and guests'

These options will be replaced by user groups in
future but this is an intermediate fix.

Fixes #19562.
2021-09-10 14:29:32 -07:00
Abhijeet Prasad Bodas e023c13cdc email notifications: Frontend work for custom batching periods.
This utilizes the API added in 5db4fe8652.

We still need /help/ documentation updates for this feature.

Fixes #15280.
2021-09-10 14:28:33 -07:00
Aman Agrawal a65af97692 recent_topics: Use `plural` syntax to conditionally display text.
We can use this format to display text in plural form or not based
on a number. This helps translators easily translate text and
users get a better formatted text.
2021-09-08 17:12:32 -07:00
Aman Agrawal cf5a154413 recent_topics: Handle no rows case on `r` keypress.
When there are no rows for user to reply on `r` keypress,
we open compose box with everything empty.
2021-09-08 17:12:32 -07:00
Anders Kaseorg 1376feda93 docs: Add missing space in “emoji set”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-08 15:31:28 -07:00
Anders Kaseorg 85fec56697 docs: Update links for zulip-mobile branch rename.
GitHub redirects these, but we should use the canonical URLs.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-08 15:30:37 -07:00
sahil839 d74f6a5de6 drafts: Rename stream to stream_name in formatted draft object.
We are renaming stream to stream_name in formatted draft object
just to be more explicit and be clear that we are storing that
stream name in this variable.
2021-09-08 15:18:11 -07:00
sahil839 238ba1c36f drafts: Save stream_id along with stream names for drafts.
This commit changes snapshot_message to store stream_id for
drafts along with stream names. The stream_id field is
undefined if draft is for empty or invalid stream name.

After this change:
  - If draft has a valid stream_id stored and it maps to
    a stream, then we display the stream name from the
    obtained stream object.

  - If draft.stream_id is undefined or doesn't map to a stream,
    then we display the name stored in draft.stream, which can
    be invalid (no stream of this name existed ever), can be
    empty and can also be name of a deactivated stream.

This change helps us to show correct stream-name for drafts
in case of renaming a stream.

Fixes #15155.
2021-09-08 15:18:10 -07:00
Mateusz Mandera 10d356d2de docs: Add instructions for AzureAD SAML on Zulip Cloud. 2021-09-08 13:05:54 -07:00
Anders Kaseorg a4dbc1edd4 docs: Format Markdown with Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-08 12:06:24 -07:00
Anders Kaseorg 35c1c8d41b docs: Apply sentence single-spacing from Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-08 12:06:24 -07:00
Anders Kaseorg 915884bff7 docs: Apply bullet style changes from Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-08 12:06:24 -07:00
Palash Raghuwanshi c16d041479 stream settings: Make right panel title larger.
Also remove 'Settings for' from the start of the title.

Fixes #19524.
2021-09-07 17:01:54 -07:00
Anders Kaseorg 3845ac2b56 compose_ui: Fix ESLint no-case-declaration error.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-07 15:43:38 -07:00
Aman Agrawal 1347ee98ee compose: Extract function to format text in compose_ui.
Along with the extraction, we do some simplifications of inserting
text in compose too. This same function can now be used in
compose formatting popover too.

We use "text-field-edit", which has good cross-browser `undo` /
`redo` support, to do the text replace for us instead of writing
that logic ourselves.
2021-09-07 14:57:17 -07:00
Sahil Batra b8a1b13166 message_edit: Fix bug when multiple message edit forms are opened.
There is a bug when multiple message edit forms are opened at the
same time where undefined value of stream_id is sent to the server.
This happens because a global variable stream_widget is used to get
the id of stream selected in dropdown and value of stream_widget
variable keeps on changing when we open multiple message edit forms.
Thus, stream_widget can have the dropdown widget of already closed
edit form resulting in undefined value of stream id.

This commit changes the save_message_row_edit function to access
the dropdown element directly using message id instead of using
stream_widget.value() and thus we always use the correct dropdown
element to get the stream id.

We also move the stream_widget variable to be inside edit_message
function instead of being global variable for the module.

Fixes #19663.
2021-09-07 14:50:04 -07:00
Signior-X 459ce92109 compose: Make the route of message sending through drafts.
Before this commit, the message or any draft is deleted as soon
as the compose box is closed. So, it removes that by removing
delete_active_drafts and instead this commit will add the deletion
process of drafts in reify_message_id that is called when a
message is successfully sent and received.

Now, see there are two types of messages, one that are locally
echoed and the second ones are that aren't locally echoed but
sent directly to server. This commit only saves the message in
draft if it is locally echoed as they are the only messages
that show message failed in message list. The non locally echoed
ones aren't remove from the compose box until they are
successfully sent. Now as the draft-id is stored in the message
data for locally echoed messages, as they are echoed from the
server, they are deleted using that draft-id.

This also adds node tests for echo reify_message_id for testing
this feature that this commit is adding.

Fixes #17697
2021-09-07 14:36:05 -07:00
Anders Kaseorg 87e2166054 apps: Remove buggy SPA tumor from apps page.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-07 12:08:26 -07:00
Aman Agrawal fd77ebcc2a recent_topics: Set focus to filter button after click.
Since, the filter button is replaced with a different button
after click, the `current_focus_elem` points at incorrect
element. `revive_current_focus` follows a good
method to locate the filter button, hence
we use it to correct the element `current_focus_elem` points at.
2021-09-07 09:52:08 -07:00
Sahil Batra 89e5c7b9f9 settings: Fix live update of notification sound dropdown.
This commit fixes the live update of notification sound
setting dropdown. We already update the notification sound
source to play the correct sound after changing the setting.
2021-09-07 09:50:39 -07:00
Aman Agrawal 31de905955 login_to_access: Rename module to `spectators`.
This allows us to call spectators.login_to_access which
is more clear for what it does.
2021-09-07 09:47:28 -07:00
Aman Agrawal 354dfb02e5 stream_select_dropdown: Correct alignment of stream select element.
We left align the text to match with the design used across the
app for similar stream select elements.
2021-09-07 09:44:35 -07:00
Aman Agrawal d9b1981335 message_edit_form: Change class name of stream select element.
We set the class name to be same as the one used in move topic
to stream popover so that a single class can be used to control
the look of both dropdowns.
2021-09-07 09:43:31 -07:00