Commit Graph

9325 Commits

Author SHA1 Message Date
yogesh sirsat 87ba3c1549 custom_profile_fields: Convert edit profile field form into a modal.
This allows this component to follow existing design patterns, rather
than being its own unusual element with various quirks.

The implementation is approximately the same as before I just migrated
"Edit custom profile field" form into modal, like "Add new custom
profile field" form modal.

Fixes: #21634
2022-08-05 17:26:56 -07:00
yogesh sirsat 5c8fcee0a3 custom_profile_fields: Remove unnecessary field_form objects.
This commit is a preparatory commit of "custom_profile_fields: Edit
custom profile field form into modal."

The object returned by get_profile_field_info, which contained jQuery
objects for the profile-field-row and profile-field-form elements, was
just a source of unnecessary indirection, since none of the functions
consuming it accessed the row.
2022-08-05 17:26:56 -07:00
yogesh sirsat f885535a7c custom_profile_fields: Add form ID to add new custom profile field form.
This makes it easy to support submitting this form when pressing enter
by passing the `form_id` parameter to `dialog_widget.launch()`.
2022-08-05 17:26:56 -07:00
yogesh sirsat 526b55c6fc custom_profile_fields: Convert new profile field form to a modal.
This lets us remove this fairly ugly user interface widget, which was
inconsistent with the rest of the settings UI.

The implementation is approximately the same as before I just migrated
"Add new custom profile field" form into a modal, status update
notifications about these forms will be displayed inside their modal,
and made some little design changes as discussed on CZO.

Fixes part of: #21634
2022-08-05 17:26:56 -07:00
yogesh sirsat c60cdc46e3 custom_profile_fields: Change class from control-group to input-group.
This is a preparatory commit for commit "Edit custom profile
field form into modal."

Above mentioned commit will use class input-group instead of
control-group so here we are already changing it to input-group.
2022-08-05 17:26:56 -07:00
yogesh sirsat d0f5b38f65 custom_profile_fields: Control-group to input-group class correction.
There is no control-group class to hide/show in custom profile fields
list instead there is input-group class, kind of little typo I guess
from this 9e343f1 commit.
2022-08-05 17:26:56 -07:00
Ganesh Pawar 5697f7f269 archive stream: Update modal text.
Fixes #22658.
2022-08-05 15:55:13 -07:00
Julia Bichler 2f399d3470 stream settings: Live update the stream privacy icon.
This live updates the stream privacy icon in the general stream
settings after changing the privacy setting of the stream.
2022-08-03 17:46:06 -07:00
evykassirer 0524e1b40d compose: Rename show_box to show_compose_box.
This lets us remove a comment to clarify this.
2022-08-03 17:05:15 -07:00
Aman Agrawal ac8d984f7c tippy: Hide tooltip for inline images if the reference is removed.
Spamming the `s` shortcut when hovered on an image can cause the
tooltip to be displayed at the top left corner. This is caused by
original reference of the tooltip being removed from DOM. The
re-rendering is happening so quickly that tippy is not able to hide
the tooltip in time.
2022-08-03 16:20:11 -07:00
Aman Agrawal a43c4afb0b tippy: Move MutationObserver logic into a function.
So that it can be used elsewhere in the code.
2022-08-03 16:19:23 -07:00
Aman Agrawal 06deeb3239 bottom_whitespace: Extract to a dedicated handlebars template.
We'll be supporting changes its content in coming commits.
2022-08-03 16:14:42 -07:00
N-Shar-ma 13ef0b5b04 left-sidebar: Use -, _ and / additionally as stream word separators.
Uptil now only space was used as a word separating character when
searching streams. This meant that searching for "xyz" would not turn
up a stream named "stream-xyz" as one would expect.

Since -, _ and / are likely to be used as word separators in stream
names, these 3 are added as word separators for streams. The utility
function `filter_by_word_prefix_match` is refactored by adding an
optional `word_separator_regex` argument.

Fixes: #19700.
2022-08-02 15:55:07 -07:00
Sahil Batra 9d831b50b7 settings: Disable spectator access option for limited plans.
We also show upgrade banner along with disabling the setting.
We also hide the web-public stream creation policy dropdown in
such case as we do when enable_spectator_access is False.
2022-07-31 18:02:36 -07:00
Sahil Batra 1455f290f2 settings_bots: Use same modal that is used in admin bot-edit form.
We change the edit form opened from "Personal" settings section
to be same as the form opened from "Organization" section.
2022-07-31 16:56:03 -07:00
Sahil Batra d4189fa6ca settings: Allow editing config data of bots from admin edit modal.
We now allow admins to edit configuration of outgoing webhook
and embedded bots from the edit form in "Organization" settings
section. In next commit we would deduplicate the code to use same
modal in both "Organization" and "Personal" settings sections.
2022-07-31 16:56:03 -07:00
Sahil Batra 7f53699a3a settings: Add avatar change option to bot edit modal in org settings.
This commit adds option to change bot avatar from the admin bot-edit
form. This is a prep commit for making bot edit forms in both
"Personal" and "Organization" settings sections same.

We do not use dialog_widget.submit_api_request now since we need
to pass processData and a couple of other parameters with the
request since we are sending a file also as part of data. And
also we add code to show loading spinner which was previously
handled by submit_api_request.
2022-07-31 16:56:03 -07:00
Sahil Batra 59fd88928f settings: Show confirmation modal when deactivating bot.
We now show confirmation modal when deactivating bot from
personal settings section. Since we have added deactivate
option in the bot-edit modal opened from admin settins page
and we would replace the modal opened from personal settings
with that modal, it would be good to show the modal consistently.

This commit also moves confirm_bot_deactivation function from
settings_users.js to settings_bots.js to avoid cyclic dependencies.
2022-07-31 16:56:03 -07:00
Sahil Batra f9a5c39908 settings: Move show_edit_bot_info_modal to settings_bots.
We move show_edit_bot_info_modal function to settings_bots.js
as this code will be used for modals opened from the personal
bot settings section as well when we would make both the modals
same and this will help us in avoiding cyclic imports.
2022-07-31 16:56:03 -07:00
Anders Kaseorg b945aa3443 python: Use a real parser for email addresses.
Now that we can assume Python 3.6+, we can use the
email.headerregistry module to replace hacky manual email address
parsing.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-07-29 15:47:33 -07:00
Swapnil Gore 4129a8f8bc
settings: Remove extraneous banner from settings tabs.
This fix excludes the bots and invitation settings tabs from having the 
organization_settings_tip.hbs template being inserted in them.

Arguably we should invert the meaning of this block so the default is
that these notices don't appear, but it's hard to be sure whether we're more
likely to add a new setting panel that is normal settings or a data table.

Fixes: #19967.
2022-07-28 21:54:59 +00:00
Ivan Toymentsev cd0821084c upload: Locally verify file size before uploading the file.
With an extended comment by tabbott.

Fixes #21978.
2022-07-28 14:15:04 -07:00
Aman Agrawal ca275c4c10 integrations: Convert `integration-main-text` selector to class.
This can now be used in multiple places.
2022-07-28 19:04:43 +00:00
Ganesh Pawar 0ed590594d delete message: Updated modal text. 2022-07-28 09:47:25 -07:00
Rishant Rokaha b16d2cc55c
settings: Improve wording in delete user group confirmation modal.
Fixes #22593.
2022-07-28 09:44:42 -07:00
yogesh sirsat f264795770 deactivate_users: Change submit button text of confirmation modal.
Change submit button text of both bot and user deactivation confirm
modal from "Confirm" to "Deactivate".
Calling `launch()` function from `dialog_widget.js` because
`confirm_dialog.js` set submit button text to "Confirm".
2022-07-27 17:09:48 -07:00
yogesh sirsat 9f21e34592 settings_users: Add ? in deactivate confirmation modal title. 2022-07-27 17:09:48 -07:00
yogesh sirsat d090347ea9 settings_bots: Change of text in bot deactivate confirmation modal.
Also, add `?` at the end of title of the this modal.
2022-07-27 17:09:48 -07:00
sahil839 594724b834 stream: Do not hide stream email on live update after unsubscribing.
We currently show stream emails for subscribed and unsubscribed
streams in stream settings overlay and don't show them for never
subscribed streams.

There is a bug where we show the empty container without email on
live update after unsubscribing and then we completely hide the
email element after we switch the stream and come back to it
again. But then we again show emails for unsubscribed streams
after reload, to preserve the beahviour of showing the emails of
unsubscribed streams.

This commit fixes this bug by not hiding stream email on live
update after unsubscribing and also showing them after switching
between different streams and makes it consistent with showing
emails for unsubscribed streams.

Fixes #22308.
2022-07-27 16:07:01 -07:00
anurastogiji 32615c81f2 popovers: Add topic auto-complete to "Move topic" menu.
We add topic auto-complete to the left sidebar menu as sometimes user
may want to merge the topic they are moving with an existing topic.

With a tweak by tabbott to remove a now incorrect comment.

Fixes #19876.
2022-07-27 16:01:03 -07:00
Anders Kaseorg 35778fa100 overlays: Remove unused support for Bootstrap modals.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-07-26 17:48:31 -07:00
Nikhil Maske 249d2a5d55 confirm_deactivate_user: Provide additional information about user.
Providing additional information like number of invites and number of
bots owned by deactivating user in the confirm_deactivate_user modal
will help the administrator if they need to do any follow-up work.

Fixes #20973.

Completed-by: Ganesh Pawar <pawarg256@gmail.com>
2022-07-26 17:03:02 -07:00
Sahil Batra 28799c5d84 settings: Mention about sponsorship in upgrade banner.
We mention about sponsorship in upgrade banner to non-business
organizations. The message for business organizations is same
as before.

There is no explicit hover behavior for banners for org types
other than business, as banners are not themselves links in
such cases and only parts of text inside the banner are links.

Fixes #22161.
2022-07-25 16:53:37 -07:00
Anders Kaseorg 9094a591e4 common: Remove unnecessary polyfills for IE.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-07-23 15:36:40 -07:00
Sahil Batra 74476317fd compose: Remove validation for stream named "announce".
Originally, DEFAULT_NOTIFICATION_STREAM_NAME was set to
"announce" and we also showed warning in frontend when
user was composing message to "announce" stream and if
the stream had more than 60 subscribers.

But we changed DEFAULT_NOTIFICATION_STREAM_NAME to "general"
in d46b125bf2. That commit did not remove the frontend code
for showing warning and this commit removes it since there
is no "announce" stream by default now, and we would not
want to show warning when sending to "general" since that
stream could be used for many discussions and it would not
be nice experience to show warning everytime.
2022-07-22 17:19:40 -07:00
Sahil Batra aa7bd76e5d compose: Show same error message everytime user is not allowed to post.
We do not show different error messages for different values of post
policy values if user is not allowed to post making it consistent with
other settings like wildcard mention settings and organization settings.

This also helps us deduplicate some code as we use almost same code
for excluding the streams to which user is not allowed to post from
the dropdown in moving messages UI.
2022-07-22 17:19:40 -07:00
Sahil Batra 18dda7b485 message_edit: Do not show streams to which user cannot post.
We do not show the streams to which user cannot post in the dropdown
list widget for moving messages between streams.
2022-07-22 17:19:40 -07:00
yogesh sirsat 5697c047fc settings_bots: Display "Deactivate bot" button inside bot edit modal.
Fixes: #22482
2022-07-22 16:57:40 -07:00
yogesh sirsat 34c01d80cb settings_bots: Display "Manage bot" modal from bots profile summary.
Fixes part of: #22482
2022-07-22 16:57:40 -07:00
Alex Tereschenko eb5fc54859 settings_org: Adjust var/function names after moving to settings_checkbox.
After moving to settings_checkbox in Authentication Methods UI,
mentions of "table" in the related JS variable/function names
are no longer meaningful and may be confusing. Change them to "list".
2022-07-22 16:38:47 -07:00
Alex Tereschenko 9142aab8ba settings_org: Use settings_checkbox in Authentication Methods UI.
Per review feedback in #21002, replace HTML table with a series
of settings_checkbox components for Authentication Methods UI.

Fixes #21001.
2022-07-22 16:38:47 -07:00
sayamsamal d810c285e3 user_profile_modal: Move user status to right and add status icon.
The user status appears out of place among the profile fields and thus
placing it under the avatar avoids any discontinuity between the profile
fields. This also adds the status icon beside the user status.
2022-07-22 15:28:05 -07:00
Lauryn Menard 35e9e4cd3b keyboard-shortcuts: Add class to arrow keys for Mac shortcuts.
The <kbd> elements in `static.templates.keyboard_shortcuts.hbs`
that are arrow keys have a class of "arrow-key". This adds that
class to arrow keys that are updated via `adjust_mac_shortcuts`.

Follow-up task due to changes introduced in #22330.
2022-07-20 11:05:15 -07:00
ritikBhandari 8b880e8942 org-settings: Update "Notifications" header and subheaders.
Updates header "Notifications" to "Automated messages and emails".

Updates these subheaders in that section:
 - "New stream notifications" to "New stream announcements"
 - "New user notifications" to "New user announcements"
 - "Notifications language" to "Language for automated messages
   and invitation emails".

Co-authored by: Lauryn Menard <lauryn@zulip.com>
2022-07-19 17:32:47 -07:00
Alex Vandiver 2d218366cc js: Only trigger reload-on-focus once.
We have observed infrequent storms of accesses (tens of thousands of
requests to minute) to `/` after an event queue expires.  The current
best theory is that the act of reloading the page itself triggers a
focus event, which itself triggers a reload before the prior one had
had time to do anything but send the network request.

Since the `focus` event here is merely as a backstop in case the
synchronous reloading and deferred reloading fail, we need only run it
once.
2022-07-19 17:29:42 -07:00
Alex Vandiver 8c1c02d164 js: Prevent scheduling a non-immediate reload while one is happening.
Prevent a non-immediate reload from being scheduled while an immediate
reload is already in progress.  This is highly unlikely in practice,
but is a reasonable safeguard.
2022-07-19 17:29:42 -07:00
Alex Vandiver 95ad507658 js: Ensure that reload.initiate cannot fall through.
A `reload.initiate({immediate: true, ...})` *should* not return, as it
should trigger a `window.location.reload` and stop execution.

In the event that it continues execution and returns (for instance,
due to being in the background and reloads being suppressed for
power-saving -- see #6821), there is no need to fall through and
potentially schedule a 90-second-later retry.
2022-07-19 17:29:42 -07:00
Sahil Batra 2b30c3c37c settings_profile_fields: Show confirmation modal when deleting option.
We show a confirmation modal when deleting option of a select-type
field mentioning number of users who are using that option. We also
show the modal if no user has selected that option. We show the modal
only in edit-form and not while creating a new profile field. We do
not show the modal when removing a newly added option during editing
the field.

Fixes #22145.
2022-07-15 16:51:24 -07:00
Sahil Batra 57e0261ff6 settings_profile_fields: Keep option value constant.
Previously, the value for an option of the select type custom
profile field was set as "order - 1". This commit changes it
to remain same even when we reorder the options or delete an
option. When we add a new option, its value is set as 1 more
than largest value already used.

This helps is eliminating various bugs in this subsystem, where
user's choice is changed unexpectedly when reordering or deleting
options.

Discussion -
https://chat.zulip.org/#narrow/stream/378-api-design/topic/custom.20profile.20fields.20option.20deletion.
2022-07-15 16:51:24 -07:00
Julia Bichler 2fcd8d5e21 message_edit: Immediately show propagation menu for topic edits.
This immediately shows the menu for which messages to move when the
user can edit the stream/topic of a message, but not the content of
the message. This balances the concern that this menu might feel like
clutter when doing a content edit with the fact that most of the time
when one visits this menu without content edit permissions, one will
want to be reassured that one can choose which messages to move.

Fixes #19196.
2022-07-15 15:31:33 -07:00