Commit Graph

48828 Commits

Author SHA1 Message Date
Anders Kaseorg 31b4be3b9b event_queue: Replace sequential queue IDs with UUIDs.
This prevents ID conflicts when resharding between multiple Tornado
shards.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-16 10:06:07 -07:00
Anders Kaseorg e38f9f038a landing_nav: Add tabnabbing protection to external target="_blank" link.
This has no impact because zulip.com is not attacker-controlled, but
we should be consistent in protecting external target="_blank" links.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-15 17:14:10 -07:00
Anders Kaseorg 82f9014970 stream_list: Fix another “subscribed” typo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-15 16:55:15 -07:00
Tim Abbott 183e7be31c models: Fix subscribed typo. 2022-09-15 16:21:09 -07:00
Mateusz Mandera d86e4ac34d models: Improve comment documentation around Recipients and Huddles. 2022-09-15 16:12:17 -07:00
Anders Kaseorg 987ab741f9 sharding: Support Tornado sharding by regexes.
One should now be able to configure a regex by appending _regex to the
port number:

[tornado_sharding]
9802_regex = ^[l-p].*\.zulipchat\.com$

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-15 16:07:50 -07:00
Anders Kaseorg 7666ff603d sharding: Configure Tornado sharding with nginx map.
https://nginx.org/en/docs/http/ngx_http_map_module.html

Since Puppet doesn’t manage the contents of nginx_sharding.conf after
its initial creation, it needs to be renamed so we can give it
different default contents.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-15 16:07:50 -07:00
David Rosa b00c030791 help: Document "Import your settings" feature.
Adds a new page titled "Import your settings" in the "Account basics"
section to document how to import user settings from an existing Zulip
account to a new Zulip account, and which settings will be imported.

Adds a question mark (?) icon linking to this help page from the
registration form when the import settings option is available.

Adds cross-links on related articles.

Fixes: #20918.
2022-09-15 16:05:49 -07:00
David Rosa 02eec29433 docs: Rename setup-vagrant.md -> setup-recommended.md.
Renames the filename so that it accurately reflects its contents
given the changes to the "Recommended setup" page in the previous
commit, and updates all links accordingly.
2022-09-15 15:54:14 -07:00
David Rosa cdc9a64c21 docs: Fix development environment setup on Windows.
Windows users end up having to follow an odd chain of links because
the recommended installation instructions live on a different
page than the rest of the instructions about the environment setup.

All the tutorials about recommended install prerequisites for each
platform should be on the same page.

This moves the section about using WSL 2 from the advanced setup page
to the recommended environment setup tutorial page.

Renames sidebar and section titles to more accurately reflect the
information in the Recommended setup vs. the Advanced setup page.
Updates relevant text and links accordingly.

Fixes: #13696.
2022-09-15 15:54:14 -07:00
Aman Agrawal 948dc3a629 popovers: Align icons and content in middle.
The icons like `x` for delete message were displayed below the
text in alignment due to a regression.
2022-09-15 12:14:15 -07:00
Ganesh Pawar 0b2c149268 edit user: Place deactivate button outside the `form` element in modal.
Pressing `Enter` on an input in the `Manage user/bot` form triggers
a click on the `Deactivate` button. This commit prevents that.

Fixes #22961.
2022-09-15 12:13:35 -07:00
Sahil Batra c3fe8420fd streams: Allow unsubscribing others based on can_remove_subscribers_group.
Current value of can_remove_subscribers_group field is admins system group
only so behavior is not changed. We would provide support to change this
setting from API and UI in further commits.
2022-09-14 16:14:15 -07:00
Sahil Batra b9248c75f4 stream: Add do_change_can_remove_subscribers_group and field to objects.
This commit adds do_change_can_remove_subscriber_group function for
changing can_remove_subscribers_group field of a stream. We also add
can_remove_subscribers_group_id field to stream and subscription
objects.

This function will be helpful for writing tests in next commit.
We would add API and UI support to change this setting in further
commits.
2022-09-14 16:03:11 -07:00
Sahil Batra 86c2f6881e models: Update can_remove_subscribers_group field to not be null.
This commit udpates can_remove_subscribers_group to be not null.
We already added a migration to set the value of this field for
existing streams and also added a commit to set this field to
admins system group for now while creating streams.
2022-09-14 16:03:11 -07:00
Sahil Batra c9c230c2da migrations: Add migration to set default of can_remove_subscribers_group.
This migration sets can_remove_subscribers_group value to admins system
group for all the existing streams. In further commit we would change
can_remove_subscribers_group to be not null and thus we add this migration
to ensure all existing streams have this setting value set.
2022-09-14 16:03:11 -07:00
Sahil Batra b0de5c0f36 streams: Set can_remove_subscribers_group while creating streams.
This commit sets can_remove_subscribers_group to admins system
group while creating streams as it will be the default value
of this setting. In further we would provide an option to set
value of this setting to any user group while creating streams
using API or UI.
2022-09-14 16:03:11 -07:00
Sahil Batra 941bb5a372 import: Fix import related code for user groups.
We change the import order to import UserGroup objects before
Stream such that we can set can_remove_subscribers_group correctly.

We do not import UserGroupMembership objects here along with
UserGroup since UserProfile objects are not imported and
GroupGroupMembership are also imported later as these are not
required before.
2022-09-14 16:03:11 -07:00
Sahil Batra 49d61d19f4 models: Add can_remove_subscribers_group field to Stream.
This new setting will be used to check which user group
is allowed to unsubscribe others from the stream.
2022-09-14 16:03:11 -07:00
Ganesh Pawar c439b9d3af modal: Make the modal content scrollable instead of the whole modal.
Earlier, if the content of the modal (apart from the header and footer)
overflowed, the whole modal would become scrollable which would hide
the modal header and footer on scrolling. This commit makes only
the modal content scrollable and keeps the modal header and
footer static.
2022-09-14 15:45:36 -07:00
Ganesh Pawar 7f8f954897 bots: Remove redundant overflow CSS.
This was added to avoid the `owner` dropdown field from being
only partially visible in the `Manage bot` modal. But, now the
`owner` field is moved up in the modal so this isn't needed.
2022-09-14 15:45:36 -07:00
Zixuan James Li e2bf8c49af test_decorators: Remove cachify test cases.
cachify has been removed in 9d448e73d2.
We don't need to keep its tests.

TODO: functools.lru_cache can be replaced by functools.cache when we
drop Python 3.8.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-09-14 09:40:46 -07:00
Mateusz Mandera 2d31c08887 help center: Tweak punctuation in saml-login-button.md. 2022-09-14 09:40:04 -07:00
Mateusz Mandera 1bb15fd731 help center: Small update to Okta SAML set up instructions.
The UI seems slightly different than before, making the metadata harder
to find - this additional description of how to get to it should be
helpful.
2022-09-14 09:40:04 -07:00
Anders Kaseorg 868e130b5f populate_analytics_db: Remove unnecessary mock.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-14 09:36:56 -07:00
Anders Kaseorg 61e149dbb5 subdomain: Remove impossible None case from user_matches_subdomain.
The only two callers pass get_subdomain(request) which can’t be None.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-14 09:35:36 -07:00
Anders Kaseorg ea6f18bb46 refresh-sharding-and-restart: Quote to prevent shell glob expansion.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-14 09:35:12 -07:00
aadiljaleel 654bab1d19
popovers: Replace full profile avatar border with box-shadow.
This makes the visual border appear outside the image, not overlapping its edges.

Fixes: #21265
2022-09-14 09:26:53 -07:00
Tim Abbott 0da9fdf28f Revert "read_receipts: Use 'one person' instead of '1 person'."
This approach will be confusing for translators for languages where
the same conjugation is required "21" as for "1".

This reverts commit 53cf974b89.
2022-09-13 11:54:19 -07:00
Ganesh Pawar f58620c7ec org settings: Move invitations required checkbox to the top.
This commit moves the
"Invitations are required for joining this organization" checkbox
in `Organization permissions` settings to the top.
2022-09-13 11:39:21 -07:00
Yogesh Sirsat ce14df0f4f custom_profile_fields: Display data of default external type while edit.
Display values of "name" and "hint" field in non-editable way while
editing default external account type profile fields.
2022-09-13 11:38:47 -07:00
Yogesh Sirsat c1cf691080 custom_profile_fields: Remove redundant empty val set from edit form. 2022-09-13 11:38:47 -07:00
Lauryn Menard f0dac7beef docs: Update base titles for documentation pages.
Updates the base titles so that they begin with the page content,
and end with "| Zulip" +  information about the type of doc: "help
center", "API documentation", "terms and policies", or "integrations".
2022-09-13 11:36:52 -07:00
Lauryn Menard 09d94c62a5 integrations: Revise integration CATEGORY dict structure.
Adds a META_CATEGORY dict for categories that are not best described
as groups of 'tools', so that in the subsequent commit the PAGE_TITLE
can be set accordingly.

Also, removes 'tools' from the 'Miscellaneous' category text and
spells out 'Human resources' instead of using 'HR'.
2022-09-13 11:36:52 -07:00
Lauryn Menard 04fd1c8773 keyboard-shortcuts: Simplify `adjust_mac_shortcuts`.
Since we are updating the help center documentation to use `<kbd>`
HTML elements when documenting keyboard keys and shortcuts, we no
longer need to support `<code>` HTML elements in
`adjust_mac_shortcuts`.
2022-09-13 11:21:10 -07:00
Lauryn Menard e860d22d61 docs: Update tutorial section on documenting keyboard shortcuts.
Updates the tutorial in "Writing help center articles: Writing
style" for using `<kbd>` HTML elements when documenting keyboard
shortcuts in help center articles.

Also, adds section about the keyboard tip macro/syntax.
2022-09-13 11:21:09 -07:00
Lauryn Menard fe7d7b48db help-docs: Use `<kbd>` HTML elements for references to keyboard keys.
Updates references to keyboard keys in the help center docs to use
`<kbd>` HTML elements, which also means updating them to be as the
key would appear on a keyboard.

Previously, uppercase and lowercase letters were used to indicate
when/if the `Shift` key was being used, and even that was not
consistent throughout the documentation.

For CSS styling, adds a similar rule for `<kbd>` elements that is
used in `/static/styles/app_components.css`. And updates the CSS
class used in `/static/js/portico/help.js` for `adjust_mac_shortcuts`
accordingly.

Also, takes advantage of revising these pages for making small
updates for current help center documentation practices.
2022-09-13 11:16:14 -07:00
Sahil Batra 1e55e7641e export: Do not export direct_members and direct_subgroups field.
We do not need direct_members and direct_subgroups field of
UserGroup objects in the export data since we already have
UserGroupMembership and GroupGroupMembership object data.

While importing we keep these fields empty when creating
UserGroup objects and direct_members and direct_subgroups
fields will get set when UserGroupMembership and
GroupGroupMembership objects are created.

This change will also help us in further changes when we
will change the order of importing to import UserGroup
objects just after Realm objects.
2022-09-13 11:07:09 -07:00
Sahil Batra c714ad993b test_import_export: Add tests for GroupGroupMembership objects. 2022-09-13 11:07:09 -07:00
Anders Kaseorg bd9a1dc971 tests: Consistently JSON-encode ‘to’ parameter
Although our POST /messages handler accepts the ‘to’ parameter with or
without JSON encoding, there are two problems with passing it as an
unencoded string.

Firstly, you’d fail to send a message to a stream named ‘true’ or
‘false’ or ‘null’ or ‘2022’, as the JSON interpretation is prioritized
over the plain string interpretation.

Secondly, and more importantly for our tests, it violates our OpenAPI
schema, which requires the parameter to be JSON-encoded.  This is
because OpenAPI has no concept of a parameter that’s “optionally
JSON-encoded”, nor should it: such a parameter cannot be unambiguously
decoded for the reason above.

Our version of openapi-core doesn’t currently detect this schema
violation, but after the next upgrade it will.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-13 11:05:37 -07:00
Anders Kaseorg a1de8d95a8 openapi: Fix ‘to’ parameter schema.
The previous schema incorrectly prohibited the string, integer, and
string-array forms that we do in fact accept.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-13 11:05:37 -07:00
Anders Kaseorg a5a12398fe openapi: Fix ‘narrow’ parameter schema.
The previous schema incorrectly prohibited the two-element array form
that we do in fact accept, and didn’t specify anything about the
contents of the object form.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-13 11:05:37 -07:00
Mateusz Mandera 011330194e help center: Fix indendation in saml-authentication.md azuread part. 2022-09-13 10:43:30 -07:00
Lauryn Menard 899f535b39 forms: Update create organization part of registration form.
Adds a legend to the "org-registration" fieldset where the user
inputs info about the new organization. Previously, there was only
a legend for the "user-registration" fieldset. Also, increases
the opacity of CSS rule for the legend color so that they are
more visible.

Removes the hint text about what the organization URL value is
used for since it is pretty clear from the field's name.
2022-09-13 10:41:03 -07:00
Aman Agrawal cdb1db156f portico: Change display name of non-profit org type.
In the left sidebar, remove `registered` word from the
non-profit category name.
2022-09-13 10:40:16 -07:00
Aman Agrawal 05df836fe6 communities: Minor wording change.
See https://github.com/zulip/zulip/pull/22081#issuecomment-1236202673
2022-09-13 10:40:16 -07:00
Anders Kaseorg 0aff5e16ee puppeteer_tests: Skip apparently broken part of message-basics test.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-12 17:19:05 -07:00
yogesh sirsat f3578912fa custom_profile_fields: Disable "External account type" select field.
Disable "External account type" select field from External account type
profile field edit form, doing it because this select field is not
editable and it is incorrectly looks like editable.
2022-09-12 14:29:11 -07:00
Yogesh Sirsat aa7fddbc1d custom_profile_fields: Display data of default external type fields.
Display default values of "name" and "hint" field in uneditable way
while creating new default external account type profile fields.
2022-09-12 14:29:11 -07:00
Yogesh Sirsat 50c13f9db0 custom_profile_fields: Backend tests for default external account type. 2022-09-12 14:29:11 -07:00