Commit Graph

7061 Commits

Author SHA1 Message Date
Shubham Dhama 209dd6dd37 narrow: Extract processes needed to be executed after narrow deactivate. 2018-11-29 12:36:00 -08:00
Tim Abbott 83b127cec1 server_events: Extract functions for managing connection errors.
This cuts a bit of code duplication.
2018-11-29 12:31:08 -08:00
Shubham Dhama 01927fb470 message view: Fix hiding of connection-error message on narrowing streams.
When there is some error in connecting to server(more specifically to the
tornado server) the "Unable to connect to Zulip" connection error message
gets cleared as Django server could send the response of "get" request of
old messages and hence get_old_messages_success hides the error message
even though the connection is not properly established.

Fixes: #5599.
2018-11-29 12:26:41 -08:00
Tim Abbott 02f09e2473 settings: Fix linter errors with user profiles. 2018-11-28 19:29:33 -08:00
Anders Kaseorg 8a6158c663 Position sidebars with top instead of margin-top.
This should make no visible changes.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-11-28 17:53:49 -08:00
Anders Kaseorg 10fb3539ae Position top-messages-logo statically.
This should make no visible changes.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-11-28 17:53:49 -08:00
Tim Abbott e39ebb7358 settings: Fix "Preview profile" button.
This was apparently broken in the refactoring in
a394778cde.
2018-11-28 16:46:15 -08:00
Yashashvi Dave fe3270d2b9 input pills: Fix modal gets closed when user click on remove-pill-btn.
This commit fixes bug: When user clicks on remove-user-pill-btn,
it closes the parent modal instead of removing user pill from input.
This happens because button has class `exit` and there is click
event listener on all `exit` class buttons, which closes modal.

Fix this by adding `e.stopPropogation` to remove-user-pill listener.
2018-11-28 16:33:08 -08:00
Yashashvi Dave 28c38a44c8 static/js/popover: Use predefine func to append user pills in field.
This commit remove repetitive code to append user pills in
custom field of user profile popover. And call already defined
function there.
2018-11-28 16:22:35 -08:00
Yashashvi Dave 20b6d08ef7 static/js/settings_account.js: Extract `append_custom_profile_fields`. 2018-11-28 16:22:35 -08:00
Yashashvi Dave b2aeffd947 static/js/settings_account.js: Extract `intialize_custom_user_type_fields`. 2018-11-28 16:22:35 -08:00
Yashashvi Dave cd8f4dfac0 statis/js/settings_account.js: Extract `initialize_custom_date_type_fields`. 2018-11-28 16:22:35 -08:00
Balaji2198 16967d6761 static/js/settings_streams.js: Refactor delete_default_stream method. 2018-11-28 16:17:21 -08:00
Nikhil Kumar Mishra 478674a6d6 analytics: Refactor to support more than one tooltip on same page.
While we don't actually need another tooltip on /stats right now, this
provides a clear approach for how to do that.  We've since added
tooltips in various other parts of the webapp, and that code is pretty
copy-pasteable, so I think it's reasonable to say this closes #4612.

Cleaned up by tabbott to remove a bunch of unnecessary changes.
2018-11-28 16:04:35 -08:00
Tim Abbott d28527b629 portico: Fix bulleted list styling on privacy page.
Fixes #10787.
2018-11-28 15:04:47 -08:00
Steve Howell 6035304619 Extract color_data.js.
This code is pretty distinct from all the color-picking UI,
and we want to get it to 100% coverage and optimize it
more.
2018-11-28 14:51:51 -08:00
Tim Abbott d8c5ad2a26 narrow: Add special text for conversation with yourself. 2018-11-28 11:59:16 -08:00
Abhinav Singh 0774bd7df0 portico: Fix password strength bar reset after form invalidation.
This code prevents the password bar from being incorrectly clear after
the sign up form is rendered again after invalid data is submitted
(generally due to forgetting to agree to ToS).

Fixes #10868.
2018-11-28 11:52:08 -08:00
butchyyyy 61c8247403 jenkins: Update integration doc with new plugin features. 2018-11-28 11:46:37 -08:00
Steve Howell b79d63e9c3 copy/paste: Try to fix Casper flake and add comments.
I think this will fix a Casper flake where there was a race
window with multiple temp DOM elements holding copied text.

I also add a comment to the code I think causes this race
for the tests.
2018-11-27 21:42:16 -08:00
Tim Abbott 65a9ee476c buddy list: Tweak styling for (you) marker. 2018-11-27 17:42:44 -08:00
Tim Abbott d9e8380981 copy: Add whitespace before timestamps in messages without sender.
This changes:

  Iago 4:11 PM
test not edited

4:11 PM
test edited

to this:

  Iago 4:11 PM
test not edited

  4:11 PM
test edited
2018-11-27 16:29:32 -08:00
Tim Abbott c43a00fd60 copy: Include EDITED notices in more copy-paste cases.
Previously, they were only included in messages that were the first in
their recipient block and were not /me (status) messages.
2018-11-27 16:24:04 -08:00
Tim Abbott 3ef0d6016c copy: Fix copy-pasting of EDITED notices in messages.
Previously, because the parens were added via CSS, copy-pasting the
EDITED notices resulted in junk like this:

 Iago 3:51 PMEDITED
edited message content

Now, you get:

 Iago 3:51 PM (EDITED)
edited message content
2018-11-27 16:20:46 -08:00
Tim Abbott e159f052bb status: Allow selecting status message text.
Status messages were incorrectly not selectable, due to a bug in how
we setup the no-select hierarchy (for making copy-paste not have weird
whitespace issues).

Fixes #10456.
2018-11-27 15:55:51 -08:00
Jeswin a5b533ba64 portico: Fix placement of "this field is required" notice.
The "This field is required" notice for the "organization URL" field
was improperly overlapping the server's root domain.

Fixes #10865.
2018-11-27 15:40:53 -08:00
Tim Abbott bddf23894d buddy list: Add marker for which user is yourself.
This helps make clear what's going on with the potentially confusing
"you" user.
2018-11-27 15:07:58 -08:00
Steve Howell 1890c30ee1 buddy list: Put "me" at the top of the list.
I think people will want this, particularly folks
with names toward the back of the alphabet.
2018-11-27 14:52:19 -08:00
Steve Howell 3aa490edbe Add current user back to the buddy list.
For many years we have been excluding the current user
from the buddy list, since their presence is kind
of implicit, and it saves a line of real estate.

This commit removes various user-is-me checks
and puts the user back for the following reasons:

    * explicit is better
    * newbies will be less confused when they
      can see they're actually online
    * even long-time users like myself will
      feel more comfortable if it's just there
    * having yourself in the buddy list facilitates
      things like checking your presence or sending
      yourself a message
    * showing "me" reinforces the meaning of the
      green circle (if my circle is green and I'm
      active, then others with green circles must
      be active too)
    * If you're literally the first user in the
      realm, you can now see what the buddy list
      looks like and try out the chevron menu.

The biggest tradeoff here is the opportunity cost.
For an org with more people than fit on the screen,
we put the Nth person below the fold to show "me".
I think that's fine--users can still scroll or
search.

This commit doesn't do anything special with the
current user in terms of sorting them higher in the
list or giving specific styling.

Fixes #10476
2018-11-27 14:52:19 -08:00
Steve Howell 731f76cea1 refactor: Have buddy_data.level() take user_id.
All the callers were having to call get_status().
We now do it for them.
2018-11-27 14:52:19 -08:00
Steve Howell 1e9d0718eb refactor: Flatten code in presence.set_info().
We reduce nesting of code by just early-exiting
for the `is_current_user` check.

This also forces us to be a bit more thorough
with our tests if we want to maintain line
coverage.
2018-11-27 14:52:19 -08:00
Rishi Gupta dd0126ff1b settings: Improve error message when deactivating the last user.
This PR was originally started by Rishi Gupta (see #10383).
2018-11-27 12:49:43 -08:00
Vishnu Ks 189e5e1fbd billing: Add frontend for upgrading by invoice. 2018-11-24 11:56:13 -08:00
Steve Howell 68d81cb25b subject -> topic: Fix respond_to_message(). 2018-11-16 11:11:40 -08:00
Steve Howell 82b9f2a3db subject -> topic: Fix create_message_object(). 2018-11-16 11:11:40 -08:00
Steve Howell 3e860fbc39 subject -> topic: Fix group.subject references. 2018-11-16 11:05:43 -08:00
Steve Howell 55362263dd Isolate/eliminate uses of "match_subject". 2018-11-16 11:05:43 -08:00
Steve Howell 89c278d1e5 Isolate/eliminate use of "subject_links".
For message groups, I just changed the internal name
to "topic_links".

For uses of "subject_links" that are tied to how the
server names fields, I introduced these wrappers:

    * util.set_topic_links(obj, topic_links)
    * util.get_topic_links(obj)

These can be used for either messages or events.
2018-11-16 11:05:43 -08:00
Yashashvi Dave 5759d5a762 statis/js/bot_data.js: Add `get_bot_owner_email` function. 2018-11-16 09:52:05 -08:00
Yashashvi Dave a394778cde statis/js/popover.js: Remove unused arg from `show_user_profile` func.
Remove unused argument `element` from function `show_user_profile`.
2018-11-16 09:52:05 -08:00
Nolan Darilek 5d291eb52c accessibility: Model messages as a list with items, each representing a single message.
Previously, messages were a string of disconnected regions. Modeling them as a list brings several benefits:
 * Quickly jump to the message list by using a screen reader's list navigation hotkey.
 * Quickly jump between messages by using a screen reader's list item navigation hotkey.
 * Quickly jump to the beginning or end of message lists in screen readers that support it.
2018-11-16 08:54:01 -08:00
Tim Abbott 86801d350a compose: Store raw_content after fetching it for quoting.
This is a nice performance optimization for the rare case where the
user does quote-and-reply on a message, aborts the compose, and then
re-does the quote-and-reply.
2018-11-14 23:55:26 -08:00
Marco Burstein f37e4df471 compose: Check if `raw_content` is present when quoting.
If `raw_content` is already present for the selected message, there is
no need to make a request to the server.
2018-11-14 23:52:08 -08:00
Steve Howell 6546fb3f1d subject -> topic: Fix local subject vars. 2018-11-14 23:24:06 -08:00
Steve Howell 51f8ac91ec subject -> topic: Rename current_subject. 2018-11-14 23:24:06 -08:00
Steve Howell a172ac264d subject -> topic: Rename by_stream_subject_uri. 2018-11-14 23:24:06 -08:00
Steve Howell b615f0df4d subject -> topic: Fix stream/subject in comments. 2018-11-14 23:24:06 -08:00
Steve Howell c6ad12d058 subject -> topic: Fix local vars in stream_list. 2018-11-14 23:24:06 -08:00
Steve Howell 3a9c81ed8c subject -> topic: Rename add_subject_links. 2018-11-14 23:24:06 -08:00
Steve Howell 91e4784b92 subject -> topic: Rename narrow.by_subject. 2018-11-14 23:24:06 -08:00
Steve Howell 6c1a96174e subject -> topic: Rename narrow_by_subject. 2018-11-14 23:24:06 -08:00
Steve Howell 7ae8907b3f subject -> topic: Rename narrows_by_subject. 2018-11-14 23:24:06 -08:00
Rohitt Vashishtha d7a0bd4a6c subject-to-topic: Add topics to compose_state.js. 2018-11-14 23:24:06 -08:00
Steve Howell 47e464528c refactor: Split up add_display_time().
We split out two new functions and call them
everywhere that we used to call add_display_time():

    - `update_group_time_display`
    - `update_timestr`

We also make some of the local vars more consistent,
as well as doing more explicit clearing of vars than
`delete`.

Splitting these functions will allow us to muck with date
dividers without affecting the `update_str` functionality.
2018-11-14 22:47:29 -08:00
Yashashvi Dave 766bdbfe89 stream settings: Rephrase info to state guest user can't join public stream.
Change wording of public stream description to
"Any member of the organization" from "Anybody"
to indicate that guest users can't subscribe even
public stream of organization.
2018-11-12 17:00:38 -08:00
Eeshan Garg 41c0e9ba47 webhooks: Add ReviewBoard integration. 2018-11-12 16:11:32 -08:00
Yashashvi Dave 89eebad14f user profile: Add user type/role in user profile popover.
Add user type/role in user's detail profile popover.

Fixes part of #10754
2018-11-12 15:13:44 -08:00
Yashashvi Dave 54dd7f0a43 user info popover: Add user type/role in user information popover.
Add user role-- "Administrator", "Member", "Bot" or "Guest"
under 'Local time' in user information popover.

Fixes part of #10754
2018-11-12 15:13:44 -08:00
Yashashvi Dave 614624d232 static/js/popover.js: Extract `render_user_info_popover`. 2018-11-12 15:13:43 -08:00
Tim Abbott 67fa755158 popovers: Remove now-unused narrowed argument to user info popover.
This stopped being used in bbfd33185c.
2018-11-12 15:10:19 -08:00
Tim Abbott 5a9f00dae4 popovers: Sort arguments for user info popover.
This makes it easier to see how the two duplicate implementations differ.
2018-11-12 15:09:09 -08:00
Tim Abbott 4c8f439ece popovers: Standardize calculation of show_user_profile. 2018-11-12 14:59:39 -08:00
Tim Abbott 96284bd336 popovers: Use attributes of user object more consistently.
This is a preparatory refactoring to make it easy to see what's
different as we deduplicate this logic.
2018-11-12 14:59:38 -08:00
Tim Abbott 08529507c8 popovers: Sort arguments to user info popover rendering.
This is a first step towards deduplicating this logic.
2018-11-12 14:59:23 -08:00
Yashashvi Dave 53201c5411 statis/js/people.js: Add function `get_user_type`.
Add function `get_user_type`, which returns user
type-"Administrator", "Guest", "Bot" or "Member"
depending on what they are.
2018-11-12 14:57:32 -08:00
Nolan Darilek c0a8f0a66e accessibility: Add button role and tabindex to sender names.
This facilitates interacting with them via keyboard.
2018-11-09 17:33:42 -08:00
Nolan Darilek fb54ea82b2 accessibility: Make the recipient row more accessible.
This primarily just exposes hidden icons.
2018-11-09 17:33:32 -08:00
Nolan Darilek ef8ea330fa accessibility: Make individual messages more accessible.
We do this by setting a region and exposing hidden icons.
2018-11-09 17:33:21 -08:00
Tim Abbott 2c06615909 streams: Fix stream color synchronization.
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
2018-11-09 17:04:47 -08:00
Shubham Dhama d5e1e8e5e3 settings: Move deactivate account button under "User settings".
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.
2018-11-08 22:27:22 -08:00
Nolan Darilek 33c2bbf0f1 accessibility: Make another reactions button semi-accessible. 2018-11-08 14:10:48 -08:00
Nolan Darilek 95781c913d accessibility: Hide non-actionable profile image from screen readers. 2018-11-08 14:10:11 -08:00
Marco Burstein 207d7a8ee6 compose: Use a placeholder when quoting and replying.
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.
2018-11-07 09:56:38 -08:00
Tim Abbott aba25a5ef6 i18n: Update translation data from transifex. 2018-11-07 07:22:47 -08:00
Yashashvi Dave 8c72adc106 subscribers: Hide subscribers of non-subscribed stream for guest user in UI.
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).
2018-11-06 12:57:19 -08:00
Roger Souza f445a71272 hello: Fix responsiveness bug when page is at 800px. 2018-11-05 10:20:34 -08:00
Tim Abbott 2636db64e4 Update translation data from transifex. 2018-11-02 17:35:21 -07:00
Yashashvi Dave f6b4e65b92 compose: Hide sub-btn in compose-to-unsub warning if user can't subscribe.
Hide subscription button in compose-message-to-unsubscribe-stream
warning, if user can't subscribe back to stream.
2018-11-02 11:57:04 +05:30
Vishnu Ks 4533f8f962 billing: Make URL hash work in billing page.
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.
2018-11-01 12:50:24 -07:00
Rishi Gupta 04acb624b6 portico: Add background image to /why-zulip hero. 2018-11-01 11:59:50 -07:00
Rishi Gupta de12facdc6 portico: Add background image to /security hero.
Also restructures the HTML to be more similar to other pages that have a
background image for their hero.
2018-11-01 11:59:50 -07:00
Rishi Gupta 2718bf27e7 portico: Fix spacing for logged-in dropdown in nav bar. 2018-11-01 10:41:30 -07:00
Tim Abbott 8673b4f4a6 compose: Use a more reasonable plus sign for opening send menu.
This icon styling definitely still doesn't look great, but it's an
improvement over what we had before.
2018-10-31 16:59:16 -07:00
Marco Burstein 502e9fe8a6 compose: Open the mobile compose popover when the `+` button is pressed.
The `+` button will only be displayed on mobile devices.
2018-10-31 16:47:48 -07:00
Marco Burstein 05b486182d compose: Create the mobile compose popover.
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.
2018-10-31 16:47:48 -07:00
Marco Burstein 9249d08a96 compose: Create the mobile compose `+` button.
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.
2018-10-31 16:47:48 -07:00
Yashashvi Dave c635d5476d message view: Hide subscribe button for guest users.
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.
2018-10-31 15:47:01 -07:00
Yashashvi Dave e489923d52 stream settings: Hide subscription button in case of guest user.
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.
2018-10-31 15:46:34 -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 bc8059d462 i18n: Sync translation data from transifex. 2018-10-31 10:31:36 -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
Rishi Gupta ef8113556a settings: Update dropdown in user roles modal. 2018-10-30 10:48:06 -07:00
Rishi Gupta 37e00dce78 settings: Update organization permission strings to reflect guests. 2018-10-30 10:48:06 -07:00
Rishi Gupta d3b6b4e885 settings: Remove extra column from table in bot-list-admin. 2018-10-29 23:16:45 -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
Pragati Agrawal d5df0377cc settings_users: Support guest user in admin-user-table.
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.
2018-10-29 12:33:35 -07:00
Steve Howell 3a267b5cc6 Have ESC zoom out topics if you're zoomed in.
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.
2018-10-24 16:54:35 -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