Commit Graph

12884 Commits

Author SHA1 Message Date
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
nooblag 18ca7bf7f9 rendered_markdown: Rework CSS for markdown headings.
Extracted by tabbott from the original pull request, with additional
changes to document the surprising margin-top in our current
implementation and avoid a bit of unnecessary CSS.
2021-09-06 16:37:10 -07:00
Eeshan Garg 64deaaceb7 help_docs: Fix improper indentation for ordered lists.
On our Markdown help docs, ordered lists that aren't encapsulated
in tabs don't have custom CSS that tells them how to display
themselves with proper indentation. An example of a doc that has
this issue is /help/saml-authentication. This commit adds some CSS
that targets such ordered lists.
2021-09-06 16:22:01 -07:00
Aman Agrawal 5151e916ea click_handlers: Don't hide compose when clicking on tippy popovers. 2021-09-06 09:35:58 -07:00
Aman Agrawal 34a37f55d6 spectators: Rename is_web_public_compatible functions. 2021-09-06 09:00:16 -07:00
Aman Agrawal f5e4dca8f2 login_to_access_modal: Restore current hash after login. 2021-09-06 09:00:16 -07:00
Aman Agrawal a67cff4964 reactions: Don't process clicks from spectators.
The reaction count goes up locally if we don't have this check.
This is misleading for spectators.
2021-09-06 09:00:16 -07:00
Aman Agrawal 9bd2701f5b message_fetch: Don't re-fetch recent msgs for spectator.
Since a spectator cannot have unread counts, we always
fetch the most recent messages. Hence, there is no need to
separately fetch this in this case.
2021-09-06 09:00:16 -07:00
Aman Agrawal fcfc81cdf3 compose: Prompt user to login when trying to compose. 2021-09-06 09:00:16 -07:00
Aman Agrawal cfd81b1bf4 login_to_access: Take user to web_public_compatible hash on exit.
We save the last web_public_compatible hash that user visited
before the modal was shown and take user to that hash when
user exits the modal.
2021-09-06 09:00:16 -07:00
Aman Agrawal 3e7538b974 filter: Copy is_web_public_compatible from server to frontend.
This will be used to check if the narrow being requested by
spectator requires authentication without requesting the server.
Having this check locally, makes this process look snappy to
the user and doesn't result in 404s in the browser log.
2021-09-06 09:00:16 -07:00
Aman Agrawal 3ed833a7e4 hashchange: For hash that needs auth, prompt spectator to login.
For spectators, without sending any request to the server,
check locally if the hash requires authentication or which
shows a feature that requires authentication;
if it does, we show login_to_access modal to the user.
2021-09-06 09:00:16 -07:00
Aman Agrawal 045cdb4ed0 login_to_access: Modal which blocks access for spectator.
We will use this modal for any narrow / hash or other UI element that
requires an actual account to use, to provide something reasonable to
occur when a user clicks on those things.
2021-09-06 09:00:16 -07:00
Tim Abbott 79d313930b settings: Clarify newsletter documentation string. 2021-09-03 11:31:53 -07:00
Tim Abbott 191b1ac2be setting: Tweak strings explaining Zulip newsletter.
We ideally will also add a /help/ page explaining these with an
example, but it seems appropriate to make the labels frame it around
what sort of emails we actually intend to send (newsletters with
updates about Zulip, not a "drip campaign").
2021-08-31 17:12:16 -07:00
Anders Kaseorg 7170fb01f1 icons: Set font-display: block for icon font.
It’s not helpful for the browser to substitute another font for the
icon font while it’s loading.

This suppresses a warning from the Lighthouse performance analyzer.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-23 15:59:54 -07:00
Sahil Batra 9cc4290140 settings: Rename "Send test notification" to "Test desktop notification". 2021-08-21 07:48:38 -07:00
Sahil Batra fef825d56f settings: Rename class of notification settings elements.
We rename class of notification settings except checkboxes
by prefixing them with 'setting_' for clarity.

We do not change class of checkboxes because settings_checkbox
is used by other templates also and if we only change class
of those using notification_settings_checkboxes then live
update code will break and will need to add separate condition
for differentiating between which partial template is used.
2021-08-20 07:51:23 -07:00
Sahil Batra d05730a199 settings: Rename classes for display settings elements.
We rename the class of display setting elements by prefixing
them with 'setting_' for clarity.
2021-08-20 07:51:11 -07:00
Sahil Batra 9c17e7019d settings: Add 'user_' prefix to presence_enabled setting element.
This commit adds 'user_' prefix to presence_enabled setting
element such that we can have unique ids when we add a realm-level
setting for this.
2021-08-20 07:50:51 -07:00
Sahil Batra 02ce8531cc notification: Rename notification-sound audio and child elements.
This is a prep commit for adding UI for realm-level defaults
of user settings.
This commit renames notification-sound-audio element to
user-notification-sound-audio because we will be adding similar
element for realm-level default of user settings also.

We also change the child elements to have current id as their
class for the same reason.
2021-08-20 07:50:51 -07:00
Sahil Batra 7b79980be9 settings: Add prefix to checkboxes used in notification_settings.
This commit adds prefix paramter with value "user_" to the
settings_checkbox and notification_settings_checkboxes references
in notification_settings.hbs such that ids are unique when we use
notification_settings.hbs for realm-level settings UI.
2021-08-20 07:50:51 -07:00
Sahil Batra 32a43985d7 settings: Create user_notification_settings.hbs template.
This commit creates a new template user_notification_settings.hbs
for user notification settings and notification_settings.hbs will
be used as a common template for user-level and realm-level
settings.
2021-08-20 07:50:51 -07:00
Sahil Batra 032d347b4f settings: Refactor frontend code for notification settings.
This is a prep commit for adding UI for realm-level default
of user settings. We refactor the code to use  classes
instead of ids such that we can use the common code for the
new settings.
2021-08-20 07:50:51 -07:00
Sahil Batra 79fa7f9609 settings: Refactor change_display_setting to have url paramter.
This commit refactors change_display_setting function to accept
url as a paramter instead of directly using '/json/settings'
such that we can use the same function for realm-level settings.
2021-08-20 07:50:51 -07:00
Sahil Batra 9bd1ea229c settings_display: Refactor change_display_setting function.
This commit refactors change_display_setting function to
accept container element as a paramter and then determine
the correct status element from it. This is the prep commit
for adding realm-level default settings UI.
2021-08-20 07:50:51 -07:00
Sahil Batra c5cc4fb114 settings: Refactor default-language modal code.
We add a prefix to id of default_language_modal.hbs
such that we can use the same code for user settings
and realm-level settings.
We also add a class "default_language_modal" to the
modal div to avoid duplicate css.
2021-08-20 07:50:51 -07:00
Sahil Batra cf1a7c4d1c settings: Add prefix to settings_checkbox references in display_settings.
This commit adds prefix paramter with value "user_" to the
settings_checkbox references in display_settings.hbs such
that ids are unique when we use display_settings.hbs for
realm-level settings UI.
2021-08-20 07:50:51 -07:00
Sahil Batra 8bf5b3a399 settings: Create user_display_settings.hbs template.
This commit creates a new template user_display_settings.hbs
for user display settings and display_settings.hbs will be
used as a common template for user-level and realm-level
settings.
2021-08-20 07:50:50 -07:00
Sahil Batra 3adf5e6383 settings: Refactor frontend code for display settings.
This is a prep commit for adding UI for realm-level
default of user settings. We refactor the code to use
classes instead of ids such that we can use the common
code for the new settings.
2021-08-20 07:40:20 -07:00
Aman Agrawal da11141eae click_handlers: Don't select message on clicking message_controls.
Note that opening the main message actions menu still selects the
message due to explicit code in toggle_actions_popover.
2021-08-20 07:31:26 -07:00
Eeshan Garg c9861b3c74 marketing_emails: Ask for user's consent at sign-up. 2021-08-20 06:43:26 -07:00
Sahil Batra 6117c3824a user groups: Hide system user groups temporarily from UI.
We hide the system groups from the typeaheads and the list
of user groups in settings page temporarily.
2021-08-19 02:56:45 -07:00
Sahil Batra 7ea3a53d49 settings: Remove unnecessary code.
We were using incorrect element as we changed the input from
select to radio buttons in 439bc2920a.
This code was originally added in 6cb03ea78e (though in a
different file) and was removed from sometime and then added
again in e7311cdf5d. But in the meantime the input was
changed to radio, which resulted in incorrect code.
2021-08-19 02:50:50 -07:00
Sahil Batra 7b74bd1428 settings: Fix incorrect elements used for emojiset loading spinner.
We were using emojiset_spinner element in destroy_indicator, but
there is no such element and emoji-settings-status element is used
in make_indicator, so destroy_indicator should also use the same
element.

This was added originally in 6cb03ea78e (though in a different
file) and was removed for sometime and then readded in e7311cdf5d.
But between these two commits, the setting was changed to be a
radio element and thus the spinner elements were also changed.
2021-08-19 02:50:50 -07:00
Eeshan Garg 190ce61eed landing-page: Fix mobile scrolling bug when sidebar is toggled.
On mobile, when the sidebar is toggled, the following three issues
are encountered:
- When none of the sidebar menus are expanded, the sidebar has no
  scrollbar, which is expected. But if you scroll, the background
  content scrolls, which is a bug.
- When some of the sidebar menus are expanded such that the content
  overflows and is "scrollable", once you get to the end of the
  sidebar content, the background content keeps scrolling in a weird
  way.
- If the mobile screen is wide enough, if you scroll the sidebar
  content, it scrolls as expected. But if you move the pointer to
  the side of the background content that is still visible, you
  can scroll the background content even though it should be fixed.

This commit fixes all of the above issues.
2021-08-17 06:23:46 -07:00
Sahil Batra 5459a92e4a setting: Use "unlimited" instead of "forever" for retention setting.
This commit updates both the stream-level and realm-level message
retention setting to use 'unlimited' instead of 'forever' to set
message retention setting to "retain messages forever".
2021-08-08 15:56:57 -07:00
Sahil Batra 0e5b2326b2 stream settings: Rearrange personal stream settings.
We rearrange the personal stream settings to show all the
notification settings together under a separate heading.

Fixes #19508.
2021-08-08 15:05:56 -07:00
Sahil Batra 4deb9dc834 stream settings: Remove border around personal stream settings. 2021-08-08 15:05:56 -07:00
akshatdalton 1a63c2d187 notification: Fix "narrow to..." link present above composebox.
Earlier copy to the link present above the composebox (which
appears when a message is sent outside the current narrow), it
used to provide the link to the home page which is fixed now.
Now, copy to the link gives the link of the narrow where message
is sent.
2021-08-07 09:51:04 -07:00
Ganesh Pawar 378395bcc4 user_status: Show change status modal when clicked on emoji in buddy list.
Fixes #19506
2021-08-07 07:19:03 -07:00
Ganesh Pawar c6368f5638 buddy_list: Add a self class to the current user entry. 2021-08-07 07:19:03 -07:00
Anders Kaseorg dd2f979541 templates: Add missing tabnabbing protection for target="_blank" links.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-07 06:25:30 -07:00
Alya Abbott 78184c5bc5 portico: Add comparison checkboxes to /for/education.
On narrow width screens, user can now scroll the table,
instead of table collapsing all the text together making
it look weird.
2021-08-07 06:23:31 -07:00
Eeshan Garg f2d58f1d5d landing-page: Fix flickering sidebar transition upon resizing.
When one resizes the window and tries to switch to the vertical
sidebar menu, the CSS transition flickers in and out. This is
less than ideal.

This commit implements a solution to this problem. The solution is
inspired by the following helpful article:

https://ishadeed.com/article/layout-flickering/
2021-08-07 06:22:29 -07:00
Eeshan Garg 132498894f header: Stop trying to detect if touch is enabled for click events.
We found a bug in our top-level nav on certain Samsung phones where
tapping on the dropdowns didn't do anything. As it turns out, trying
to figure out whether touch is enabled on a device using CSS media
queries such as `(hover: none)` is very tricky business! While it
may work on some devices, it may break spectacularly on others.

This commit presents a potential solution to this. Media queries
about widths are a lot more device-independent than hover media
queries. So, this is what we do now:

- We fire click events regardless of whether the top-level nav is in
  the vertical sidebar orientation or the horizontal orientation.
  Since we are no longer dependent on hover media queries for click
  events, this fixes the mobile bug mentioned above because taps or
  clicks will always work regardless of device.
- The mouseover/mouseout events are only fired when the header is
  in the horizontal orientation and the primary input mechanism
  supports hovering over elements. This allows us to support hovering
  over menus on desktop. However, since mouseout/mouseover events are
  irrelevant for mobile, we are fine on that front since clicks/taps
  will still work.

NOTE that the above approach also takes care of weird edge cases where
you have a horizontal orientation on a device such as the iPad Pro that
is flipped in the horizontal position. Since clicks work anyway, these
edge cases are largely taken care of.
2021-08-07 06:22:29 -07:00
Eeshan Garg 13b0114bcc landing_page: Switch to sidebar menu earlier at width <= 1024px.
Right now, some of our horizontally spaced out top-level dropdowns
(such as "Solutions") get truncated on screen widths less than
1024 px. We switch to the vertical sidebar menu at widths less than
686px.

Looking at a lot of mainstream websites, a few of them switch to a
vertical sidebar menu on much wider widths than we do. Plus,
switching to a vertical orientation is a much cleaner way to fix
this issue than playing around with legacy Bootstrap code. Therefore,
we should toggle on the sidebar menu at width <= 1024px.
2021-08-07 06:22:29 -07:00
Anders Kaseorg b44e6123fe gear_menu: Fix template variables passed from page_params.
Commit 9049fb3bd4 (#19176) broke these
by changing {page_params} to {...page_params}.  We could change it
back, but it’s better to be explicit about which items we use from
page_params.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-07 06:19:43 -07:00
Priyam Seth 5a4318d046 compose: Fix compose fade not updating on deleting user pill.
This commit makes the compose.update_fade as an exported
function and adds the listener to update the fade manually
as deleting the pill was not calling this functions.

Fixes #18865
2021-08-06 14:22:55 -07:00
tushar912 83f6557f43 integrations: Add SonarQube webhook integration.
Fixes #13395.
2021-08-05 09:53:42 -07:00
Steve Howell ea6929457c unread: Add get_read_message_ids() helper.
We only use this is in tests for now, but it will be
helpful to mark messages as unread in an upcoming PR.
2021-08-04 12:06:11 -07:00
Steve Howell 8ac0beefcf refactor: Use named parameters for UnreadTopicCounter.add(). 2021-08-04 12:06:11 -07:00
Steve Howell 09d0652bdd refactor: Use user_ids_string more internally.
We want to avoid passing opaque messages around to
low-level functions that only need certain fields.

This sets us up to handle mark-as-unread messages
that aren't necessarily full messages.
2021-08-04 12:06:11 -07:00
Steve Howell f7e5847b5c unread: Avoid use of opaque message.
We only care about ~8 fields from a Zulip message
when we're tracking unread counts. For example, we
don't care about the "content" field. This also sets
us up to pull up the "display_recipient" logic in an
upcoming commit.
2021-08-04 12:06:11 -07:00
Steve Howell 80edf7456c unread: Extract process_unread_message.
This will facilitate adding mark-as-unread events in
the (hopefully near) future.
2021-08-04 12:06:11 -07:00
Aman Agrawal 49901e9eca portico: Flip some svgs to face text. 2021-08-04 12:02:18 -07:00
Aman Agrawal eaf037c1d1 for-companies: Apply css from plans page.
Some of the narrow width css was not being applied which used
to result in weird behavior.
2021-08-04 12:02:18 -07:00
Aman Agrawal 6835fe0eeb for-companies: Add margin to `.feature-end` text.
Avoids text sticking to border on narrow screens.
2021-08-04 11:57:19 -07:00
Riken Shah d2a15f613f user_info_popover: Fix status emoji showing even if it's not set.
This happened because we had not put a condition in
our template to handle the above situation.
2021-08-04 01:11:06 -07:00
Riken Shah 53e9fdf8e2 set_user_status: Increase the selected emoji size a bit. 2021-08-04 01:11:06 -07:00
Riken Shah e5b216fc64 compose: Update status text in placeholder instantly after it's updated.
When compose box is opened to self and the user
updates the status, it should instantly update the status
text in a placeholder.
2021-08-04 01:11:06 -07:00
Alya Abbott b679148788 portico: Revamp /for/companies.
We rework the landing page for companies in the same way we've
recently revamped the landing pages for other use cases.

This implementation unfortunately duplicates a lot of content from
/plans; we should clean that up at some point.
2021-08-03 21:54:38 -07:00
Aman Agrawal f965ed4013 portico: Resize companies hero image to speed up loading time. 2021-08-03 21:54:38 -07:00
Aman Agrawal 649df3570f plans: Redesign compare table. 2021-08-03 17:00:46 -07:00
Anders Kaseorg 42fa62e563 Revert "time_widget: Make the generated time string more readable."
This reverts commit 1965584eec.

This syntax has a bad interaction with table syntax and needs to be
rethought.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-03 16:45:31 -07:00
ericluoliu c618d7d87c UI: Fix x button alignment in feedback widget. 2021-08-03 16:15:25 -07:00
Lefteris Kyriazanos 2b70e88fda integrations: Add basic open collective integration.
Add basic open collective integration for the user donation
event.
Fixes #18319
2021-08-03 16:09:33 -07:00
Eeshan Garg 6383b38915 landing_page: Decrease margin around the call-to-action section.
The call-to-action ("Experience Zulip today!") section on our
landing page has a lot of superfluous margin around it that takes
up a lot of space. This commit decreases that margin as a part of
our efforts to restructure the bottom nav in general.
2021-08-03 15:17:07 -07:00
Eeshan Garg 967db85201 landing_page: Restructure bottom navigation.
We recently added a lot of new pages to our top navigation and
restructured top-navigation in general. This commit updates the
footer to reflect the recent changes to our top navigation.
2021-08-03 15:17:07 -07:00
Aman Agrawal 8fff420250 emails_assets: Change color of outlines to #5f5ffb.
This is a slightly darker shade of purple from what was previously
merged.

Also the followup svg assets have been replaced with the new ones.
2021-08-03 10:38:40 -07:00
Sahil Batra aefab3d898 settings: Fix incorrect usage of user_settings.
'corporate_enabled', 'realm_push_notifications_enabled'
and 'realm_digest_emails_enabled' settings are part of
page_params and not user_settings.

This was introduced in 998d710275.
2021-08-03 10:27:38 -07:00
Ganesh Pawar 1965584eec time_widget: Make the generated time string more readable.
Before: <time:2021-07-14T00:14:00-07:00>
After: <time:2021-07-14|00:14:00|UTC-07:00>

Fixes #19205
2021-08-02 23:17:01 -07:00
Aman Agrawal 7e0d26cd83 compose_send_button: Use box shadow instead of outline on focus.
This gives rounded corners to outline on focus instead of square
which looks bad.
2021-08-02 13:54:54 -07:00
Aman Agrawal 4d37215c3d css: Set standard outline color for focusable elements.
Fixes #19198

We set blue outline color in day mode and light gray outline colour
in night mode. This removes the different outline colours users
in different platforms / desktop app.
2021-08-02 13:54:54 -07:00