Commit Graph

14215 Commits

Author SHA1 Message Date
sofbe f87f27f9d0 settings: Create a new "Message deletion" section.
Create a new section under "Message editing" and move
"Who can delete their own messages" and
"Time limit for deleting messages" to the new section.
Remove "i" tooltips next to them. Add a label to the
new section "Administrators can delete any message."

Fixes part of #22892.

settings: Add widgets to the new section "Message deletion".
Forgot to add settings_save_discard_widget to last commit.
This commit add two buttons when a change is made to the
subsections.

Fixes part of #22892.
2022-10-10 08:52:36 -07:00
sayamsamal 19e292989c misc: Improve app title bar for stream and topic views.
We want to be able to differentiate between the stream and the topic
in the title bar, but the current implementation displays both the
steam name and the topic name in the same way which becomes difficult
to comprehend at a glance.

In this commit, we make the following changes,

- <stream_name> to #<stream_name> (when viewing the entire stream)

- <topic_name> to #<stream_name> > <topic_name> (when viewing a topic)

These changes help us differentiate between a stream and a topic with
with a quick glance.

Fixes #22969.
2022-10-07 16:43:50 -07:00
Yogesh Sirsat 8b6976331a popovers: Redesign user info popover.
Following the addition of support for custom profile fields in the
user info popovers, we redesign the popover to have a cleaner look.

* Switch top section design from centered to left-aligned.
* Move mute/unmute and manage user options behind a \vdots menu.
* Move the local time and status into a new block.

Almost all design changes ideas are from discussion on chat.zulip.org;
see "#design > pronouns in profile card" for details.

Co-authored-by: evykassirer <evy.kassirer@gmail.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2022-10-07 15:52:23 -07:00
Tim Abbott eb6ca14377 popovers: Change icons for user popover private message options.
We've decided to standardize on the envelope icon for viewing private
messages; certainly that feels more natural than the lock, which we
use for private streams. And then to avoid duplicates, we change the
existing envelope to a chat bubble.
2022-10-07 15:29:12 -07:00
Lauryn Menard fdc1335e3a analytics: Move range selector buttons and hover information.
Because some button text is much longer in different languages,
there is an existing  bug when the charts are rendered with the
range selector buttons positioned on the right side of the chart.

This positions the range selector buttons to the left side of the
chart and the hover information to the right side of the chart.

For the pie charts and horizontal bar chart, the grouping buttons
labeled "Me" and "Everyone" are moved to the top of the chart, which
matches the grouping buttons on the vertical bar charts.

Adjusts some chart margins for new positioning of buttons and hover
information. Deduplicates some shared code for rangeselector buttons
in `stats.js` for the three vertical bar charts.
2022-10-07 11:34:01 -07:00
Lauryn Menard 687160432c analytics: Update font-family used in stats charts.
Updates the font-family and font-size for plotly charts so that
the text in some legends is no longer cut off.

Updates the tick angles of the vertical bar charts so that the
x-axis text never becomes angled when moving the rangeslider.

Fixes #18912.
2022-10-07 11:34:01 -07:00
Lauryn Menard cdcef8b814 analytics: Remove "Aggregation" labels from stats page. 2022-10-07 11:34:01 -07:00
Lauryn Menard 396c7c3046 analytics: Remove unused CSS styling for `hr` tags.
There are no `<hr>` HTML tags in the stats / analytics page, so
removes the unused CSS rules for these elements.
2022-10-07 11:34:01 -07:00
evykassirer 61a782d252 drafts: Don't update draft count when successfully sending messages.
Fixes #21757.

Previously the draft count would briefly increase between the action
of sending a message and the success of sending that message.
Now the draft count will only increase if the message fails to send.
2022-10-07 11:26:36 -07:00
Lauryn Menard df7a1cec93 analytics: Add summary statistic for upload/storage space in use.
Adds the realm's used storage space for attachments to the stats
view `page_params`. This information is then added to the summary
statistics section of the analytics page after being formatted by
`stats.js`.

Uses the emoji test image to create an `Attachment` in the database
for the analytics realm. Even though it doesn't create a message
to claim the attachment, it still is sent as storage space used
data for the analytics `/stats/` page.
2022-10-07 10:08:09 -07:00
Aman Agrawal 87316a777a css: Fix background color of date_row in unread PMs.
This was a regression introduced in the commit
a80500cf5d
where we forgot to change the color of for unread PM date rows
while change the color for the date row of unread stream messages.
2022-10-07 09:54:42 -07:00
Aman Agrawal 06a9ceb911 popovers: Hide mark as unread button for spectators.
Since spectators cannot mark messages as unread, hide this button
in message actions popover.
2022-10-07 09:53:37 -07:00
Sahil Batra da8817889b settings: Check "display_profile_in_summary" for Pronouns type field.
While creating a pronouns type field, "display_in_profile_summary"
checkbox is checked by default for "Pronouns" type field if the
limit is not reached.

Fixes #21271.
2022-10-06 17:56:26 -07:00
Sahil Batra 12ba5cb814 settings: Add default label and hint when creating "Prounouns" custom field.
Label and hint can be edited, but we just fill it by default values for
convenience.
2022-10-06 17:56:26 -07:00
Sahil Batra aaa5d5cb0e settings: Show typeahead for pronouns type custom profile field.
User can add any pronouns in this field, but we just show some
commonly used pronouns as suggestions in typeahead.
2022-10-06 17:56:26 -07:00
Aman Agrawal ab9c5ae482 actions_popover: Only wrap content to next line on small width.
Fixes #23017

We try to keep the width of actions popover at `max-content` till
small widths.
2022-10-06 16:58:33 -07:00
Sahil Batra 3f010bbcc4 settings_org: Add missing closing square bracket.
Due to closing bracket not being present, discard
button of "Theme" subsection of default user settings
resulted in error.
2022-10-06 13:46:13 -07:00
evykassirer 553723e5d4 compose: Offer narrow to compose target button for private messages.
We already offer this for stream messages, but had been blocked on
adding it for private messages for visual design reasons. The dark
theme had a natural place to put this, since it had a box around the
private message recipient box; but the light theme didn't.

We add a border to the light theme private message recipient box to
allow us to add the same button to private messages, and implement
that button.

Fixes #21962.
2022-10-05 11:11:28 -07:00
Yogesh Sirsat 05a56fd764 user_info_popover: Fix missing translation tags. 2022-10-04 17:20:03 -07:00
Tim Abbott f0b8ae4fbe message_fetch: Fix calling pm_list.update_private_messages twice.
This also adds a comment noting a remaining performance bug we have in
this code path, namely fetching messages for a streams narrow will do
unnecessary work.
2022-10-04 16:46:08 -07:00
evykassirer c321f57785 settings: Explain that Google blob emojis are deprecated.
Part of fixing #19371.
2022-10-04 12:29:35 -07:00
Zixuan James Li 07050394b9 reload: Remove get_reload_topic.
This finishes up the work from 057ee6633a.
We had this "get_reload_topic" helper for user that has "topic"
encoded as "subject" from a older release. This is unlikely to cause
problem now because we no longer use "subject" for reloading since 2018.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-04 11:59:22 -07:00
Zixuan James Li 1e64aa9b79 drafts: Remove support for legacy drafts with "subject".
This removes the temporary get_draft_topic helper from utils and remove
references to draft.subject.

This finishes up the work from
9861cdfeb6. Since 2018 we had stopped
referring to the "subject" property, it is considered safe to remove
this code now. It's impossible to directly upgrade to the current
release without substantial downtime for upgrading the OS, so this
logic is unlikely to provide any future benefit.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-04 11:57:47 -07:00
Aman Agrawal 19ee1e92e7 msg_actions_popover: Allow keyboard navigation to mark as unread button.
We missed defining `tabindex` in the HTML element of the button.
2022-10-04 10:07:06 -07:00
Sofia B 2a4ec505e4
settings: Remove the "i" for "Message retention".
Fixes part of #22892.
2022-10-03 14:28:20 -07:00
Sahil Batra d6b85404d2 message_edit: Focus on dropdown-widget if only changing stream is allowed.
Previously, content box was focused inspite of it being disabled in case
when only stream editing was allowed. Now we instead focus on the stream
down.
2022-10-03 11:43:25 -07:00
Sahil Batra 6d5118674d popovers: Remove should_display_view_source from actions_popover_content.
Instead of having a separate field, we can use in if condition on
view_source_menu_item itself to determine whether to show the view
source option or not.
2022-10-03 11:43:25 -07:00
Sahil Batra 1dd89b8f9b popovers: Show "Move message" menu always when moving message is allowed.
Previously "Move message" option was not shown when content editing
was also allowed and also when only moving messaages between streams
was allowed but not topic edits.

Now we show "Move message" option when editing topics or moving
messages between streams is allowed irrespective of whether content
editing is allowed or not.
2022-10-03 11:43:25 -07:00
Akarsh Jain 67d7efefdc message_actions: Split the View source / Move message option into two menu options.
Split the View source / Move message option into two menu options that
take you to the same UI: Move message and View message source.
Previously, it was confusing to have this double option,
and hard to parse it at a glance.

-View message source uses the current icon.

-Move message uses the arrows icon from the Move topic menu option.

-New option order: (1) Move message, (2) Quote and reply or forward,
 (3) View message source.

Also remove the "Topic editing only" and "View source" text on the
bottom right of the message edit UI along with the tooltips. Only
the timer text is shown (along with tooltip) when content editing
is allowed.
2022-10-03 11:43:25 -07:00
Alya Abbott 5465e2d4d4 help center: Edit "Create your organization profile" info.
- Remove unnecessary screenshot with old Zulip branding.
- In the intro, clarify how the organization profile picture is used.
- Extract org profile intro into an included file.
- Describe the Preview organization profile button.
2022-10-03 11:33:30 -07:00
Aman Agrawal a80500cf5d css: Don't add unread indicator to the date row of first unread row.
Fixes #23030

If the first unread `.message_row` has a date_row, we don't show
unread indicator on it.
2022-10-03 11:31:35 -07:00
Aman Agrawal d00dc1188c communities: Hide catalog section and adjust spacing based on feedback.
Catalog section is hidden for now since there are not enough
orgs listed on the live page.
2022-09-30 11:45:30 -07:00
Aman Agrawal 12fe9b78de integrations: Keep 50px space between content and window.
I am not sure why we didn't want no space between them for
768px to  65px. It looks better with this change.
2022-09-30 11:45:30 -07:00
Ganesh Pawar 5b75fcd3e7 settings: Convert `form` to `div` in `Full name` input.
This prevents the web app from being reloaded when the user presses
`Enter`.

Fixes #22906
2022-09-29 17:11:15 -07:00
Ganesh Pawar 6b80f010f5 delete attachments: Add confirmation dialog.
Fixes #22814
2022-09-29 17:10:26 -07:00
Tim Abbott c99a40803b message_edit: Add 'message' to tooltip for view source.
Fixes part of #22537.
2022-09-29 11:20:02 -07:00
Akarsh Jain 72cc5d6bd2 message_actions: Rename Edit to Edit message and Collapse to Collapse message.
This commit renames Edit to Edit message and Collapse to Collapse message
for better readability and to match the Delete message and
Copy link to message options.
2022-09-29 10:29:51 -07:00
Yogesh Sirsat 544b88e7ec user_info_popover: Not displaying "Manage this bot" for system bots. 2022-09-29 10:19:21 -07:00
Lauryn Menard 842da9e10a analytics: Add messages sent in last 30 days summary statistic. 2022-09-29 09:06:29 -07:00
Lauryn Menard 954b0475fe analytics: Add total messages sent summary statistic. 2022-09-29 09:06:29 -07:00
Lauryn Menard 7f1a060c4d analytics: Add summary statistics section and user statstics.
Adds a section to the top of the stats page for organization
summary statistics. Also, adds the first two statistics to that
section for total users in the organization and users that have
been active in the past 15 days.
2022-09-29 09:06:29 -07:00
Lauryn Menard 06445dc5e1 analytics: Use flexbox for charts in stats page.
Reworks the stats page to use CSS Flexbox. Also centers the main
page header and reorganizes the order of the charts on the page.
2022-09-29 09:06:29 -07:00
Lauryn Menard a6232cfc69 templates: Use help link widget in invite user modal.
Updates the help center link in the invite user modal to use the
help_link_widget.
2022-09-28 16:03:40 -07:00
Tim Abbott b8a4bf6f40 settings: Remove 'useful for testing' from label.
This label is unnecessary and creates the potential for an incorrect
assumption that it's only useful for testing, when in fact it's a
reasonable configuration overall.
2022-09-27 10:43:51 -07:00
Sahil Batra fda471ab80 settings: Italicize text inside parens for presence_enabled setting. 2022-09-27 10:43:51 -07:00
Sahil Batra f151a4aa11 settings: Add option in settings_checkbox to show some text in parens.
There are cases where we add some text in italics inside parens along
with the label in checkbox settings.

This commit adds option to settings_checkbox template so that we can
directly use it and not require to duplicate the settings_checkbox
code and thus we now use settings_checkbox template for
enable_read_receipts setting.
2022-09-27 10:43:51 -07:00
evykassirer 8dca83265d messagebox: Undo regression that removed higlights for mentions.
Regression introduced in 3f66a9ef2b

CZO discussion https://chat.zulip.org/#narrow/stream/9-issues/topic/mention.20highlighting.20broken/near/1441212
2022-09-26 12:50:24 -07:00
Taiki 106b19ea42 css: Apply same margin to all 4 types of icons in message_view_header.
This `margin-left: 5px` was missing for globe icon. This change
ensures that all the 4 types of icons that are displayed have
the same margin.
2022-09-26 12:29:28 -07:00
Lauryn Menard aeb01cfeb3 analytics: Remove unused click handler in populate messages by client.
Removes a click handler in `populate_messages_sent_by_client` for
anchor links that start with a hash.

I think this goes back to when there was a sidebar navigation on
the stats page, which no longer exists. The only anchor link in
the current html is to the help center documentation and not part
of the Plotly charts.
2022-09-26 12:28:11 -07:00
Taiki 4ba9853481
stream settings: Fix buggy background color in narrow windows.
For some reason, the CSS declared a different background color for this element
only with a narrow window media CSS query. Change this color to the default 
background for the rest of this modal.

Fixes #22991.
2022-09-26 11:41:59 -07:00
Steve Howell 8fc811dfa9 unread: Add UI support for marking messages as unread.
Fixes #2676.

Co-authored-by: Aman Agrawal <amanagr@zulip.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2022-09-23 16:45:43 -07:00
Tim Abbott e7b97e25c9 message_list: Fix messages marked as read during rendering.
I found a highly reproducible bug using the "Mark as unread" feature,
which triggers a rerender via message_list.rerender_view().

The reproducer was as follows:
* Navigate to a narrow by going to All messages and using the `S` hotkey.
* Mark as unread to mark several messages as unread in that view.
* Notice that the message that had been selected in home_message_list
  is immediately marked as read again.

What was happening is that the reselect_selected_id call for
message_lists.home (All messages) was incorrectly re-marking the
currently selected message as read, even though (1) that view was not
visible and (2) this was an internal rendering change that could not
be the first time the message was selected.

Because only the current message_list has marking messages as read
blocked, it's still able to mark the currently selected message as
read.

All the callers of reselect_selected_id are internal rendering code
paths that are not intended to be user-visible; as a result, they
should not change the unread state either.

The bug fixed here is a potential root cause of #16986, but I haven't
had a chacne to confirm it.
2022-09-23 16:45:43 -07:00
Tim Abbott 1b18f1fb5d message_list: Move and deduplicate reselect_selected_id functions.
redo_selection and reselect_selected_id did the same thing: Reselect
the currently selected message as a result of internal rendering. I
combine the useful features of both -- not crashing if no message is
selected (id -1) and passing the `from_rendering` option, to avoid
potentially triggering an additional rerender.
2022-09-23 16:45:43 -07:00
Sahil Batra eba390c6b2 settings_org: Convert to number before parseFloat in parse_time_limit.
We now first convert the element value to number using "Number()"
function and then call parseFloat in parse_time_limit function.

If we do not do so and the input element contains something like
"24a", it will be converted to 24 after parseFloat and will result
in an unexpected behavior where the save-discard widget will not
appear if the custom value input is changed from "24" to "24a",
since the value is considered as same as before.

But now "24a" will return NaN and save-discard widget will
appear with save button disabled.
2022-09-23 16:24:16 -07:00
Sahil Batra 711536f53a settings: Fix custom time limit input validation.
Previously, typing something like "24aa" in message edit limit
custom input box would not disable the "Save changes" button
and clicking on it would set the limit to 24 minutes because
"24aa" was parsed to 24 by parseInt which is a valid value.

We now fix this to first convert the input to number using
"Number()" function and then use parseInt. "Number()" function
returns NaN for input like "24a" and other inputs containing
alphabet characters and thus it is considered as invalid value
and "Save changes" button is disabled.
2022-09-23 16:24:16 -07:00
Sahil Batra 37fefb374c settings: Refactor code of realm-default of notification batching period.
Previously realm-level default of email notification batching period
setting was handled as a special case in populate_data_for_request.

But now we have added some functions to handle time limit settings and
this commit changes the email notification batching setting to be
handled similarly.
2022-09-23 16:24:16 -07:00
Sahil Batra e53a76bc03 settings: Rename get_message_edit_or_delete_limit_setting_value function.
This commit renames get_message_edit_or_delete_limit_setting_value
function to get_time_limit_setting_value, so that we can use the
same function to get value for email notification batching setting
value.
2022-09-23 16:24:16 -07:00
Sahil Batra 009e06d868 settings: Extract a function to set msg edit and delete limit setting.
Since set_msg_edit_limit_dropdown and set_msg_delete_limit_dropdown
have almost same code except the ID of elements, we extract a common
function set_time_limit_setting and both the above functions call
this new function only.

We can use this function for topic edit limit setting which will be
added in further commits.
2022-09-23 16:24:16 -07:00
Sahil Batra 55cf61eaf3 settings: Do not show save-discard widget till custom input is not changed.
We now show save-discard widget on changing the message edit and delete
limit setting dropdown from any value to "Custom" only after value inside
the custom input is changed. This makes sense as the setting value is
not actually changed unless the custom input is not changed and also
makes the behavior consistent with realm-level default of notification
batching period setting.

After this change, the dropdown element and custom input element are not
considered as different setting elements for code purposes and are
treated as single setting like the realm-level default of notification
batching period setting. And thus we remove the prop-element class
from the custom input elements of these settings.
2022-09-23 16:24:16 -07:00
Sahil Batra 6b876bdf70 settings: Send only changed settings to server for msg edit subsection. 2022-09-23 16:24:16 -07:00
Sahil Batra ed070000e8 settings: Extract function to show/hide custom input.
This commit extracts a function to show or hide the custom
input of message edit and delete limit setting and to set
the initial value of custom input while showing it.
2022-09-23 16:24:16 -07:00
Sahil Batra 3fa7e68058 settings_config: Change time_limit_dropdown_values to a list.
This commit changes time_limit_dropdown_values from map to
list like we have email_notifications_batching_period_values.

This change will help us in further commits for refactoring
the message edit and delete settings related code.
2022-09-23 16:24:16 -07:00
Sahil Batra 17aba277c5 settings: Change id and name of message delete limit dropdown.
We change the id and name of message delete limit dropdown to
"id_realm_message_content_delete_limit_seconds" and
"realm_message_content_delete_limit_seconds" respectively.

This is a prep commit for sending only changed settings in
message editing section to the API.
2022-09-23 16:24:16 -07:00
Sahil Batra 1e9c65b759 settings: Change id and name of message edit limit dropdown.
We change the id and name of message edit limit dropdown to
"id_realm_message_content_edit_limit_seconds" and
"realm_message_content_edit_limit_seconds" respectively.

This is a prep commit for sending only changed settings in
message editing section to the API.
2022-09-23 16:24:16 -07:00
Sahil Batra 0dfcc14ebb settings_org: Rename changed_val variable to proposed_val.
This commit renames changed_val variable to proposed_val
in check_property_changed function for better readability.
2022-09-23 16:24:16 -07:00
Tim Abbott 155787512f css: Modal read receipts CSS to modal.css. 2022-09-23 16:21:31 -07:00
Riken Shah ff899e5c31 read_receipts: Disable showing read receipts for Notification Bot msgs.
The implementation is simple, we just check if the
the message sender is a notification bot to decide if we
should show the read receipts list.

We also update the modal content styling to match the padding at the
top of the modal.

Fixes #22905
2022-09-23 16:20:25 -07:00
Tim Abbott 80e4dcb042 settings: Remove trailing period for reactions setting.
All of our other settings labels don't have a trailing period.
2022-09-23 12:27:54 -07:00
Lauryn Menard d5b7551f09 frontend: Implement 'invisible mode' feature.
Transitions the frontend of the web app to no longer use the
user status `away` field for setting a user's activity status
to be 'unavailable' (which is now a deprecated way to access
a user's `presence_enabled` setting).

Instead we now directly use and update the user's `presence_enabled`
setting for this feature.

Renames frontend code related to the feature to `invisible_mode`
vs `away`.

We lose node test coverage in `user_status.js` because we are now
using `channel.patch` to send these user setting updates to the
server.

Removes the temporary updates to `server_events_dispatch.py` (and
related tests) made in a previous commit, since we no longer have
or need the `away_user_ids` set.
2022-09-23 12:27:54 -07:00
Lauryn Menard 5accbf38bf frontend: Update `away_user_ids` for presence_enabled update events.
Because the web app has the capacity to update the presence_enabled
user setting directly, we need to temporarily ensure that the
user profile popover is also updated to the correct text/value.

This can be removed once the web app client transitions to use
the presence_enabled setting for the 'invisible_mode' feature.
2022-09-23 12:27:54 -07:00
Yogesh Sirsat 5248f1c40b settings_bots: Change text "profile picture" to "avatar". 2022-09-23 12:06:51 -07:00
Yogesh Sirsat 601bd796a1 bots: Live update add new bot button on changing bot_creation_policy. 2022-09-23 12:06:51 -07:00
Yogesh Sirsat 0b3dd4755e settings_bots: Make it possible to add new bots from org settings.
Adding an "Add a new bot" button to Organization settings > Bots,
which opens a `Add a new bot` form modal from `settings_bots.js`.

Fixes #20309.
2022-09-23 12:06:51 -07:00
Yogesh Sirsat 6db88f0d39 settings_bots: Move "Add a new bot" tab inside a modal.
"Add a new bot" tab from personal `settings > bots` moving this
into a modal form, so we can trigger this form from other places
too without duplicating the code.

Fixes part of #20309.
2022-09-23 12:06:51 -07:00
evykassirer bca41fd29f reload: Preserve unused reload tokens for a week.
Previously, we deleted all reload tokens on each reload, which
created a race condition if there were multiple tabs open.

Now, we continue to delete tokens after using them, but if a
token is not used it is preserved for a week before being deleted.

Fixes #22832.
2022-09-23 10:59:59 -07:00
Aman Agrawal 5ef1b1f5da portico: Fix footer text overflow in different languages.
Fixes #22946
We fix width of footer sections and let the text overflow within.
2022-09-23 10:49:48 -07:00
Mateusz Mandera a359362845 delete_topic: Add retry logic in the webapp. 2022-09-22 15:01:43 -07:00
Tim Abbott 09c6ee6468 settings: Fix redraw_bots_list when adding/removing bots.
The ListWidget component needs to be provided with an updated list of
elements to display in order for it to show new items when
rerendering.
2022-09-22 12:31:28 -07:00
David Rosa 4549529714 help: Document "Mark messages as read on scroll" mobile app feature.
Adds section on how to configure whether messages are automatically
marked as read.
Adds instructions to manually mark all messages as read, or mark all
messages in a stream or topic as read.
Adds the all messages tab image icon.

Fixes: #22915.
2022-09-22 10:36:41 -07:00
Aman Agrawal 5d76f67247 rendered_markdown: Fix alignment of icons in code blocks. 2022-09-22 10:35:33 -07:00
Sahil Batra 086147fdc4 settings: Move display_in_profile_summary checkbox to center.
We move display_in_profile_summary checkbox in the custom
profile fields table to center. We also need to move heading
subsequently to the center.
2022-09-21 11:06:54 -07:00
Yogesh Sirsat a3094d0f26 custom_profile_fields: Toggle new "display_in_profile_summary" field.
Custom profile fields table `CSS` changed to fit the new "Display"
column of checkboxes, checkboxes are for select/deselect custom
profile field to display in profile popover.

New option "Display in profile summary" added in create and edit
custom profile fields form, with the help of this the user can
pick max of 2 custom profile fields except for `LONG_TEXT` and
`USER` fields to display in his user profile popover.

Checkboxes will go in a disabled state, with an explanatory tooltip,
if we've already passed the limit of 2 fields with this setting
enabled.

Fixes #21215.
2022-09-20 17:03:57 -07:00
yogesh sirsat cd71fdea60 popovers: Display custom profile fields in user profile popover.
Displaying custom profile fields in user profile popover, as mentioned
in the issue.

In `popovers.js` filtering out only those custom profile fields, which
are not `LONG_TEXT` or `USER` fields and their values are not empty.

Custom profile fields rendering in profile popover the same way use
similar rendering logic as in the user's full profile modal.

Fixes: #21215
2022-09-20 17:03:57 -07:00
Lauryn Menard 9177ac7a4c buddy-data: Remove unimplemented `user_circle_status` description.
In #11882, the alternate tooltip text/behavior for user status
circles was removed from the implementation, but not from the
buddy list data.

This commit removes the `buddy_data.status_description` function
and related frontend tests. There are no remaining instances of
`user_circle_status` in the codebase.

Prep commit for transitioning from 'unavailable' user status
feature to 'invisible mode' user presence feature.
2022-09-20 10:04:11 -07:00
Sahil Batra b3b6449034 settings: Enable and disable the save button in change_save_button_state.
We now enable and disable save button when changing inputs for custom time
limit settings in change_save_button_state function only which shows or hide
the save-discard widget instead of handling them in "change" event handlers.

This fixes the bug of save button flashing to its enabled state from
disabled state before hiding after clicking on "Discard" as now button
is re-enabled only after save-discard widget is hidden and it is disabled
if required before being shown.

Note that there is still a bug for message edit and delete limit settings
where the save button flashes to enabled state when setting is changed to
the original value instead of clicking on "Discard". This bug is not present
for email notification batching setting in a follow-up PR.

This commit also renames update_save_button_state function to
enable_or_disable_save_button to avoid confusion with
change_save_button_state function.
2022-09-19 20:20:53 -07:00
Sahil Batra a446f05c98 settings: Disable save btn for invalid values of batching period setting.
We disable the "Save changes" button for invalid values in custom
input of realm-level default of email notification batching period
setting.
2022-09-19 20:20:53 -07:00
Sahil Batra fa63045b49 settings: Rename dropdown value for custom option for msg limit settings.
This commit renames dropdown value for custom option for message edit
and delete limit settings to "custom_period" to make it consistent
with the value for email notification batching setting and thus
we can avoid code duplication in further commits.
2022-09-19 20:20:53 -07:00
Sahil Batra 25223539d1 settings_org: Move update_save_button_state function to module level.
We would use update_save_button_state for realm-level default of
notification batching setting also in further commits.
2022-09-19 20:20:53 -07:00
Sahil Batra 2933f079b8 settings: Modify update_save_button_state to use it for other settings.
This commit modifies update_save_button_state such that it can be used
for other time-limit settings too.
2022-09-19 20:20:53 -07:00
Lauryn Menard 7a0d659f14 templates: Add HTML title element to templates that extend base/portico.
Adds HTML title elements to templates that extend either `base.html`,
`portico.html` or `portico_signup.html`, and that are not website
portico landing pages that will use the `PAGE_TITLE` variable to set
the HTML title element (see following commit in series).

Also, updates some templates for missing translation tags.

As a general rule, we want the title element (and page content)
translated. Exceptions that are updated in this commit are templates
used in the development environment, analytics templates that are used
by staff and templates related to Zephyr.
2022-09-19 20:17:17 -07:00
Aman Agrawal 683a5e7c23 view_code_in_playground: Fix tooltip being partially hidden. 2022-09-19 14:11:53 -07:00
Lauryn Menard 5441ec7d16 buddy-data: Remove unused `get_my_user_status` function.
As of 297379029d, the data for the current user's buddy list
row no longer uses the '(unavailable)' or '(you)' text generated by
`buddy_data.get_my_user_status`. This commit removes the function
and related frontend tests.

Remaining instances of `my_user_status` in the codebase are related
to the CSS rule in `right_sidebar.css`, which is still relevant.

Prep commit for transitioning from 'unavailable' user status
feature to 'invisible mode' user presence feature.
2022-09-19 14:09:21 -07:00
Purushottam Tiwari 4db6c51fb1 stream_edit: Fix warning in confirm dialog modal from sub-unsub modal. 2022-09-18 16:02:08 -07:00
Ganesh Pawar a1ac78f34e delete custom emoji: Add confirmation dialog.
Fixes part of #22812.
2022-09-17 11:55:33 -07:00
Ganesh Pawar 4c32972274 modals: Add `data-simplebar` to `login` and `api key` modal.
c439b9d3af added `data-simplebar` to
the `dialog_widget` module, but these modals don't use it. So, add it
separately.
2022-09-17 11:45:36 -07:00
Yogesh Sirsat 2a9145c212 user_profile: Initialize user type fields only when necessary. 2022-09-16 17:51:34 -07:00
Yogesh Sirsat 9416427dc2 settings_bots: Open bots streams tab from personal settings > bots.
UI in settings for bot owners to unsubscribe their bots from streams,
Personal settings > Bots > Bot info card > hashtag icon.

Fixes: #22460
2022-09-16 17:51:34 -07:00
yogesh sirsat d3b4b1cefd stream_bots: Display unsubscribe button on bots full profile modal.
Displaying unsubscribe button on bots full profile modal, allowing bot
owners to ubsubscribe their bots from streams.

Admins can also unsubscribe any bot from any subscribed streams from
bots full profile modal.

Fixes part of: #21402
2022-09-16 17:51:34 -07:00
Yogesh Sirsat 23fbd38b4c bots: Display full user profile modal for bots.
This commit can display a full user profile modal for bots too,
by clicking on "View Full Profile" in the profile info popover
same as normal users.

Fixes part of: #21402
2022-09-16 17:51:34 -07:00
yogesh sirsat 45307affc0 popovers: Text change from "Owner" to "Bot Owner" in profile popover. 2022-09-16 17:51:34 -07:00