Previous commits have fully implemented the logic for stream email
notifications; this final commit adds support for configuring it to
the UI.
Fixes#6511.
This migrates Zulip to use a dramatically better set of names and
aliases for our emoji set, defined in emoji_names.py (which is in turn
manually generated from our hand-curated CSV file).
This should significantly improve the experience of using Zulip's
emoji picker and emoji typeahead for finding what one is looking for.
This changes the icon indicating that you can drug the custom
profile field rows in settings to be the double rows of dots
typically used to indicate draggability. It also gives those
rows the "move" cursor on hover.
This is essential for using simplebar, since simplebar doesn't account
for parent <div> paddings, which might cause scrollbars to be mispositioned
if not considered.
When you hover above the navbar, the cursor focuses on the page
body and scrolls the entire page, breaking the positioning of the
fixed sidebar and page content.
We disable scrolling on the body but allow the sidebar and Markdown
content page elements to be scrolled to fix this bug.
Fixes#7665
In case of invitation events, 'invites_changed' event without
any real payload is sent to all the realm admins and the user.
The event is handled by reloading the list to view recent changes.
Commit tweaked by shubhamdhama:
* Send an `invite_changed` event when an user accept an invite.
Also, added the test for the same.
* No need to delete the invite list in frontend, current logic
handles the case when the invite data is changed properly.
* Extracted the common logic for sending an event into
`notify_invites_changed`.
It seems to have been there to paper over a styling problem that was
actually caused by slightly mismatched font sizes (em vs. rem).
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit adds a Markdown tree-processor extension that renders
multi-line code blocks that are nested inside lists with the
formatting. Note that the code block could be nested inside multiple
list levels and would still get rendered correctly.
Tim: This fixes the need for unpleasant workarounds like
f5bfa4e793 and makes nested code blocks
in our documentation look exactly how users would expect them to.
This was used for the very early-stage Zulip "ask for invite" form,
which was built around a stamped envelope concept. The form was
removed from Zulip a couple years ago in
bded0d9d54, but this CSS was missed in
the removal.
We can now theoretically use this for any textarea
that supports our markdown (besides the compose box),
plus we keep the RTL code a bit more self-contained.
This hides the up and down arrows that appear in the year input
of the Flatpickr-provided datepicker. (This is only used in
settings for now, but the arrows will be hidden anywhere Flatpickr
is used.)
The JavaScript click handler for this feature was fragile in a way
that would break with upcoming changes to how we display the X
element. We clean this up with a replacement implementation that
should be much less fragile.
Previously, commit e5d2e95 attempted to change the styling of the user
profile pill containers to match the inputs above it. However, it used
an incorrect selector (#settings_page), resulting in all other pill
containers on settings pages being changed to match it as well
(example: User groups pill containers in Organization
settings). Additionally, its selector's specified background attribute
resulted in problems in dark mode.
To correctly style the user profile pill containers to match the other
input's styling, we apply the uneditable-input class native to
Bootstrap so that we don't need to create an entirely new selector to
style it.
Note that the .custom_user_field .pill-container selector was added so
that it could match the padding of inputs. Also, the
.custom_user_field .pill-container:focus-within selector was added
with attributes straight from Bootstrap's input:focus selectors so
that .custom_user_field .pill-container would have a blue outline
while users were typing in the input pill, just like the other inputs.
Fixes#9842.
Enables avatar images in pills wherever user_pill.js is used.
(e.g composebox, user group settings)
Changes to search_pill.js are not made as search pills haven't been
added yet completely and search_pill.js just contains the preparatory
code right now.
No change to compose_pm_pill.js is not required as it uses
`user_pill.create_item_from_text` in its `create` function.
Adding the 20*20 image inside the pill caused a minor increase in
pill height. Making the image 19*19 causes some increase in the height
under different zoom conditions. I'm not sure about the reason behind
this, so this can be counted as a hack.
Allow passing image link in the item passed to appendValidatedData.
When passing image link via any of the append* functions, make sure
that create_item_from_text for that pill also adds the image link to
the item created.
This commit does not make any visual change to the current app.
Changes to user_pill.js are necessary to enable user avatars for
pills.
We now use narrow_state.filter() everywhere. The
two functions did the same thing, and I slightly
prefer the concise name, which was already in use
in lots of places.
This implements right-to-left message automatic detection support in
the compose box as well as the message feed. Full unit tests and
support in the message-editing UI are for future work (as are
potentially more fancy things like supporting things like
right-to-left multi-word names for users/streams/etc.).
Fixes#3123.
I also removed the comment that said "this is just a workaround".
It is not, it is technically correct for us to do apply different
CSS rules to <p> tags that aren't the first child of the <li>
element in question.
xmlns:svg is an XML namespace declaration that would be valid in XHTML
but not in HTML. Even in XHTML, it wouldn’t be necessary because we
don’t write SVG tags prefixed like <svg:circle>, only unprefixed like
<circle>.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit fixes some modules that were erroneously left out while
transitioning app.js to webpack. This commit exposes them using
expose-loader or setting them directly to window.
This commit moves all files previously under the 'app' bundle in
the Django pipeline to being compiled by webpack under the 'app'
entry point. In the process, it moves assets under the app entry
to a file called app.js that consumes all relevant css and js files.
This commit also edits the webpack config to be able to expose certain
variables for third party libraries that are currently required by
some modules. This is bad coding form and should be refactored to
requiring whatever dependencies a module may have; we're just
deferring that to the future to simplify the series of transitions we
need to do here. The variable exposure is done using expose-loader in
webpack.
The app/index.html template is edited to override the newly introduced
'commonjs' block in the base template. This is done as a temporary
measure so as not to disrupt other pages on the app during the transition.
It also fixes the value of the 'this' context that was being inferred
as window by third party libraries. This is done using imports-loader
in the webpack config. This is also messy and probably isn't how we
want things to work long term.
This commit prepares the frontend code to be consumed by webpack.
It is a hack: In theory, modules should be declaring and importing the
modules they depend on and the globals they expose directly.
However, that requires significant per-module work, which we don't
really want to block moving our toolchain to webpack on.
So we expose the modules by setting window.varName = varName; as
needed in the js files.
We remove css which has been dead since convertion of subscriptions
page to an overlay. This should ideally have been dealt with in
commit 1886f0a which actually did the converstion but we forgot to
handle it at that time.
We remove the dead CSS which was introduced in commit 963a93367
back in 2013 and doesn't seem to have any use now. Its probably
the case that we removed the actual html structure which used this
CSS since 2013 and forgot to clean up the css part.
This was killed when the "Deleted Streams" feature was dropped
in commit 7bbe44d7 but we forgot to deal with it at the time.
squash to admin_streams_list
This cleans up some leftover js and css from the effort of
redesign the rows of the #subscriptions table. Redesign happened
in commit 368b5859 and but we forgot to clean up these js and css
pieces.
squash to subs.js.
The error handling for delete/reactivate was broken.
The old code related to appending id_suffix to the ids of
the per-bot error divs did not have corresponding
selectors in the actual error handling.
Things still aren't great, but there's a bit more
encapsulation now, and you'll see errors for the
delete/reactivate cases.
The user can also edit the question after adding it.
The question in the poll can only be added/edited
by the user who started the poll.
The input bar will be disabled for the other users
if the question is not yet added. If the question is
added, the input bar will not be visible to the other
users.
Even when admin removes all custom fields from org, custom
fields header "Profile" doesn't get removed.
Render header "Profile" whenever custom fields data get changed.
This commit fixes a regression which was introduced while
we were removing icon-vector and replacing the same with
font-awesome. We forgot to update the toggle icons from the
JS file.
Fixes#9797.
Clicking on the unread count badge on the right sidebar did not
narrow the selected pm/group-pm. This commit moves the count div
inside selectable_sidebar_block. Also uses flexbox instead of
inline-blocks for user presences selectable_sidebar_block.
The reason for the bug was 71e3f778cc.
This commit makes the width 100% for selectable_sidebar_block only
on the right sidebar, the left sidebar selectable_sidebar_block
width is unset.
Fixes#9822.
fuzzysearch matched query if the query letters appeared in sequence.
Here we use the extracted phrase_match to match query with the prefixes
of words.
This disables `ctrl + shift + [`, while `ctrl + [` will still trigger
an action.
Also, add a test for ensuring that the `ctrl + shift` combinations fall
through.
This disables `cmd-or-ctrl + shift + k` and `cmd-or-ctrl + shift + s`,
while `cmd-or-ctrl + k` and `cmd-or-ctrl + s` will still trigger
actions.
Also, add tests for ensuring that the `cmd-or-ctrl + shift`
combinations fall through.
Fix#9779.
Adds search_pill.js to the static asset pipeline. The items
for search pill contain 2 keys, display_value and search_string.
Adding all the operator information i.e the operator, operand and
negated fields along with the search_string and description was tried out.
It was dropped because it didn't provide any advantage as one had to
always calculate the search_string and the description from the operator.
The slash in command is stripped in the backend,
rather than in the client to make the client code
cleaner.
This would make client code cleaner in the slash
commands which include parameters.
NOTE: To test this locally I've used Google Chrome input tool.
This change will not affect users who don't use input tools.
Here is the algorithm used to deal with this case and other important
points:
* Here I've used `compositionend` event which is triggered
as soon as an input tool completes a word or user press "enter"
to get the suggested text. (There was a situation where it is
triggered even when input tool wasn't closed, that is when we
press space, but it also triggers another `compositionstart`
event simultaneously so our logic can't be affected by this.)
* We are using a variable `is_using_input_method` which sets to
`true` when `compositionend` event is triggered.
* Basically our searching is initiated by `keyup` event which
is triggered by the same keypress which triggers `compositionend`
event to get the text, so our main goal is to suppress the searching
triggered by this key pressing.
* Observation shows that `compositionend` is triggered before the
`keyup` and calling of callback `narrow_or_search_for_term`
used by typeahead.
i.e. chronological order of triggering of this event is
`compositionend` > calling of `narrow_or_search_for_term` > `keyup`.
* So the main logic is to set `is_using_input_method` to `false`
by default and if used the input tool then when we press enter
to get the suggested text we set it to `true` which indicate
further events triggered after it to skip the searching and
finally in `keyup` we set it to default `false` so when pressed
enter again we have it set to false and we have a successful
search.
Fixes: #9396.
Whenever a link is clicked, the page link changes, and the content
of the `.markdown .content` node updates, preventing the old
listener to catch any future anchor link clicks.
We attach the listener to the document instead and only activate
it when the target element is a proper anchor link heading.
Fixes#9767.
This makes sure that CSRF token is available while initializing
Socket, irrespective of the order of execution of deferred callbacks
after document becomes ready.
This is part of #9416.
This updates the unread pills in the left and right sidebar
to look better at a wide range of zoom values. (It doesn't change
their appearance at all.)
Set the initial visibility of the page content to hidden via
the stylesheet, and allow any data fetching and rendering to
complete before making content visible.
Adjust the conditional logic within `render` to first check for
the case in which a user goes to a doc link, the case in which
we asynchronously fetch data prior making content visible.
Fixes#9577.
For other users' profile, keyboard navigation worked only upto 2
items as the third item with '.mention_user' could not be focused.
This was due to href missing from the anchor tag. $.focus() requires
href to be defined, even if it is '#' to focus the anchor tag.
actions_menu_handle_keyboard now only gets the action menu items
and passes them to the newly added popover_items_handle_keyboard.
popover_items_handle_keyboard takes the key and menu items as its
parameters. The function can be used when handling keyboard input
like user profile popover. Similar refactor has been carried out in
focus_first_action_popover_item. This refactor is a part of adding
the missing support of keyboard navigation to user profile popover.
The function `settings_account.add_custom_profile_fields_to_settings`
called twice, which resulted in two templates objects being
rendered.
The function also didn't check whether settings overlay was open or
not when processing new events, and thus would throw an "undefined"
error if a custom profile field was editing while the overlay was not
open.
Fixes#9668.
Explaining the problem a bit: When we narrow to a stream/private message
using `q+Enter`/`w+Enter` compose box opens which isn't desirable here.
The bug here was the propagation of event after getting handled in
`keydown_util.handle` to `hotkeys.process_enter_key`.
Fixes: #9679.
We should only open the default article heading which is "Guides",
if the user is on the index page i.e. /help/. For non index pages
we don't need to open this heading.
This commit adds a minor improvment in clicking
the left sidebar behaviour. So if you click on
an article heading then other opened headings will
be closed automatically. This makes the toggle
experience better.
This is less than perfect, but for most settings hitting
the enter key will now take you to the first element in
the right panel.
The two exceptions are below. They have checkboxes with
kind of strange markup:
Notifications
Authentication methods
If you toggle between Settings and Organization now, it
will remember where you were the last time (not counting
reload). Likewise if you go in and out of settings.
The old code always put you in the first section, which I
think was an accident of implementation. Of course, we'll
continue to default to the first row if you haven't gone
anywhere else.
This is mostly a code move, but because things are more
modular now, we don't need the two conditionals to find
out what kind of panel menu we're inside of, and our
selectors are less brittle.
The list with the options for normal settings now has
the class normal-settings-list.
The list with the options for org settings now has
the class org-settings-list.
The new markup helps us avoid code like this:
$(".settings-list li:not(.admin)")
We also have funny hacks in our key handlers related
to the old combined-list approach, which we can
eventually eliminate.