Commit Graph

5002 Commits

Author SHA1 Message Date
Shubham Dhama
990d7fb37d narrow: Remove narrow_activated.zulip event trigger. 2018-11-29 12:36:00 -08:00
Shubham Dhama
654c3240e4 narrow: Remove narrow_deactivated.zulip event trigger. 2018-11-29 12:36:00 -08:00
Shubham Dhama
42f1d2a33b tab_bar: Make explicit call of narrow change handle function. 2018-11-29 12:36:00 -08:00
Shubham Dhama
b726cd4b3e typing_events: Make explicit call of narrow change handle function. 2018-11-29 12:36:00 -08:00
Shubham Dhama
e908da7831 narrow: Remove some narrow_deactivated.zulip event handling. 2018-11-29 12:36:00 -08:00
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
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
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
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
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
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
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
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