Commit Graph

11981 Commits

Author SHA1 Message Date
Anders Kaseorg 5ca763fc24 eslint: Fix unicorn/prefer-switch.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 19:26:41 -07:00
Anders Kaseorg 04569bc17e settings_org: Remove unused case for realm_zoom properties.
Commit 4d04fa3118 (#11874) removed those
properties.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 19:26:41 -07:00
Anders Kaseorg a284299b85 eslint: Fix unicorn/prefer-array-flat.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 18:07:13 -07:00
Anders Kaseorg 42abc1b635 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 18:07:13 -07:00
Aman Agrawal 512f16690a settings_streams: Use hash_util to check if settings is open.
Since both `organization` and `settings` are category of hash,
we can simply check if the current hash's category is among
them.
2021-05-10 17:55:03 -07:00
Aman Agrawal 570306fa69 subs: Use hash_util to get stream id.
Active stream's hash look like this - `#streams/1/announce`
Since the stream_id is present where typically hash section
is for all other hashes, get_current_hash_section should return
the same result.
2021-05-10 17:55:03 -07:00
Aman Agrawal b180c245b4 subs: Use hash_util to check if user is in "#streams/new". 2021-05-10 17:55:03 -07:00
Aman Agrawal b6f14c54e5 subs: Move active_stream function to hash_util.
This function better belongs in hash_util since it relies on
the current window hash.
2021-05-10 17:55:03 -07:00
Aman Agrawal c6a934da4c reload: Use hash_util to get current hash encoded.
We do this change to limit the use of window in other modules,
specifically window.location.hash.
2021-05-10 17:55:03 -07:00
Aman Agrawal e7129af8ac hash_util: Extract functions to be reused without `window`.
These functions can now be used in other libraries without
using window.location.hash in them and directly calling these
functions.
2021-05-10 17:55:03 -07:00
PIG208 d8db797798 doc: Fix configurations for images in the doc of newrelic.
The screenshot generating mechanism doesn't work for newrelic and
causes error because its configuration file doesn't exist. This
commit fixes the configuration and re-generate the screenshots.
2021-05-10 17:50:32 -07:00
PIG208 9b48a36b91 tools: Add support to generating bot avatars for non-webhook integrations.
New bot avatars are generated with this tool. Having the avatars generated,
we can run generate-integration-docs-screenshot to generate the doc
screenshots.

Fixes: #17792
2021-05-10 17:50:32 -07:00
aryanshridhar 69e3b9c7ec keydown_util: Add comments documenting keys. 2021-05-10 17:32:16 -07:00
aryanshridhar 9f9259683c settings_panel: Bind vim keys to SettingsPanelMenu.
Added a commit to bind vim keys with the SettingsPanelMenu,
allowing users to control the settings and organization tabs
using 'h','j','k' and 'l' keys.

vim_left('h') -> Switch between tab by shifting focus to the left.
vim_right('l') -> Switch between tab by shifting focus to the right.
vim_up('k') -> Move up.
vim_down('j') -> Move down.
2021-05-10 17:30:10 -07:00
Abhijeet Prasad Bodas 67cd385cec mute user: Add user documentation page.
Also link to it from the API documentation page,
other help pages, and the confirmation dialog for
muting a user.

With substantial edits by tabbott and alya.
2021-05-10 17:10:40 -07:00
Abhijeet Prasad Bodas 9519221bb5 mute user: Remove development environment checks. 2021-05-10 16:38:21 -07:00
Tim Abbott f83bea76a2 compose: Revert placeholder styling for bottom reply button.
* Revert "frontend: Remove hover effect from small messagebox."
  This reverts commit 27d9643274.
* Revert "frontend: Use placeholder style for small messagebox text."
  This reverts commit 8453aac260.
* Revert "frontend: Make "Reply" button look more like a textbox."
  This reverts commit 9fdd7184c6.
2021-05-10 12:54:30 -07:00
Abhijeet Prasad Bodas 35fb095f61 confirm dialog: Allow specifying /help links.
This makes it easy for users new to a feature to learn
about more it when confirming the action.
2021-05-10 12:36:39 -07:00
Abhijeet Prasad Bodas 22053d8399 people: User "Muted user" placeholder for muted usernames. 2021-05-10 12:36:39 -07:00
Abhijeet Prasad Bodas 5bcc96508d refactor: Extract people.get_display_full_names.
This deduplicates code used to generate message group headers
and the reactions tooltip.
2021-05-10 12:36:39 -07:00
Gaurav Pandey 756ee2c055 right-sidebar: Replace invite-link height with shortcut height.
To calculate the max-height of buddy_list_wrapper, we use
invite-link-height. This works alright if inviting is enabled
for all. However for users who aren't permitted to invite,
the element does not render, hence the logic uses `0` as
default value for subtraction in `get_new_heights` function
under resize.js. This leads to the keyboard-shortcut icon
rendered below the browser window. Hence use the parent div
`right-sidebar-shortcuts` height for the logic.
2021-05-10 12:10:41 -07:00
Gaurav Pandey 96e035a2f0 api: Fix encoding of strings in streams endpoint.
* Remove unnecessary json_validator for string parameters.
* Update frontend to pass right parameter.

Bump api feature level and highlight the fix for `emojiset`
parameter of `settings/display` endpoint in zulip.yaml file.

Fixes part of #18035.
2021-05-10 10:29:22 -07:00
Gaurav Pandey 9abe1cafbe api: Fix encoding of strings in display settings endpoint.
* Remove unnecessary json validator for string validator.
* Update frontend to pass right validator.
* Update zulip.yaml to pass right parameter for curl request
  in openapi.
* Update python_examples to pass right paramater.

Fixes part of #18035.
2021-05-10 10:03:32 -07:00
Anders Kaseorg 544bbd5398 docs: Fix capitalization mistakes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 09:57:26 -07:00
Anders Kaseorg 41e8872b0f realm_playground: Stop using Map incorrectly.
Commit ad76df25ac (#18405) uses Map
incorrectly.  A JavaScript Map needs to be indexed with .get() and
.set(), not with [].

Also, clean up the API: ‘lookup_table’ is a meaningless variable name,
and there was no information in the array that wasn’t also in the Map.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-09 22:01:00 -07:00
PIG208 7150fe5dc5 backend: Extract check_update_message from update_message_backend. 2021-05-09 20:44:04 -07:00
Ryan Rehman 5041616adb panels: Fix incorrect frb positioning.
The previous `top_offset` calculation didn't include the height
of the panels which led the calculations to be performed as if
a portion which was hidden behind the searchbox, was visible to
the user.

The new formula is corect as the frb_top calculation in
panel.resize_app also uses panels_height.
2021-05-09 20:42:27 -07:00
Ryan Rehman aa00ef3a32 refactor: Remove hardcoded frb height. 2021-05-09 20:42:27 -07:00
Adam Birds 589a7799dc integrations: Add Uptime Robot integration.
Note that the documentation cannot fully use our macros, because
Uptime Robot requires an & of the end of the URL, because of how it
passes its payload.

Fixes #13854. Fixes #13939.
2021-05-09 20:34:19 -07:00
Tim Abbott 831b7ca965 css: Fix style for buttons that are just a pencil icon. 2021-05-09 20:29:06 -07:00
Tim Abbott 1d9b5ffa92 lint: Fix badly quoted strings tagged for translation.
We also remove an aria-label on a placeholder that matches the input
element's actual label field.
2021-05-09 20:16:28 -07:00
akshatdalton 43aee21dcc linkifiers: Add frontend support to edit linkifier.
A modal is added to edit the realm linkifier which
supports ui_report error.

Puppeteer tests to verify linkifier update and an
invalid test to verify that linkifier error messages
are reported on the modal are added as well.
2021-05-09 20:12:25 -07:00
akshatdalton 8f290216ef linkifiers: Add `title` attribute to `Delete` button.
This commit adds `title` attribute and removes
`aria-hidden` attribute in `Delete` button in
linkifiers table.

`aria-hidden` attribute is used only for icons on buttons
that have a plain-text label.
2021-05-09 19:55:06 -07:00
Tim Abbott 99636c36a3 css: Remove inconsistent topic edit modal margin.
Similar elements in both the compose box and main message edit UI have
no margin in this location, and look better.
2021-05-09 19:47:27 -07:00
Tim Abbott 3e4a819722 css: Centralize topic edit modal CSS. 2021-05-09 19:47:08 -07:00
aryanshridhar 85fc8d5472 popovers: Allow Move topic's dropdown_list_widget to overflow.
Added a CSS overflow property to Move topic popover so that the
dropdown_list_widget doesn't hide behind the modal.
2021-05-09 19:35:51 -07:00
aryanshridhar 42c02f0788 popovers: Add search typeahead to Move topic popover.
Implemented dropdown_list_widget in Move topic popover which enables,
the functionality to search for streams while moving a particular topic.

The aim is to reduce the user effort by having an input
typeahead instead of haivng a dropdown list of streams.

Closes #14860.
2021-05-09 19:32:33 -07:00
aryanshridhar 2c50c67d07 dropdown_list_widget: Properly bind focus event to input field.
Previously, the focus event was triggering on a hidden
dropdown input field, which caused it to not gain focus when
clicked on dropdown button.

This is so because focus events cannot be triggered to
hidden elements or elements that aren't visible in DOM.

Added a fix by explicilty triggering the focus event to
dropdown input field only if the input field is visible in the DOM.
2021-05-09 19:26:40 -07:00
aryanshridhar a3baf90d3a move_topic_to_stream: Replace modal confirmation text to Confirm.
Followup of zulip#17926.
Basically, the aim is to concise modal texts
to use 'Confirm' instead of long labels since they can
tricky for translators and can also create bad strings
having long words.
2021-05-09 19:21:46 -07:00
Wesley Aptekar-Cassels 6639342892 shared: Add link to mobile @zulip/shared docs in README. 2021-05-09 19:12:09 -07:00
Tim Abbott 9a5ad4163e i18n: Rewrite text explaining default language panel.
* Explain what the percentages mean.
* Adjust old verbiage from before we had many translations.
2021-05-09 19:02:09 -07:00
Aman Agrawal 1152e0ffef default_language: Mark popup text for translation.
Provide link to Read the Docs translation guidelines page which
is more detailed.
2021-05-09 18:48:46 -07:00
Tim Abbott eff0014691 apps: Fix inconsistent sizing of hover bubbles.
They are all now approximately 110x110 squares, rather than having some be
substantially taller than others.
2021-05-09 18:42:13 -07:00
Aman Agrawal 1212635151 ui_util: Stop propagation enter keypress when it is already handled.
This is good to do in general for these type of event handlers
and this also fixes a bug where pressing on reply button in
the recent topics will open compose with a new line since
browser assumed enter was pressed on compose_textarea since
process_enter_key returned false.
2021-05-09 18:31:20 -07:00
Tim Abbott 27b04cb7ed settings: Fix position of custom_profile_field hints.
These were confusing when placed below the input element.
2021-05-09 16:55:07 -07:00
Tim Abbott b507efc0d8 settings: Disable form autocomplete for playground name. 2021-05-09 16:18:59 -07:00
Sumanth V Rao ad8f27e20c playgrounds: Display the typeahead before the user starts typing.
We display the 5 most popular Pygment languages in the typeahead
when the user clicks on the `pygments_name` field and before they
start typing.
2021-05-09 16:13:19 -07:00
Sumanth V Rao 9c4ed43d6b playgrounds: Add an option to select "Custom language" in typeahead.
Since we support hooking up code playgrounds for custom languages
outside of the list of languages supported by Pygments, we display
an option to select a "Custom language" in the typeahead.
2021-05-09 16:13:04 -07:00
Sumanth V Rao ad76df25ac playgrounds: Add pygment aliases into a parenthetical in the typeahead.
The `pygments_name` field typeahead shows a list of human-readable
`pretty_name`to pick from. However, the Pygment aliases which are
used for code highlighting within a code block are different from
these. This mismatch might be confusing for folks unfamiliar with
technical details of the "code playgrounds" feature.

To bridge the gap, we now include the Pygment aliases within
parenthesis along with its human-readable name, in the typeaheads.

E.g: Python 2.x (py2, python2).
2021-05-09 16:11:30 -07:00
aryanshridhar 9f15de41f3 drafts: Allow vim up and down key to scroll between drafts.
Added a fix to bind vim_up(k) and vim_down(j) keys
with the draft section, allowing users to scroll
between the drafts using 'k' (scroll up) and
'j'(scroll down) keys.

Fixes #18397
2021-05-09 09:18:07 -07:00
aryanshridhar c25155a143 hotkeys: Fix a minor typo in comment.
'Rnter' -> 'Enter'
2021-05-09 09:18:07 -07:00
Wesley Aptekar-Cassels 27d9643274 frontend: Remove hover effect from small messagebox.
Textboxes shouldn't have hover effects.
2021-05-08 08:26:16 -07:00
Wesley Aptekar-Cassels 8453aac260 frontend: Use placeholder style for small messagebox text.
This makes the small messagebox (previously referred to as the "Reply"
button) look more like a textbox.
2021-05-08 08:26:16 -07:00
Wesley Aptekar-Cassels 8bc0c14e81 css: Explicitly set placeholder text style.
Previously, we relied on the browser placeholder text style, but this
makes it impossible to style text to look like a placeholder.

Chrome uses `color` to set the placeholder, while Firefox uses
`opacity`. This commit sets both, since setting one without the other
will lead to strange behaviour.

We pick the color for the light and day themes to ensure that we meet
WCAG standards for accessibility.
2021-05-08 08:26:16 -07:00
Wesley Aptekar-Cassels 9fdd7184c6 frontend: Make "Reply" button look more like a textbox.
* Use "text" cursor effect
* Reduce padding
* Remove blue color in placeholder text
2021-05-08 07:59:31 -07:00
Tim Abbott 747cbb5dde integrations: Fix JavaScript exception on category pages.
This logic threw an exception ever since we added new buttons at the
bottom of the page that were inside the container this looped over.
2021-05-08 07:54:51 -07:00
Tim Abbott e319a1e5e8 templates: Fix typo in stream deactivation modal. 2021-05-08 07:31:40 -07:00
aryanshridhar 5e47d8446f deactivate_stream: Add Help link widget for UI modal.
Added Help link widget for deactivate_stream UI modal
which redirects to /help/archive-a-stream within
the user documentation.
2021-05-08 07:29:24 -07:00
aryanshridhar 5a254bf495 deactivate_realm: Add Help link widget for UI modal.
Added Help link widget for deactivate_realm UI modal
which redirects to /help/deactivate-your-organization within
the user documentation.
2021-05-08 07:29:24 -07:00
aryanshridhar e1fc389d79 deactivate_account: Add Help link widget for UI modal.
Added Help link widget within account settings for
deactivate account UI modal which redirects to
/help/deactivate-your-account within the user documentation.
2021-05-08 07:29:23 -07:00
Abhijeet Prasad Bodas eadbce4b0c message list: Don't exclude 1:1 PMs with muted users in pm-with narrows.
Previously, we used to hide 1:1 PMs with muted users everywhere
in the UI. This commit makes it so that such messages will now be
visible in `pm-with/<muted_user>` narrows, meaning these will not
be excluded from message lists, but will still be hidden under
the "This message was hidden." dialog implemented earlier.
2021-05-07 16:21:35 -07:00
Abhijeet Prasad Bodas a59f545136 message lists: Exclude 1:1 PMs with muted users.
* We hide 1:1 PMs from and to muted users throughout
the UI, because doing so will not lead to loss of
conversational context. The "to" part is also important,
because the last few messages sent to a user before
muting them would probably be asking them to stop
spamming.

* After this change, we will need to do filtering for either
user or topic muting in pretty much all narrows, so we need
to keep the `_all_items` list in MessageListData always
up-to-date.

* A further commit will relax this and make it possible to
view these messages only when in a `pm-with/muted_user`
narrow.
2021-05-07 16:21:35 -07:00
Abhijeet Prasad Bodas e64e5936ce message lists: Don't allow user/topic mute message filtering independently.
This basically reverts 4bd7ec7c36 and
3a9dfc02e6.

The plan earlier was to have compeletely different codepaths
for user and topic muting, so that we could call seperate
functions in the message list class on receiving the respective
events.

However, this cannot be done, because if we, for example, on
receiving a `muted_users` event, filter `_all_items` based on
just user mutes, and store the result in `_items`, then, that
result may still contain topic-muted messages, which is
undesirable. Hence whenever we filter messages, we must do so
based on both user as well as topic muting.
(The code for the former will be added in further commits.)

So, we will have a single function which will handle updating
the message lists for muting.
2021-05-07 16:21:35 -07:00
Aman Agrawal 0dd8ce6ff9 recent_topics: Hide reply button when search or filters selected.
Since there is no context for a message in the search or filter buttons,
we don't show reply button either of them are focused.
2021-05-07 16:07:52 -07:00
Aman Agrawal 5040246474 recent_topics: Load enough topics to maintain scroll position.
We were losing scroll position after re-render because there
were not enough rows present in the table to focus back to
the same position. With this commit it is possible now since we
always render with enough rows to do so.
2021-05-07 16:07:52 -07:00
Aman Agrawal 2066553635 recent_topics: Always keep a `visible` topic row in focus.
We save the scroll position of the user by keeping the topic
row at the center of the visible scroll container in focus. The
avoids focus being reset to first topic row when recent topics
renders. Thus, this improves the UX of recent topics.
2021-05-07 16:07:52 -07:00
Aman Agrawal d2e3dbeb50 list_widget: Allow instance to change load_count as per state.
Add a function which is called before every render to
get the number of items it can render. This can be used by
instance to load custom number of items as per its state.
2021-05-07 16:07:52 -07:00
Aman Agrawal 7d6b65e8f4 list_widget: Give instances more control over scrolling behaviour.
We allow ListWidget instances to pass functions in opts that can
be called after scrolling to determine when to render.
Also, allow a callback function to be called pre render.
2021-05-07 16:07:52 -07:00
Aman Agrawal 51acbefc8a recent_topics: Display compose box & enable compose hotkeys.
We move compose from being a part of message feed to
being a part of  middle column which is a common parent of recent
topics and message feed. This allows us to use a common compose
box for both the views. Fortunately, compose actions were
independent of this change so there weren't any evident
side effects.

Fixes #17543
2021-05-07 16:07:51 -07:00
Aman Agrawal 1bc21a6a2f compose: Extract function to update compose buttons.
These two functions just have text_stream different, rest are
same.
2021-05-07 15:51:54 -07:00
Gaurav Pandey 36ad9b7d0e api: Fix encoding of strings in user settings endpoints.
* Remove unnecessary json_validator for string parameters.
* Remove unnecessary JSON encoding in frontend calls.  Structurally,
  JavaScript does correct encoding without explicit JSON encoding.

Fixes part of #18035.
2021-05-07 14:10:45 -07:00
Gaurav Pandey 232c7107eb api: Fix encoding of strings in tutorial endpoint.
* Remove unnecessary json validator for string parameter.
* Update frontend to pass right parameter.

Fixes part of #18035.
2021-05-07 14:06:54 -07:00
Gaurav Pandey d4219da254 api: Fix encoding of strings in realm domain endpoint.
* Remove unnecessary json_validator for string parameters.
* Update frontend to pass right parameters.

Fixes part of #18035.
2021-05-07 14:06:54 -07:00
Gaurav Pandey d6cf1ef27b api: Fix encoding of strings in hotspot endpoint.
* Remove unnecessary json_validator for string parameter.
* Update frontend to pass right parameters.

Fixes part of #18035.
2021-05-07 11:45:25 -07:00
Vishnu KS 752fd2e2d1 corporate: Fix string encoding in billing and sponsorship endpoints. 2021-05-07 09:37:40 -07:00
Ryan Rehman e48c24872f message send: Do not retry failed message if already in progress.
The `.refresh-failed-message button` was registering clicks even
while the button was spinning (has already been clicked once).
Thus a network request was sent for every subsequent click which
raises an exception that the local id is not found in the message
store as it had already been reifyed by the first request.

Fixes #18375.
2021-05-07 08:47:11 -07:00
Riken Shah 089ca2bdcf node_tests: Add remaining tests for `panels.js`.
In this commit, we add the node tests for `panels.js`, which started
in 2f36c5aefc commit (it added tests for
the server upgrade alert).
2021-05-07 08:41:41 -07:00
Riken Shah 37b265495b alert_words: Revert back `before_punctuation` regex to stable one.
In this 009b7bca24 commit `before_punctuation`
regex was updated to use lookbehind feature of regex.

This caused a regex error in some browsers (reported in
Safari) because lookbehind feature is not yet supported
on all the browsers (https://caniuse.com/js-regexp-lookbehind).

This commit fixes that error by reverting to stable regex which
works on all the browsers.
2021-05-06 20:36:52 -07:00
Anders Kaseorg 405bc8dabf requirements: Remove Thumbor.
Thumbor and tc-aws have been dragging their feet on Python 3 support
for years, and even the alphas and unofficial forks we’ve been running
don’t seem to be maintained anymore.  Depending on these projects is
no longer viable for us.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-06 20:07:32 -07:00
Anders Kaseorg 779353b44e apps: Link to macOS Apple silicon native build.
Leave the Intel build as the prominent default, since it will run on
both platforms.  (I would have liked to detect the appropriate
platform, but Apple seems to have put significant effort into making
that impossible for anti-fingerprinting reasons, which is probably an
overall good.)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-06 17:52:00 -07:00
Anders Kaseorg fa8532d9b7 apps: Move id="download-android-apk" from span to a.
Due to spaghetti CSS that should be fixed but isn’t fixed here, the
<span> wrapper is still needed so the hover effect is applied.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-06 17:52:00 -07:00
Riken Shah 2f36c5aefc navbar_alerts: Add button to hide "Server Upgrade" alert for 7 days.
This button will allow users to avoid a distracting red banner across
their screen, while they wait for their sysadmin to do the upgrade
work.

Fixes: #18359
2021-05-06 15:55:40 -07:00
Anders Kaseorg fc9481a24e js: Remove some pointless IIFEs.
Some of these were there because they predate block-scoped const/let.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-06 14:38:57 -07:00
Aman Agrawal 707d23d1e8 recent_topics: Don't rerender when topic_data is unchanged.
Since we don't process private messages yet, we don't
need to re-render when we receive a new private message
as it doesn't change any data related to recent_topics.
2021-05-06 12:06:22 -07:00
Adam Birds a3ba8b9efd integrations: Add Freshping webhook integration.
I have added a webhook integration for Freshping.
2021-05-06 11:18:35 -07:00
Alya Abbott 279f7b1c8d user docs: Create separate "Code blocks" user documentation page.
* Move the extended documentation of code blocks to a separate page.
* Merge "code playgrounds" documentation to be a section of that page.
* Document copy widget on code blocks.
* This commit changes how we refer to "```python" type syntax for code
  blocks. Instead of being called a syntax highlighting label, this is
  now referred to as a "language tag", since it serves both syntax
  highlighting and playgrounds.
* Remap all the links.
* Advertise this new page in various places that previously did not have a link.
2021-05-05 16:11:21 -07:00
Tim Abbott c60609efeb css: Fix hover effect for status list messages in night theme.
Fixes #17944.
2021-05-05 15:37:30 -07:00
Tim Abbott 318dd8b408 css: Remove grey styling for day theme compose buttons.
This day theme styling was added in
74dbcdf2a8, and some users interpreted
this buttons styling as suggesting that these buttons were disabled.
2021-05-05 11:51:56 -07:00
Abhijeet Prasad Bodas 65249d90e9 compose_typeahead: Exclude muted users from results.
Hides muted users from PM recipients and compose box
mention typeaheads.
2021-05-05 09:42:30 -07:00
Abhijeet Prasad Bodas 04c355c248 typing notifications: Exclude muted typists. 2021-05-05 09:35:27 -07:00
Abhijeet Prasad Bodas 47764ded76 user muting: Add helpers to filter out muted users.
This will allow us to avoid duplication of array filtering
logic of the form-
`Array.filter((user_id) => !muting.is_user_muted(user_id))` and
`Array.filter((person) => !muting.is_user_muted(person.user_id))`
2021-05-05 09:34:39 -07:00
Abhijeet Prasad Bodas e4d5114c3c filter: Add new is_non_huddle_pm method.
We want to exclude 1:1 PMs from muted users everywhere
except in `pm-with/<muted_user>`.
This method will help us determine whether we are in such
a narrow.
2021-05-05 09:29:51 -07:00
Abhijeet Prasad Bodas 9f6ad779e4 message view: Allow revealing hidden message from muted sender.
* We show a "Click here to reveal." hyperlink in the hidden
message dialog for user to click on and read a hidden message.

* The "reveal" action is temporary, in the sense that a revealed
message will again be hidden once the broswer tab reloads or
if the user renarrows.

* When a message is revealed, we make sure to show the sender
of that message, even if it isn't the first message of it's group.
This is because the first message of that message group (which
would have otherwise shown the sender) can still be hidden.

* Reactions and background color after revealing a message are
the same as if the message hadn'e been hidden at all in the
first place.
2021-05-05 09:15:45 -07:00
Abhijeet Prasad Bodas 5d796987f2 message view: Hide messages sent by muted users.
* We hide the sender and reactions on messages sent by muted
users, and replace the content with a "This message was hidden"
dialog.

* Ideally, we should collapse a series of consequetive
messages sent by muted users into one such dialog, but
that could break the cursor behaviour and `near/<message_id`
links, so we as of now show one dialog per muted message.

* Because we hide the sender, there is a chance of the first
hidden message in a group looking like it was sent by the
author of the message above it. To tackle this, we intentionally
make the hidden message dialog float-left, so that it is clear
that this is a special type of message.

* For context, we still show the timestamp of the message.

* Starring, editing, deleting etc a message still work just like
before.

A further commit will add the ability to reveal a
hidden message.
2021-05-05 09:15:45 -07:00
sahil839 357e3c7135 settings_users: Fix the sorting of owner and admin in users list.
We were not considering the owner role in `sort_role` function
which was leading to improper sorting when sorting the users
list according to role. This commit fixes this bug by considering
role in `sort_role` function.
2021-05-05 09:02:59 -07:00
Tim Abbott 638ffb36a4 refactor: Move click handlers to compose_closed_ui.js. 2021-05-04 20:55:58 -07:00
Aman Agrawal 0db7fe389e message_viewport: Extract function to check if it is visible.
We also add a check to see if `message_feed_container` is visible,
since it is possible that recent topics could be visible which
was not a possibility when this logic was written.
2021-05-04 16:40:43 -07:00
Sumanth V Rao db2ad6bada puppeteer: Add settings test for realm-playgrounds. 2021-05-04 12:19:04 -07:00
Sumanth V Rao a40fe26586 help: Document playgrounds on /help, /features and /for/open-source.
Linked the Help Center document in places like
    - zulip.yaml (/events, /register/, realm/playgrounds,
                  /realm/playgrounds/{playground_id})
    - /help/format-your-message-using-markdown (Linked to make
      users reading the markdown code block style, aware of this
      feature)
    - /templates/settings/playground_settings_admin.hbs (Linked
      as a reference to read more about playgrounds before
      configuring one)

Also showcase the feature on /features and /for/open-source.
2021-05-04 12:19:01 -07:00
Sumanth V Rao 215320bc72 settings_playground: Add typeaheads for `pygments_name` field.
The typeahead suggests a human-readable `pretty_name` for the
`language` field in the add-playgrounds form.

The suggestions are sorted based on the popularity of these
languages.

E.g: A `py` prefix would match with `Python` first before
matching with others like `Python 2.x` based on priority.
2021-05-04 11:39:33 -07:00