Commit Graph

1950 Commits

Author SHA1 Message Date
Marco Burstein 1490653e42 tests: Test the compose buttons in stream and private narrows.
Also add a test for the `narrow.is_in_private_narrow` function used by
the mobile compose popover.
2018-10-31 16:59:53 -07:00
Shikhar Vaish 5ffca5e388 settings: Warn if server is unable to deliver mobile push notifications.
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.
2018-10-31 13:18:17 -07:00
Tim Abbott 27f0a30768 casper: Remove overly-specific test for whether body is well-formed.
This test started failing recently; the apparent cause is that
sometimes, zerver/lib/generate_test_data.py generates messages
containing bulleted lists, and those don't end with a `</p>` tag since
they end with `</ul>` instead; the result is that this test failed
nondeterministically in CI.

There isn't really a useful version of this check to do that would
cover that case (as well as the entire message body being a bulleted
list), so we just remove the check; I don't think it's ever caught any
actual bugs.
2018-10-31 10:46:26 -07:00
Tim Abbott deb29749c2 people: Add a CSS class to label guest users.
This doesn't do anything yet, since we still need to add the actual
CSS, but it should make it easy for someone to just do the design
work.
2018-10-31 10:15:49 -07:00
Steve Howell 706821e259 minor: Change error to warning for missing user ids.
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.
2018-10-29 12:57:15 -07:00
Tim Abbott d48fbb3f63 node: Fix missing test coverage for user_events.js with guests. 2018-10-29 12:49:07 -07:00
Steve Howell 06b1aece31 Simplify narrow/search interactions.
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.
2018-10-24 16:54:35 -07:00
Steve Howell 08f0690333 left sidebar: Fix scrolling bugs with zoomed topics.
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".
2018-10-24 16:54:35 -07:00
Steve Howell 4bfb49c3a4 Streamline closing topic lists.
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.
2018-10-24 16:54:35 -07:00
Steve Howell 047a81dd2c refactor: Move clear_topics into topic_zoom.js.
This sets up some subsequent changes.
2018-10-24 16:54:35 -07:00
Steve Howell acb7149386 Extract topic_zoom.js.
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.
2018-10-24 16:54:35 -07:00
Steve Howell c58a99b156 PM sidebar: Expand PM sidebar for huddles.
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.
2018-10-22 12:22:26 -07:00
Steve Howell 328e2ff316 Fix "Copy link to conversation" links.
This cleans up the code for stream links
and creates nicer, more correct links for
PMs.

Fixes #10605
2018-10-22 12:22:26 -07:00
Steve Howell adf616d3f1 Add pm_perma_link helper. 2018-10-22 12:22:26 -07:00
Steve Howell 8c49985058 url decoding: Handle your own id being in PM slugs.
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.
2018-10-22 12:22:26 -07:00
Aditya Bansal a4b51a33f8 timerender.js: Remove use of legacy font awesome base class 'icon-vector'. 2018-10-15 19:22:57 +05:30
Rohitt Vashishtha 11e4011d5f transmit.js: Use people.get_mention_syntax. 2018-10-13 16:42:50 -07:00
Rohitt Vashishtha 38cddf7d54 compose_actions: Use people.get_mention_syntax in reply_with_mention. 2018-10-13 16:42:50 -07:00
Rohitt Vashishtha b18f9def06 people.js: Add get_mention_syntax to conditionally get @user|id syntax.
This is intended to replace all function calls for generating mention
syntax for a target user.
2018-10-13 16:42:34 -07:00
Steve Howell 27ef6a9991 compose pill: Add has_unconverted_data() helper. 2018-10-12 11:20:30 -07:00
Steve Howell 3225f81a92 compose pills: Add get_user_ids_string().
This helper will be useful for typing indicators.
2018-10-12 11:20:30 -07:00
Steve Howell 3b9a5afcee input_pill: Add is_pending() helper. 2018-10-12 11:20:30 -07:00
Steve Howell 3545bc1893 settings: Confirm before deleting user groups.
Fixes #10498.
2018-10-12 10:38:56 -07:00
Cynthia Lin a11c56f02a people: Format times without leading zeroes. 2018-10-04 17:02:09 -07:00
Cynthia Lin 6d0aa68591 custom profile fields: Add and restyle default user profile fields.
Refactor selectors to utilize SCSS features.

Fixes some issues in #10545.
2018-10-04 17:02:09 -07:00
Harshit Bansal 20aee7b116 emoji: Change fallback emojiset for text emojiset.
Now that we have added back support for `google-blob` emojiset,
changing the fallback emojiset for `text` emojiset to `google-blob`
make sense.
2018-09-21 18:34:12 -07:00
Akash Nimare 0a7b487617 hotkey: Update test for hotkey deprecation.
This commit adds a test for hotkey deprecation since
we need to test the 'CMD' hotkey on macOS.
2018-09-21 10:59:55 -07:00
Steve Howell b991bbe431 Add coverage for message_events.update_messages(). 2018-09-11 15:17:51 -04:00
Rohitt Vashishtha d5459f09fd typeahead: Insert extended mention syntax for users with same full name.
Fixes #374.
2018-08-31 14:16:47 -07:00
Rohitt Vashishtha e497816a42 people: Track users with same full names.
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.
2018-08-31 14:16:47 -07:00
Rohitt Vashishtha ef5940a864 markdown.js: Add @user|id syntax to support users with same name. 2018-08-31 14:16:47 -07:00
Steve Howell 7b2f5ccabc Rename markdown-help to message-formatting.
This just makes the id match the name of the
menu item.
2018-08-31 11:51:22 -07:00
Pragati Agrawal e1ed0ee8e0 org settings: Disable topic editing checkbox when message editing is off.
This checkbox has no effect in this case, so it makes sense to display
it as such.

Fixes: #10327.
2018-08-31 11:49:54 -07:00
Yashashvi Dave e398b25429 user popover: Remove repetitive "Last seen" text from all last seens.
This text was unnecessary.

Fixes part of #10303.
2018-08-28 16:04:52 -07:00
Marco Burstein 6f57cd4d23 upload: Use a placeholder when uploading.
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.
2018-08-26 23:33:24 -07:00
Marco Burstein fa22cf18f6 compose_ui: Create the `compose_ui.replace_syntax` function.
`replace_syntax` will replace text inside of a compose textbox. Also,
add tests to the `compose_ui` Node tests for this function.
2018-08-26 23:33:24 -07:00
Vishnu Ks 62b93d551a signup: Fix broken resend email link in realm creation flow.
Also use name for selecting form in casper tests
as form with action=new is present in both /new
and /accounts/new/send_confirm/ which breaks
test in CircleCI as
waitWhileVisible('form[action^="/new/"]) never stops
waiting.
2018-08-26 22:54:05 -07:00
Vishnu Ks d2e4417a72 urls: Separate endpoint for signup and new realm email confirm.
This is preparation for the next commit.
2018-08-26 22:53:57 -07:00
Steve Howell c8fbc0706f tests: Test misc things with input pills. 2018-08-26 22:32:08 -07:00
Steve Howell 53fee3606c tests: Test arrowing between input pills. 2018-08-26 22:32:08 -07:00
Steve Howell a3b573a07c tests: Test pasting into pill input area. 2018-08-26 22:32:08 -07:00
Steve Howell 892085723f tests: Test copying text from input pills. 2018-08-26 22:32:08 -07:00
Steve Howell 1600529a8b tests: Clean up duplicate setup for input_pill.
We just set pill_input.before to a noop for all
of our tests in set_up, and callers can always
override it with more specific implementations.
2018-08-26 22:32:08 -07:00
Steve Howell 3745d44bed node tests: Add test for input pill exit button. 2018-08-26 22:32:08 -07:00
Harshit Bansal 9bd56d0ce4 build_emoji: Change emoji sprite sheets to use hyphens in names.
Use of hyphens is more consistent with our other emoji infra names.
2018-08-26 22:16:23 -07:00
Steve Howell 37acb3e2cb tests: Test left arrow for pill input. 2018-08-25 06:51:15 -04:00
Steve Howell c9fab959b9 tests: Test comma behavior for input pills. 2018-08-25 06:51:15 -04:00
Steve Howell 383567aa73 tests: Test enter-key behavior for input pills. 2018-08-24 10:00:04 -07:00
Steve Howell 572990b7f4 tests: Add set_up() helper for input_pill tests. 2018-08-24 10:00:04 -07:00
Steve Howell 9e0c8e50d1 tests: Cover removePill function for input_pill.
We simulate hitting backspace while focused on
particular pill.
2018-08-24 10:00:04 -07:00