Commit Graph

13417 Commits

Author SHA1 Message Date
Aman Agrawal 98fa5c9ae2 flatpickr: Move `show_flatpickr` function in a new module.
This would avoid cyclic imports to access `show_flatpickr`
function.
2022-01-28 11:43:07 -08:00
Sahil Batra 78a81ab21a stream-settings: Add code to live update right panel title on changing privacy. 2022-01-28 11:39:15 -08:00
Sahil Batra 2280777168 stream-settings: Add code to live update right panel title on stream rename. 2022-01-28 11:39:15 -08:00
Sahil Batra 74294ae602 stream_settings: Extract function to set title in right column.
This is a prep commit such that we can use this function to
live-update the title.
2022-01-28 11:39:15 -08:00
Sahil Batra 12efde8a51 stream-settings: Refactor code to pass sub object to title template.
This commit refactors the code to directly pass sub object to
selected_stream_title template instead of passing name, is_web_public
and invite_only as different parameters.
2022-01-28 11:39:15 -08:00
Aman Agrawal 5688d8b0df scroll_bar: Remove unnessary adjustment of keyboard icon.
Since the keyboard icon is not associated with scrollbar, we
can just have a fixed margin-right for it.
2022-01-28 09:50:27 -08:00
Aman Agrawal b0dd063bb8 scroll_bar: Simplify module.
The content which is scrollable is moved left by the width of the
scrollbar when scrollbar is visible. The navbar, floating recipient bar
and composebox doesn't move. We reduce their width by scrollbar width
to adjust for the reduced width of the scrollable content.

Since floating recipient bar is center aligned (with margin: 0 auto)
we also have to move left by half the scrollbar width.

Group css classes having the same value being assigned together. This
makes the code easier to understand.
2022-01-28 09:50:27 -08:00
N-Shar-ma 4219f9bdf8 compose: Align blue selection properly in Drafts.
Added a negative `outline-offset` of the same width as the grey border
for the blue selection outline around the `draft-info-box`.

This removes the gap between the blue box in the active state, while
the unselected `draft-info-box`es look the same as before, with a grey
border.

Fixes: #20950.
2022-01-28 09:15:28 -08:00
Aman Agrawal 38e044173d login_to_access: Remove icons for login buttons.
They don't serve the purpose of adding clarity to button.
2022-01-28 08:30:56 -08:00
Steve Howell 576b966edc search suggestions: Add comment about server history. 2022-01-27 10:19:07 -08:00
Steve Howell eb2bf77212 search suggestions: Find older topics.
We no longer limit our list of candidate topics
to 300.

We continue to limit the topic results to 10, since
we don't want to overwhelm users or crowd out
non-topic-related suggestions.

We try to handle this is an efficient manner.
2022-01-27 10:19:07 -08:00
Sahil Batra 7265a76fc6 stream-settings: Show icon according to in the right column title.
We were showing # for all types of streams in the title at the top
in the right column of stream settings overlay. This commit fixes
it to show globe icon for web-public streams and lock icon for
private streams.
2022-01-26 12:50:05 -08:00
Sahil Batra e26de17ee1 stream-settings: Add space between # and stream name in title.
This commit adds space between # and the stream name appearing
at the top in right column in stream settings overlay.
2022-01-26 12:50:05 -08:00
Ashwat Kumar Singh 563b06ee08
stream_settings: Make disabled tab look disabled in dark mode.
Make disabled tabs look disabled in dark mode by adding color
to ".ind-tab.disabled" in "dark_theme.css".

Fixes #20917.
2022-01-26 04:11:47 -08:00
N-Shar-ma 048c9b99e3 compose: Add format hinting for polls.
Added a placeholder key to the polls slash command object. This is
selected and highlighted after being typed ahead in the compose box.
For slash commands without placeholder, everything works as before.

Formatting hints can easily be added for other slash commands too,
by adding a placeholder key to their object.

Fixes part of #20868
2022-01-25 18:12:42 -08:00
Aman Agrawal ec86290e2a tippy: Fix persistent message action tooltips on icons after blur.
When users tabs through the message action icons, they used to
persist even when the focus is not on them. We manually
destroy them on blur event since tippy has some issue with
handling elements with opacity hiding effect.
2022-01-25 11:15:30 -08:00
N-Shar-ma a003fe0246 compose: Fix bug where stream color didn't update on mouse selection.
Called the `decorate` function to update stream color in the compose
box on `change` instead of `blur`.

On clicking on a stream option, the input box for the stream name
remained in focus, hence decorate wasn't triggered on blur. Using
the change event instead, ensures that decorate will be called
anytime the stream is changed.

Fixes: #20871
2022-01-24 17:14:47 -08:00
Anders Kaseorg 44f9aaec32 eslint: Fix unicorn/prefer-dom-node-dataset.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 15:55:38 -08:00
Anders Kaseorg 392676d4da js: Avoid _.get.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 15:54:21 -08:00
Anders Kaseorg cc40352541 js: Avoid _.first, _.last, _.initial, _.tail.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2022-01-24 15:54:21 -08:00
Anders Kaseorg 42931e69e6 js: Convert _.isFunction to typeof.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 15:54:21 -08:00
Anders Kaseorg 57cc5cb25a js: Convert _.without to filter or other logic.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2022-01-24 15:54:21 -08:00
Anders Kaseorg e2290ef0de js: Convert _.uniq(a) to Array.from(new Set(a)).
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2022-01-24 15:54:21 -08:00
N-Shar-ma 6d2de28bf0 todo_widget: Fix bug where new todos sometimes replaced old todos.
Initialised `this.me` for the TaskData using a constructor to the
current user id.

The bug was caused due to `this.me` never being initialised, and hence
`idx` wasn't incremented on page reload, which resulted in duplicate
`data-key` attributes and hence new todos overwriting older todos with
the same `data-key`

Fixes: #20698
2022-01-24 11:25:32 -08:00
Lauryn Menard e479acc809 api_docs: Add line break before return value description text.
Adds a line break before the descriptive text for return
values and events in the api documentation in order to
help with readability of descriptions with multiple
paragraphs of descriptive text.

Adjustments made to the CSS of list items in unordered
lists to visually group the first paragraph of text
to any following paragraphs or unordered lists.
2022-01-24 10:02:02 -08:00
Anders Kaseorg c6b372b471 js: Simplify indexing arrays from the end with Array#at.
https://github.com/tc39/proposal-relative-indexing-method

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 09:58:54 -08:00
Anders Kaseorg 0b03628324 js: Shorten Object.prototype.hasOwnProperty.call to Object.hasOwn.
https://github.com/tc39/proposal-accessible-object-hasownproperty

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-24 09:57:09 -08:00
Sahil Batra fd1d4e101b overlay: Fix bug of information overlay not closing when text is selected.
There was a bug where information overlay was not closing on clicking
"x" when some text was selected. This was due to document.getSelection().type
returning "Range" and we do not close the modal in that case as per the code
added in 081d74141b.

As the "x" icon was button, the document.getSelection().type was
still returning "Range" for the text selected, but when the "x"
icon is inside a span, as in settings overlay, clicking on "x"
deselects the already selected text and selection type is not
"Range" and thus modal is closed.

This commit also improves the vertical alignment of "x".

Fixes #20645.
2022-01-21 17:39:01 -08:00
Aman Agrawal c4efc97d5a compose: Extend empty compose navigation logic to recipient boxes.
Navigation key presses like `Up` and `PageUp` with an empty recipient
boxes will now close the compose and propagate the keypress to the message
list or recent topics, depending upon the active view.

This extends behavior we've had for a long time with focus in the
compose box itself.
2022-01-21 16:40:13 -08:00
Ganesh Pawar 49e9cf10de user_status: Migrate modal to dialog_widget. 2022-01-21 16:17:25 -08:00
Ganesh Pawar f43d3b9986 change_email: Migrate modal to dialog_widget. 2022-01-21 16:12:34 -08:00
Ganesh Pawar 84ed22d59a api_key_modal: Place the error element at the top of the modal.
This is consistent with other modal behaviour.
2022-01-21 16:12:34 -08:00
Ganesh Pawar 79bdd8bdb6 api_key_modal: Update the modal config for `on_show`.
This is needed since 291aaf373f changed
the interface for modal event handlers.
2022-01-21 16:12:34 -08:00
Tim Abbott a020d7a80d user_profile: Fix unsubscribing other users from streams.
This fixes a bug introduced with the Micromodal migration in
7a505e3857, where the data-user-id
declaration for this modal was lost.
2022-01-21 15:45:11 -08:00
Alya Abbott 1bd83c33ab policies: Rename "Terms of Use" to "Terms of Service" in DPA. 2022-01-20 13:15:00 -08:00
Eeshan Garg f2e7b92b02 team_page: Display count of contributors with >=100 commits. 2022-01-19 17:37:09 -08:00
Eeshan Garg 1e8a7bc977 team_page: Exclude dependabot from contributors.
Dependabot has a history of merging some PRs and that makes GitHub
think that it is a contributor.
2022-01-19 17:37:09 -08:00
Eeshan Garg 94c89c80d1 team page: Display contributor count per repo.
Fixes #20725.
2022-01-19 17:37:09 -08:00
Eeshan Garg 3b9455c9ce billing: Make all buttons the same size.
Previously, the "Add Card" button was significantly larger than
the "Buy Standard" and "Submit" buttons.
2022-01-19 16:11:31 -08:00
Anders Kaseorg 3eb2791c3e CVE-2021-3853: Fix HTML escaping in recipient_row.
Commit 44f935695d (#20462) incorrectly
added these extra braces while intending to add whitespace control.
This triple-brace syntax was asking Handlebars to skip escaping the
string.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-18 21:28:21 -08:00
Aman Agrawal d4c70319eb topic_list: Fix search box not focused in expanded state.
We only check `topic_search_focused_before_build` if the
search box is visible.
2022-01-18 16:53:25 -08:00
Sahil Batra bb6dbb6383 todo_widget: Tag "Task list" heading for translation. 2022-01-18 14:15:34 -08:00
Priyank Patel 039910a159 ts: Convert lazy_set module to typescript. 2022-01-18 13:24:02 -08:00
Priyank Patel d0c339e772 lazy_set: Return set from the _make_set method.
This is done to avoid adding typescript type error checks when this
is converted to typescript.
2022-01-18 13:24:02 -08:00
Priyank Patel 84958bf7eb lazy_set: Move the size getter above other methods.
This is to avoid @typescript-eslint/member-ordering error when this
module is converted to typescript.
2022-01-18 13:24:02 -08:00
Priyank Patel 16a3d444fd lazy_set: Move set and array properties to the data field.
The data field will be a union type when it is converted to typescript.
This approach allows us to avoid introducing additional type check for
both of the properties.
2022-01-18 13:24:02 -08:00
N-Shar-ma be486b6138 i18n: Fix 'add choice' / 'add task' button size.
Removed the CSS rule setting the button's width to 100px.  This lets
the button take as much space as the appropriate translation needs,
without displaying an odd two-line button.

Fixes: #20077
2022-01-18 12:46:45 -08:00
My-Name-Is-Nabil 20d0fc9733 compose: Prevent upload files tooltip from hiding behind left sidebar.
Resolves the issue by appending tooltip to document body.

Fixes: #20639.
2022-01-11 16:30:55 -08:00
Sahil Batra df58a0740a settings: Show user name in heading of deactivation modal.
We show user name in heading of the deactivation confirmation
modal instead of email, since there can be a case when admin
does not have access to real email and we already show email,
if accessible, in the content of the modal.
2022-01-11 15:42:51 -08:00
Ganesh Pawar c1f639d115 org edit_bot_modal: Fix dropdown styling issue.
This makes use of the existing CSS present for the personal
edit_bot_modal.
2022-01-11 09:15:06 -08:00
Ganesh Pawar 21fa68ae7e org edit_bot_modal: Fix styling issues. 2022-01-11 09:15:06 -08:00
Eeshan Garg c30458e174 streams: Add notifications for posting policy changes.
An explanatory note on the changes in zulip.yaml and
curl_param_value_generators is warranted here. In our automated
tests for our curl examples, the test for the API endpoint that
changes the posting permissions of a stream comes before our
existing curl test for adding message reactions.

Since there is an extra notification message due to the change in
posting permissions, the message IDs used in tests that come after
need to be incremented by 1.

This is a part of #20289.
2022-01-10 18:29:04 -08:00
Aman Agrawal c23f5a114e topic_list: Don't restore focus to search if it wasn't focused.
After topic list is updated, only restore focus to it, if it was
focused before. This avoids jumping focus from say compose box
to topic search unexpectedly when the topic list is updated.
2022-01-07 14:39:16 -08:00
Anders Kaseorg 03f073d762 compose: Fix Enter to send switch internationalization.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-07 14:38:10 -08:00
Priyam Seth 9aa5082d63 message edit: Move with_first_message_id to message edit.js.
Prep commit so that the function first_message_id can be used
as an exported function for marking resolved topic as unresolved.

Related to #20584.
2022-01-05 17:55:00 -08:00
Aman Agrawal b3886af651 click_handler: Use a variable for target's jquery instance. 2022-01-05 16:15:40 -08:00
Aman Agrawal bf7224d04d reminder: Simplify logic and improve error text. 2022-01-05 16:15:40 -08:00
Aman Agrawal fa4311e7d0 popovers: Don't trigger remind handler on every flatpickr confirm.
This is part of remind popover and hence should be handled
separately.
2022-01-05 16:15:40 -08:00
Aman Agrawal 4d7cbc0a63 compose: Move emoji button outside of popover.
Since we more space after moving Help button below, we stop hiding
emoji icon in a popover on small screens.
2022-01-05 16:03:53 -08:00
Aman Agrawal e4b8b9a24e compose: Move `Help` icon beside `Enter send` button. 2022-01-05 16:03:53 -08:00
Aman Agrawal db09639f6c compose: Change UI which toggles `enter_sends` setting.
Use a popover which displays both the options instead of long text.
We only use a small text indicating the current state which user
can click on to trigger the popover.
2022-01-05 16:03:53 -08:00
Rishabh Maheshwari 937d49e209
popover: Fix alignment of edit and delete button.
The icons were misaligned with the time stamp.  

I changed the CSS `right` property to get proper alignment.

Fixes: #20529.
2022-01-05 15:24:00 -08:00
Eeshan Garg 7196b5ac84 header: Fix unresponsive dropdown pill on /help pages.
My PR #18974 introduced a bug where the logged-in dropdown pill on
the /help pages stopped working and has been unresponsive ever
since. This was caused by the incorrect assumption that each
`.dropdown` would be inside an unordered list `ul`. However, that
isn't the case for the dropdown pill on the /help pages. This commit
simply removes said assumption, by widening the scope of the relevant
CSS selectors.
2022-01-05 15:18:24 -08:00
Sahil Batra 98ec1acb35 settings: Make banner asking to confirm new email sticky.
We make the banner, mentioning the user to confirm new email
after changing the email through settings, sticky and it
disappears either on reload or after confirming the new email.

Fixes #20686.
2022-01-05 14:42:23 -08:00
YashRE42 e17c96d86d composebox_typeahead: Fix bug in global time backspace & delete cases.
In the previous commit (bea41e975d) we
introduced a bug by using `hotkey` instead of `hotkey.name`, further
debugging revealed that the conditional was unnecessary and as such
has been removed in this commit, the comment for the is_numeric
conditional has also been changed to explain its actual purpose.

Some other inline comments have also been moved to be on their own
lines.
2022-01-04 18:10:21 -08:00
YashRE42 bea41e975d compose: Fix numeric typing regression related to global time widget.
In commit 1d54b383bd we introduced some
changes to add better support for keyboard navigation with the global
time widget. Unfortunately, as a result of the fact that
get_keydown_hotkey returns undefined for numeric keys, we caused a
regression that prevented users from typing into the time picker.
Additionally, we also lost support for the backspace and delete keys.

Hence, this commit fixes the above bug by early returning in two
places if the key pressed is backspace, or delete or a numeric key.
2022-01-04 17:06:47 -08:00
Sahil Batra b642615e73 settings: Rephrase text in user deactivation modal. 2022-01-04 14:42:19 -08:00
Sahil Batra 2eb1f0195d settings: Show only real email in user deactivation modal.
We show email of the user being deactivated only if real email is
accessible and not the fake email generated using user id.
2022-01-04 14:42:19 -08:00
YashRE42 d82653c3de condense: Do not cache message_content height of 0 from recent_topics.
Previously, we suffered a bug where we would not properly condense
messages on first load of CZO (ie after login).

This bug was an unintended consequence of setting recent topics as the
default view, because since the page loads to recent_topics the
message_list is hidden but still gets rendered into the DOM and when
condense_and_collapse runs, it causes get_message_height to cache a
message height of 0, which results in the message not being collapsed.
There may be other ways to trigger the same broken mechanism.

This commit changes the function so we only return 0 but don't cache
the result.

Fixes: #20666.
2022-01-02 12:12:36 -08:00
Steve Howell c6d9029dfc dom: Remove outer subscriptions div. 2021-12-30 11:36:52 -08:00
Steve Howell 7ff89e4cae dom: Rename div to #manage_streams_container.
The old name was confusing, since the contents
of the div aren't just a table, and we have
smaller elements that actually do list a bunch
of subscriptions in tabular format.
2021-12-30 11:36:52 -08:00
Steve Howell 507da749b7 stream edit: Tighten up selectors for handlers.
Even though we intend to shortly share lots of code
for editing stream subscribers with the create-stream
UI, we don't want to confuse click handlers and
containers too much.
2021-12-30 11:36:52 -08:00
Steve Howell 36378477ff stream edit: Extract make_list_widget. 2021-12-30 11:36:52 -08:00
Steve Howell f55d9c2f35 stream edit: Simplify how we find the search input. 2021-12-30 11:36:52 -08:00
Steve Howell 5e86c72f8e stream edit: Extract set_up_pill_typeahead. 2021-12-30 11:36:52 -08:00
Steve Howell 5a89672ac5 refactor: Extract update_subscribers_list_widget. 2021-12-30 11:36:52 -08:00
Steve Howell fb003d757b performance: Use a single ListWidget for subscribers.
It's kind of silly to cache ListWidgets for subscriber
lists when we only ever update the most recent one.

This will save memory if you are managing a whole bunch
of streams, although I suspect the savings here is
mostly negligible unless you were doing something
crazy.

The main motivation here is just that it simplifies the
code.
2021-12-30 11:36:52 -08:00
Steve Howell afd1d12405 refactor: Remove is_sub_settings_active. 2021-12-30 11:36:52 -08:00
Steve Howell 2a19468432 subscribers: Use current_stream_id to track current stream. 2021-12-30 11:36:52 -08:00
Steve Howell 1c54d44f97 hash_util: Add is_editing_stream helper.
This is a bit more robust than active_stream().

We don't do the typeof check for parseFloat,
since even NaN is a number type.
2021-12-30 11:36:52 -08:00
Steve Howell 208cec2848 refactor: Move update_subscribers_list.
We should be able to solve the import back
to stream_edit in an upcoming commit.
2021-12-30 11:36:52 -08:00
Steve Howell 49a1d5a9a3 refactor: Reduce scope of message var. 2021-12-30 11:36:52 -08:00
Steve Howell d7f90acbf6 refactor: Extract remove_subscriber. 2021-12-30 11:36:52 -08:00
Steve Howell e742ebb8e8 refactor: Limit scope of e.target.
Now our click handlers get stream_id directly from
e.target, and then downstream code is no longer
coupled to the event semantics.

Note that we'll probably just know the stream_id
more directly after future commits.

We also remove a little bit of redundant error
handling.
2021-12-30 11:36:52 -08:00
Steve Howell 0777cd73bb stream edit: Extract stream_subscribers_ui.js.
This is a fairly straightforward extraction.

It's good to test this with Iago, and then go into
Manage Streams and add/remove subscribers for a stream
like devel.

I copy/pasted two small functions that will soon
diverge from stream_edit. The get_stream_id function
will either use a module variable (since we're
generally only editing subscribers for one stream, and
we already have the singleton assumption with
`input_pill`) or a more strict CSS selector.  And then
get_sub_for_target depends on get_stream_id. We may not
always need full subs, anyway, and when we adapt some
of this code for creating streams, things are likely to
change.

I stopped exporting a couple functions that have no
callers outside of this module.

The main entry point for the module is
enable_subscriber_management.

We continue to export invite_user_to_stream and
remove_user_from_stream, which should possibly be just
pulled into their own module to lessen some
dependencies, but they don't have too much baggage,
since they just wrap channel calls.
2021-12-30 11:36:52 -08:00
Steve Howell d938f73d05 refactor: Move code for can't-subscribe popover. 2021-12-30 11:36:52 -08:00
Biki-das b3c2f88b7b typeahead: Remove unnecessary topic_names variable.
Also fix a comment typo in the same file.
2021-12-30 06:56:29 -08:00
Tim Abbott 877c275380 typeahead: Use early return pattern for enter logic.
This makes this code more readable.
2021-12-30 06:55:57 -08:00
Julia Bichler b673e966ca spectators: Prevent toggling TODO checkboxes.
Checkboxes now don't change if a user who is not logged in
clicks on them.

Fixes #20300.
2021-12-29 17:10:21 -08:00
Sahil Batra a59d429045 settings: Fix code for special case of theme settings subsection.
We handle "Theme settings" subsection separately in
get_subsection_property_elements as it contains unique
radio-button structure for emojiset setting.

This should have been fixed while reorganizing the section
to have color scheme and emoji related settings under same
subsection in adb612a0b4.

Fixes #20644.
2021-12-29 16:32:12 -08:00
YashRE42 5e194afda3 reactions: Destructure during make..reaction call from set..reaction.
This is a pure code refactor for readability.
2021-12-28 11:12:02 -08:00
YashRE42 6fa92cce7e reactions: Use parameter destructuring in make_clean_reactions.
This is a pure code refactor for readability.
2021-12-28 11:11:57 -08:00
YashRE42 06d8e6dfd5 reactions: Refactor add_clean_reactions to make_clear_reaction.
This is a pure code refactor for readability.

Previously, we were relying on there being a side effect to
add_clean_reaction which was necessitated by the presence of an output
parameter, `message` (or more specifically `message.clean_reaction`).
Output parameters are confusing.
Hence, this commit changes to have a make_clean_reaction function that
returns a reaction.
2021-12-28 11:11:51 -08:00
YashRE42 0b0637de78 reactions: Remove `export` from add_clean_reaction() function.
This function is not called by any external files or tests.
2021-12-28 11:11:43 -08:00
YashRE42 1dffad98fa reactions: Use parameter destructuring in insert_new_reaction.
This is a pure code refactor for readability.
2021-12-28 11:11:39 -08:00
YashRE42 0438ed5777 reactions: Use parameter destructuring in update_existing_reaction.
This is a pure code refactor for readability.
2021-12-28 11:11:37 -08:00
YashRE42 0991ed4526 reactions: Use parameter destructuring in view.remove_reaction.
This is a pure code refactor for readability.
2021-12-28 11:11:31 -08:00
BIKI DAS 42dd58cffe
docs: Fix a few typos in documentation. 2021-12-28 09:36:59 -08:00
BIKI DAS d7f5d041b9
typo: Rename default_hander to default_handler. 2021-12-28 09:19:57 -08:00
Steve Howell 7f8ea5b9f2 stream edit: Find stuff within parent_container.
This will facilitate code reuse.
2021-12-16 15:28:11 -08:00
Steve Howell 2194a51b97 refactor: Extract people.get_users_from_ids. 2021-12-16 15:28:11 -08:00
Steve Howell 6c9427340a refactor: Move user-sorting code to people.js.
We also remove the blueslip check, since it is
pretty easy to audit the callers here.
2021-12-16 15:28:11 -08:00
Steve Howell ab8b550cda stream settings: Extract enable_subscriber_management.
The name here is accounting for future plans where
we will share code for both of these use cases:

    * editing subscribers on current stream (now)
    * editing subscribers on new stream (upcoming)
2021-12-16 15:28:11 -08:00
Steve Howell 931a8f28a0 stream settings: Simpify code to find input pill.
We also future-proof against having multiple input
tags in the stream-edit container.
2021-12-16 15:28:11 -08:00
Steve Howell 585ca1bc26 stream settings: Extract stream_settings_containers.js.
This has two long-term goals:

    - avoid circular dependencies between
      stream_ui_updates and stream_edit

    - facilitate code reuse for adding subscribers
      to a new stream (i.e. using same widget for
      when you edit subscribers)
2021-12-16 15:28:11 -08:00
Tim Abbott 1dc36c3f16 policies: Fix typo in Data Processing Addendum.
The previous copy referenced "Terms of Use" rather than "Terms of
Service".
2021-12-14 23:20:19 -08:00
Tim Abbott 963ef9e843 help: Remove white border after h1 titles.
This hasn't been part of the visible design for some time; however the
relocation in 3319893545 caused these to
appear again.
2021-12-14 17:35:57 -08:00
YashRE42 bc3d03730f message_controls: Inherit visibility from `.message_failed`.
Previously, there was a bug where a failed message would only show the
`.message_failed` icons on hover, the intent was for them to always be
visible if a message failed to send.

The cause of the above bug was that in
e7b1de8ace we modified the html
structure of the icons such that each icon was inside its own div,
which possessed the `message_control_button` class, and both such divs
were inside a `.message_failed` div. The unintended consequence of this
change was that the rule `.message_controls .message_control_button`
would apply `visibility: hidden` to the icons.

Hence, this commit explicitly sets the visibility of
`.message_failed .message_control_button` to `inherit`.
2021-12-12 11:14:46 -08:00
Alya Abbott 0836b51738 policies: Update Kandra Labs policies pages. 2021-12-10 17:56:12 -08:00
Tim Abbott 3319893545 help: Apply heading CSS beyond just h1 headings.
This makes it possible to use non-H1 headings in the sidebars.
2021-12-09 17:51:52 -08:00
Archit Hadge 25ccd4a7db settings: Change "N minutes" options to Custom.
We change the various "Up to N minutes" settings option labels to
"Custom", since the N is a little too mathy for some users.

Since the new prompts for the value of N are longer, we need to move
those prompts to the next line. Mainly this means switching from
`dependent-inline-block` to `dependent-block`, but we also need to
move the block out of the containing input-group for the CSS to be
happy.

Substantially rewritten by tabbott to use CSS for positioning and
change the message deleting copy of this issue.

Fixes #20177.
2021-12-09 11:52:27 -08:00
Swati Bhageria 2d766f3e78 message list: Display MOVED for messages with only topic edits.
This avoids the somewhat confusing visuals of showing messages as
EDITED where the content had not been changed, which also obscured
situations where a message had both been edited and moved.

It's possible we could do better with some sort of fancier block-move
visual styling, but it's a bit tricky to do well given that we support
moving multiple messages at once.

Fixes #20451.
2021-12-09 10:50:01 -08:00
Kevin 1d54b383bd compose: Fix keyboard UI with new global time widget.
Fixes #20130
2021-12-09 09:00:33 -08:00
Alya Abbott e70ec964dc portico: Add use case buttons to /why-zulip and /hello. 2021-12-09 08:58:45 -08:00
Aman Agrawal c35ab98d03 hello: Move call to action button style to a specific class. 2021-12-09 08:58:45 -08:00
Tim Abbott 36f03ccd5c message_events: Fix edit history live update when moving topics.
As noted in the TODO that we delete with this commit, we never
implemented live-updated for edit history when moving a message to
another topic.

Implementing this involves somewhat ugly copy-paste of the logic for a
content edit, but structurally is pretty simple.

It also makes #20451 much more visible.
2021-12-08 21:35:44 -08:00
Nikhil Maske 091772b534 hotspots: Remove intro_reply hotspot.
Zulip shows two guides on How to reply, first one by
the welcome bot and second one is intro_reply hotspot.
To simply and avoid redundancy, intro_reply hotspot is
removed.

Fixes #20482.
2021-12-07 21:55:59 -08:00
Sahil Batra 116a0f6f9d stream_settings: Sort subscriber list by name always.
This commit changes the behavior of subscriber list to
always be sorted by name instead of sorting them by email
when emails are accessible.

This change is fine because we will be using user-level
email address visibility and in that case the email of
some users will be visible and email of some will be not.
2021-12-07 21:44:40 -08:00
Sahil Batra 1ce869f16c settings_users: Fix comment in bot_info function. 2021-12-07 21:42:24 -08:00
Sahil Batra a1a5a1643f settings: Remove unused show_email parameter.
We show "Email" column heading always in users list and
subscriber list irrespective of the email-address visibility
setting after 46660e5, so we do need to pass show_email
parameter to render_admin_tab and render_stream_settings.
2021-12-07 21:42:23 -08:00
Tim Abbott 48dccfd37a css: Fix night theme radio inputs.
Radio inputs that are not selected are technically independent
:read-only inputs, not a single input with multiple values; this
results in this selector for read-only inputs not behaving as
expected.

Fixes #20221.
2021-12-07 14:32:37 -08:00
S-Abhishek 186d1a83e9 narrow_banner: Move empty narrow messages to handlebar templates.
Removed existing empty narrow divs from app/home.html and created
a new javascript module to dynamically load empty narrow messages
using handlebar template.

Fixes #18797
2021-12-07 13:38:48 -08:00
Lauryn Menard 58438c362f documentation: Fix text wrapping and alignment of ordered lists.
Moves CSS rules that rely on list items in an ordered list being
wrapped in a `<p>` tag so that they apply to the list item itself.
Uses `position: absolute` to set the `::before` pseudo-element in
place and `position: relative` to adjust the list items so that they
do not overlap.

Ideally, when Safari supports the `content` property for `::marker`
pseudo-elements, this issue can be revisited.

Fixes #20440.
2021-12-07 11:53:14 -08:00
Sahil Batra 9bb506c6f7 streams: Fix live-update bug of disabling web-public option instead of hiding.
The web-public option was disabled instead of being hidden in stream creation
form during live update triggerred from setting enable_spectator_access to
False. It was not being hidden since we have made web-public as the first
option and it is selected by default.

This commit fixes the bug to hide the option and also makes the code more
readable.
2021-12-07 11:44:45 -08:00
Sahil Batra 265a587470 streams: Consider only visible choices while selecting default choice.
We should only consider visible choices while selecting the default
stream-privacy choice in stream creation form. Previously, we were
only checking whether the option is disabled, but this resulted in
a case where no option was selected when the realm-level setting
was set to not allow web-public streams as the choice was only
hidden and not disabled.
2021-12-07 11:44:45 -08:00
Sahil Batra 1049867485 streams: Reorder stream-privacy choices in UI.
This commit moves 'Web public' option to top in
the stream privacy choices in stream creation
form and changing privacy modal.
2021-12-07 11:44:45 -08:00
Steve Howell 1509e7f355 templates: Always indent "each" blocks. 2021-12-06 14:58:29 -08:00
Tim Abbott fdfaa321b3 css: Fix Saving/saved buttons in stream settings.
This is likely not the correct long-term fix, but it's an effective
tactical fix for this button.  Added a TODO noting the expected
direction for a long term solution.

Fixes #20481.
2021-12-06 14:40:21 -08:00
Aman Agrawal 7dea22c532 dark_theme: Keep modal related css together. 2021-12-06 10:37:21 -08:00
Aman Agrawal 8123ebbfc0 modal: Fix button colors in dark theme.
Use the dark purple color we use for `send` buttom on the
`confirm` button.

Fix color of `cancel` and `disabled` buttons in dark mode.
2021-12-06 10:37:21 -08:00
Aman Agrawal a23cc709e8 resize: Hide popover on width change on mobile devices.
It is possible for user to change the width by using
screen rotation after the page has been loaded on mobile.

If only height has changed, it is most likely due to a
virtual keyboard, we don't hide popover in that case.

Fixes #20439
2021-12-06 10:36:20 -08:00
Steve Howell f5bb43aba2 bug fix: Restore placeholder text for adding members.
In 4792af5682 I reformatted the template in such a way
that the div was no longer empty, and therefore
the :empty pseudoclass was not properly applied to
show the placeholder.
2021-12-04 15:35:24 -08:00
Steve Howell 44f935695d templates: Improve comments for recipient_row.hbs.
We also squash some whitespace in the HTML, although
it's mostly irrelevant since you can't copy/paste
the text.
2021-12-04 15:35:24 -08:00
Aman Agrawal ec48f29daf compose: Check if compose control btn popover has the clicked element.
This is necessary to avoid a poptention bug where the popover
is open but the button is clicked somewhere else.
2021-12-04 06:52:18 -08:00
Aman Agrawal d749438551 compose_ui: Use white spinner on both dark and light theme.
Fixed alignment slightly.
2021-12-04 06:52:18 -08:00
Yash Rathore 345616ad02
user_sidebar: Set personal presence dot based on the user's settings. (#20376)
If a user chooses to not broadcast their presence status to others, we
still show the user as available in their own user sidebar. Instead, one's
own availability should appear the same as it does for other users.

With tweaks from YashRE42: rebasing to use user_settings instead of
page_params, as introduced in the series of commits ending with
8755a76cf6, adding code comments and
moving the redraw call to `server_events_dispatch.js`.

Fixes part of #18846.  Further work is required to display the user's own idle
status properly to complete #18846.

Co-authored-by: YashRE42 <33805964+YashRE42@users.noreply.github.com>

Co-authored-by: Ganeshprasad Biradar <biradarganesh25@gmail.com>
2021-12-03 16:20:20 -08:00
Sahil Batra c648982996 settings: Fix behavior of realm-level notification batching settings UI.
Changing realm-level notification batching period setting from UI
was broken after adding the "Custom" option in 4f63378e7f because it
handled only user-level setting code and not realm-level setting.
This commit fixes it.
2021-12-03 16:03:02 -08:00
Sahil Batra 08038ef140 settings: Refactor set_notification_batching_ui function.
This commit refactors the set_notification_batching_ui to
use settings_org.change_element_block_display_property function
for toggling the visibility of custom input.

We add id to the email_notification_batching_period_edit_minutes
element such that we can use change_element_block_display_property
function because it requires id of element as an argument.

This commit also removes the value attribute of the custom
input since its value was set undefined in the template
and then was set in set_notification_batching_ui, so there
is no use of keeping the value attribute in templates.

This is a prep commit for fixing the behavior of this element
in realm-level default settings.
2021-12-03 16:03:02 -08:00
Aman Agrawal c894f50f3c recent_topics: Extend persistent focus bug to all RT elements.
The bug fix for RT search, also needs to be applied to other
elements.

Fixes #19458.
2021-12-03 14:39:48 -08:00
Aman Agrawal 2eaf869949 move_topic_to_stream: Fix clipped stream select dropdown.
The stream select dropdown's height was clipped by the modal
container which resulted in the dropdown only being displayed
partially. We could either move the dropdown to under `body` or use
`position: fixed` for it be able to show outside parent container.
We go for the later option.
2021-12-03 14:38:27 -08:00
Anders Kaseorg 951b81e2bd eslint: Fix unicorn/prefer-code-point.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-12-03 14:33:53 -08:00
Aman Agrawal 24900ec7f8 compose: Don't fix width of send button.
Since the width of `send` text can vary based on language. We
shouldn't fix its width.
2021-12-03 14:29:26 -08:00
Aman Agrawal c7f27f6c94 compose: Fix height of GIF icon.
The GIF icon was taking more height than it was alloted to.
The height taken also varied slighly based on external factors.
This pushed other buttons out of their desired position.
2021-12-03 14:29:26 -08:00
Aman Agrawal 02053f1319 compose: Add side margin to fa-exchange icon. 2021-12-03 14:29:26 -08:00
Aman Agrawal b4c2c97ffd compose: Extract method to get compose click target. 2021-12-03 14:29:26 -08:00
Aman Agrawal 9d330365fc compose: Stop propagating clicks for compose control buttons. 2021-12-03 14:29:26 -08:00
Aman Agrawal 7af573fa45 compose: Remove unused code.
Since we don't use video button in compose control buttons
popover, this will never be reached. We can add this code again
when we add video button to the popvoer.
2021-12-03 14:29:26 -08:00
My-Name-Is-Nabil edccb79010 settings: Apply dark theme to upgrade tips.
Fixes #20431 by changing dark theme colors of upgrade tips to match
colors of other dark theme tips (with the same structure as the
existing .tip class).
2021-12-03 14:22:18 -08:00
Aman Agrawal 788bf8b32e compose: Fix overflowing `.enter_sends` text on `<375px` screens. 2021-12-02 15:11:15 -08:00
Aman Agrawal baa1b4ed1d compose: Fix angle-up icon overlapping with topic input field.
The previous calculations were based on just the cross icon.
Adjusted for the angle-up icon which is 16px in width.
2021-12-02 15:11:15 -08:00
Aman Agrawal 50f916443d compose: Fix alignment of help link. 2021-12-02 15:11:15 -08:00
Aman Agrawal a84869c078 compose: Use a ligther red for character limit exceeded text. 2021-12-02 15:11:15 -08:00
Aman Agrawal ffd9d18577 compose: Enclose hotkeys in `kbd` tag.
We change how `kdb` is displayed in dark-theme for
compose so that they don't take too much user attention
when composing.
2021-12-02 15:11:15 -08:00
Aman Agrawal 7610b33963 flatpickr: Hide bottom arrow in dark mode.
Previous change didn't hide it in dark mode since this css was
being overridden.
2021-12-02 15:11:15 -08:00
Aman Agrawal 4ed6b441c7 flatpickr: Improve look of `Confirm` button.
Change text from OK to Confirm.
Remove icon.
2021-12-02 15:11:15 -08:00
Aman Agrawal aaa7150b8a compose: Move overflowing buttons to a popover.
We don't hide popover on click for formatting buttons, emoji picker and time
picker.
Emoji and time picker popovers need a reference to be displayed,
hence we don't hide them.
Not hiding formatting buttons is based on past discussion.

The current instance of compose popover is stored locally
so that we can access it across different modules.

The basic approach for hiding / displaying a button is based on
width and is executed at `sm` breakpoint as per our
`css_variables.js`.
Used handlebars and `hide/show-sm` css class to make this
work. This avoids using too much JS to hide/display elements.
2021-12-02 15:11:15 -08:00
Aman Agrawal b5f662c646 popover_menus: Extract common onShow methods. 2021-12-02 15:11:15 -08:00
Aman Agrawal 065b905f87 compose: Slightly move send button upwards.
This may have got misaligned after my last minutes changes to
the compose refactor PR.
2021-12-02 15:11:15 -08:00
Aman Agrawal 63c3f74056 compose: Rearrange compose bottom to separate out enter sends.
* We move enter sends into its own row separate from compose
control buttons and send button. This makes sure compose control
icons don't wrap on narrow widths.

* Move char limit indicator parallel to enter sends button.

* Left align character exceeded count at bottom.
2021-12-02 15:11:15 -08:00
Aman Agrawal a64f6edc2a compose: Use loading spinner as loading indicator. 2021-12-02 15:11:15 -08:00
Aman Agrawal 25ee6a795e compose: Never hide send button.
`Press Enter to send` used to hide `Send` button, we remove that
behaviour.

We show the current state of `Enter` hotkey action via text below
`Send` button which can toggle behaviour on click.
2021-12-02 15:11:15 -08:00
somesh202 219ecea659 people: Extract helper functions for medium avatar urls.
The new is obviously parallel with the small avatar URL construction,
and allows us to deduplicate this construction between the popovers
and full user profile logic for getting a medium avatar URL.

Fixes #20140.
2021-12-02 14:56:34 -08:00
Aini-Alem Robertson e9d80390cc stats: Remove complex regex badly implementing toLocaleString.
This regular expression to add commas to a large number is hard to
read and produces less useful output than using the standard browser
API for doing this.

Fixes #20416.
2021-12-02 14:35:56 -08:00
Sahil Batra fc8db93f36 settings: Disable spectator access setting when server setting is False.
We disable the enable_spectator_access setting when the server level
setting, WEB_PUBLIC_STREAMS_ENABLED setting is set to False.

This commit adds a new argument is_disabled to settings_checkbox which
is used to disable the checkbox and set the color of label accordingly.

This commit also adds a help-link besides the label pointing to
"/help/web-public-streams" which is shown irrespective of the
setting being enabled or disabled.

Fixes #20417.
2021-12-02 14:33:51 -08:00
Sahil Batra 03a91a8b77 settings: Remove render_only parameter from enable_spectator_access checkbox.
The render_only parameter was passed to settings_checkbox partial of
realm_enable_spectator_access to hide the setting if the server-level
setting is set to False, but it was incorrect since we do not pass
page_params dict to the template and this was not working.

Initialy the render_only was set as page_params.development_environment
and then to page_params.server_web_public_streams_enabled in 260851cd0.
Both of these were incorrect since page_params is undefined in this
template.

We have now decided to disable the setting instead of hiding and this
will be done in next commit and this commit removes the render_only
parameter since it is not working anyways.
2021-12-02 14:33:51 -08:00
Sahil Batra eb50641af3 settings: Remove is_nested parameter and disableable class.
The is_nested paramter in settings_checkbox.hbs used to
set disableable class in the div element is not used
anywhere and thus we can remove both the is_nested parameter
and disableable class.

The is_nested paramater was first added in 3e0b420423 and
disableable class was added in 706f422c3.

The use of is_nested parameter was removed in a501abf3a1.
2021-12-02 14:33:51 -08:00
alguimo 8ae6e1b718 settings: Remove Unset and Disable buttons when no permissions.
This makes the UI for users browsing organization permissions a bit
less confusing; if they can't edit anything, they shouldn't have these
extra little buttons.

Fixes #20002.
2021-12-02 14:32:01 -08:00
Ganesh Pawar 19c4a63d51 move_topic_modal: Use `dialog_error` to display error.
Fixes #20210
2021-12-02 14:02:27 -08:00
Ganesh Pawar f4dac2dd77 minor: Pass the error function to channel call in with_first_message_id.
We accidentally passed `error_cb` to the `get` function when it should
have been `error`.
2021-12-02 14:02:27 -08:00
Ganesh Pawar 4ccaff6e32 modal: Hide, instead of empty, the dialog error element.
Consider a modal with an error element displayed. When a user clicks
the submit button, the current behaviour is to empty the element. This
empties the inner HTML of the error element, but the CSS makes it still
visible, just empty. This looks bad. To avoid this, we hide the element.
We use the `ui_report` module to display errors, which adds the `show`
class to the error element every time an error is to be displayed. This
makes sure that the error element isn't hidden when the user re-clicks
the submit button while the modal is still open.
2021-12-02 14:02:27 -08:00
Steve Howell 2f0f27b841 templates: Fix minor whitespace errors.
(we also add validation)
2021-12-02 09:49:10 -08:00
Aman Agrawal a91fac75ce narrow: Check if narrow is spectator compatible before activation. 2021-12-02 09:44:00 -08:00
Aman Agrawal 0254187771 hotkey: Disable message interaction for spectators with keyboard. 2021-12-02 09:44:00 -08:00
Aman Agrawal b72a9c1261 reactions: Don't create local echo for reactions at a common point.
update_ui_and_send_reaction_ajax is called from hotkeys, popovers,
reaction clicks, etc. but it is the common point to deny
spectator from creating a reaction local echo.
2021-12-02 09:44:00 -08:00
Ketan1502 0a2649d9fe left sidebar: Add titles for remaining global filters.
Fixes part of #20284.
2021-12-01 17:07:55 -08:00
Tim Abbott 9875c9be1b stream_data: Fix web_public option defintion being development only.
The availability of this option is now controlled by fancier logic in
stream_settings_ui.js, but we neglected to remove this
development_environment guard when doing so, resulting in stream
creation being broken in production environments (because the
JavaScript code depended on this value being available).
2021-12-01 14:08:16 -08:00
Arch0125 7c4382bb06 dropdown_list_widget: Replaced pencil icon with chevron-down.
This is the standard way to indicate that something is a dropdown
menu, and in particular avoids confusion some folks had with the
pencil icon.

Tweaked by tabbott to unify CSS with all of our other dropdown list
widget instances.

Fixes #19888.
2021-12-01 13:35:15 -08:00
Sahil Batra 988e9d2abc stream_create: Select the first enabled choice by default.
We select the first enabled radio button by default instead
of selecting "Public" because there can be case when a user
is allowed to create a private-stream only and the other
options are disabled in that case after some recent changes.
2021-12-01 13:01:19 -08:00
Sahil Batra 969bb2bf76 events: Live update stream-privacy choices on changing enable_spectator_access. 2021-12-01 13:01:19 -08:00
Sahil Batra a2ebb92649 settings: Add live-update code for updating stream privacy choices.
This commit adds code for live-updaing the stream-privacy choices
in stream creation form and privacy change modal on changing
"create_public_stream_policy", "create_private_stream_policy"
and "create_web_public_stream_policy".
2021-12-01 13:01:19 -08:00
Sahil Batra 17a955bf1e server_events_dispatch: Add create_web_public_stream_policy to realm_settings object. 2021-12-01 13:01:19 -08:00
Sahil Batra 0986141a5e stream_settings: Refactor code to disable private stream privacy option.
This commit renames disable_private_stream_privacy_option to
update_private_stream_privacy_option_state and also refactors
the code such that it can also be used to enable the option along
with disabling the option in further commit.
2021-12-01 13:01:19 -08:00
Sahil Batra 8778e5039b stream_settings: Refactor code to disable public stream privacy option.
This commit renames disable_public_stream_privacy_option to
update_public_stream_privacy_option_state and also refactors
the code such that it can also be used to enable the option along
with disabling the option in further commit.
2021-12-01 13:01:19 -08:00
Sahil Batra 8a3a5f9c19 stream_settings: Refactor code to hide or disable the web-public privacy option.
This commit renames hide_or_disable_web_public_stream_privacy_option to
update_web_public_stream_privacy_option_state and also refactors the code
such that it can also be used to enable or show the option along with disabling
and hiding the option in further commit.
2021-12-01 13:01:19 -08:00
Sahil Batra 15cf972a8e stream_settings: Split code for disabling the stream-privacy choices.
This commit splits the hide_or_disable_stream_privacy_options_if_required
function into three separate functions for public, private and web-public
streams. This is a prep commit for live-updating the stream-privacy choices
on changing the realm setting.
2021-12-01 13:01:19 -08:00
Sahil Batra 4eeee7296e dialog_widget: Use simplebar for the modals using dialog_widget. 2021-12-01 12:13:06 -08:00
Sahil Batra b23df8dc9b popovers: Add "Manage this user" option to user info popover.
This commit adds "Manage this user" option in the user-info popover
which simply opens the administrative user-info modal.

We show a spinner on submit button in this case as modal
is not closed immediately and thus we need some indicator
to show that the task is in progress. There is no spinner
on submit button in the modal opened from "Users" section
of organization settings.

Error handling for this case is different than when the
modal is opened from "Users" section of organization
settings because there is no overlay in the background
of modal in this case.

In this case, we show error inside the modal and do not
close it and in case the change is completed successfully
we just close the modal without showing any message.

Fixes part of #18944.
2021-12-01 12:13:06 -08:00
Sahil Batra 2836879767 settings: Extract code for opening user-info edit modal into a function. 2021-12-01 12:13:06 -08:00
Sahil Batra 2c70302e19 settings: Change heading of modal used to edit user info.
This commit changes the heading of modal used by admins to
edit user info to "Manage user".
2021-12-01 12:13:06 -08:00
Anders Kaseorg a030aa5252 drafts: Reformat with Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-12-01 12:12:29 -08:00
YashRE42 be76d7592a reload: Manually save draft and preserve id when triggering reload.
We received a complaint about the generation of multiple duplicate
drafts for a single message. It was discovered that the likely cause
of this was how we were handling clients that were frequently
suspending/unsuspending, we would initiate a reload when we discovered
this, and expect the `beforeunload` handler to save the draft. This
behaved correctly, however, we would also save the compose state and
fill it in via `preserve_state` in reload.js. The important detail
here is that `preserve_state` would not encode and preserve the
`draft_id` for the current message, partly because it had no way of
knowing the `draft_id` of the draft... since we have not saved it yet,
the `beforeunload` event happens after `preserve_state`. As such,
performing any action that would trigger a draft to be saved, eg
pressing Esc to close the compose box, would save a duplicate draft of
the same message.

To resolve the above bug, we (1) ensure that we call
`drafts.update_draft()` in `preserve_state`, this returns a draft_id
to us, which we (2) ensure that we encode as part of the url and (3)
set on the `#composebox-textarea` as a `draft-id` data attribute,
which we check the next time we try to save the draft, post reload.

Note that this causes us to save the draft twice, once from
preserve_state and then again from the `beforeunload` handler, but we
do not add two drafts since the second update_draft call just edits
the timestamp because it finds the `draft-id` data attribute on the
`#composebox-textarea` set by the first call.
2021-12-01 12:03:20 -08:00
YashRE42 3e853d6f8f drafts: Don't notify if contents of draft have not been changed.
Previously, opening a draft and closing it without changing the
content would cause us to show the "saved as draft" tooltip. This was
annoying and would cause annoying UX after fixing a bug related to
saving drafts when reloading, as such, this commit removes the above
behaviour by introducing a simple check on whether the draft contents
are edited.
2021-12-01 12:03:17 -08:00
YashRE42 c8f18f8ae7 drafts: Extract maybe_notify function in update_draft.
This is a prep commit for adding node test coverage to
drafts.update_draft().
2021-12-01 11:54:33 -08:00
YashRE42 555f80c34b compose_actions: Add comment about spread syntax overwrite behavior. 2021-12-01 11:29:37 -08:00
Ganesh Pawar f760850993 login_to_access_modal: Migrate modal to Micromodal. 2021-11-30 14:39:46 -08:00
Aman Agrawal 8a0c3aeadd landing_page: Force white background colour.
A page can have either `white` (from `landing_page.css`) or `gray`
(from `portico.css`) background color depending on
webpack chunking order.  So, this fixes that bug.
2021-11-30 13:08:17 -08:00
akshatdalton 76afb31196 filter: Show typeahead suggestions if search query has search filters.
In message header search bar, users didn't use to get any typeahead
suggestions if a normal filter follows search filter.

E.g.: query => foo bar stream:D

In the above case, users didn't use to get any typeahead suggestions.
This was because we had set that the callers of 'parse' function can
assume that the 'search' operator is present in the last in the query.
Because of which `get_search_result` function (in search_suggestion.js)
didn't use to show any typeahead suggestions as it used to assume that
the latest typed query is for search filters.

Fixes part of #19435.
2021-11-29 16:20:29 -08:00
akshatdalton 275171b592 filter: Add `maybe_add_search_terms` function to add search_term.
This function adds search_term to the operators list.
This logic is extracted as a prep commit for the
changes related to #19435.
2021-11-29 16:20:29 -08:00
Aman Agrawal 0fece515f2 hash_util: Remove dependency on narrow_state module.
We directly pass operators to remove dependency on narrow_state
module. This avoids a circular dependency of `filter` module
which is evident on the `/devtools/integrations/` page.
2021-11-29 13:30:18 -08:00
Sahil Batra c20f5a9866 dialog_widget: Add a new optional parameter validate_input.
This commit extends dialog_widget class by adding a new
optional paramter validate_input which will be a function
to validate the inputs in the dialog and will be called
before showing the spinner and calling the on_click function.

Currently, the password change modal uses this paramter to
validate that the old and new password inputs must not be
empty. Since the spinner will not be initiated in the case
where form is invalid, we need not hide the spinner after
showing the error and thus we can simplify the code to use
ui_report.error to show the error messages of empty fields.
2021-11-29 13:28:52 -08:00