Commit Graph

6611 Commits

Author SHA1 Message Date
Steve Howell bec40af614 Remove redundant narrow_state.get_current_filter().
We now use narrow_state.filter() everywhere.  The
two functions did the same thing, and I slightly
prefer the concise name, which was already in use
in lots of places.
2018-07-10 14:20:24 +05:30
Rhea Parekh fe4cad15a4 widgets: Add todo widget. 2018-07-10 11:18:05 +05:30
Shayan Toqraee 0757d022f5 messages: Add support for right-to-left messages.
This implements right-to-left message automatic detection support in
the compose box as well as the message feed.  Full unit tests and
support in the message-editing UI are for future work (as are
potentially more fancy things like supporting things like
right-to-left multi-word names for users/streams/etc.).

Fixes #3123.
2018-07-10 10:47:56 +05:30
Eeshan Garg 8362d927d0 css: Refactor CSS responsible for rendering multi-paragraph lists.
I also removed the comment that said "this is just a workaround".
It is not, it is technically correct for us to do apply different
CSS rules to <p> tags that aren't the first child of the <li>
element in question.
2018-07-10 10:01:16 +05:30
Anders Kaseorg ecb4fd2193 HTML validation: Rename custom on-page attribute to data-on-page.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-07-09 09:45:42 +05:30
Anders Kaseorg 37dfa7f7d4 HTML validation: Remove xmlns:svg attribute.
xmlns:svg is an XML namespace declaration that would be valid in XHTML
but not in HTML.  Even in XHTML, it wouldn’t be necessary because we
don’t write SVG tags prefixed like <svg:circle>, only unprefixed like
<circle>.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-07-09 09:45:42 +05:30
Steve Howell 930f3937dc Remove feature_flags.mark_read_at_bottom.
We removed all code related to the possibility
of it being false.
2018-07-07 10:19:15 +02:00
Steve Howell ed24d1c413 Remove unused feature_flags.collapsible field. 2018-07-07 10:19:15 +02:00
Steve Howell b88206a637 Remove code for full-width feature.
The full-width feature has been turned off for
about four years.
2018-07-07 10:19:15 +02:00
Armaan Ahluwalia ba6543b850 webpack: Fix missing exposed modules left out of transition.
This commit fixes some modules that were erroneously left out while
transitioning app.js to webpack. This commit exposes them using
expose-loader or setting them directly to window.
2018-07-07 08:00:34 +02:00
Jack Zhang 8fe422794d register-accounts: Align terms of service checkbox.
Fixes an invalid css property from
https://github.com/zulip/zulip/commit/30815b402, which addressed #9328.
2018-07-06 22:54:37 +02:00
Shubham Dhama 1e157057c3 voting_widget: Don't update question in question.outbound function.
We should wait for server response(event) for updating the question.
2018-07-06 11:30:12 -04:00
Shubham Dhama 1e32f66832 voting_widget: Minor refactor of jquery elements selectors. 2018-07-06 11:30:12 -04:00
Cynthia Lin 642111b6fa settings UI: Expand bot card width in narrow windows.
Fixes #9513
2018-07-05 12:29:52 +02:00
Armaan Ahluwalia 54d3d8e8b3 webpack: Transition app.js to be compiled by webpack.
This commit moves all files previously under the 'app' bundle in
the Django pipeline to being compiled by webpack under the 'app'
entry point. In the process, it moves assets under the app entry
to a file called app.js that consumes all relevant css and js files.

This commit also edits the webpack config to be able to expose certain
variables for third party libraries that are currently required by
some modules. This is bad coding form and should be refactored to
requiring whatever dependencies a module may have; we're just
deferring that to the future to simplify the series of transitions we
need to do here. The variable exposure is done using expose-loader in
webpack.

The app/index.html template is edited to override the newly introduced
'commonjs' block in the base template. This is done as a temporary
measure so as not to disrupt other pages on the app during the transition.

It also fixes the value of the 'this' context that was being inferred
as window by third party libraries. This is done using imports-loader
in the webpack config.  This is also messy and probably isn't how we
want things to work long term.
2018-07-05 11:03:08 +02:00
Armaan Ahluwalia 6d255efe4c app: Prepare JS files for consumption by webpack.
This commit prepares the frontend code to be consumed by webpack.

It is a hack: In theory, modules should be declaring and importing the
modules they depend on and the globals they expose directly.

However, that requires significant per-module work, which we don't
really want to block moving our toolchain to webpack on.

So we expose the modules by setting window.varName = varName; as
needed in the js files.
2018-07-05 10:53:36 +02:00
Aditya Bansal b10822efcf subscriptions.scss: Remove dead CSS.
We remove css which has been dead since convertion of subscriptions
page to an overlay. This should ideally have been dealt with in
commit 1886f0a which actually did the converstion but we forgot to
handle it at that time.
2018-07-04 23:51:45 +05:30
Aditya Bansal 69904e04d8 help: Remove dead css and js left over from the time of redesign.
This removes some left over dead code from the redesign which was
introduced in commit 1cf7ee.
2018-07-04 23:51:45 +05:30
Aditya Bansal e3aa479cc3 zulip.scss: Remove dead CSS from 2013.
We remove the dead CSS which was introduced in commit 963a93367
back in 2013 and doesn't seem to have any use now. Its probably
the case that we removed the actual html structure which used this
CSS since 2013 and forgot to clean up the css part.
2018-07-04 23:51:45 +05:30
Aditya Bansal 4f090861e7 admin_streams_list.handlebars: Remove since its dead.
This was killed when the "Deleted Streams" feature was dropped
in commit 7bbe44d7 but we forgot to deal with it at the time.

squash to admin_streams_list
2018-07-04 23:51:45 +05:30
Aditya Bansal db7448c4e3 subs: Remove dead css and js left over from a redesign.
This cleans up some leftover js and css from the effort of
redesign the rows of the #subscriptions table. Redesign happened
in commit 368b5859 and but we forgot to clean up these js and css
pieces.

squash to subs.js.
2018-07-04 23:51:45 +05:30
Steve Howell 7b8d3023f5 Fix saving of collapsed flags.
This was broken in 7a362861.  It was a refactoring
related to cleaning up unread flags.
2018-07-03 06:05:22 -07:00
Shubham Padia 17cbafe0e0 bot settings: Scroll to bottom after showing bot_error.
Fixes #9868.
The error went unnoticed as the error remains hidden below due to
the scrollable div.
2018-07-03 06:02:49 -07:00
Shubham Padia d07f5eef22 bot settings: Change top and bottom margins of bot_error. 2018-07-03 06:02:49 -07:00
Steve Howell d90d1a04bb bot settings: Clean up error handling.
The error handling for delete/reactivate was broken.
The old code related to appending id_suffix to the ids of
the per-bot error divs did not have corresponding
selectors in the actual error handling.

Things still aren't great, but there's a bit more
encapsulation now, and you'll see errors for the
delete/reactivate cases.
2018-07-03 06:02:49 -07:00
Steve Howell fef98c932b bot settings: Fix reactivation feature.
The reactivation feature was broken, because the
template was still using email when we were looking
for user_id.
2018-07-03 06:02:49 -07:00
Steve Howell 26b48b95dc refactor: Export settings_bots.render_bots().
We also now call this explicitly when we need to
re-render (instead of triggering a custom event).
2018-07-03 06:02:49 -07:00
Shubham Dhama b938523592 widgets: Increase node tests coverage to 100%. 2018-07-03 08:48:49 -04:00
Shubham Dhama 617c79545a widgets: Extract function for current list update on narrow deactivation. 2018-07-03 08:48:49 -04:00
Steve Howell 1fdfe11e8b node tests: Add tests for voting_widget.js.
This first commit starts by testing handling of
inbound data.
2018-07-02 13:46:30 -04:00
Rhea Parekh 7c7e3dcd3f slash commands: Add /settings command. 2018-07-01 20:32:36 -04:00
Rhea Parekh b22d266667 widgets: Add question for poll widget in the message itself.
Use the command '/poll question?', to start a question.
2018-07-01 19:56:19 -04:00
Rhea Parekh 784e7249a5 widgets: Add question in the poll widget itself.
The user can also edit the question after adding it.

The question in the poll can only be added/edited
by the user who started the poll.

The input bar will be disabled for the other users
if the question is not yet added. If the question is
added, the input bar will not be visible to the other
users.
2018-07-01 19:56:19 -04:00
Rhea Parekh 3d5cecdad5 widgets: Avoid voting while adding a new option in poll widget. 2018-07-01 19:56:19 -04:00
Rhea Parekh 19725b74d5 widgets: Add basic styling for poll widget. 2018-07-01 19:56:19 -04:00
Rhea Parekh 2673a7f71f widgets: Add basic styling for tictactoe widget. 2018-07-01 15:09:18 -04:00
Aditya Bansal 3cf8ba33d8 integrations: Upgrade to use font-awesome 4.7 icon prefixes. 2018-07-01 06:02:10 -07:00
Eeshan Garg 061e760d1e webhooks: Add Clubhouse integration. 2018-07-01 04:01:17 -07:00
Yashashvi Dave e7a172293f user popover: Display name of user instead of id in user-type-custom field. 2018-07-01 02:05:00 -07:00
Yashashvi Dave 554a0773dc custom fields: Add icon to delete value of date-type-custom-field. 2018-07-01 02:05:00 -07:00
Yashashvi Dave 52b6d0ce9f custom fields: Add default value choice in choice-type-custom-fields.
Add default choice option in choice type of custom profile field.
2018-07-01 02:05:00 -07:00
Yashashvi Dave aa39b1e28e custom field: Allow admin to change custom fields order using drag & drop.
Using sortablejs library, allow admin to modify custom fields order
in admin settings using drag and drop of custom field list element.

Fixes #9351
2018-07-01 02:05:00 -07:00
Yashashvi Dave a6c03a4738 custom fields: Fix custom fields header not rendering properly.
Even when admin removes all custom fields from org, custom
fields header "Profile" doesn't get removed.
Render header "Profile" whenever custom fields data get changed.
2018-07-01 02:03:56 -07:00
Shubham Dhama 9a45e52f75 widgets: Fix empty message_content of "All messages" widgets.
Fixes: #9827.
2018-06-28 14:04:37 -04:00
Akash Nimare d5e3ab761b settings: Unify code for setting-panel. 2018-06-27 11:48:50 -04:00
Akash Nimare 00a34fb46a settings: Remove duplicate code from setting panel.
We don't need to update this classes since we have
already added those classes in the setting_panel_menu.js.
2018-06-27 11:48:50 -04:00
Akash Nimare 68cf2b1690 settings: Fix broken setting items in smaller window.
Fixes: #9780.
2018-06-27 11:48:50 -04:00
Akash Nimare c82734d9c5 streams-settings: Fix toggle icon not updating.
This commit fixes a regression which was introduced while
we were removing icon-vector and replacing the same with
font-awesome. We forgot to update the toggle icons from the
JS file.
2018-06-27 11:30:35 -04:00
Shubham Padia 2977a4cb6f right-sidebar: Narrow pm/group-pm on clicking unread count badge.
Fixes #9797.
Clicking on the unread count badge on the right sidebar did not
narrow the selected pm/group-pm. This commit moves the count div
inside selectable_sidebar_block. Also uses flexbox instead of
inline-blocks for user presences selectable_sidebar_block.
2018-06-27 11:26:24 -04:00
Shubham Padia 3442fde126 sidebar: Fix unread count shifted right in stream list.
The reason for the bug was 71e3f778cc.
This commit makes the width 100% for selectable_sidebar_block only
on the right sidebar, the left sidebar selectable_sidebar_block
width is unset.
2018-06-27 11:26:24 -04:00
Shubham Padia e4fa02e8e3 integrations: Use phrase_match instead of fuzzysearch.
Fixes #9822.
fuzzysearch matched query if the query letters appeared in sequence.
Here we use the extracted phrase_match to match query with the prefixes
of words.
2018-06-26 20:38:47 -04:00
Shubham Padia 1364971a17 search: Extract phrase_match to common.js.
Extracts phrase_match to common.js so it can be used by other
components like integrations search.
2018-06-26 20:38:47 -04:00
Rishi Gupta c0751c0644 stream settings: Rename stream accessibility section heading.
The content of this section has recently changed to include posting
restrictions. "Stream accessibility" was sort of an awkward name anyway.
2018-06-23 18:40:42 -07:00
Rishi Gupta d5c48af365 stream settings: Fix link to stream-permissions user doc. 2018-06-23 18:40:42 -07:00
Rishi Gupta c6048527bf stream settings: Rename average messages to estimated messages. 2018-06-23 12:48:15 -07:00
Yashashvi Dave 317a2fff2a bots settings: Improve API for editing bot owners to refer to users by ID.
Fixes #9502
2018-06-23 12:47:50 -07:00
Vishnu Ks 66dead7fee signup: Fix the full_name hidden bug when user has no other account.
Fixes #9802
2018-06-23 10:56:47 -07:00
Shubham Dhama eaeaf2d851 list_render: Remove rows sort click handler from the body.
This removes the click handler previously attached to the body, now
we just need to pass `parent_container` which at least contains the
table heads.
2018-06-22 09:21:47 -04:00
Shubham Dhama 5b18a381fb list_render: Extract sort handler function from data-sort click handler. 2018-06-22 09:21:47 -04:00
Shubham Dhama 92d843add9 list_render: Remove redundant `list_render.delete` method. 2018-06-22 09:21:47 -04:00
Shubham Dhama 2aba7c239f list_render: Make list creation logic as an export in list_render module.
This changes how we create lists i.e.
    from `list_render($container, list, opts)`
        to `list_render.create($container, list, opts)`
2018-06-22 09:21:47 -04:00
Marco Burstein 9643c8ed26 hotkeys: Deactivate `ctrl + shift` hotkeys.
This disables `ctrl + shift + [`, while `ctrl + [` will still trigger
an action.

Also, add a test for ensuring that the `ctrl + shift` combinations fall
through.
2018-06-22 09:10:23 -04:00
Marco Burstein 56f711d5ff hotkeys: Deactivate `cmd-or-ctrl + shift` hotkeys.
This disables `cmd-or-ctrl + shift + k` and `cmd-or-ctrl + shift + s`,
while `cmd-or-ctrl + k` and `cmd-or-ctrl + s` will still trigger
actions.

Also, add tests for ensuring that the `cmd-or-ctrl + shift`
combinations fall through.

Fix #9779.
2018-06-22 09:10:23 -04:00
Shubham Padia 6853530eba search: Add search_pill.js with basic operations.
Adds search_pill.js to the static asset pipeline. The items
for search pill contain 2 keys, display_value and search_string.
Adding all the operator information i.e the operator, operand and
negated fields along with the search_string and description was tried out.
It was dropped because it didn't provide any advantage as one had to
always calculate the search_string and the description from the operator.
2018-06-22 09:05:36 -04:00
Cynthia Lin 71e3f778cc right sidebar: Expand sidebar block width for greater click area.
Fixes #9797
2018-06-22 08:57:01 -04:00
Shubham Dhama 42f9ecb841 search: Remove a redundant preventDefault & export is_using_input_method.
Return false is equivalent to preventDefault and stopPropogation.
is_using_input_method is exported for node testing.
2018-06-22 07:58:06 -04:00
Shubham Dhama 35be5a88ac search: Remove redundant re-declaration of variables for search box.
This is just a minor refactor.
2018-06-22 07:58:06 -04:00
Shubham Dhama 053b5a0da6 search: Refactor update_buttons_with_focus.
This just change `attr` to `prop` as it is more preferred.
Also, a minor renaming of variable is done here.
2018-06-22 07:58:06 -04:00
Rishi Gupta d466f3fffc org settings: Update labels for organization profile. 2018-06-21 12:47:19 -07:00
Rishi Gupta f52765be5b user docs: Update create-your-organization-profile. 2018-06-21 12:47:19 -07:00
Rhea Parekh d066c11b47 zcommand: Strip the slash in the backend.
The slash in command is stripped in the backend,
rather than in the client to make the client code
cleaner.
This would make client code cleaner in the slash
commands which include parameters.
2018-06-20 16:49:29 -04:00
Shubham Dhama 9b5986d320 search: Fix "Enter to search" while using an input method.
NOTE:   To test this locally I've used Google Chrome input tool.
        This change will not affect users who don't use input tools.

Here is the algorithm used to deal with this case and other important
points:

* Here I've used `compositionend` event which is triggered
as soon as an input tool completes a word or user press "enter"
to get the suggested text. (There was a situation where it is
triggered even when input tool wasn't closed, that is when we
press space, but it also triggers another `compositionstart`
event simultaneously so our logic can't be affected by this.)

* We are using a variable `is_using_input_method` which sets to
`true` when `compositionend` event is triggered.

* Basically our searching is initiated by `keyup` event which
is triggered by the same keypress which triggers `compositionend`
event to get the text, so our main goal is to suppress the searching
triggered by this key pressing.

* Observation shows that `compositionend` is triggered before the
`keyup` and calling of callback `narrow_or_search_for_term`
used by typeahead.
    i.e. chronological order of triggering of this event is
`compositionend` > calling of `narrow_or_search_for_term` > `keyup`.

* So the main logic is to set `is_using_input_method` to `false`
by default and if used the input tool then when we press enter
to get the suggested text we set it to `true` which indicate
further events triggered after it to skip the searching and
finally in `keyup` we set it to default `false` so when pressed
enter again we have it set to false and we have a successful
search.

Fixes: #9396.
2018-06-20 16:32:51 -04:00
Shubham Dhama 9387efc399 scroll_bar: Initialize scroll_bar in ui_init.js.
This will help in making the order of ui modules initialization
more explicit and clear.
2018-06-20 07:38:22 -04:00
Max Nussenbaum e5d2e953bd settings: Clean up styling of the Mentor field.
This restyles the Mentor custom profile field in Settings >
Your account to better match the rest of the profile fields.
2018-06-20 07:33:30 -04:00
Akash Nimare 8973ece70b night-mode: Remove background from edit topic form. 2018-06-20 07:31:39 -04:00
Cynthia Lin 35a0fc17ab help: Prevent anchor link text from being selected.
Double clicks sometimes cause the anchor link text to be selected accidentally.
2018-06-19 14:19:23 -07:00
Cynthia Lin dcfc2e10b8 help: Fix broken anchor link scrolling in documentation pages.
Whenever a link is clicked, the page link changes, and the content
of the `.markdown .content` node updates, preventing the old
listener to catch any future anchor link clicks. 

We attach the listener to the document instead and only activate
it when the target element is a proper anchor link heading.

Fixes #9767.
2018-06-19 14:19:23 -07:00
Vishnu Ks 3dd9f61851 signup: Show profile details during settings import. 2018-06-19 11:25:23 -07:00
Shubham Dhama 8e032376f9 guest: Restrict guest access to user group creation and updation. 2018-06-19 11:04:14 -07:00
Shubham Dhama 05323e776e user groups: Refactor settings_user_groups.can_edit. 2018-06-19 11:04:14 -07:00
Shubham Dhama 281611f64c night mode: Fix loading-ellipsis visiblity on clicking "more topics". 2018-06-19 11:04:14 -07:00
Shubham Dhama acd2528038 transmit: Refactor logic for deferring the socket initialization.
This makes sure that CSRF token is available while initializing
Socket, irrespective of the order of execution of deferred callbacks
after document becomes ready.

This is part of #9416.
2018-06-18 06:51:42 -07:00
Shubham Dhama 6eaa54a876 sockets: Remove redundant defering in `_setup_sockjs_callbacks`.
This deferment is redundant because we are already waiting for document
ready in transmit.js where we initialize this Socket object.
2018-06-18 06:51:42 -07:00
Shubham Dhama e42e3af7a1 settings_org: Refactor 'get_property_value' to be more readable. 2018-06-17 09:28:19 -04:00
Yashashvi Dave 8909cb1d15 custom fields: Allow list of users in user type of custom fields.
Allow user to add more than one user-value in user type of custom
fields.

Tweaked by tabbott to improve the models.py code and type annotations.
2018-06-16 09:37:49 -07:00
Tim Abbott b0db90648a topic_edit_form: Disable autocomplete for topic editing.
Browser autocomplete is just annoying for this context.
2018-06-16 09:06:34 -07:00
Max Nussenbaum 42f10addd8 sidebars: Update unread pills to handle zoom better.
This updates the unread pills in the left and right sidebar
to look better at a wide range of zoom values. (It doesn't change
their appearance at all.)
2018-06-16 09:04:13 -07:00
Jack Zhang ac76935f25 integrations: Hide page content until all data has loaded.
Set the initial visibility of the page content to hidden via
the stylesheet, and allow any data fetching and rendering to
complete before making content visible.

Adjust the conditional logic within `render` to first check for
the case in which a user goes to a doc link, the case in which
we asynchronously fetch data prior making content visible.

Fixes #9577.
2018-06-16 08:50:16 -07:00
Shubham Dhama 417f01386d bots: Hide UI for adding new bots for guest users. 2018-06-16 06:33:14 -07:00
Shubham Dhama 603139500a settings_bots: Extract logic for ability to create bots.
This is a minor refactor/deduplication and renaming of
'admin_only_bot_creation' to 'can_create_new_bots'
2018-06-16 06:33:14 -07:00
Shubham Dhama d40c2bb166 emoji: Make uploading new realm emoji inaccessible for guest users. 2018-06-16 06:33:14 -07:00
Shubham Dhama 596ce5b60f invite: Make inviting new users inaccessible for guest users. 2018-06-16 06:33:13 -07:00
Shubham Padia 3a742d8ae4 popovers: Fix keyboard navigation for user profiles except their own.
For other users' profile, keyboard navigation worked only upto 2
items as the third item with '.mention_user' could not be focused.
This was due to href missing from the anchor tag. $.focus() requires
href to be defined, even if it is '#' to focus the anchor tag.
2018-06-13 05:57:14 -04:00
Shubham Padia 5f9cdf9b08 popovers: Enable keyboard navigation on user profile menu.
Fixes #9318.
Calls popovers.user_info_popover_handle_keyboard in process_hotkey.js.
Makes popovers.message_info_popped public.
2018-06-13 05:57:14 -04:00
Shubham Padia 655175c9f7 hotkey: Rename actions_dropdown_hotkeys to menu_dropdown_hotkeys.
actions_dropdown_hotkeys are also to be used for user profile menu
keyboard navigation, so renaming it to a more generic name.
2018-06-13 05:57:14 -04:00
Shubham Padia 5481dd11bc popovers: Focus on first menu item when user profile opened by hotkey.
Adds focus_user_info_popover_item to popovers.js. When menus are
opened by hotkeys, first menu item is focused to enable further
keyboard navigation.
2018-06-13 05:57:14 -04:00
Shubham Padia 4516a72676 popovers: Add get_user_info_popover_items.
Gets menu items for the user profile popover. To be used to add
keyboard navigation to user_profile_menu.
2018-06-13 05:57:14 -04:00
Shubham Padia 68d58b92cc popovers: Refactor functions using get_action_menu_menu_items.
actions_menu_handle_keyboard now only gets the action menu items
and passes them to the newly added popover_items_handle_keyboard.
popover_items_handle_keyboard takes the key and menu items as its
parameters. The function can be used when handling keyboard input
like user profile popover. Similar refactor has been carried out in
focus_first_action_popover_item. This refactor is a part of adding
the missing support of keyboard navigation to user profile popover.
2018-06-13 05:57:14 -04:00
Lyla Fischer 3ccae20566 docs: Remove the footer, which directed people to help with docs. 2018-06-12 13:42:30 -04:00
Eeshan Garg 0a43e5e257 Replace all user-facing references to "invite-only" with "private".
Fixes #9611.
2018-06-12 13:37:45 -04:00
Shubham Dhama d060101cfa message: Fix opening of compose box on mobile webapp. 2018-06-12 13:31:42 -04:00
Cynthia Lin 7772b99d24 night-mode: Fix incorrectly-colored user profile in mobile view. 2018-06-12 13:13:19 -04:00
Steve Howell 31a8eca4d0 refactor: Extract do_populate_profile_fields.
This makes it easier to write tests (since you
can't set meta.loaded to true directly) and
separates out the concern of short-circuiting
updates.
2018-06-12 10:15:18 -04:00
Shubham Dhama 80a2d5bc59 eslint: Enable `conditionalAssign` config of no-trailing-spaces rule. 2018-06-11 07:51:24 -04:00
Shubham Dhama dcb6254a4e eslint: Enable `no-extra-parens` rule.
Following sub-configuration is disabled:
                "nestedBinaryExpressions": false,
2018-06-11 07:51:24 -04:00
Yashashvi Dave 40590bb6b9 custom fields: Fix exception in rendering custom profile field template.
The function `settings_account.add_custom_profile_fields_to_settings`
called twice, which resulted in two templates objects being
rendered.

The function also didn't check whether settings overlay was open or
not when processing new events, and thus would throw an "undefined"
error if a custom profile field was editing while the overlay was not
open.

Fixes #9668.
2018-06-10 13:50:38 -07:00
Shubham Dhama 51ae82fbcf left-sidebar: Fix opening of compose box on narrowing using hotkeys.
Explaining the problem a bit: When we narrow to a stream/private message
using `q+Enter`/`w+Enter` compose box opens which isn't desirable here.
The bug here was the propagation of event after getting handled in
`keydown_util.handle` to `hotkeys.process_enter_key`.

Fixes: #9679.
2018-06-09 12:53:24 -04:00
Rishi Gupta 283d530f68 portico: Add svgs and update pngs for why-zulip. 2018-06-09 00:08:54 +03:00
Felix Yan 974f015837 js: Fix a typo in search.js. 2018-06-08 12:14:55 -07:00
Cynthia Lin 88795898a2 message edit: Fix edit author text overflow on images.
Fixes #9175.
2018-06-08 07:49:28 -07:00
Akash Nimare 9955580251 help: Remove outline from article links.
This commit removes the ugly dotted outline from the article links.
This bug can only be seen in Mozilla since it adds the outline in all
the links.
2018-06-07 11:21:13 -07:00
Akash Nimare 64c668b881 help: Update default article heading on help pages.
We should only open the default article heading which is "Guides",
if the user is on the index page i.e. /help/. For non index pages
we don't need to open this heading.
2018-06-07 11:21:12 -07:00
Akash Nimare 4b3309f3f0 help: Close other article headings on click.
This commit adds a minor improvment in clicking
the left sidebar behaviour. So if you click on
an article heading then other opened headings will
be closed automatically. This makes the toggle
experience better.
2018-06-07 11:20:10 -07:00
Akash Nimare 733b1a14bb help: Highlight article heading in left-sidebar.
This fixes a bug where we don't toggle the article heading
if you open it direclty.

Fixes: #9700.
2018-06-07 10:51:59 -07:00
Shubham Dhama ed7373febb profile: Fix glitch when exiting custom profile display UI.
Tweaked by tabbott to add a brief comment explaining the issue.

Fixes: #9702.
2018-06-07 09:03:19 -07:00
Yashashvi Dave f7f039e772 custom fields: Add endpoint to delete value of custom profile data.
Add delete endpoint at `users/me/profile_data` to delete value of
custom profile data.

Fixes #9669
2018-06-07 08:35:04 -07:00
Yashashvi Dave f725fa591d custom fields: Fix all fields background color.
Fix url and date type of fields background color to
match with other filed's background color.
2018-06-07 08:31:27 -07:00
Adam Birds 5855fe3e53 integrations: Add Zabbix webhook.
With a few changes to the documentations by Eeshan Garg.
2018-06-07 08:31:24 -07:00
Yashashvi Dave b9b923aab6 user profile: Display local date format in user profile.
Display local date format in date type of inputs in user profile
popover, i.e. joined_date, date-type-custom-field.
2018-06-06 15:06:26 -07:00
Anupam Dagar 8939767452 message view: Add loading indicator to bankruptcy modal.
Tweaked by tabbott to remove the old logic, which wasn't be displayed
and regardless didn't look as nice.

Fixes: #9629.
2018-06-06 15:06:05 -07:00
Max Nussenbaum 0f77a1f81d portico: Restyle blockquotes on Why Zulip.
This restyles the blockquotes on the Why Zulip page.
2018-06-06 14:54:38 -07:00
Rishi Gupta 634c4516a7 portico: Add svgs of sea creatures. 2018-06-06 13:57:55 -07:00
Max Nussenbaum d57beb40c7 portico: Small style fixes for landing page tour.
Updates the landing page tour to improve some of the included
images.
2018-06-06 13:26:30 -07:00
Steve Howell 3065bf0c58 settings: Make the enter key go to panels.
This is less than perfect, but for most settings hitting
the enter key will now take you to the first element in
the right panel.

The two exceptions are below.  They have checkboxes with
kind of strange markup:

    Notifications
    Authentication methods
2018-06-06 09:42:33 -07:00
Steve Howell 8af04ac3cd toggler: Stop supporting payload target.
We no longer need the payload target for our callbacks.
2018-06-06 09:42:33 -07:00
Steve Howell e7e38253ec settings: Add better keyboard navigation for panel menus.
You can now use all four arrow keys intuitively in the
Settings/Organization panel menus.
2018-06-06 09:42:33 -07:00
Steve Howell a5f0163a67 Keep track of which settings sections are open.
If you toggle between Settings and Organization now, it
will remember where you were the last time (not counting
reload).  Likewise if you go in and out of settings.

The old code always put you in the first section, which I
think was an accident of implementation.  Of course, we'll
continue to default to the first row if you haven't gone
anywhere else.
2018-06-06 09:42:33 -07:00
Steve Howell beecee4b8c Move panel click handler into settings_panel_menu.js.
This is mostly a code move, but because things are more
modular now, we don't need the two conditionals to find
out what kind of panel menu we're inside of, and our
selectors are less brittle.
2018-06-06 09:42:33 -07:00
Steve Howell 8ce8e93645 refactor: Extract settings_panel_menu.js. 2018-06-06 09:42:33 -07:00
Steve Howell db514002ec settings: Use separate lists for the two sidebar panels.
The list with the options for normal settings now has
the class normal-settings-list.

The list with the options for org settings now has
the class org-settings-list.

The new markup helps us avoid code like this:

    $(".settings-list li:not(.admin)")

We also have funny hacks in our key handlers related
to the old combined-list approach, which we can
eventually eliminate.
2018-06-06 09:42:33 -07:00
Shubham Dhama f148ed5bbf org settings: Improve error handling status elements.
With styling work by @maxnuss.

Fixes: #9188.
2018-06-06 09:00:35 -07:00
Akash Nimare 84d3a4dbf3 help: Fix back button on help pages.
We should use update_page function for popstate
event so that we can fetch and update the help
articles correctly.

Fixes: #9617.
2018-06-06 03:18:58 +05:30
Akash Nimare 3a8a5a39bd help: Extract code for updating the page.
This commit extracts the code for updating
help page to update_page function.
2018-06-06 03:13:56 +05:30
Akash Nimare 5a2c19c67e help: Refactor code in help.js.
This commit organizes the code properly i.e.
declaring variable on top of the function and
moving window events in the bottom.

Fixes: #9617.
2018-06-06 03:01:52 +05:30
Tim Abbott d5206be969 settings: Fix high contrast mode not being development-only.
This feature is unfinished and doesn't do anything yet.
2018-06-05 10:10:53 -07:00
Shubham Dhama 8852ed588a style: Remove redundant brackets from typeof operator. 2018-06-05 09:22:26 -07:00
Max Nussenbaum ca18c635e7 User profile: Style the custom user profile fields.
This restyles the user profile modal so that the custom fields
look nice.
2018-06-04 16:15:24 -07:00
Max Nussenbaum 1e6bb09bfc portico: Restyle Why Zulip page.
This updates the Why Zulip page to improve the styling of bullets,
blockquotes, and images.
2018-06-04 15:09:03 -07:00
Akash Nimare ac93281cfe portico: Update advance clicking on tour carousel.
We shouldn't move the slide forward if the user is
on the last slide. This commit adds an exception for
the same.
2018-06-04 15:07:54 -07:00
Steve Howell a361e2b993 Fix recent regressions with All Messages (muted topics).
My recent refactoring that split out MessageListData
introduced a nasty bug where we were putting muted
messages into the "All Messages" view even though
the underlying list was correctly filtering
them, so the symptoms were two-fold:

    - muted messages cluttered up your feed
    - replying to the message caused a traceback (since
      it wasn't actually in the underlying data
      structure)

This has to do with what MessageListData.add_messages()
was passing back to MessageList to orchestrate drawing
in MessageListView.

I think what happened here is I got this working kind
of sloppily but correctly for the non-muting case and
then got in the weeds of some other stuff.  Not my
finest moment.

The actual correct code here is simple enough.  We
triage top, interior, and bottom, and then the respective
methods that put the data into the data structure
return the filtered lists (i.e. not muted) and put them
into the info structure.

Fixes #9656
2018-06-04 14:35:23 -07:00
Shubham Dhama cc03f9fb8f eslint: Enable space-infix-ops rule.
More about rule at  https://eslint.org/docs/rules/space-infix-ops
2018-06-05 00:47:35 +05:30
Shubham Dhama c6738889a9 eslint: Add and enable `space-unary-ops` rule.
Info about rule at https://eslint.org/docs/rules/space-unary-ops.
2018-06-05 00:47:35 +05:30
Steve Howell b4d83446dc info-overlay: Make toggler initialization less eager.
We want to avoid doing too much setup for the info overlay widget
during initialization, since we don't really need it, and side
effects like focusing a modal can cause hard-to-detect
glitches for other features.
2018-06-04 09:02:58 -07:00
Steve Howell 8deb2fc9ef toggler: Always call back to callback function.
In our toggler component (the thing that handles tabs in things
like our markdown/search help, settings/org, etc.), we have
a callback mechanism when you switch to the tab.  We were
being tricky and only calling it when the tab changed.

It turns out it's better to just always call the callback,
since these things are often in modals that open and close,
and if you open a modal for the second time, you want to do
the callback task for whichever setting you're going to.

There was actually kind of a nasty bug with this, where the
keyboard handling in the keyboard-help modal worked fine the
first time you opened it, but then it didn't work the second
time (if you focused some other element in the interim), and
it was due to not re-setting the focus to the inner modal
because we weren't calling the callback.

Of course, there are pitfalls in calling the same callbacks
twice, but our callbacks should generally be idempotent
for other reasons.
2018-06-04 09:02:58 -07:00
Shubham Dhama 4b42a1207a portico: Fix `/plans` link in the tour carousel. 2018-06-04 08:54:52 -07:00
Shubham Dhama 6ef6657e3e portico: Make control-indicators of carousel synced with slides.
Fixes: #9654.
2018-06-04 08:54:52 -07:00
Shubham Dhama 06d00b0dfe portico: Fix clicking of carousel-container to move to next slide. 2018-06-04 08:54:52 -07:00
Shubham Dhama e59fcddb13 portico: Stop wraping of slides in landing page carousel. 2018-06-04 08:54:52 -07:00
Robert Hönig 5d9a8cf64f bots: Add token to outgoing webhook zuliprc.
We want the Botserver to not only work with the
botserverrc, but also with a zuliprc of an outgoing
webhook. Because the Botserver uses the outgoing
webhook token for authentication, we need to include
it in the zuliprc for outgoing webhooks.
2018-06-04 08:39:24 -07:00
Robert Hönig d08c701bb4 frontend: Use bot_data instead of HTML data to generate zuliprc.
It is better to retrieve all information about a bot from
the central bot data store, rather than relying on the
bot card's HTML attributes.
2018-06-04 08:39:11 -07:00
Robert Hönig 7e7583e9cd frontend: bots: Extract encode_zuliprc_as_uri.
This is preparation for an upcoming refactoring where we pass a bot
ID, not the email/api_key, into the zuliprc generation functions in
the bots code path.
2018-06-04 08:38:14 -07:00
Tim Abbott 973510718d filter: Fix new linter error.
This wasn't a linter error until we rebased
1e518dceef together with
e32dd53cd9.
2018-06-03 14:57:00 -07:00
Shubham Padia f6f4a3f50a browser-support: Replace occurrences of `.includes` in static/js/*.
Fixes #9649.
`.includes` is not supported in Internet Explorer.
Replace `.includes` with `.indexOf() !== -1`.
2018-06-03 14:30:22 -07:00
Shubham Padia 1e518dceef filter.js: Add describe_is_operator for describing is operand categories.
Aims to increase readability.
2018-06-03 14:28:05 -07:00
Shubham Padia 561c9d7368 search: Add format_as_suggestion to search_suggestions.js.
`format_as_suggestion` formats a list of operators into a
suggestion using the Filter.describe and Filter.unparse methods.
This change aims to increase readability.
2018-06-03 11:53:34 -07:00
Shubham Padia c92e909980 search: Add check_validity to search_suggestions.js.
Refactors search_suggestions.js to use check_validity to check if
last operator is valid and none of the previous operators is invalid.
2018-06-03 11:53:34 -07:00
Rishi Gupta 182215d125 portico: Update text of why-zulip.
With edits from tabbott.
2018-06-03 09:37:00 -07:00
Anupam Dagar c8024cec5c hotkey: Close deprecation notice on Enter keypress. 2018-06-03 09:33:16 -07:00
Anupam Dagar 528d2c6b28 hotkey: Edit comment which refers to deprecated hotkey '*'.
This commit is related to issue #9613.
2018-06-03 09:33:00 -07:00
Max Nussenbaum 7f32c26731 portico: Update landing page tour.
This moves the tour on the landing page to the top of the page,
and makes a number of other minor fixes.
2018-06-03 09:01:01 -07:00
Yashashvi Dave 7c2f053f0f custom fields: Fix buggy behaviour of trash icon in choice type of field.
In admin UI for creating new choice type of custom field, the behavior
of trash icon for removing choice field is buggy.
When admin clicks on trash icon it disappears, but the row does not
and admin end up being unable to create the field.

Fix this by selecting proper element to find and delete choice row.
2018-06-03 08:22:29 -07:00
Steve Howell 47b4dd6bdb slash commands: Refine /day and /night.
These two slash commands now use zcommand to talk to
the server, so we have no Message overhead, and if you're
on a stream, you no longer spam people by accident.

The commands now also give reasonable messages
if you are already in the mode you ask for.

It should be noted that by moving these commands out of
widget.py, they are no longer behind the ALLOW_SUB_MESSAGES
setting guard.
2018-06-02 09:40:12 -07:00
Steve Howell 4b2e8b83c4 slash commands: Add /ping command (via zcommand).
This adds a /ping command that will be useful for users
to see what the round trip to the Zulip server is (including
only a tiny bit of actual server time to basically give a
200).

It also introduce the "/zcommand" endpoint and zcommand.js
module.
2018-06-02 09:40:12 -07:00
Steve Howell 87ba752758 refactor: Extract compose.do_post_send_tasks(). 2018-06-02 09:40:12 -07:00
Anupam Dagar 0e8081093b hotkey: Add deprecation notice for '*' hotkey. 2018-06-02 08:59:42 -07:00
Tim Abbott 7d7d89e486 narrow: Clean up computation of then_select_offset.
We had a significant amount of code for handling what seemed to be 2
cases, but which were really just a single case (if we are trying to
narrow to a specific message ID, and we end up landing on it, restore
the previous offset; with the special case that the previous offset
might be passed in from the previous call).

This cleanup also fixes a very minor bug, where our background
auto-reload (`reload.initiate({immediate: true});` in the JS console)
would incorrectly reset the pointer position to match the a near:
message ID if that was present in the narrow.
2018-06-01 12:45:02 -07:00
Steve Howell baa691db7d narrow: Fix how we select ids for narrows.
This commit fixes a couple regression related to narrowing.

For a long time we've had bugs where we too aggressively
preserve the currrent selection on topic -> stream
re-narrows ("s" key) even when the wider narrow may
have unread messages before the selection.

Also, we recently introduced a bug so that when you used
a link from the "copy link to conversation" (aka a "near"
query), it would advance you to your first unread message
despite the near:999 specifier.  (The code would work for
subsequent "near" queries once you had fetched some of
your original messages).

This commit introduces a new data structure called id_info (replacing
the select_strategy data structure) in various functions and uses that
to track all the ids of relevance.

Significantly rewritten by tabbott to handle a few extra corner cases,
and add a ton of comments explaining why it works the way it does.

Fixes #2091.
Fixes #9606.
2018-06-01 12:45:02 -07:00
Yashashvi Dave 3422766c25 create stream: Fix widget for changing privacy doesn't render initially.
When admin user create new private stream, widget for changing privacy
of stream doesn't render. Because we render subscription-settings
template partially on subscription-add event, so this case wasn't
handled.

Fixes #9469
2018-06-01 12:09:50 -07:00
Anupam Dagar 562f5387e3 analytics: Add "last 2 months" and "last 6 months" button.
This commit removes "last 30 months" button and includes some layout changes so as to accomodate rangeslider with extra introduced buttons.
2018-06-01 12:07:18 -07:00
Shubham Dhama ceae1a1c5f streams: Improve 'is-announcement-only' checkbox. 2018-06-01 10:05:13 -07:00
Shubham Dhama c03acaa078 streams: Improve and make stream_privacy_modal consistent with others.
Previously weren't registering modal properly, which gets fixed by
using open_modal. It further fixes closing of modal by using escape
and positioning of modal.

Fixes: #9590.
2018-06-01 10:05:13 -07:00
Anupam Dagar 9674a139bf hotkeys: Change * to Ctr+s for starring a message.
Fixes: #9613.
2018-06-01 09:53:15 -07:00
Eeshan Garg f5bfa4e793 css: Fix code block formatting issues in our Markdown docs. 2018-06-01 09:19:42 -07:00
Anupam Dagar 0f55b56398 analytics: Add a rangeslider to the "number of users" plot.
This also requires some layout/spacing changes, since the rangeslider
takes up some space.

Fixes: #9557.
2018-06-01 08:51:53 -07:00
Lyla Fischer 7fba0f1505 user docs: Update logging-in.md. 2018-06-01 01:39:45 -04:00
Eeshan Garg 10523813fd webhooks/pagerduty: Update docs to conform to style guide.
A few things have changed on PagerDuty's end, so I thoroughly tested
this webhook with a local ngrok instance. Also, added a message
screenshot!
2018-05-31 23:48:42 -04:00
Steve Howell ab9e348fab dead code: Remove narrow.by_time_travel(). 2018-05-31 17:13:50 -07:00
Shubham Dhama e18ced7f13 css: Make all modals with backdrop. 2018-05-31 13:05:40 -07:00
Max Nussenbaum eddcec5e86 hotspots: Style "How to reply" hotspot.
Styles the "How to reply" hotstop that shows for new users to
match the rest of the hotspots.
2018-05-31 12:56:37 -07:00
Steve Howell c1cd0b710e poll widget: Handle unknown keys.
This directly prevents a traceback when submessage events
arrive in the wrong order.  This was probably a symptom
of not updating message.submessages for not-yet-widgeted
messages, which was fixed in an earlier commit, but we
want defensive code in case of races or other glitches, and
it's not the end of the world is somebody sees partial
survey results due to some corner case.
2018-05-31 12:11:32 -04:00
Steve Howell d0ad6295fa Avoid unneeded call to can_apply_locally().
The "if" condition that was removed in this commit
is no longer needed, since the called code now
handles the cannot-apply-locally use case.  (We
wanted the called functions to be defensive, so
they already were effectively handling the conditions
anyway, and recent commits has them returning
appropriate values and doing the right things.)
2018-05-31 08:44:18 -07:00
Steve Howell 7642ed66cf Expand get_unread_ids() to all local narrows.
This commit makes it so that any query for
which we do a local filter leads to us
examining the full list of unread message
ids in our cache to find a potentially
unread message that passes the filter.  This
can often allow us to more immediately
jump to a new narrow with an appropriately
selected message.

Fixes #9319
2018-05-31 08:44:18 -07:00
Steve Howell 4c235bfe65 Handle non-local case in get_first_unread_info().
We want to be able to call get_first_unread_info() even
if we cannot apply a search locally.  It was returning
the correct value before, but this change removes a
blueslip warning that will allow our callers to remove
some guard code in a subsequent commit.
2018-05-31 08:44:18 -07:00
Shubham Dhama e4e47a41d2 eslint: Enable "no-whitespace-before-property". 2018-05-31 08:11:57 -07:00
Steve Howell c0a9eb19fd poll widget: Clear input after adding an option. 2018-05-30 18:11:03 -07:00
Steve Howell f1877d8fdb poll widget: Prevent blank poll options. 2018-05-30 18:11:03 -07:00
Steve Howell d67c323c01 poll widget: Add very basic styling.
These styles aren't great, but they're hopefully
better than none at all and inspire a follow up
commit from somebody else (so it starts to look
like a "real" feature instead of feeling completely
proof-of-concept).
2018-05-30 18:10:59 -07:00
Akash Nimare 873cd23811 desktop: Update app version to v2.3.2. 2018-05-30 15:08:06 -07:00
Steve Howell 7305d4f652 submessages: Add update_message() function.
We want to update message.submessages for new events, even
though our couple of widgets (poll/tictactoe) that can process
"update" events currently just apply events as "deltas"
to their current data.

This does fix a subtle issue where you may get incoming
events for a message that the client knows about but which
it hasn't yet activated as a widget.  Up until now,
we've rarely seen the bug that's fixed here, since it's
usually the case that as soon as we receive a message, we
widgetize it right away.
2018-05-30 14:47:36 -07:00
Steve Howell 8b08772128 minor: Introduce submsg variable in a couple places.
We also pass in the submessage id to handle_events.
2018-05-30 14:47:36 -07:00
Tim Abbott d947ada4da stream_creation: Improve documentation link pointing to help center. 2018-05-30 14:46:31 -07:00
Tim Abbott 984da1f3b1 stream creation: Remove the bullhorn symbol for announcement.
It felt a bit awkward with the adjacent content.
2018-05-30 14:41:44 -07:00
Tim Abbott 555d3128d8 templates: Rename the stream creation form template.
"subscription creation" was a pretty confusing name for this.
2018-05-30 14:29:37 -07:00
Shubham Padia 214ce1ccca streams: Add create and edit ui for is_announcement_only.
The user can now specify the value while creating a stream.
An admin can later change it via `Change stream permissions`
modal. Add is_announcement_only to subscription type text.
2018-05-30 14:22:15 -07:00
Shubham Padia 518764b843 streams: Change stream-privacy-model save button text to `Save changes`. 2018-05-30 14:18:41 -07:00
Tim Abbott bab09a6579 stream_types: Suggest private, shared history before protected history.
This feels like the more common use case for most users.
2018-05-30 14:17:32 -07:00
Tim Abbott ee45125f82 stream_types: Change descriptions of stream privacy models. 2018-05-30 14:17:00 -07:00
Steve Howell bfc13ecea4 submessages: Just send content for submessage events.
For some reason in my original version I was sending both
content and data to the client for submessage events,
where data === JSON.parse(content).  There's no reason
to not just let the client parse it, since the client
already does it for data that comes on the original
message, and since we might eventually have non-JSON
payloads.

The server still continues to validate that the payload
is JSON, and the client will blueslip if the server
regressses and sends bad JSON for some reason.
2018-05-30 13:53:11 -07:00
Steve Howell de7f147cd9 minor: Remove blueslip call in submessage.handle_event. 2018-05-30 13:53:11 -07:00
Shubham Dhama 5ce58d3cc5 Revert "i18n: Revert pieces of recent settings changes."
This reverts commit ef9681caa3.
2018-05-30 23:52:09 +05:30