Previously, when a new stream was created on a client other than the
current one, the browser would first receive the "stream_created"
event, and make up a client-side display color at that time to use in
the "stream settings" view (it doesn't yet know the color that was
selected when the user was actually subscribed, because it doesn't
even know yet that the user is being subscribed to this stream), and
then moments after it'll receive a "susbcribe" event letting the
client know that the user is subscribed (and specifying the color to
use).
However, due to an argument not being passed through properly and a
missing rerender, we were not properly updating either the data
structures or doing a stream colors rerender in order to show the new
color.
This fixes the issue reported in
https://chat.zulip.org/#narrow/stream/48-mobile/subject/stream.20colors/near/660170
This moves the deactivate account which was previously placed under
"SETTINGS / YOUR ACCOUNT" -> "Deactivate account" to "SETTINGS / YOUR
ACCOUNT" -> "User settings" for making it more visible.
Use the placeholder `[Quoting…]` when quoting and replying before the
quote has been added to the message. Also, add tests to the
`compose_actions` Node tests for the new behavior.
Fix#10705.
Guest users can't access subscribers of any(public or private)
non-subscribed streams. Therefore, hide subscribers list
of all non-subscribed streams from guest users in UI.
Fixes#10749 (the previous parts were fixed already).
This will change the hash of the URL when a new tab
gets selected. Vice versa when the billing page is opened
the appropriate tab is selected according to hash of
the URL. This means when the card gets updated the
page would be reloaded correctly to show #payment-method
tab.
When a user clicks the compose `+` button, create a popover at the
bottom right of the screen including buttons for opening a new stream
message or a new private message.
Use CSS to display a `+` button on mobile but keep the more verbose
buttons on desktop. In the future, this button will be used to display
a popop for a new message.
Guest users can't subscribe themselves to streams, so we shouldn't
display the subscription button at end of stream message view.
Fixes part of #10749.
Guest users can't subscribe themselves to any stream, so we hide the
"Subscribe" button. Previously, it was showing Subscribe button after
a guest user unsubscribed from a stream.
Fixes part of #10749.
The "notification settings" page previously advertised support for
mobile push notifications via checkboxes, even if the server hadn't
yet been registered for push notifications. This was a frequent
source of onboarding pain for new Zulip organizations.
We fix this by providing a clear warning and disabling the relevant
inputs on the settings pages.
Modified significantly by tabbott to correct some tricky logic errors
as well as some copy-paste bugs.
Fixes#10331.
We want to avoid `blueslip.error` in cases where
the root cause could just be bad data that is
human-entered.
There are a few callers here who **should** be
sending good data all the time, but hopefully
they either have good test coverage, other
obvious failure symptoms, or, ideally, just
do what the user would mostly expect in the
face of bad data.
This supports guest user in the user-info-form-modal as well as in the
role section of the admin-user-table.
With some fixes by Tim Abbott and Shubham Dhama.
This is the natural behavior that most users will
probably expect. If you need to go to All Messages when
topics are zoomed in, you can just hit ESC twice.
Before this change, if you hit ESC, then hotkey
code would call search.clear_search, which would
call narrow.deactivate(), which would then use
`$('#search_query')` to clear a value, but then
let search.clear_search blur the input and
disable the exit button. It was all confusing.
Things are a bit more organized now.
Now the code works like this:
hotkey.process_escape_key
Just call narrow.deactivate.
$('#search_exit').on('click', ...):
Just call narrow.deactivate.
narrow.deactivate:
Just call search.clear_search_form
search.clear_search_form:
Just do simple jquery stuff. Don't
change the entire user's narrow, not
even indirectly!
There's still a two-way interaction between
the narrow.js module and the search.js module,
but in each direction it's a one-liner.
The guiding principle here is that we only
want one top-level API, which is narrow.deactivate,
and that does the whole "kitchen sink" of
clearing searches, closing popovers, switching
in views, etc. And then all the functions it
calls out to tend to have much smaller jobs to
do.
This commit can mostly be considered a refactoring, but the
order of operations changes slightly. Basically, as
soon as you hit ESC or click on the search "X", we
clear the search widget. Most users won't notice
any difference, because we don't have to hit the
server to populate the home view. And it's arguably
an improvement to give more immediate feedback.
If you zoom into "more topics" for a stream that has
a LOT of topics, and then scroll down to the bottom,
and then zoom out by selecting "All messages" or
similar upper-left-sidebar options, we now try to scroll
the more recently active stream back into place after we scroll
out.
Before this change, it was possible for your lower left
sidebar to appear empty, as it would keep the
scroll offset from "more topics".
If our topic list isn't zoomed in, avoid calling
stream_list.zoom_out_topics().
This commit also introduces `zoomed_in` to track
our topic zooming state.
This small modules nicely breaks down the
responsibilities of topic_list and stream_list
when it comes to zooming in and out of topics
(also known as hitting "more topics" or "All
Streams).
Before this, neither module was clearly in
charge, and there were kind of complicated
callback mechanisms. The stream_list code
was asking topic_list to create click handlers
that called back into stream_list.
Now we just topic_zoom set up its own click
handlers and delegate out to the other two
modules.
This fixes a regression from here:
88b4a9f2d7
The fix didn't account for how huddles are
represented as comma-delimited strings.
We also simplify the logic by extracting a
function and doing early-exit for simple
cases.
Internally we generally omit our own id and email
in data structures related to PMs, except when we
are the sender, but if we receive "perma links"
we will need to filter out our id.
This reflects the newly selected value of role in "role" column under
active-users section and deletes the redundant admin-icon updation code(
As we already removed bolt admin-icon)
New user avatar width is not maximum when user upload
new image. Because wrong html element is accessed for
setting value of image src attribute.
This commit removes these code from success of ajax call,
cause we already handle this in event `user_events - avatar_url`.
This deduplicate code for the checkboxes which are dependent on other
parameters and it makes no sense changing them when that parameter is
false. For example, changing `message_content_in_email_notifications`
makes sense only when `enable_offline_email_notifications` is true.
There is need for such a helper because `unless` executes to be true even
when we haven't passed the context variable on which we are checking the
conditional statement.
We drop support for usage of `icon-vector` as base class when
including icons from font awesome icons package.
Now on, only icons as specified in font awesome v4.7.0 can be used
in the code base.
We now ask compose_pm_pill to give us a list of user
ids that we are PM'ing to, and we only convert user
ids to emails right before we put requests on the wire.
We also let the "pill system" tell us whether we
have unconverted data.
It also sets up for an upcoming server change where we
can just send user ids to the server.
This change should be transparent to the majority of users.
For Zephyr users we are slightly less aggressive about
sending typing indicators, since we now require valid
user ids.
This module makes it really easy to create are-you-sure
dialogs for dangerous operations.
Basically it's one function with five parameters. You
give three chunks of HTML, a callback function, and
a parent container.
The first use of this will be in settings_user_groups,
coming up in a couple commits.
This removes some unnecessary code duplication in the CSS classes for
Google and GitHub authentication social auth buttons.
This will, in turn, help us avoid extra work every time we add a new
authentication backend.
Changes -
a) Updated the border-radius to 4px for all the buttons.
b) Increased the margins between the labels and inputs.
These changes affect the login and register page's styling.
Previously we only added the active class to the Date uploaded
column, thinking it was already sorted by upload date by default.
However, it wasn't, so now we explicitly make a call to sort it by upload
date to fix an issue with broken sorting.
Fixes#10518.
I don't know how long this has been broken, but it seems
some re-design of our message feed moved the Subscribe
button out #zfilt, so we use a different parent selector
now to turn on the click handler.
Hopefully this was a pretty obscure bug. To reproduce
it go to "Manage Streams" and then select a stream you're
not subscribed to (from "All Streams"), and don't actually
subscribe, but then hit "View stream".
The user experience here is still a bit confusing, but
this is just a quick fix.
Previously, if someone updated his/her name from accounts page and closed
the modal and then reopen the modal, the page still had the old name as
we use `page_params.full_name` in `accounts-settings.handlebars`. This
commit fixes this bug.
Fixes: #10529.
Since now we have email notifications for streams messages too, so
there is no direct dependency of
`message_content_in_email_notifications`checkbox on
`enable_offline_email_notifications` setting and neither we can say it's
dependent on `enable_stream_email_notifications` as well because we may
have email notifications set for individual streams. So removing this
checkbox dependency is the best solution here.
I used line-height: 22px and font-size: 16px in .message-content to take the
screenshots. Requires some additional fiddling for the LaTeX picture, inline
code block, and maybe a few others.
We have a body-level click handler that closes
all modals if you click outside a modal. This
code is a bit brittle, because we need to first
check that the element we clicked is not in a modal,
and our markup there isn't entirely consistent.
This is a quick fix that just adds `#user-profile-modal`
as one of the selectors to look for.
Fixes#10500
We don't use input.create_non_editable_pill() in our
code yet. If we add this back, we'll want to have node
tests on it.
Removing this unused code brings us to 100% line
coverage for input_pill.js.
This directly reverts 5c11ab85 with the small addition
of adding input_pill to our list of fully covered
modules.
This commit exposes the function is_duplicate_full_name()
that can be used to discern if we cannot identify a user
just by their full name in the interface and have to use
his user id as well to distinguish them from other users.
* Eliminate unnecessary div element wrapping around the icon and
change jQuery selectors accordingly
* Set initial position through CSS instead of JS
* Set color to inherit to prevent night mode issues.
This is largely inspired by requests from people not liking the
Google's new emojiset. A lot of people were requesting to revert
back to old blobs emojiset so we are re-enabling this feature
after making relevant infrastructure changes for supporting google's
old blob emojiset and re-adding support for twitter emojiset.
Fixes: #10158.
When we nudge up the feed to prevent the compose box
from obscuring it, we now have 20 pixels of separation
instead of 5. Before this fix, it was hard for users
to know whether they had any messages being covered.
Wrap all inputs tabs and inputs in `.contributors-list`, and increase
the width of that `div` to be 80px larger than the width of the other
content in order to fit each tab.
Instead of rendering tabs upfront, initialize them to a `Loading…`
indicator and then render them when clicked.
Use a `rendered_tabs` object to cache rendered HTML strings instead of
re-loading a tab (e.g. if it is selected, another tab is selected, and
then it is selected again).
These repositories (`zulip-ios-legacy` and `zulip-android`) are
deprecated, and as such should not have their own tabs, but still
should be included in the total contributions count.
This adds a feature in the "Notification" section of "Settings" tab,
which lets user enable or disable login emails notification.
Tweaked by tabbott to simplify the test.
Fixes: #5795, progress towards #5854.
We now have a callback for whenever the compose
box gets autosized by our old vendored version
of the autosize widget. It calls code to
scroll up the message feed if we are newly
covering it.
Use the placeholder `[uploading file]()` when uploading before the
upload has completed. This behavior prevents an image from being
improperly placed when typing after starting an upload. This is based
on GitHub's handling of image uploading.
Also, add tests to the `upload` Node tests and update existing tests to
account for the new behavior.
Fix#10305.
Empty "person picker" fields appear with a much smaller width than all
other custom fields. Increase the `min-width` of the field that it
matches the widths of other text boxes.
Fix#10414.
This is general fix that makes sure that we
apply all message-modifying events after we
apply the events for the initial incoming
messages.
The particular scenario that was reported here
was when you would have two tabs for Zulip,
with one of them open and in a PM view, and
with the open tab being at the bottom of the
feed, such that incoming messages would be
immediately visible.
Now suppose the other person in that PM
conversation sent you a message.
The open tab would properly immediately
mark the message as read, and notify
the server. The problem was that the closed
tab would not process the main message event
until it "woke up", by which time the flag-update
event was bundled into the same event batch
as the main message event. We'd then process
the flag-update first, which essentially was
a noop, since the actual message wasn't in
the message store yet. The user would then
see unread counts increment in the closed tab,
while the open tab didn't increment. This
was confusing.
Now `server_events.js` processes the actual
message first and does the flag-update as part of a
`post_message_events` loop.
We include events for updating message flags,
deleting messages, and attaching submessages
to messages in the `post_message_events` array.
This bug was a bit difficult to simulate in a dev
environment, since you needed your "open" tab
to be in focus to simulate the race, but as
soon as you tab to another place to deliver
a message (whether from the browser or otherwise),
the open tab is no longer in focus.
I did this in the console of my "open"
tab to work around it:
unread_ops.process_visible = unread_ops.mark_current_list_as_read;
This problem was easy to reproduce, but it wasn't
entirely consistent. I often needed to send
several messages in succession to trigger event
batching and force the race condition. (This wasn't
precisely a "race", as events actually arrive in the
correct order; it was having them arrive in the same
batch that triggered the bug.)
This commit fixes multiple invite-user-email sent to user.
In invite-user-form, submit-form click handler is getting
called multiple times on submit-invite-user-form event, which
results in multiple invitation mail to user.
Because, we registered same submit click handler multiple times.
Submit form click handler is registered when user opens invite-user
modal. If user opens modal multiple times, click handler get
registered multiple times.
We should register this click handler on `exports.initialize`
function instead of `exports.launch` function. This modal is unlike
other modal, where we append html when user opens modal. In this
case, we append modal on initialization. We only show modal when
user opens. So on initialization, modal element already exists,
register click handler on submit-btn element, on intialization
not when user open modal.
Fixes#10354.
If a caller passes undefined to go_to, it is
almost certainly a programming error, so we
shouldn't silently ignore it just because
the current key is undefined.
We also avoid setting curr_key until we
validate the incoming key.
When non-admin users visit the custom profile fields settings page,
the `Sortable` error
Uncaught Sortable: `el` must be HTMLElement, and not
[object Undefined]
is thrown, with `undefined: undefined | No stacktrace available` being
shown in the browser. Fix this by only using `Sortable` if the user is
an admin.
Fix#10403.
In commit c293bb82c4 we changed
id_realm_invite_by_admins_only and realm_invite_required checkboxes to a
single dropdown so these lines are redundant now.
In user type custom field, field value is list of user ids. We weren't
converting list to json object in update event payload. This throws
error in frontend, cause we store stringify representation of custom
field value. Therefore, after update event is recieved field-value-
type gets updated to array from string which throws json parsing error.
On mobile devices, the search bar appears as too tall for the rest of
the top header. Fix this by setting `#search_query`'s height and
vertical alignment properties.
Fix#10373.
These buttons are displayed with a lighter background than other
buttons. Update their borders and background colors (along with the
border on the search box) so that they match the night theme.
Fix#10301.
Expect div-input element in every pill-container even though pills are
not editable. This is correct, because `input_pill.js` appends pills
before the div-input element.
Modify structure of template data used to render
`user_profile_modal.handlebars`.
This is preparatory commit to display user pills in user profile
popover instead of user names in user type custom fields.