For small-ish realms (<= 250 users), we ensure that the presence
info includes all realm users the front end knows about, even in
cases where the server sends down a slimmed version of presence
data. We make the users "offline" by default, of course.
This commit sets us up to optimize larger realms without concerns
of breaking small realms. Small realms may want to continue to
show all users, even users who may have been offline several weeks,
since it doesn't clutter their API as much as it would for big
realms.
Most of this code was simply moved from activity.js with some
minor renaming of functions like set_presence_info -> set_info.
Some functions were slightly nontrivial extractions:
is_not_offline:
came from activity.huddle_fraction_present
get_status/get_mobile:
simple getters
set_user_status:
partial extraction from activity.set_user_status
last_active_date:
pulled out of admin.js code
We also fixed activity.filter_and_sort to take user_ids.
* Change the classes and ids of different widgets and modals
and make suitable changes in `admin.js`.
* Remove any other occurrences of `alias` or `realm_alias`
from admin.js.
This fixes an issue with the menu going below the bottom of screen
with non-tiny windows, and it was rare that anyone benefitted from the
extra suggestions.
Fixes: #4133.
This `overflow: hidden` constraint would make it so that modals
embedded in the sections would have their edges cut off. This fixes
that and doesn’t seem to cause any other regressions.
Fixes#4208.
We remove the jquery dependency here and just search for strings
in the text. It turns out the test was leaking jquery into
message_edit, so now we explicitly stub jquery in message_edit.
The default is too tight for easily distinguishing paragraphs. This
change increases it slightly, while keeping the last paragraph's
margin at the original value.
Our unread.js code basically silently treats empty recipient
strings or unknown streams as having zero unread messages,
which is probably the correct behavior. We now have tests
that cover this. This commit also gets us to 100% line
coverage on the module (but not yet 100% branch coverage).
This moves the implementations of error/report/message from
ui.js to ui_report.js. They had been shimmed before, so calling
modules still use the same names to call the functions, but we
no longer need the shims.
This removes the 200px width limitation that was part of a previous
style guide for the settings/administration pages. It force-wraps
lines that shouldn't be wrapped and no longer serves its original
purpose.
Fixes: #4312.
Previously drafts called compose.snapshot_message which would then
get the message object from compose.create_message_object. This method often
checked for the validity of stream/user recipients which would often cause tracebacks.
The new method in drafts.snapshot message just gets the data from the fields and
stores them in the draft model without any additional checking.
The addDraft and editDraft tests were copying objects by reference
which meant the methods weren't tested properly. Due to this, a bug with
stubTimestamp was also discovered where the method wasn't getting stubbed
Due to Pgroonga regression, there is a difference in search
result between Travis and development env due to which one of
our tests fails. This commit makes sure that the test passes
for both strings till the Pgroonga bug is resolved.