Commit Graph

12728 Commits

Author SHA1 Message Date
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