Commit Graph

31059 Commits

Author SHA1 Message Date
Mayank Madan 264c2e9803 provision: Add provision support for Ubuntu 18.10.
Note that this is only support for Ubuntu 18.10 in the development
environment.
2019-03-09 16:01:46 -08:00
vinitS101 4523c8d7ee typo: Change "generage" to "generate". 2019-03-09 15:49:38 -08:00
Mateusz Mandera edcb6d57fc email_mirror: Don't remove quotations from forwarded messages.
Addresses point 2 of #10612. We use a regex to detect if a form
of FWD indicator is present at the beginning of the subject, which
means the message has been forwarded.
remove_quotations argument is added to a couple of functions where
it's necessary.
In filter_footer, the criteria for a line to be a possible beginning
of a footer is changed to line.strip() == "--", instead of
line.strip().startswith("--"), because the former would remove
quotations from plaintext emails. This change makes sense, because
RFC 3676 specifies ""-- " as the separator line between the body
and the signature of a message":
https://tools.ietf.org/html/rfc3676
2019-03-09 15:36:17 -08:00
Mateusz Mandera 0633f268fb email_mirror: Move subject processing into process_stream_message.
We remove the 'subject' argument of process_stream_message and make
subject processing happen inside the function, as it's a more
appropriate place than the general process_message function and is
needed to have a good way of disabling removing quotations in forwarded
emails sent into the mirror.
2019-03-09 15:36:17 -08:00
Mateusz Mandera 518ccec235 test_email_mirror: Improve performance of subject stripping tests.
This used to have a single function test_email_subject_stripping which
would run through a sizeable list of example subjects from subjects.json
fixture, form an email with each subject, send it to the email mirror
and check if the resulting stream message has a correctly stripped
topic. That took too much time, because we run through the entire
process_message and most_recent_message codepaths a lot of times.
We change the way of testing to:
1. Ensure process_message applies subject stripping (only need to run
process_message twice here)
2. Test the strip_from_subject function separately, on all the example
from the subjects.json fixtures. This is very fast.
2019-03-09 23:15:41 +01:00
Mateusz Mandera 0d84be8e4b test_email_mirror: Clean up unnecessary use of "type: Any" on MIMEText.
The explanation on those type declarations referenced issue
https://github.com/python/typeshed/issues/275,
which has now been resolved.
2019-03-09 23:15:16 +01:00
Tim Abbott 625c4aaca8 docs: Update recommendations on Vagrant version.
The history of this was that there was a period where half of Vagrant
releases were broken (for everyone, e.g. downloading a base container
didn't work).  It seems Vagrant has cleaned up their act at this point.

We really just want 2.0.x, not a specific version, and the direct
links we had are now quite old.

Thanks to Jonathon Hinchley for reporting this.

Fixes #11836.
2019-03-08 17:34:11 -08:00
Tim Abbott 399aa43c75 night mode: Fix initial state of night mode. 2019-03-08 15:45:11 -08:00
Boris Yankov 3df4990781 cleanup: Remove unnecessary 'magic' style for night mode.
This was introduced in e0236646

For 1.5 years we did not find a case that needed it (besides the
`a` tag hover state, that is not obvious if it was needed or it was
used as an example)

It is not obvious if this solution was a good idea. The concern was
that `body.night-mode` is more specific than `body` and some styles
might override others less specific in cases we might not want that.

Of course, we want that in the majority of cases, and css-specificity
rules are not simple to comprehend.

Good further reading:
http://cssspecificity.com/
https://specificity.keegan.st/

The added complexity of the resulting styles and the added code that
might not serve any practical purpose seem to not be worth it.
2019-03-08 15:27:32 -08:00
Steve Howell 725bdcc384 user popover: Pop user menu closer to avatar.
If you click on the avatar, we now show the menu
right next to the avatar.  The current behavior
is particularly funny for long names.  (I confirmed
this with Rishi.)
2019-03-08 15:24:01 -08:00
Steve Howell fb750a2656 bug fix: Fix hovers for /me messages.
This fixes several bugs with /me messages:

    * We no longer hover name if you're over
      the message.

    * We now launch the user popup if you
      click on the name.

    * Even if you click on the avatar, we
      launch the user popup to the right
      of the name.  (I think this is odd,
      but it's consistent with how we
      do it for normal messages.)

The underlying problem here is that you have
two possible organizations.

From a logical standpoint, the image and
name go together (and both launch the user menu):

    img Alice | says hi

From a physical perspective, the main message
is "Alice says hi" and it's aligned differently
from the image:

    img | Alice says hi

Our HTML reflects the latter.

HTML doesn't allow overlapping diffs, of course,
so you have to pick your poison.
2019-03-08 15:24:01 -08:00
Steve Howell 45ba971d6d refactor: Move /me complexity out of body template.
One goal of this commit is to just make the "happy
path" code a lot easier to read.  It should be
pretty easy to verify that in this diff.

And then more stuff is now in me_message.

This is a pure code move, and it doesn't fix these
structural issues yet:

    * the "say hi" part of "/me says hi" is
      inside ".message_sender" (due to legacy
      positioning issues)

    * the avatar is outside of .sender-status
      (again due to legacy positioning issue)

    * we don't have sender_info_hover on
      the sender name (which causes it not
      to launch the user menu)
2019-03-08 15:24:01 -08:00
Steve Howell b00c54ff1c popovers: Remove broken code with 'u" key.
The code that was removed here wasn't doing what it
was intending to do, and we really just want to pop
up the user menu above the currently selected message.
2019-03-08 15:24:01 -08:00
Tim Abbott 0ab8cd9ca3 provision: Refactor handling of dependencies for building pgroonga.
This lets us leave build-pgroonga platform-agnostic.
2019-03-08 15:12:56 -08:00
Tim Abbott 5c20ee998c build-tsearch-extras: Add support for Debian/Ubuntu. 2019-03-08 15:12:56 -08:00
Tim Abbott 32d26c8aad provision: Clean up building search extensions from source.
This generalizes the provision logic for deciding whether to build our
tsearch_extras and pgroonga search extensions from source to support
Ubuntu cosmic as well (and evenutally, other future platforms).
2019-03-08 15:12:56 -08:00
Ben Muschol bb8bdf9960 linkifiers: Add no-select to trash icon.
This fixes some annoying copy-paste issues we've seen with users
accidentally getting a weird invisible unicode character in their URL
format string when trying to copy-paste an existing linkifier to
use for a new linkifier.

Fixes #10828.
2019-03-08 15:05:05 -08:00
YashRE42 a724a38c03 markdown: Improve handling of broken img urls.
Some urls which end with image file extensions (eg .jpg) may link to
html pages. This adds handling for linx.li, wikipedia.org and
pasteboard.co. If it is possible, we redirect to the actual image url
otherwise we do not attempt to render it as an image.

Fixes #10438.
2019-03-08 13:39:34 -08:00
Tim Abbott 4986f11c67 popovers: Fix clicking on user popover avatar image.
Previously, because our check for whether to close compose for clicks
on the page body was looking at popover-content, not popover, parts of
larger popover-title areas (e.g. the big avatar at the top of the user
popover) did not have the proper click handler behavior.

Also, rearrange the comments to be a bit clearer.
2019-03-08 13:31:29 -08:00
Wyatt Hoodes 98d489a0d5 popovers: Maintain compose box on profile modal close.
The modal-backdrop and user-profile-modal had their on-click behavior
overridden to simply hide the modal, thus preserving the compose box.

Keeping the compose box open after viewing a user's profile feels
like a more natural UX.

Tweaked by tabbott to move the fix into the central click handler.

Fixes: #11585.
2019-03-08 13:31:29 -08:00
Tim Abbott d63ac71adf node: Fix a node test broken by recent narrowing fix.
The changes in 3baf1f3dbd required some
additions to our test setup code.
2019-03-08 13:31:29 -08:00
Tim Abbott 3baf1f3dbd narrow: Remove "subscribe" button for guests for emptry streams.
This button didn't work, because the backend blocks subscribing, so it
was just confusing.

Fixes an issue reported in #11743.
2019-03-08 13:12:47 -08:00
Casper f3a4d2df58 search_users: Add | as OR-operator.
Adds possibility for users to use | as an OR-operator (besides ,)
when searching for other users.

This is a thing reasonable folks might try, and | in the thing to
search for isn't a realisitic possibility, so there's no real downside
to adding this.

Fixes #4109.
2019-03-08 12:09:49 -08:00
Steve Howell 504759f432 css: Consolidate some widths in left sidebar.
We now use 10px to the left of major elements in
left sidebar.

And we then explicitly use 19px for the following:

    icons in top left
    indent for (more conversations)
    stream hashtag icons
    stream lock icons

We also kill off 2px of gutter that was caused
by whitespace in the HTML (and was slightly messing
up alignment of names beneath "Private messages").

Finally, we make the topic indent a bit more explicit.
2019-03-08 12:04:20 -08:00
Abhinav Singh 99df926ef3 sidebar: Allow users to use sidebar search in mobile browser.
It was impossible to search people in mobile browsers because virtual
keyboard used to fire resize event and the function call that we used
to handle this event caused the input field to loose focus and this
made it impossible to type in the people search bar.

The code in this commit fixes this by simply ignoring the resize
events when the user wants to search.

Fixes #11795.
2019-03-08 11:37:02 -08:00
Rishi Gupta 4e504e46a1 portico: Fix styling of dropdown menu in nav bar.
The previous gradient must have been from a previous design; it looked kind
of crazy against our current homepage. This widget also appears on /help,
/integrations, and other pages with a variety of different backgrounds, so a
neutral, muted style is probably safest.

The icon change is just because fa-off seems to be broken/missing. Maybe it
was in Font Awesome 3?

The extra padding line is to supercede padding (I assume) unintentionally
added by `.top-links a` to this widget on /help.
2019-03-07 21:28:54 -08:00
Rishi Gupta aa5770f824 portico: Update screenshots on /apps.
The border radius is a compromise between:
* Windows: no border radius on windows
* Mac: border radius top and bottom
* Ubuntu: border radius only on top

Ideally the image itself would just have border radius matching the OS, but
that's a bit tricky to do in the image editing software I'm using.
2019-03-07 21:03:49 -08:00
Anders Kaseorg 674abdef43 drafts: Fix CSS transition when opening drafts.
The code was all there, but we weren't triggering a style calculation.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-03-07 20:55:02 -08:00
ruchit2801 9f7e90f68b left sidebar: Add an "unstar all messages" option.
In this commit, I've added a feature to unstar all the starred
messages.  This is useful, e.g., for folks who are using starred
messages to keep track of things they should come back when next at
their desktop.

The event flow is the standard one for a feature with a confirmation modal:

(1) User clicks on unstar all messages.

(2) We display a confirmation modal; if the user confirms, we send a
request to the backend to clear all starred messages.

(3) The events system sends that UI update back to us, removing the
stars from the UI.

Fixes #11401.
2019-03-07 20:52:00 -08:00
Tim Abbott dbf7f8e193 zephyr: Fix handling of account deactivation.
When a Zephyr user deactivates their account, they should be
automatically turned into a mirror dummy user (so that other users can
continue to interact with them as normal for a Zephyr user who isn't
using Zulip).
2019-03-07 20:41:39 -08:00
Vishnu Ks a288cfc43a uploads: Show used upload space in attachments UI. 2019-03-07 20:18:00 -08:00
Tim Abbott cc4774f371 docs: Update our language on finding a first issue.
We might want to do another pass on this, but I at least want to
de-emphasize "good first issue" since we're not maintaining that
label.
2019-03-07 20:04:04 -08:00
Tim Abbott 051bbf9f35 docs: Add some more links to new soft deactivation documentation. 2019-03-07 17:48:54 -08:00
Tim Abbott 010c02af09 docs: Add detailed documentation for soft deactivation. 2019-03-07 17:47:04 -08:00
Puneeth Chaganti 8ca4ca1400 digest: Don't update context with data already in common context. 2019-03-07 15:29:51 -08:00
Mateusz Mandera dbff533e09 email_mirror: Add the sender at the start of stream message.
Fixes part 3 of #10612. When sending an email to the email mirror to a
stream address, if "+show-sender" is added in the address, the stream
message will now include "From: <sender>" at the top.
2019-03-07 14:28:33 -08:00
Pragati Agrawal 60c7467464 test_events: Add test for `do_change_logo_source` event.
This adds tests for `do_change_logo_source` event in both day as well as
night mode in `test_event.py`.
2019-03-07 12:32:30 -08:00
Tim Abbott 99a2c21ff3 test_events: Fix incorrect usage of get_realm.
The test_events system was in several tests using get_realm to fetch a
realm object, rather than accessing self.user_profile.realm.  This
created subtle problems where we were neither directly editing nor
refreshing the `realm` object associated with our UserProfile object
from the database after our the `do_*` methods.

The payoff for this is we can update the previously confused
`do_change_icon_source` test to actually change the state and have the
correct result.
2019-03-07 12:29:16 -08:00
Pragati Agrawal 095e24c515 realm_logo: Update `upload_logo` views to return nothing. 2019-03-07 12:12:00 -08:00
Pragati Agrawal 276020445d realm_logo: Make `delete_logo_backend` views return nothing. 2019-03-07 12:12:00 -08:00
Pragati Agrawal 78e9ad3128 test_upload: Use actions.py do-change functions to change property. 2019-03-07 12:12:00 -08:00
Pragati Agrawal 0192f80d2e org_settings: Remove print statements.
This commit deletes the redundant `print` statement from the
`test_upload.py` file.
2019-03-07 12:12:00 -08:00
Pragati Agrawal bf1c9420df org_settings: Refactor `build_realm_logo_widget` function.
This commit deduplicates the code for `build_realm_logo_widget` and
`build_realm_night_logo_widget`. It deduplicates the common code for
`build_realm_day_mode_logo_widget` & `build_realm_night_mode_logo_widget`
into tthe function `build_realm_logo_widget`.
2019-03-07 12:12:00 -08:00
Steve Howell 1b065d811a me messages: Avoid empty "message_content" div.
We no longer have an empty message_content div for
messages like this:

    /me gets some coffee

This requires a minor change in how we compute the
position of the message for editing.
2019-03-07 11:39:38 -08:00
Steve Howell 9aa7ebadd7 me messages: Turn off collapse feature.
This is totally broken on master.  If you "collapse" a /me
message, it adds the "More..." link without actually
hiding any content.

I have another branch related to collapse/condense that
will make this easier to resurrect.
2019-03-07 11:32:09 -08:00
Rohitt Vashishtha 3ed85f4cd7 Revert "bugdown: Process word boundaries properly in realm_filters."
This reverts commit ff90c0101c but keeps
the test cases added for reference.

This was reverted because it was both not a clean solution and created
other realm filters bugs involving dashes (etc.).
2019-03-07 11:03:35 -08:00
Tim Abbott 00903a19c0 Revert "templates: Avoid empty message_content div for /me messages."
This reverts commit 3a73d03e8e.

This was making casper test 08 fail.
2019-03-06 18:28:27 -08:00
Rishi Gupta 99ea5f4e32 popovers: Remove a few entries from stream popover.
These options are pretty low-value, since clicking the stream does the
narrow, and it's likely that almost nobody sends messages via these
buttons.
2019-03-06 17:36:06 -08:00
Hemanth V. Alluri ae126c452b stream-descriptions: Create wrapper for rendering stream descriptions.
In commit de65a04 we can see that if the need ever arises to modify
how stream descriptions are rendered, we would need to make changes
at 5 different call points which can be quite cumbersome. So this
functionality has been extracted to a new method called
'render_stream_descriptions'.
2019-03-06 17:16:14 -08:00
Tim Abbott e0c6136ce1 puppet: Fix nginx configuration logic for S3 backend.
Apparently, our testing environment for this configuration was broken
and didn't test the code we thought it did; as a result, a variable
redefinition bug slipped through.

Fixes #11786.
2019-03-06 13:17:11 -08:00