Commit Graph

4947 Commits

Author SHA1 Message Date
sahil839 e669818544 invites: Allow user to be invited as a moderator.
This commit adds both frontend and backend code to invite a user as
moderator. We allow only existing owners and admins to invite a user
as a moderator.
2021-04-30 15:57:09 -07:00
Nikhil Maske 04da50a7bb user docs: Move "Create a poll" section in Sending messages.
Fixes #18312.
2021-04-30 09:37:48 -07:00
Anders Kaseorg 871e73ab8f mypy: Don’t use Iterable for values iterated multiple times.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-29 16:06:17 -07:00
Tim Abbott fd52c1b114 help: Lightly advertise moderator users role. 2021-04-29 15:52:24 -07:00
Tim Abbott a95cb97ceb help: Add basic documentation for organization moderators.
We'll extend this in the future with details on what is configurable,
but this at least ensures we don't have a state where they don't
appear in our documentation at all.
2021-04-29 15:49:02 -07:00
sahil839 bd78b1ff90 events: Add 'is_moderator' field to the page_params object sent to clients. 2021-04-29 15:18:49 -07:00
sahil839 dc771f3a14 users: Add support for changing user role to moderator in api.
This commit adds backend support for changing a user role to
moderator and also to change role from moderator to any other
role.
2021-04-29 15:17:45 -07:00
sahil839 34f134d58d users: Add role field to user objects returned by format_user_row.
This commit modifies the user objects returned by 'GET /users',
'GET /users/me', 'GET /users/{user_id}' and 'GET /users/{email}'
endpoints to include role field.

We also include role field in the page_params['realm_users'] dict
and in the person object sent in (type="realm_user", op="add")
event.
2021-04-29 15:13:50 -07:00
m-e-l-u-h-a-n 65c400e06d api: Add zulip_version and zulip_feature_level in restart event.
This help mobile and terminal clients understand whether a server
restart changed API feature levels or not, which in turn determines
whether they will need to resynchronize their data.

Also add tests and documentation for this previously undocumented
event type.

Fixes: #18205.
2021-04-29 12:08:15 -07:00
Aman Agrawal 5bd37b44f2 zulip-icon: Add `zulip-icon` as classPrefix for icon.
This avoids general class names like `bot`.
2021-04-29 09:02:25 -07:00
Adam Birds 188273d8f5 integrations: Add JSON Printer webhook integration.
I have added the JSON Printer integration which will show any webhook
payload inside a code block which is useful for webhook testing.

Fixes #17969.
2021-04-28 07:23:18 -07:00
Aman Agrawal f47e93481e giphy: Set rating according to realm_giphy_rating.
We set rating of GIFs retrieved from GIPHY according to
realm_giphy_rating setting. Also, we allow user to set
a rating in organization settings.
2021-04-28 07:07:36 -07:00
Tim Abbott 5e55165f9f faq: Update details on sponsored organizations. 2021-04-27 22:44:36 -07:00
Tim Abbott 3ea01406f2 send_custom_email: Include unsubscribe options in emails. 2021-04-27 21:36:09 -07:00
Tim Abbott b3dd6e7c4c unsubscribe: Fix styling of unsubscribe page.
This was apparently one of our few portico pages that never got the
white-box migration.

I did a bit of copyediting while looking at this page as well.
2021-04-27 21:36:09 -07:00
Dinesh 27e4f5da92 typing: Support sending stream/topic typing status.
This extends the /json/typing endpoint to also accept
stream_id and topic. With this change, the requests
sent to /json/typing should have these:
* `to`: a list set to
    - recipients for a PM
    - stream_id for a stream message
* `topic`, in case of stream message
along with `op`(start or stop).

On receiving a request with stream_id and topic, we send
typing events to clients with stream_typing_notifications set
to True for all users subscribed to that stream.
2021-04-27 20:52:21 -07:00
Tim Abbott b50e261cac help: Document support for disabling notification sounds. 2021-04-27 16:47:13 -07:00
Nyior 8e2042d378 security: Add tooling to nag users if a Zulip server is very old.
This will help ensure that users upgrade their Zulip server.

Essentially rewritten by tabbott.

Fixes part of #17826.
2021-04-27 12:10:48 -07:00
Aman Agrawal 08f6214829 keyboard_shortcuts: Use same wording as in search input of RT. 2021-04-27 10:02:34 -07:00
sahil839 a84725de9b dev_login: Show 'shiva' in a separate Moderators section. 2021-04-26 17:14:06 -07:00
nikhilmaske-2001 32bde79b61
confirm_dialog: Use the Confirm and Cancel labels.
Long labels like "Yes, Unsubscribe this stream" can
be confusing for translators and it can also create bad
strings that can end with like 4 long words in German.
It is better to have the simple options like "Confirm"
and "Cancel". This commit fixes this issue by changing
the text to "Confirm".

Fixes #17926.
2021-04-26 16:36:21 -07:00
Anders Kaseorg 6060d0d364 docs: Add missing space to compound verbs “log in”, “set up”, etc.
Noun: backup, checkout, cleanup, login, logout, setup, shutdown, signup,
timeout.

Verb: back up, check out, clean up, log in, log out, set up, shut
down, sign up, time out.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
Anders Kaseorg e3f2ffa681 docs: Capitalize “Markdown” consistently.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
PIG208 4d3daa7ee0 portico: Add alert-box element to portico pages.
Fixes #17936 (the second time).
2021-04-26 09:28:04 -07:00
Tim Abbott 78c7d749d9 passwords: Set title/aria-label attributes dynamically.
This allows us to use different "Show password" and "Hide password"
for these labels, which is more consistent with how other products
implement this.

It also lets us delete N duplicate copies of these strings in the HTML.
2021-04-23 15:01:37 -07:00
Gaurav Pandey a9fcafc433 reset_confirm: Add show password feature to reset confirm page.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Gaurav Pandey 91c73025d2 register: Add show password feature to password fields.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Gaurav Pandey fa235e60ff login: Add show password feature to login page.
The show password feature is a functionality to
toggle the visibility of the password fields in forms
so that one can check if they have entered the correct
password or not. We implement this using an eye icon
toggling which converts input field type from password
to text and vice-versa.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Alex Vandiver ec12a6128a scripts: Add a start-server as well.
In general, `./scripts/restart-server` will already work in any
circumstance where the server is already stopped and needs to be
started.  However, it will output a couple minor warnings, and it is
not readily obvious that it *will* work correctly.

Add an alias for `restart-server` named `start-server`, for
parallelism with `stop-server`, which omits the steps of
`restart-server` which would stop the server first.
2021-04-21 10:24:08 -07:00
Alex Vandiver 476524c0c1 scripts: Add a script to stop the server.
Using `supervisorctl stop all` to stop the server is not terribly
discoverable, and may stop services which are not part of Zulip
proper.

Add an explicit tool which only stops the relevant services.  It also
more carefully controls the order in which services are stopped to
minimize lost requests, and maximally quiesce the server.

Locations which may be stopping _older_ versions of Zulip (without
this script) are left with using `supervisorctl stop all`.

Fixes #14959.
2021-04-21 10:24:08 -07:00
Abhijeet Prasad Bodas bbbaa109ec settings: Add UI page for managing muted users.
This page is temporarily hidden except in the development environment,
because the "muted users" feature is incomplete.
2021-04-21 10:17:44 -07:00
Abhijeet Prasad Bodas e56db79af4 mute user: Add dev-only UI to mute/unmute a user.
Since the "mute users" feature isn't complete yet,
this UI is shown only in development setups.
Ideally we should have had this commit after the whole
feature was completed and merged, but doing so makes it
difficult to test and merge subparts of the feature one by
one (which is a better workflow, while we still decide what
exactly we want this feature to do).

This commit adds a new button in the user info popover
to mute or unmute the user, and uses a confirmation
dialog while muting, because muting a user accidently can lead
to the muter losing out on a lot of information.

TODOs when making this UI visible in production-
1. Make a /help page and link to it from the confirmation
dialog and the API docs.
2021-04-21 10:14:27 -07:00
Mateusz Mandera 8d4ab69a46 docs: Move the /configure-missed-message-emails help page.
configure-message-notification-emails is the correct name now.
2021-04-21 10:10:54 -07:00
Mateusz Mandera 977a2f7fa0 emails: Rename "missed message email" to "message notification email". 2021-04-21 10:10:54 -07:00
Mateusz Mandera cc11575b21 emails: Rename "New missed messages" email subjects to "New messages". 2021-04-21 10:10:54 -07:00
Anders Kaseorg dd3fa4ac52 templates: Mark all void tags as self-closing.
This reverses the policy that was set, but incompletely enforced, by
commit 951514dd7d.  The self-closing tag
syntax is clearer, more consistent, simpler to parse, compatible with
XML, preferred by Prettier, and (most importantly now) required by
FormatJS.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-21 09:49:34 -07:00
Anders Kaseorg 7177529107 templates: Use HTML5 doctype for emails.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-21 09:49:34 -07:00
Tim Abbott 051d448bc0 invite modal: Fix sorting of roles.
Previously, we would show the guest role oddly between organization
administrator and organization owner.

We preserve the property that the Member role is the default.
2021-04-20 10:55:38 -07:00
akshatdalton 6509c4f8f4 linkifiers: Add an API to support the editing of linkifier.
This commit adds an API to `zproject/urls.py` to edit/update
the realm linkifier. Its helper function to update the
database is added in `zerver/lib/actions.py`.

`zulip.yaml` is documented accordingly as well, clearly
stating that this API updates one linkifier at a time.

The tests are added for the API and helper function which
updates the realm linkifier.

Fixes #10830.
2021-04-19 18:01:45 -07:00
Aman Agrawal 70d444a8eb compose: Move to `hbs` file and append it to DOM on init.
We move compose.html to compose.hbs file while keeping
`#compose` still in `home.html` as a hanger
where append rest of the elements.

This will provide us with two benefits:
* We could share common elements between message_edit_form and
compose.
* We can insert compose directly in any element. We may decide to
do it for recent topics.
2021-04-19 16:53:30 -07:00
Tim Abbott d531c4d6d4 help: Clarify guest users on public streams.
The previous language was unclear that we were talking about how the
features interacted, but the users.
2021-04-19 14:37:34 -07:00
Sumanth V Rao 0ecf5d0e83 settings_playground: Add UI to list all playgrounds.
Adds a setting UI to list all configured playgrounds
in a realm. The filter functionality can be used to
search playgrounds by its name or language.

Default sort is provided on the 'pygments_language'
field.

Front tests added to maintain server_event_dispatch
coverage. The `settings_playgrounds.js` file is added
to coverage exclusion list since it is majorly UI
based and will be tested using puppeteer tests (in
following commits).
2021-04-19 12:54:59 -07:00
Riken Shah c3601d7e3e lint: Ensure non-dev templates entrypoint name doesn't start with `dev`.
Only development-related templates entrypoint name
should start with `dev`.
2021-04-19 10:27:33 -07:00
Riken Shah 1d9417f9a1 refactor: Rename `dev_panel.html` for more clarity.
This commit renames `dev_panel.html` to `integrations_dev_panel.html`.
2021-04-19 10:25:05 -07:00
Riken Shah bd9e6ae97e refactor: Move dev-only templates to `templates/zerver/development`.
This a prep commit for adding a check to lint to ensure
only development-related templates entrypoint name
starts with `dev`.
2021-04-19 10:25:05 -07:00
aryanshridhar efc63ae7ce templates: Fix email input field within reset.html.
Earlier, the email label tag was dislocated with respect to
it's input field, causing the UI to be disorganized.

Rectified by moving the label tag above the email input field
and added placeholder value to the field.
2021-04-19 10:00:20 -07:00
sahil839 2dc99aa90f settings: Add new setting for controlling who can move msgs to stream.
This commit adds a new setting 'move_messages_between_streams_policy`
for controlling who can move messages from one stream to other.
2021-04-16 15:10:39 -07:00
Vishnu KS ab771e4b19 support: Show the first human user in realm search result. 2021-04-16 13:22:02 -07:00
Vishnu KS 8139896e3d support: Show realm owners in realm search results. 2021-04-16 13:18:46 -07:00
Vishnu KS b2f6acc33f support: Remove duplicate query for admin emails in template. 2021-04-16 13:18:46 -07:00
Vishnu KS 97765798d7 support: Rename realm_admin_emails to get_realm_admin_emails_as_string. 2021-04-16 13:18:46 -07:00
Anders Kaseorg e7ed907cf6 python: Convert deprecated Django ugettext alias to gettext.
django.utils.translation.ugettext is a deprecated alias of
django.utils.translation.gettext as of Django 3.0, and will be removed
in Django 4.0.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-15 18:01:34 -07:00
Adam Birds 545cd961f4 integrations: Add docs for GitHub Actions integration.
I have added a documentation page for the GitHub Actions integration to
`/integrations/doc/github-actions` with a link to the Zulip GitHub
Actions repository.

Tweaked by tabbott to add cross-links with the main GitHub integration.
2021-04-15 16:42:31 -07:00
Tim Abbott 208721b3d7 left sidebar: Fix misleading "search streams" label.
This widget only filters the user's subscription -- it's only suggest
public streams that the user is not subscribed to.  "Filter" is the
correct label for a widget with this use case.
2021-04-15 15:36:05 -07:00
Tim Abbott 007a5bb95e devtools: Delete unnecessary user creation links.
These have a better UI on the main login page, and also don't work due
to the wrong HTTP method.
2021-04-14 15:28:00 -07:00
Aman Agrawal 84afc67369 top_left_corner: Directly use `span.unread_count` to display unreads.
In an effort to use a common class to display unread counts across
the app, we simplify the elements used to show unreads and use a
single `span` with `unread_count` class to do so.
2021-04-14 10:57:16 -07:00
Aman Agrawal 802c450b3f realm: Add setting to configure GIPHY rating.
Organization admins can use this setting to restrict the maximum
rating of GIFs that will be retrieved from GIPHY. Also, there
is option to disable GIPHY too.
2021-04-14 10:29:39 -07:00
Tim Abbott c30a4c5466 settings: Standardize on "video call provider" (not "video chat").
We had a mix of the two names, and "video call provider" both feels
more professional and more clear about precisely what it does.

We don't change the API fields, since it doesn't seem worth an API
migration.
2021-04-14 08:48:21 -07:00
m-e-l-u-h-a-n e1c5bcd56f docs(user): Remove redundant docs in /help/start-a-call.
Documentation about using and configuring different video
call providers was present at /help/start-a-call. This
documentation was later moved to /integrations as asked in
issue #17588. So to avoid redundancy most of the documentation
in /help/start-a-call is removed, by providing appropriate
links, pointing to where new documentation lives.

Fixes: #17588.
2021-04-14 08:44:00 -07:00
m-e-l-u-h-a-n dd308528c2 docs(integrations): Document zoom video provider in /integrations.
Moves documentation about using zoom as video call provider
to /integrations. This documentation was earlier present
at /help/start-a-call and is moved as asked in issue #17588.
2021-04-14 08:44:00 -07:00
m-e-l-u-h-a-n 4077673da7 docs(integrations): Add Big Blue Button video provider on /integrations.
Moves documentation about using Big Blue Button as video call
provider to /integrations. This documentation was earlier
present at /help/start-a-call and is moved as asked in issue #17588.
2021-04-14 08:44:00 -07:00
m-e-l-u-h-a-n 13e43917db docs(integrations): Document jitsi video provider in /integrations.
Moves documentation about using jitsi as video call provider
to /integrations. This documentation was earlier present
at /help/start-a-call and is moved as asked in issue #17588.
2021-04-14 08:44:00 -07:00
m-e-l-u-h-a-n 32b4655394 docs(integrations): Add steps for setting up a video chat provider.
This is a preparatory commit that documents
steps for setting a video chat provider for an
organization. It is added as a separate section
in /help/start-a-call. Permalinks to this section
are utilized in succeeding commits which move
documentation of our video call providers to
`/integrations`, as asked in issue #17588.

Tweaked by tabbott for clearer/more consist language.
2021-04-14 08:44:00 -07:00
Siddharth Asthana 7c485c1302 integrations page: Add "Create your own" button.
This commit adds a "Create your own" button on the integrations page. It
redirects to "api/integrations-overview" page and is placed by the side
of "Request an Integration" button.

Fixes #7935
2021-04-13 21:03:48 -07:00
majordwarf 4b3290566b docs: Document integration request process.
There was no proper documentation to guide user to request an integration.
The following changes documents the whole process and links it from the
`/integrations/` page making it visible to the end-user.

Fixes #7935
2021-04-13 20:48:34 -07:00
Abhijeet Prasad Bodas 3947b0c80a linkifiers: Update API to send data using dictionaries.
* This introduces a new event type `realm_linkifiers` and
a new key for the initial data fetch of the same name.
Newer clients will be expected to use these.

* Backwards compatibility is ensured by changing neither
the current event nor the /register key. The data which
these hold is the same as before, but internally, it is
generated by processing the `realm_linkifiers` data.
We send both the old and the new event types to clients
whenever the linkifiers are changed.
Older clients will simply ignore the new event type, and
vice versa.

* The `realm/filters:GET` endpoint (which returns tuples)
is currently used by none of the official Zulip clients.
This commit replaces it with `realm/linkifiers:GET` which
returns data in the new dictionary format.
TODO: Update the `get_realm_filters` method in the API
bindings, to hit this new URL instead of the old one.

* This also updates the webapp frontend to use the newer
events and keys.
2021-04-13 12:16:07 -07:00
Abhijeet Prasad Bodas e1acfb9e9a mute user: Fix incomplete API error responses in docs.
The possible errors had already been documented in
`zulip.yaml` in 3bfcaa3968.
I had missed adding some of them to the markdown files
in the API docs. This commit fixes that.
2021-04-13 09:08:47 -07:00
Zeeshan Equbal 2da4443cc5
api: Add max_message_length field to API data.
Commit 4a3ad0d introduced some extra stream-level parameters
to the `realm` object. This commit extends that to add a
max_message_length paramter too in the same server_level.
2021-04-12 16:03:31 -07:00
Tim Abbott 4a3ad0da06 api: Improve encoding of stream/topic max field lengths.
Previously, you had to request the `stream` event type in order to get
the stream-level parameters; this was a bad design in part because the
`subscription` event type has similar data and is preferred by most
clients.

So we move these to the `realm` object.  We also add the maximum topic
length, as an adjacent parameter.

While changing this, we also fix these to better match the names of
similar API parameters.
2021-04-10 10:07:57 -07:00
Tim Abbott cdbcb43706 api: Fix encoding of strings in realm endpoint.
* Don't require strings to be unnecessarily JSON-encoded.
* Use check_capped_string rather than custom code for length checks.
* Update frontend to pass the right parameters.

With a much simplified populate_data_for_request design suggested by
Anders; we only support a handful of data types, all of which are
correctly encoded automatically by jQuery.

Fixes part of #18035.
2021-04-09 16:27:30 -07:00
Prakhar Gupta a220a7105e
left sidebar: Change label for exiting topic zoom to Back to Streams.
All streams in left-side bar cause discrepancy
as it is unable to express if it is heading for
the current column as "Streams" is in previous
column or is it text description for the back icon.
Renaming "All streams" to "Back to streams" removes
discrepancy.
2021-04-09 09:57:35 -07:00
Tim Abbott 681d2a08a1 help: Remove nbsp formatting from stream-permissions.
This doesn't look good, but it does look better and deletes code.
2021-04-09 08:52:50 -07:00
Tim Abbott b28b200f50 help: Clarify documentation on guest users and streams.
This tries to make it more immediately clear facts like that guests
cannot see public streams.
2021-04-09 08:52:40 -07:00
Tim Abbott 42b1f4e5f5 portico: Fix visual double-quote in FHIR quote.
The <blockquote> area adds its own set of quotation marks.
2021-04-08 23:26:44 -07:00
Tim Abbott a96d497fff analytics: Fix placement of envelope icons.
We neglected to update this bit of logic when migrating to have the
totals at the top of the page.
2021-04-08 17:47:34 -07:00
Tim Abbott 6b1ca15ba7 activity: Use realm owners, not realm administrators.
The analytics system was not properly updated when we replaced realm
owners with realm administrators.
2021-04-08 17:47:23 -07:00
Aman Agrawal d4fa938a23 giphy: Convert `compose_giphy_logo` from id to class.
Since there are multiple `compose_giphy_logo` elements, we should
use it as a class as per HTML spec.
2021-04-08 10:03:51 -07:00
Aman Agrawal e9a9eb9a43 stream_header: Use consistent tooltip text. 2021-04-07 17:11:23 -07:00
Aman Agrawal 52eeb7bc68 streams_nav: Use tippy for tooltip.
Tippyjs automatically places it to right, placement can change to
bottom if there is no space available to right.
2021-04-07 17:11:23 -07:00
Aman Agrawal 910ceebfc1 user_list_title: Use consistent tooltip text for user search.
Make the text for tooltip on search icon and header same.
2021-04-07 17:11:23 -07:00
Aman Agrawal e0c9c92cf1 userlist_search: Use tippyjs for showing tooltips.
Placement is set to `auto` which is based on space available.
Hence, it varies based on browser width and the current narrow.
2021-04-07 17:11:23 -07:00
Aman Agrawal 2e2ff568ba stats: Show tooltips using tippyjs.
We don't want to import tippyjs module here
along with its dependencies, so we just copied
over tippyjs defaults here. They should be
work fine for /stats page even if we decide to change
defaults for the app in tippyjs and forget to do
it here.
2021-04-07 17:11:23 -07:00
m-e-l-u-h-a-n 079f016a35 api docs: Document display settings endpoint.
With substantial changes by tabbott to fix bugs, clarify the
documentation, and add links.

Fixes #16048.
2021-04-07 12:10:25 -07:00
sahil839 86f7b6af60 events: Pass can_invite_others_to_realm to client using page_params.
This commit adds backend code for passing can_invite_others_to_realm
field to clients using the fetch_initial_state_data in the page_params
object.

Though this field is not used by webapp as of now, but will be used
to fix a bug of incorreclty showing the invite users option in
settings overlay in the next commit.
2021-04-07 09:05:16 -07:00
sahil839 4c8339fa8c settings: Replace invite_by_admins_policy with invite_to_realm_policy.
This commit replaces invite_by_admins_policy, which was a bool field,
with a new enum field invite_by_realm_policy.

Though the final goal is to add moderators and full members option
using COMMON_POLICY_TYPES, but this will be done in a separate
commit to make this easy for review.
2021-04-07 09:02:33 -07:00
Aman Agrawal d4248cf060 keyboard-icon: Use tippyjs for tooltip.
Tippyjs automatically places it to left.
2021-04-07 01:24:52 -07:00
Alya Abbott 4309760e8d portico: Update number of contributors listed on the website. 2021-04-06 21:06:38 -07:00
Sumanth V Rao 1ac8fe7538 events/tests/api: Send realm_playground events to clients.
We send the whole data set as a part of the event rather than
doing an add/remove operation for couple of reasons:
    * This would make the client logic simpler.
    * The playground data is small enough for us to not worry
      about performance.

Tweaked both `fetch_initial_state_data` and `apply_events` to
handle the new playground event.

Tests added to validate the event matches the expected schema.

Documented realm_playgrounds sections inside /events and
/register to support our openapi validation system in test_events.

Tweaked other tests like test_event_system.py and test_home.py
to account for the new event being generated.

Lastly, documented the changes to the API endpoints in
api/changelog.md and bumped API_FEATURE_LEVEL.

Tweaked by tabbott to add an `id` field in RealmPlayground objects
sent to clients, which is essential to sending the API request to
remove one.
2021-04-06 20:56:58 -07:00
Sumanth V Rao d2e5b62dce realm/playground: Add API endpoint for deleting a playground entry.
Similar to the previous commit, we have added a `do_*` function
which does the deletion from the DB. The next commit handles sending
the events when both adding and deleting a playground entry.

Added the openAPI format data to zulip.yaml for DELETE
/realm/playgrounds/{playground_id}. Also added python and curl
examples to remove-playground.md.

Tests added.
2021-04-07 08:20:53 +05:30
Sumanth V Rao 251b415987 realm/playground: Add API endpoint for creating playground entry.
This endpoint will allow clients to create a playground entry
containing the name, pygments language and url_prefix for the
playground of their choice.

Introduced the `do_*` function in-charge of creating the entry in
the model. Handling the process of sending events which will be
done in a follow up commit.

Added the openAPI format data to zulip.yaml for POST
/realm/playgrounds. Also added python and curl examples for using
the endpoint in its markdown documented (add-playground.md).

Tests added.
2021-04-07 08:20:53 +05:30
Abhijeet Prasad Bodas 3bfcaa3968 mute user: Add backend infrastructure code.
Adds backend code for the mute users feature.
This is just infrastructure work (database
interactions, helpers, tests, events, API docs
etc) and does not involve any behavioral/semantic
aspects of muted users.

Adds POST and DELETE endpoints, to keep the
URL scheme mostly consistent in terms of `users/me`.

TODOs:
1. Add tests for exporting `zulip_muteduser` database table.
2. Add dedicated methods to python-zulip-api to be used
   in place of the current `client.call_endpoint` implementation.
2021-04-06 18:44:08 -07:00
Anders Kaseorg 738532ba51 requirements: Remove django-webpack-loader.
It does not seem like an official version supporting Webpack 4 (to say
nothing of 5) will be released any time soon, and we can reimplement
it in very little code.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-06 09:31:35 -07:00
LoopThrough-i-j bdcbd53db7 docs: Allow passing additional params to `call_on_each_event`.
`call_on_each_event` now supports additional params other than
`event_type` and `narrow`; Ex: `all_public_streams` to fetch events
of all public streams.

Also add a bit of explanation of how this parameter works.

Fixes zulip/python-zulip-api#647
2021-04-06 08:40:32 -07:00
Sushanth Reddy Manda ddbb0a5fbc help: Mention only owners can create reusable invite links.
Fixes #16951.
2021-04-05 17:44:15 -07:00
Aman Agrawal 5e83965e80 giphy: Use GIPHY web SDK to allow inserting GIFs in compose box.
We use GIPHY web SDK to create popover containing GIFs in a
grid format. Simply clicking on the GIFs will insert the GIF in the compose
box.

We add GIPHY logo to compose box action icons which opens the GIPHY
picker popover containing GIFs with "Powered by GIPHY"
attribution.
2021-04-05 15:04:49 -07:00
Vishnu KS 9d96847d43 faq: Add instruction for requesting sponsorship when free trial is disabled.
The request sponsorship form(/upgrade page) is shown after the organization
creation only when the free trial is enabled.
2021-04-05 12:29:13 -07:00
Siddharth Asthana e7f24ac8d4 docs: Improve documentation for changing a realm's subdomain.
The current documentation doesn't clearly explain the process of
changing the organization's subdomain.
This commit adds instructions for user to get the string_id of their
organization and then lists the commands to be executed in the
management shell to change the subdomain.

Part of #17857.
2021-04-05 08:43:34 -07:00
rht 4f38da5ce7 docs: Add info on zulip-archive on for/working-groups-and-communities. 2021-04-03 08:05:02 -07:00
Tim Abbott f745efdde0 help: Link quote-and-reply and permalink articles.
This to a partial rewrite of the quote-and-reply article to explain
the current details for how it works (the permanent link is relatively
new).
2021-04-03 07:51:29 -07:00
Tim Abbott c01c947f5b help: Clean up documentation around permanent links. 2021-04-03 07:51:10 -07:00
Mateusz Mandera 1e367f9509 docs: Mention plans to add stream unarchiving. 2021-04-02 22:08:23 -07:00
Mateusz Mandera 82b43a8cfe streams: Use "archive stream" phrasing instead of "delete stream".
The previous phrasing was misleading in relation to what the action
actually does.
2021-04-02 22:06:48 -07:00
Zeeshan 811eff1a03 api-docs: Fix table in update_message_flags to use proper html.
The Available flags table in update_message_flags.md was using
markdown for certain content inside HTML, which resulted in the
table not being rendered properly.
This commit fixes the table to use proper HTML for content rendering
instead of markdown, since the table was written in markdown's HTML
syntax.
2021-04-01 15:26:25 -07:00
Anders Kaseorg 0868641ea4 Revert "static: Make alert-box available for portico pages."
This reverts commit a00f5dd90e (#17801).

That commit introduced a regression in the portico pages as described
in commit 85b3157b47.  Since that fix
introduced a regression of its own, we need to revert both commits for
now.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-01 15:25:23 -07:00
m-e-l-u-h-a-n aea31eb31f api: Add REALM_DEACTIVATED error code.
In `validate_account_and_subdomain` we check
if user's realm is not deactivated. In case
of failure of this check, we raise our standard
JsonableError. While this works well in most
cases but it creates difficulties in handling
of users with deactivated realms for non-browser
clients.

So we register a new REALM_DEACTIVATED error
code so that clients can distinguish if error
is because of deactivated account. Following
these changes `validate_account_and_subdomain`
raises RealmDeactivatedError if user's realm
is deactivated.

This error is also documented in
`/api/rest-error-handling`.

Testing: I have mostly relied on automated
backend tests to test this.

Fixes #17763.
2021-03-31 08:46:13 -07:00
m-e-l-u-h-a-n 2eeb82edba api: Add USER_DEACTIVATED error code.
In validate_account_and_subdomain we check if
user's account is not deactivated. In case of
failure of this check we raise our standard
JsonableError. While this works well in most
cases but it creates difficulties in handling
of deactivated accounts for non-browser clients.

So we register a new USER_DEACTIVATED error
code so that clients can distinguish if error
is because of deactivated account. Following
these changes `validate_account_and_subdomain`
raises UserDeactivatedError if user's account
is deactivated.

This error is also documented in
`/api/rest-error-handling`.

Testing: I have mostly relied on automated
backend tests to test this.

Partially addresses issue #17763.
2021-03-31 08:46:13 -07:00
Sumanth V Rao e12f682e2e markdown: Include text & url in `topic_links` parameter of our API.
The linkifier code now includes both the shortened text and the expanded
URL, sorted by the order of the occurrence in a topic. This list is passed
back in the `topic_links` parameter of the /messages and the /events APIs.

topic_links earlier vs now:

earlier: ['https://www.google.com', 'https://github.com/zulip/zulip/32']

now: [{'url': 'https://www.google.com', 'text': 'https://www.google/com},
      {'url': 'https://github.com/zulip/zulip/32', 'text': '#32'}]

Similarly, the topic_links local echo logic in the frontend now returns
back an object.

Fixes: #17109.
2021-03-30 15:53:07 -07:00
Megamind 27d1f5e0e3
frontend: Use fa-user-plus as invitation icon in gear menu. 2021-03-29 13:31:38 -07:00
Mateusz Mandera c70f926dc1 docs: Clarify situation with custom domains on Zulip Cloud.
We can support it, and it's not that hard, but it does require ongoing
work to manage/maintain SSL certificates.
2021-03-29 09:00:39 -07:00
Vishnu KS 8737634347 navbar: Include opening and closing braces in translation tags.
This fixes the bug introduced in the following commits.

161342a298
3165ffa8e2
2021-03-26 16:28:45 -07:00
shanukun bc2d58ad4a custom_profile_fields: Remove op field for the event.
* `op` (operation) field, added in f6fb88549f, was never intended for
`custom_profile_fields` event. This commit removes the `op` as it doesn't
have any use in the code.

* As a part of cleanup, this also eliminates the schema check warnings
for `custom_profile_fields` event, mentioned in #17568.
2021-03-26 16:28:33 -07:00
PIG208 a00f5dd90e static: Make alert-box available for portico pages. 2021-03-26 09:41:08 -07:00
Tim Abbott 459bf379c2 dev_panel: Use correct content helper for portico pages.
In 1a12e112d9, this page was converted
to use portico styling, but we intentionally left this page not using
the portico_content class since we didn't want the header/footer.

We still don't want the header/footer clutter, so instead, we achieve
that same goal using the isolated_page flag.
2021-03-26 09:40:40 -07:00
Mateusz Mandera f18d7fa7ed docs: Remove "beta" mark from message-retention-policy.md.
The retention policy has been sufficiently well tested at this point to
consider it stable.
2021-03-25 12:43:54 -07:00
Adam Birds 3acdbd277a integrations: Update Capistrano Documentation.
I have updated the capistrano docs so that the indentations are all
correct and align with the numbers correctly.

This one, if wanting to pout backticks round the code whilst indented,
doesn't render properly. Has to be double indented.

Fixes #17633.
2021-03-25 01:40:38 -07:00
Adam Birds 503e129af4 integrations: Update Twitter Documentation.
I have updated the docs for the twitter plugin to include number to
increase ease of readability.

Fixes part of #17633.
2021-03-25 01:40:38 -07:00
Adam Birds 22cbcadeb1 integrations: Update Trac Documentation.
I have updated the docs for the Trac integration to include numbers for
ease of readability.

Fixes part of #17633.
2021-03-25 01:40:38 -07:00
Adam Birds e723e9abe7 integrations: Update Puppet Documentation.
I have updated the Puppet docs to include numbers for increase of
readability and have removed a thank you message from the bottom to
bring in line with the rest of the docs.

Fixes part of #17633.
2021-03-25 01:40:38 -07:00
Adam Birds ff1b344179 integrations: Update Phabricator Documentation.
I have updated the docs for the Phabricator integration to include
numbers to match the style of the rest of integrations docs.

Fixes part of #17633.
2021-03-25 01:40:38 -07:00
Adam Birds 3a91f5baf6 integrations: Update Openshift Documentation.
I have updated the Openshift docs to include numbers to increase its
readability.

Fixes part of #17633.
2021-03-25 01:40:38 -07:00
Adam Birds 132bae3850 integrations: Update Email Documentation.
I have updated the documentation for the email integration to include
numbers to match the rest of the integrations.

Fixes part of #17633.
2021-03-25 01:40:38 -07:00
Adam Birds 1128453e50 integrations: Update Nagios Documentation.
I have updated the Nagios documentation to include numbers to increase
ease of readability.

Fixes part of #17633.
2021-03-25 01:35:57 -07:00
Suyash Vardhan Mathur d3a3c6898c api docs: Add documentation of deactivate-own-user endpoint.
Currently, there was no markdown page for deactivate-own-user API
endpoint. Created deactivate-own-user.md for the API page and
created a new owner client in test-api to reactivate the client
deactivated during testing.

Also changed endpoint name from deactivate-my-account to
deactivate-own-user, for better consistency with other endpoints.

Fixes #16163.
2021-03-25 01:05:44 -07:00
m-e-l-u-h-a-n 2699048208 markdown: Extend user mention syntax to support user_id for mentioning.
Extend our markdown system to support mentioning of users
by id also. Following these changes, it would be possible
to mention users with @**|user_id** and silently mention
using @_**|user_id**.

Main intention for extending the mention syntax is to make
it convenient for bots to mention a users using their ids. It
is to be noted that previous syntax are also supported.

Documentation tweaked by tabbott for better readability.

The changes were tested manually in development server, and also
by adding some new backend and frontend tests.

Fixes: #17487.
2021-03-25 00:44:56 -07:00
smit_patel 5ddb5fc534 popovers: Change "Delete all messages in topic" to "Delete topic".
This cleans up the copy a bit to be more readable.

Documentation changes cleaned up by tabbott.

Fixes #16856.
2021-03-23 15:46:00 -07:00
Anders Kaseorg d22a61443e notifications: Remove in_browser_notify and bootstrap-notify.
Follow up to #14768.  This feature was already non-functional due to
.alert-display { display: none; }, and if we want to reimplement it,
we should do it using a modern library.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-22 23:40:38 -07:00
Anders Kaseorg aff8a32bc1 notifications: Simplify sound playing.
Remove the unused notifications-area wrapper.  Remove the feature
detection code as all browsers recognize the <audio> element.  Create
the <audio> statically with the page template.  Use multiple <source>s
to let the browser detect the appropriate format instead of trying to
do its job for it.  Remove the absurd loop="yes" attribute, which had
fortunately been specified on the wrong element.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-22 23:36:38 -07:00
Gaurav Pandey dea5245590 right-sidebar: Fix design bugs with keyboard-shortcuts.
The keyboard-shortcuts icon currently has a fix position
causing design related bugs such as overlapping with userlist
in the sidebar.

The fix wraps the invite-more-users link and keyboard icon inside
a div with display property as flex instead of just using the anchor
tags inside the side-bar items.
2021-03-22 19:29:46 -07:00
Vishnu KS a404711740 support: Show the actual user email in /support. 2021-03-22 18:10:03 -07:00
Vishnu KS 38e7903425 support: Show role of the user in search result. 2021-03-22 18:10:03 -07:00
Tim Abbott f121e40848 message: Record whether unread_msgs data is truncated.
This is preparatory work for investigating reports of missing unread
messages.

It's a little surprising that not test failed after adding the code
without API documentation.

Co-Author-By: Tushar Upadhyay (tushar912).
2021-03-21 19:48:13 -07:00
Megamind ec43f5418d
right sidebar: Improve icon for "Invite more users".
This replaces the `+` with a version that has a user head next to it.
2021-03-17 17:33:25 -07:00
Tim Abbott a14cd23bdb integration docs: Fix organization of Google calendar doc. 2021-03-16 15:35:15 -07:00
Adam Birds bd79428a19 integrations: Update SVN Documentation.
I have updated the docs for the SVN integration to properly indent the
code block etc as well as using 1. for the numbers rather than 1. 2. and
so on.

Fixes part of #17633.
2021-03-16 15:29:47 -07:00
Adam Birds d74f608147 integrations: Update RSS Documentation.
I have updated the docs for the RSS integration to include numbers to
increase its readability.

Fixes part of #17633.
2021-03-16 15:29:47 -07:00
Adam Birds eca9cfd7d7 integrations: Update Perforce Documentation.
I have updated the docs for the Perforce integration to include numbers
to increase readability.

Fixes part of #17633.
2021-03-16 15:29:47 -07:00
Adam Birds 26916bdf85 integrations: Update Jenkins Documentation.
I have updated the docs for the Jenkins integration to include number
for ease of read as well as switching over to the new
{create-a-bot-indenmted.md} template to allow the continuation of
numbers.

Fixes part of #17633.
2021-03-16 15:29:47 -07:00
Adam Birds eaf0212f6a integrations: Update Google Calendar Docs.
I have updated the docs for the Google Celndar integration to include
numbers to increase its readbility.

Fixes part of #17633.
2021-03-16 15:29:47 -07:00
Adam Birds c14dd92c2c integrations: Update Discourse Documentation.
I have updated the docs for the Discourse integration to include numbers
for better readability.

Fixes part of #17633.
2021-03-16 15:29:47 -07:00
Adam Birds d03f75fd79 integrations: Update Docs for Hubot integrations.
I have updated the documentation for all the integrations that use Hubot
to include numbers for ease of readability.

Fixes part of #17633.
2021-03-16 15:29:47 -07:00
Adam Birds 8f4983a093 integrations: Update Asana Documentation.
I have updated the documentatsion for the Asana integration to include
numbered steps to increase its readability.

Fixes part of #17633.
2021-03-16 15:29:47 -07:00
Vishnu KS cda64b6204 navbar: Tag organization profile update message properly for translation. 2021-03-16 15:15:09 -07:00
Vishnu KS c463ccc4e4 navbar: Tag desktop app security alert message properly for translation. 2021-03-16 15:15:09 -07:00
Vishnu KS 1c6f223d06 navbar: Tag unread alert message properly for translation. 2021-03-16 15:15:09 -07:00
Gaurav Pandey 7ddf6435a9 left-sidebar: Remove add-streams option out of scrollbar.
This commit removes the option to add more streams out of scrollbar
as it is not visible on mobile devices or organizations with large number of
streams until scrolled down.
2021-03-16 14:10:04 -07:00
Nikhil Maske 236393d5cf left_sidebar: Place the title at private_messages_header div.
The title in li.top_left_private_messages applies the title
to private-container too. This causes to show "Private message"
title to private message elements. To fix this, the title is
placed at div.private_messages_header.
2021-03-15 12:04:22 -07:00
Abhijeet Prasad Bodas 9223dced3b refactor: Rename filter to linkifier in frontend code and docs.
This only leaves `page_params.realm_filters`, which
will be changed in further commits along with the
API change.
2021-03-15 11:19:59 -07:00
m-e-l-u-h-a-n d95fc244d3 documentation(api): Fix typo in construct narrow documentation. 2021-03-14 22:05:31 -07:00
Megamind 238c2ff4fb
Rename "Add streams" to "Subscribe to more streams" in left-sidebar.
The "Add streams" button text made users think this was what you needed to create
additional streams in the organization.  While that's correct for the first user/organization 
administrator, it's not correct for most other users.
2021-03-14 18:09:37 -07:00
Vishnu KS f6b97f20e3 sponsorships: Don't translate the subject of support emails.
The email subject used to be translated to the language of
the user who requested the sponsorship. This was a bug since
the recipient of the emails are Zulip's support staff and
not the user who requested the sponsorship.
2021-03-12 13:30:46 -08:00
Anders Kaseorg 3e552268e5 templates: Delete unused markdown_help.html.
Apparently I failed to finish deleting it in commit
7f30e5f9df (#17560).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-11 21:45:48 -08:00
Anders Kaseorg 7f30e5f9df info_overlay: Render Markdown help with frontend Markdown library.
Fixes #15375.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-11 21:24:39 -08:00
Tushar912 55de66f944 api: Support user_id in get_user_presence_endpoint.
This is part of our general process of replacing emails, which are not
static with time, with user_ids when referring to users in the API.

We still keep the `email` reference option, since it can be useful for
linking third-party applications to Zulip on an intranet that might
have a user's corporate email handy and not want to do the extra round
trip to lookup the user.

The name of the parameter, user_id_or_email, was chosen to to make it
clear that the default/preferred option is user_id.

Fixes #14304.
2021-03-11 20:14:04 -08:00
Aman Agrawal e587c029f6 display_settings: Allow user to set default_view.
TextField is used to allow users to set long stream + topic narrow
names in the urls.

We currently restrict users to only set "all_messages" and
"recent_topics" as narrows.

This commit achieves 3 things:
* Removes recent topics as the default view which loads when
  hash is empty.
* Loads default_view when hash is empty.
* Loads default_view on pressing escape key when it is unhandled by
  other present UI elements.

NOTE: After this commit loading zulip with an empty hash will
automatically set hash to default_view.  Ideally, we'd just display
the default view without a hash, but that involves extra complexity.

One exception is when user is trying to load an overlay directly,
i.e. zulip is loaded with an overlay hash. In this case,
we render recent topics is background irrespective of default_view.

We consider this last detail to be a bug not important enough to block
adding this setting.
2021-03-11 18:09:08 -08:00
sahil839 9a432b0c3b events: Remove name field from update subscription events.
This commit removes name field from update subscription
events, as it is not used by any of the clients, and use
stream_id in the events code instead.
2021-03-07 22:03:24 -08:00
sahil839 b53c773987 events: Remove email field from update subscription events.
This commit removes email field from update subscription
events, as email field is of no use in this case.
2021-03-01 14:52:06 -08:00
Aman Agrawal 612f100e51 help: Improve documentation about Recent topics. 2021-02-25 17:32:31 -08:00
Aman Agrawal a210ee2b7d recent_topics: Don't revive focus when user is trying to type. 2021-02-25 17:31:33 -08:00
smit_patel 24ad553dc1 left_sidebar: Add tooltip for recent topics shortcut key. 2021-02-25 17:31:33 -08:00
Aman Agrawal b84bce2bc7 all_messages: Change default icon from home to align-left.
Since All messages narrow is no longer home page for webapp,
we change its icon to align-left which also shows a concept of
interleaved topics / messages.
2021-02-25 17:31:32 -08:00
Aman Agrawal 760e4fc1e7 recent_topics: Focus on search box on `t` keypress. 2021-02-25 17:31:32 -08:00
Aman Agrawal 39d123e355 recent_topics: Make it the default view.
Go to Recent Topics on "#", no hash and "#recent_topics".
Go to Recent Topics as the last destination for escape key.
Map `a` key to All messages and change its hash to
`#all_messages`.
2021-02-25 17:31:32 -08:00
Aman Agrawal 1eafb1d8b3 recent_topics: Move from overlay to a narrow-like view.
Recent Topics is no longer an overlay now, but note that it is
also not a typical messages narrow. It can reside between
an overlay and a Filter in the sense that it is dispalyed as
a typical Filter narrow but has properties of an Overlay.

Compose box is not visible in this view as it will be confusing
to many users and hence compose shortcuts have also been disabled.

Keyboard shortcuts that apply on messages have also been disabled.

The remaining shortcuts that apply to a narrow are still accessible
here.
2021-02-25 17:31:32 -08:00
Alex Vandiver e53be6d043 email: Set an envelope-from which may be different from the From: field.
The envelope-from is used by the MTA if the destination address is not
deliverable.  Route all such mail to the noreply address.
2021-02-24 17:32:28 -08:00
Suyash Vardhan Mathur f1eda37836 api docs: Fix documentation of update-subscription-settings.
The description of request parameter of update-subscription-settings was
wrongly pasted in yaml and wasn't completely removed from the md file.
Made appropriate fixes in yaml and md file.
2021-02-24 13:28:58 -08:00
Anders Kaseorg 378295351d desktop-app-install-guide: Update for APT repository move.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-17 10:24:04 -08:00
Aman Agrawal 009f88210a left_sidebar: Show title when mouse hover anywhere on the button.
Instead of showing title text when user hovers over the text in
the button, show title when user hovers anywhere on the button.
2021-02-16 17:00:20 -08:00
Tim Abbott 7323163149 confirmation: Adjust language for link_expired template.
This both is better copy and also cleared for translators, who in
languages with gendered nouns don't need to guess what gender to use
for "one" without context.
2021-02-16 07:42:13 -08:00
Tim Abbott 158752ca9b docs: Update contributor and developer documentation counts. 2021-02-15 17:45:34 -08:00
Tushar912 dfafdda9b3 api: Add REST API endpoint for looking up a user by email address.
Add new rest api endpoint GET users/{email} for looking up a user by
email, which is useful especially for corporate API applications that
might already have a user's email address.

Fixes #14302.
2021-02-15 17:38:33 -08:00
Signior-X 05140a6e20 docs: Replace A icon with help in format using markdown.
In the format-your-message-using-markdown, in the in-help
help section, the A icon is replace by help button. This
updates the docs.
2021-02-08 17:29:03 -08:00
Suyash Vardhan Mathur 63c13a8f13 api docs: Fix documentation of update-subscription-settings.
The responses for the API weren't being rendered from yaml, and were
incorrectly formatted in yaml. The parameters also weren't completely
included in yaml and needed to be moved. Made appropriate fixes in
yaml and markdown file.
2021-02-05 10:41:42 -08:00
Vishnu KS 6a9e534a22 help: Clarify the number of invites one can send.
The 100 invite per day restriction is only for the free plan. Also,
the value 100 is configurable using
settings.INVITES_DEFAULT_REALM_DAILY_MAX. On top of this, newly
created realms on free plan combined can only send
INVITES_NEW_REALM_LIMIT_DAYS number of invites. So it's better not
to hardcode 100 in the doc.
2021-02-04 21:08:06 -05:00
Aman Agrawal b26727ed16 invite-new-users: Specify that the limit spans for the whole day. 2021-01-29 09:51:11 -08:00
Aman Agrawal 961d1d0a68 community_topic_edit: Increase time limit to 3 days.
24hrs is a small time in an asynchronous conversation. Increased
time limit of topic editing for non-admins to 3 days.
2021-01-25 14:55:33 -08:00
Aman Agrawal 18bd2469fa help: Remove false claim in message topic editing table row.
Message editing setting doesn't effect a member being able
to edit other user's message topic.
2021-01-25 14:55:33 -08:00
Aman Agrawal 5a8150e34b media_query: Use 1199px instead of 1165px as xl breakpoint.
We use 1199px for hiding right column.

The components changed here were tested to be working fine.

This change is not likely to introduce any regression as the
calculations in the components here were not dependent upon the
breakpoint being at 1165px.
2021-01-25 14:49:32 -08:00
Tim Abbott 63539ddc37 website: Mention that we sponsor hundreds of projects. 2021-01-22 10:02:26 -08:00
Steve Howell d9740045a5 refactor: Eliminate checks in build_stream_dict_for_sub.
We eliminate some redundant checks.

We also consistently provide a `subscribers` field
in our stream data with `[]`, even if our users
can't access subscribers.  We therefore bump
the API version and tweak the docs.  (See further
down for a detailed justification of the change.)

Even though it is sometimes fine to have redundant code
that is defensive in nature, some upcoming changes are gonna
move subscriber-related logic out of build_stream_dict_for_sub
for certain codepaths as part of our effort to streamline
the payload for subscribers within page_params.

So we can't rely on the code that I removed here
inside of build_stream_dict_for_sub.

Anyway, it makes more sense to do these checks explicitly
in the validate function.

The code in build_stream_dict_for_sub was almost effectively
a noop, since the validation function was already preventing
us from getting subscriber info.  The only difference it
made was sometimes converting `[]` to `None`, and then
subsequently omitting the subscribers field.

Neither ZT nor the webapp make any distinction between
`[]` or <missing key> for the `subscribers` data in
`page_params`.

The webapp has had this code for a long time (and now
equivalent code elsewhere in this PR):

    if (!Object.prototype.hasOwnProperty.call(sub, "subscribers")) {
        sub.subscribers = new LazySet([]);
    }

The webapp calculates access based on booleans, anyway:

    sub.can_access_subscribers =
        page_params.is_admin || sub.subscribed ||
        (!page_params.is_guest && !sub.invite_only);

And ZT would choke if `subscribers` were missing, except that
it never gets to the relevant code due to other checks:

    def get_other_subscribers_in_stream(<snip>):
        assert stream_id is not None or stream_name is not None

        if stream_id:
            assert self.is_user_subscribed_to_stream(stream_id)

            return [sub
                    for sub in self.stream_dict[stream_id]['subscribers']
                    if sub != self.user_id]
        else:
            return [sub
                    for _, stream in self.stream_dict.items()
                    for sub in stream['subscribers']
                    if stream['name'] == stream_name
                    if sub != self.user_id]

You could make a semantic argument that we should prefer
<missing key> to `[]` when subscribers aren't even available, but
we have precedent from the way that `bulk_get_subscriber_user_ids`
has traditionally populated its result:

    result: Dict[int, List[int]] =
        {stream["id"]: [] for stream in stream_dicts}

If we changed `stream_dicts` to `target_stream_dicts` we
would faciliate a move toward `None`, but it would just cause
headaches for other server code as well as the frontends
(which, to reiterate, already prefer the empty array
for convenience).
2021-01-21 15:04:07 -08:00
Nikhil Maske 719217be8f markdown_help: Make spoiler-button work by changing its tag.
The "a" tag of spoiler-button present in Markdown formatting page
disrupts click handlers. To fix this, "a" tag is changed to "span" tag.
2021-01-21 14:32:13 -08:00
rht d514b799ad slack-import: Explain current implementation about threads. 2021-01-12 10:21:32 -08:00
Aman Agrawal c685d36821 hipchat_import: Remove tool from codebase.
Remove functions and scripts used by HipChat import tool and
those which will no longer be required in future.
2020-12-23 08:28:49 -08:00
Aman Agrawal 62d721e859 docs: Remove HipChat migration guide.
As of Feb 15th 2019, Hipchat Cloud and Stride
have reached End Of Life and are no longer
supported by Atlassian. Since it is almost 2 years
now we can remove the migration guides.
2020-12-23 15:43:13 +05:30
Mateusz Mandera 160cc5120a api: Require can_create_users permission to create users via API.
Allowing any admins to create arbitrary users is not ideal because it
can lead to abuse issues.  We should require something stronger that
requires the server operator's approval and thus we add a new
can_create_users permission.
2020-12-21 13:20:21 -08:00
Tim Abbott d513bb4aa6 help: Fix Gitter docs to encourage making users owners. 2020-12-17 18:45:05 -08:00
sushant52 9393371a94 docs: Add auth backend configuration is optional.
Tweaked by tabbott to use slightly clearer language.
2020-12-17 18:11:28 -08:00
Vishnu KS 023a33dc49 support: Disable adding discount for fixed price plans.
Discount is applied relative to the price per license of our normal
plans. For fixed price plans, the concept of discount doesn't make
any sense since we manually assign a price for the entire realm
irrespective of the number of users in the realm.
2020-12-17 17:09:20 -08:00
Vishnu KS dd5bcb97e8 support: Allow user look up through full name search. 2020-12-17 17:07:28 -08:00
Siddharth Asthana daac7536f3 accounts/deactivated: Show deactivated_redirect url if present
If a user visits a realm which has been deactivated and it's
deactivated_redirect field is set, we should have a message telling the
user that the realm has moved to the deactivated_redirect url.
2020-12-14 21:04:52 -08:00
shanukun 82a262018a dev_tools: Fix dev-secrets.conf path.
At /devtools 'Connecting to the local PostgreSQL database',
path for `dev-secrets.conf` should zulip/zproject/dev-secrets.conf
instead of zulip/zerver/dev-secrets.conf.
2020-12-08 18:11:14 -08:00
Anders Kaseorg c4d805a82c api docs: Use --data-urlencode in send-message curl example.
Commit 13c11ec5f3 (#16699) already fixed
the generated curl examples, but missed this, which is the only
hard-coded one.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-12-07 17:00:05 -08:00
Siddharth Asthana 6f962c1815 support: Add ability to change subdomain of realms. 2020-12-06 00:48:10 -08:00
Siddharth Asthana 37e158b9ba support: Rename message -> success_message. 2020-12-06 00:48:10 -08:00
rht 4911bc3c4d docs: Recommend Matterbridge for integration with IRC/Matrix/Slack. 2020-12-01 14:12:05 -08:00
Tim Abbott 3b5ea2dbad docs: Remove broken Gitter help center link.
Gitter's help center seems to no longer be on the Internet.
2020-11-18 13:02:07 -08:00
Tim Abbott a6744646e4 help: Clarify how deactivating an account interacts with organizations. 2020-11-18 12:51:39 -08:00
Abhishek Yadav 4d458eeb49
left_sidebar: Add data-placement to settings icon to prevent flickering.
Changing the position of tooltip using data-placement=bottom fixes this flickering artifact.

Fixes: #16676
2020-11-16 17:22:18 -08:00
Vishnu KS d6743da139 docs test: Verify zulip/zulip file and directory links locally. 2020-11-05 10:07:43 -08:00
Vishnu KS 2a17dd61aa docs: Link session length and idle timeouts to GitHub search.
The line number was outdated and was linking to totally unrelated
section. I think the best way to handle this case would be to
link directly to search.
2020-11-05 10:07:43 -08:00
shanukun be39672026 api_docs: Document the /fetch-api-key endpoint.
With tweaks by tabbott to document addition details.

Fixes: #16408.
2020-11-02 16:45:42 -08:00
Tim Abbott cba7425cdc docs: Clean up email testing docs a bit more. 2020-10-30 12:15:27 -07:00
Vishnu KS ff754ee528 emails: Pass help link as variable in password reset email. 2020-10-30 11:50:30 -07:00
Vishnu KS 0eec12ad8b emails: Pass reset link as variable in notify new login email. 2020-10-30 11:50:30 -07:00
Vishnu KS 0853c866a9 emails: Use link tag macro for realm uri in password reset email. 2020-10-30 11:50:30 -07:00
Vishnu KS e53008410a emails: Use email tag macro for email in password reset email. 2020-10-30 11:50:30 -07:00
Vishnu KS 1c08ea8134 emails: Use trans tag for ladap username in followup day 1 email. 2020-10-30 11:50:30 -07:00
Vishnu KS abc5fb6cea emails: Use email tag macro for email in followup day1 email. 2020-10-30 11:50:30 -07:00
Vishnu KS df882d1563 emails: Use link tag macro for realm_uri in followup day1 email. 2020-10-30 11:50:30 -07:00
Vishnu KS cb6ab43ba2 emails: Use link tag macro for realm_uri in realm reactivation email. 2020-10-30 11:50:30 -07:00
Vishnu KS 36b00b6b96 emails: Use email tag macro for old and new emails in confirm new email. 2020-10-30 11:50:30 -07:00
Vishnu KS c06d8f9e45 emails: Use link tag macro for realm_uri in confirm new email. 2020-10-30 11:50:30 -07:00
Vishnu KS 4b784f8869 emails: Use macros for link tags in new login email. 2020-10-30 11:50:30 -07:00
Vishnu KS 8abf6897cb emails: Use macros for email tags in realm reactivation email. 2020-10-30 11:50:30 -07:00
Vishnu KS 01a92abf12 emails: Use macros for email tags in notify new login email. 2020-10-30 11:50:30 -07:00
Vishnu KS 3bac784590 emails: Use macros for email tags in notify change in email. 2020-10-30 11:50:30 -07:00
Vishnu KS 689c636e29 emails: Use macros for email tags in confirm registration email. 2020-10-30 11:50:30 -07:00
Vishnu KS 0d56f3d73e emails: Use macros for email tags in verify new email. 2020-10-30 11:50:30 -07:00
Vishnu KS 2caee3d68c emails: Use macros for email tags in invitation reminder email. 2020-10-30 11:50:30 -07:00
Vishnu KS eb008fc864 emails: Use macros for email tags in invitation email. 2020-10-30 11:50:30 -07:00
Tim Abbott 5fb667cf9e templates: Make sure users know deletion is for everyone.
Implements a proposal I suggested in #16426.
2020-10-29 17:25:40 -07:00
Tim Abbott 5bfafae764 docs: Improve linking of documentation around message deletion.
This should help users confirm their understanding of how deletion
works in Zulip starting from the actual deletion UI.
2020-10-29 17:12:49 -07:00
sahil839 5d79dff00b docs: Extract help doc for wildcard mention policy.
This commit moves the wildcard mentions documentation to a top-level page.

Edited by tabbott to deduplicate with the existing docs, and add cross-links.
2020-10-29 15:29:52 -07:00
Alex Vandiver abb8b2166f docs: Fix name of realm rename function. 2020-10-26 12:48:56 -07:00
Steve Howell 0e7e4f1ad3 api feature level: Bump level for peer_add/peer_remove. 2020-10-26 07:18:08 -04:00
Alex Vandiver e3dacdadae help: Gitter imports do not use a token to fetch latest data.
This is a copy/paste error from the Slack import.
2020-10-23 16:47:28 -07:00
Anders Kaseorg 72d6ff3c3b docs: Fix more capitalization issues.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-23 11:46:55 -07:00
sahil839 1d5aa2e514 settings_org: Add frontend to change wildcard_mention_policy.
We add dropdown for wildcard_mention_policy in organization
permissions page.
2020-10-22 15:00:27 -07:00
Mateusz Mandera ec8fcf3a04 docs: Fix duplication in apple-error.md config error page.
SOCIAL_AUTH_APPLE_TEAM was repeated twice.
2020-10-22 12:07:46 -07:00
akshatdalton 1abae8baaa docs: Update guidelines to URL-encode stream name or topic name.
Updated create-bot-construct-url-indented.md file with
guidelines on how to URL-encode stream name and topic
name. The hyperlink added will solve the issue for those
who use emoji in stream name or topic name.

Tweaked by tabbott to edit the copy and update the non-indented
version as well.

Fixes #16430.
2020-10-21 11:14:42 -07:00
Tim Abbott 2ba76c8289 docs: Merge Zoom and BBB configuration pages. 2020-10-18 15:10:23 -07:00
strifel 1ed1614c9d docs: Add more specific Big Blue Button documentation. 2020-10-18 15:03:16 -07:00
the-rdt 03005dacdb preview_message_area: Use simplebar scrollbar.
Add `data-simplebar` attribrute to `preview_message_area` div in
`templates/zerver/app/compose.html`.

This will cause preview_message_area div to use simplebar scrollbar
instead of normal scrollbar.

Fixes #16468.
2020-10-18 14:35:16 -07:00
Aman Agrawal 8297121050 Revert "login: Fix alignment of error message in login form."
This reverts commit 6fe82620df.

Reverted since this misaligns other forms which use the same
class.
2020-10-18 14:06:20 -07:00
Anders Kaseorg dd48dbd912 docs: Add spaces to “check out”, “log in”, “set up”, “sign up” as verbs.
“Checkout”, “login”, “setup”, and “signup” are nouns, not verbs.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-13 15:47:13 -07:00
shanukun 537051e4f1 api docs: Fix JavaScript example for /streams api endpoint.
This commit fixes the JavaScript tab in 'Usage example'
for 'Get all streams' that currently shows python code.
2020-10-11 23:12:33 -07:00
Anders Kaseorg f0ae2a88f2 activity: Show server time rather than browser time.
This gets rid of an inline <script> that was blocking #16451.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-08 19:17:35 -07:00
Aman Agrawal 6fe82620df login: Fix alignment of error message in login form. 2020-10-07 16:18:54 -07:00
Tim Abbott 914862f8cd docs: Fix text for requesting an integration. 2020-10-01 17:29:17 -07:00
sahil839 78b98d8067 realm: Add wildcard_mention_policy setting.
We add a new wildcard_mention_policy setting to handle wildcard
mentions in large streams, with a wide range of policies available to
organizations.

We set the default to the safe option for preventing accidental spam:
only stream administrators being able to use wildcard mentions in
large streams.
2020-10-01 12:18:03 -07:00
Anders Kaseorg 57cb95af9f docs: Show simple POSIX shell quoting in send-message documentation.
This reverts commit 5275d49f05
(effectively), which created more problems than it solves.  #8484 is
not a bug: a newline can be included literally with no escaping within
POSIX quotes.  Meanwhile, $"" is a bashism, and not even the correct
bashism: it translates strings using the LC_MESSAGES catalog.  If the
user wants to do something complicated, they can consult the
documentation for their shell.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-30 17:31:55 -07:00
Vishnu KS 510efbc1a8 support: Add option to change billing method. 2020-09-28 15:37:49 -07:00
Vishnu KS 3e438538b4 support: Add support for downgrading realm. 2020-09-28 15:37:49 -07:00
Gittenburg b245e1e49a compose: Display Formatting button as "Help".
The Formatting button that opens our Markdown help popover previously
had an "A" as its icon (the Font Awesome icon for font). This commit
changes the link to spell out "Help" to make it more discoverable.
2020-09-25 16:47:44 -07:00
Gittenburg 0c6df114f6 compose: Reorder message action buttons.
Now that they are tab accessible, we should order them by importance.
Previously the order was:

1. Add emoji
2. Formatting
3. Attach files
4. Add video call
5. Preview
6. Drafts

This commit changes the order to:

1. Attach files
2. Preview
3. Add video call
4. Add emoji
5. Drafts
6. Formatting

The "Add emoji" button is moved back because emojis can be more
conveniently entered using the typeahead triggered with ":" or the
emoticon conversions.
2020-09-25 16:47:43 -07:00
Dinesh 043146fa83 reset_password: Change reset password page heading. 2020-09-25 16:24:18 -07:00
Dinesh 232eb8b7cf auth: Render config error page on configuration error.
We previously used to to redirect to config error page with
a different URL. This commit renders config error in the same
URL where configuration error is encountered. This way when
conifguration error is fixed the user can refresh to continue
normally or go back to login page from the link provided to
choose any other backend auth.

Also moved those URLs to dev_urls.py so that they can be easily
accessed to work on styling etc.

In tests, removed some of the asserts checking status code to be 200
as the function `assert_in_success_response` does that check.
2020-09-25 16:16:17 -07:00
Vishnu KS a888e65ea4 i18n: Don't include email tags in translation strings. 2020-09-25 15:53:26 -07:00
Vishnu KS 2d2ea9af6e i18n: Tag confirmation templates for translation. 2020-09-25 15:53:26 -07:00
Anders Kaseorg faf600e9f5 urls: Remove unused URL names and shorten others.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-22 10:46:28 -07:00
Sumanth V Rao 2b9f7916c5 api: Document markdown changes for code blocks and bump API_FEATURE_LEVEL. 2020-09-18 17:15:47 -07:00