Commit Graph

28007 Commits

Author SHA1 Message Date
Yashashvi Dave 7480c73d9f custom profile field: Reset initial choices in edit-field-choice form.
Currently, our edit-field-choice form in custom profile field settings
in admin UI, is rendered when settings modal is loaded not when admin
user clicks on edit-btn.
Admin user open edit-field-form of choice-type-field, do some changes
in choices, discard those changes and close edit-field-form.
When admin user again open this edit-field-form, those discarded
changes are displayed, instead of original choices data.

Fix this issue by re-rendering field choices when admin user clicks
on edit-field-btn.
2018-08-08 11:42:20 -07:00
Yashashvi Dave 07959bf18e custom profile field: Reset delete-btn of choices on choice ordering.
Admin user must enter at least one choice for choice type fields
in create new custom field form. Admin can not delete all choice
options in form.
Reset delete-btn of choice inputs on choice reordering so that
admin can delete all choice except first choice input option.
2018-08-08 11:31:15 -07:00
Yashashvi Dave e4bd72ea44 custom profile field: Replace choice-order input with drag-drop rows.
Currently, admin user has to add order of custom-field-choice in
input box to create and edit choice-type custom field.
Remove this input boxes and add drag-drop list of custom-field-choices
using Sortable.js.

Fixes #10129
2018-08-08 11:31:15 -07:00
Cynthia Lin d37a7dd9a7 popovers: Recolor user profile avatar border to fit in night mode. 2018-08-08 11:29:51 -07:00
Cynthia Lin 16518aaa34 night-mode: Change coloring of disabled items to fit night mode. 2018-08-08 11:29:49 -07:00
Cynthia Lin f68bb8132a zcommand: Fix broken switch mode message.
Instead of displaying the zcommand to switch to the other mode, the
message displayed the zcommand that the user had just entered.
2018-08-08 11:29:49 -07:00
Cynthia Lin 89dbfc2926 night-mode: Fix stream creation loading indicator background color. 2018-08-08 11:29:49 -07:00
Cynthia Lin ecbc58c586 settings: Fix color styling for nested inputs to work in night mode. 2018-08-08 11:29:48 -07:00
Cynthia Lin a001e8d6ec night-mode: Fix color of clear search button for filter inputs. 2018-08-08 11:29:45 -07:00
Cynthia Lin d46ad47bd2 night-mode: Fix broken selector for legacy searchbox styling. 2018-08-08 11:29:36 -07:00
Shubham Padia 17d81d46dc Realm filters: Allow `#`(hash) based URLs in filter patterns.
Fixes #9817.
Use case: When people try to add a filter to a site that uses
a hash based router, which makes the URL like:
`http://some-site.domain.com/#/c/$(id)s`.
2018-08-08 11:06:33 -07:00
Yago González 5566646c45 user_groups: Handle renaming to existing names.
Renaming a user group to a name shared by other group wasn't a scenario
handled by the backend, and the server errored whenever this was
attempted.

Now a json_error is returned, letting the user know that a user group
with that name already exists.
2018-08-08 11:03:47 -07:00
Marco Burstein 995d073dbf org settings: Fix a bug where the loading spinner was not visible.
In Chrome, the loading spinners on the Bots and Deactivated Users pages
were not visible due to the `filter` elements having duplicate IDs across
the different pages. (There are multiple `filter` elements with the ID
`uil-ring-shadow` on the page.)

To solve this, when generating a new loading SVG element, we append
the container element's ID to the filter's ID, thus preventing any
duplicates.

Fix #8620.
2018-08-08 10:59:23 -07:00
Yago González 14bc5c7d5c messages: Don't require "anchor" when "use_first_unread_anchor" is set.
The use_first_unread_anchor parameter allows automatically setting the
anchor to the first message that hasn't been read in this narrow.
Therefore it isn't necessary to specify an anchor when this parameter is
enabled.

Note from Tim: Arguably, we should think about making
`use_first_unread_anchor` the default behavior when anchor is
unspecified, but that's for later consideration.
2018-08-08 10:30:08 -07:00
Yago González c7a97e34fb editorconfig: Declare max line lengths for JS/Python code.
110 is what we enforce in Python code via our existing lint rules, and
120 is what we'd most realistically move the JS codebase to next.

Make supported IDEs and text editors keep a maximum line length of 110
characters for most code files.
2018-08-08 09:48:17 -07:00
Tim Abbott a8d0fdce64 API: Reorganize message section of endpoints index a bit. 2018-08-08 09:43:01 -07:00
Yago González f63b7ada60 api docs: Create the NonExistingStreamError schema definition. 2018-08-08 09:29:27 -07:00
Yago González 586e013069 api docs: Specify array types. 2018-08-08 09:29:27 -07:00
Yago González d45fac0327 api docs: Minor formatting improvements. 2018-08-08 09:29:27 -07:00
Yago González 90e3b8d808 api docs: Remove unnecessary argument entry. 2018-08-08 09:29:27 -07:00
Yago González 8d0cf3ebe5 api docs: Migrate POST /user_uploads to OpenAPI. 2018-08-08 09:29:27 -07:00
Yago González 119b3c0bc4 api docs: Migrate DELETE /users/me/subscriptions to OpenAPI. 2018-08-08 09:29:27 -07:00
Yago González 14c9277095 api docs: Migrate POST /users to OpenAPI. 2018-08-08 09:29:27 -07:00
Tim Abbott 271c7fbe65 backends: Import googleapiclient lazily.
This saves about 30-50ms in the startup time of a Zulip manage.py
command.
2018-08-08 09:21:14 -07:00
Yago González e1662024d1 api docs: Load the OpenAPI file only when needed.
We found out in #9953 that, appparently, loading the OpenAPI file was
taking abut a 5% of the Zulip server startup time.

Since in many cases (especially in development) having the file loaded
won't be necessary at all, we read it on the first time data from the
OpenAPI spec is needed.

Tweaked by tabbott to add a test.
2018-08-08 09:00:28 -07:00
Yago González 25d2efb9ca api docs: Live reload the OpenAPI spec on update.
Automatically detect if the OpenAPI spec file has been modified since
the last time it was loaded into memory, and if it has, automatically
reload it to have the latest version.

This feature is designed with development environments in mind. The main
benefit is being able to see the changes made to the OpenAPI document
without needing to restart the development server, which is tedious and
slows the documentation workflow down.
2018-08-08 08:54:25 -07:00
Rhea Parekh 18a4904437 import: Move 'build_attachment' to import_util. 2018-08-07 16:45:42 -07:00
Rhea Parekh b6ccc0bc52 import: Move 'build_defaultstream' to import_util. 2018-08-07 16:45:42 -07:00
Rhea Parekh bee3964f14 import: Move 'build_usermessages' to import_util. 2018-08-07 16:45:42 -07:00
Rhea Parekh eefe7cccd2 import: Move 'process_uploads' and 'process_emojis' to import_util. 2018-08-07 16:45:42 -07:00
Rhea Parekh 30cc7354eb import: Move 'process_avatars' to import_util. 2018-08-07 16:45:40 -07:00
Rhea Parekh 87cc1a6280 import: Move 'build_subscription' and 'build_recipient' to import_util. 2018-08-07 16:35:56 -07:00
Rhea Parekh a516f80646 import: Move 'build_avatar' to import_util. 2018-08-07 16:35:56 -07:00
Rhea Parekh 1117455a90 import: Move 'ZerverFieldsT' and 'build_zerver_realm' to import_util. 2018-08-07 16:35:56 -07:00
Tim Abbott c6bbb9a8d4 docs: Improve cross-linking between export/import and backups.
Now that we have nice documentation for our export/import tools, we've
been seeing a lot of users trying to use that as their primary backup
process.  Let's correct this.
2018-08-07 14:50:38 -07:00
Shubham Dhama 44b18fcaba invite: Refactor update_subscription_checkboxes.
This is a preliminary commit for further changes.
In refactoring, logic for gettings streams is extracted.
2018-08-07 14:02:50 -07:00
Shubham Dhama 915960ee58 invite: Change "User join as" to dropdown. 2018-08-07 14:02:50 -07:00
Vishnu Ks 119d108da0 droplets: Update code and remove nvm settings from bashrc.
* Synced zulip repo to master and provisioned
* Synced python-zulip-api repo to master and provisioned.
* Removed unnecessary nvm config from bashrc
2018-08-07 13:38:18 -07:00
Yashashvi Dave 55325b71a4 stream settings: Display nothing-selected when active-stream is deleted.
Display nothing-selected in stream settings tab, if we get delete-stream
event of active-stream(which stream's settings tab is opened) in
frontend.
2018-08-07 13:30:53 -07:00
Yashashvi Dave 290388e5e0 stream settings: Fix bug in UI when last user unsubscribe private stream.
When last user(only in case of admin) unsubscribe from private stream,
stream page doesn't get updated. Cause we delete the private stream
as soon as last user unsubscribe from stream.
So `sub` get undefined in frontend, cause that stream is deleted
before unsubscribe-user-from-stream event is received.

Fix this by changing order of events sent to frontend. Event
`subscription: remove` should be sent before `stream: delete` event
from backend.
2018-08-07 13:30:53 -07:00
Yashashvi Dave ee8948c3e1 default stream: Limit private streams in default stream suggestions.
Admin users can't add private unsubscribed streams to the default
streams list.  Therefore, we shouldn't include private streams the
user is not subscribed to in the default stream suggestions.
2018-08-07 13:29:17 -07:00
Yashashvi Dave 6e136be975 default stream: Allows admins to remove any default stream.
This fixes a bug where administrators couldn't remove private
unsubscribed streams from the "default streams" list, because
access_stream_by_name didn't give them access to the stream object.
2018-08-07 13:28:30 -07:00
Rohitt Vashishtha c41c82aae0 settings_emoji: Use display_name in handlebars.
This commit fixes two issues with the previous implementation:

1. JavaScript's replace replaces only the first instance,
   thus we need to use a regex.
2. Handlebars was setting the id of the HTML elements with
   spaces in between which broke the delete button; now a
   new variable display_name is passed to the template.

This also makes changes to the casper tests to have an emoji
name with multiple spaces in it to ensure this bug doesn't
appear again.
2018-08-07 10:22:08 -07:00
Marco Burstein 9c1dd5cda5 compose: Deactivate the reply button when there are no messages.
When visiting a narrow like
https://chat.zulip.org/#narrow/stream/doesnotexist, grey-out the reply
button and add the title `There are no messages to reply to.`

Also, add to the tests for `narrow.js` with
`#left_bar_compose_reply_button_big`.

Fix #8547.
2018-08-07 10:19:45 -07:00
Marco Burstein 5a160c66b7 night-mode: Add styles for disabled buttons.
Also create the similar styles for the hovered state.
2018-08-07 10:19:44 -07:00
Yashashvi Dave 6a382f332e create stream: Fix announce_stream isn't disabled in create-private-stream.
Currently in create new stream form, announce_stream option isn't get
disabled for private stream with public history.
This commit fixes the above issue.
2018-08-07 10:15:22 -07:00
Aditya Bansal 5bfe24beef puppet-lint: Fix an error with defined type safepackage in base.pp.
We fix "ERROR: safepackage not in autoload module layout" error
which was caused by a defined type "safepackage" definitation
lying in the wrong place. We refactor to create the defined type
according to puppet guidelines. Link below:
https://docs.puppet.com/puppet/2.7/lang_defined_types.html
2018-08-07 10:03:40 -07:00
Aditya Bansal 710d4507de puppet-lint: Fix lines longer than 140 characters lint warnings.
We fix these by adding ignore statements in a bunch of files
where this error popped up. We target only specific lines using
the ignore statements and not the entire files.
2018-08-07 10:03:40 -07:00
Tim Abbott 4300683bca lint: Fix mypy error in check_pyflakes annotations.
Introduced in 78a93b8d9e.
2018-08-07 09:59:14 -07:00
Tim Abbott e67fa36803 lint: Update config to split files more evenly. 2018-08-07 09:42:37 -07:00