Commit Graph

2621 Commits

Author SHA1 Message Date
yogesh sirsat 078d966c64 modals: Refactor help_link_widget for confirmation modal.
Added class "help_link_widget" and applied existing css,
to `a` tag of help_link_widget.

Follow-up of #21508.
2022-03-25 10:43:37 -07:00
Aman Agrawal d006b6cc3d message_list_view: For spectators, show login button for failed images.
We render a login button for images that failed to load for
spectators. The image failed to load most likely due to being
rate limited by the server.

Fixes #19840
2022-03-24 10:50:00 -07:00
SantamRC 373f700736 widgets: Fix line wrapping of todo descriptions.
The simplest solution for doing this involves adding some divs.

Fixes #20523.
2022-03-21 17:52:45 -07:00
somesh202 cf5a70a958 settings: Fix buggy heading hover behavior for some settings panels.
Previously, hovering over the table headers in the code playground
table in the dark theme looked wrong. We were able to trace this issue
to the table-sticky-headers class not having been applied to this
table. The `alert-words` table was also affected and is fixed as well.

This also adds the `actions` class in alert-words table to fix the
inconsistency of the actions column in that table.

We've done an audit and these are the only two instances of either
bug in the HTML templates for a settings table.
2022-03-21 17:24:23 -07:00
Austin Riba 3df0cacd9e messages: Show tippy tooltip for inline images.
This commit adds a tippy tooltip for inline image previews in messages.

There exists some (reasonable) logic in `static/js/util.js` which
overrides all title attributes for links to user-uploaded content to
ensure they always display "Download <filename>". This doesn't make
sense for inline images specifically because they will be opened in a
ligthbox, so we prevent that.

There is an additional tippy instance created in `static/js/tippyjs.js`
to add tippy tooltips to inline images, which takes advantage of the now
preserved title attribute of the parent link.
2022-03-21 15:36:10 -07:00
Ganesh Pawar b7edd5df2f settings: Place the saving indicator in the header.
Fixes #21441.
2022-03-21 13:30:38 -07:00
yogesh sirsat 0d31781aed popovers: Support reactivating users from user profile popover.
If the target user is deactivated, `Reactivate this user` will be
shown as one of the options in the small user profile popover, where
`Manage this user` would usually be.

We rename `show_manage_user_option` to `can_manage_user` because now
it will also be used as the common condition for whether the current
user has administrative permission to active or deactivate the target
user.

The implementation closely follows the existing deactivation modal.

Fixes #21428.

chat.zulip.org discussion:
design > reactivate user from user popover
2022-03-18 15:19:13 -07:00
yogesh sirsat 1fb4dd2eee popovers: Remove parens around "This user has been deactivated".
These feel like unnecessary clutter, given that we also have italic
styling for this element.

Fixes part of #21428.
2022-03-18 15:19:13 -07:00
yogesh sirsat 211f137fc8 popovers: Remove the "Manage this user" link for deactivated users.
The "Manage this user" link did not work correctly for deactivated
users.

Fixes part of #21428.
2022-03-18 15:18:56 -07:00
sayamsamal 7fcac3288b settings: Fix alignment issues for non-English languages.
Due to differences in length of the words for different languages
there were alignment issues in the organization profile settings.

This commit uses flexbox to ensure that the alignment stays correct
for any changes in language/word length.

Fixes #21385
2022-03-18 14:43:13 -07:00
Aman Agrawal bae5f016bf compose_control_menu: Allow to enter press to open the menu.
Make `compose_control_menu_wrapper` clickable and allow tab focus
on it. Disable tab focus on `compose_control_menu` icon. Fix outline
for `compose_control_menu_wrapper`.

Extend out custom outline property to all `[role="button"]` elements.
2022-03-15 16:14:25 -07:00
Tim Abbott a4d42392a6 settings: Avoid dropdown_list_widget on same line as labels.
The 3 instances of dropdown_list_widget using the `label` property had
different design than the rest of all of our dropdowns, in that the
label was on the same line as the dropdown.

Fix this by adjusting the `label` option to use our standard
`dropdown-title` CSS class.

Also remove the colons in the labels.

I confirmed that these were the only instances of this widget using
the label feature.

Fixes #20415.
2022-03-15 16:08:41 -07:00
Tim Abbott 6b6a1d53f7 stream settings: Remove Bootstrap collapse class.
This class was leftover from a very old version of this design, and
had the side effect of settings `overflow: hidden` on the panel.

This, in turn, resulted in the focus outlines for clicking on
checkboxes looking broken.
2022-03-10 15:49:18 -08:00
Tim Abbott 89afe55076 stream settings: Fix inconsistent headings for subscribers panel.
Previously, these two headers were inconsistent with the rest of the
application, and with "Edit subscribers". We make them the same as
"Edit subscribers".
2022-03-10 15:27:52 -08:00
NerdyLucifer 10e6fd04e7 stream_settings: Fix fonts & margins in create/edit stream form.
In "stream_types.hbs"
For "Who can access the stream?" and "Who can post to the stream?" replace
"h4" with "label" to make the for smaller and to remove boldness.
For "Message retention for stream" replace the "h4" with "label"
and add class="stream-title".

In "subscriptions.css":
Add "margin:25px auto" to "#announce-new-stream" to ensure equal
gaps above and below it.
Reduce margin and paddings for ".radio-input-parent".
For "select" set "width: fit-content" and
"height: fit-content" to ensure that the text in the
dropdown is clearly visible.

Fixes: #21322
2022-03-10 15:20:20 -08:00
NerdyLucifer 5f472b1607 stream_settings: Implement dropdown widget for "stream post policy".
In stream edit and stream create replace the existing checkbox
format for choosing "stream post policy" with dropdown widget.

In "stream_types.hbs" implement the dropdown menu and remove
the checkbox format for selecting "stream post policy".

In "stream_create.js" and "stream_edit.js" edit the code for
"stream_post_policy" to extract the "stream post policy" value
from the dropdown menu after submitting the form.
2022-03-10 15:11:35 -08:00
Sayam Samal 681414caf1 user_profile_modal: Interchange posititons of "Joined" and "Role" fields.
This commit swaps the posititon of "Joined" and "Role" fields in the
User Profile Modal to make it consistent with settings/profile.
2022-03-10 15:10:24 -08:00
Sayam Samal 4227f74638 user_info_popover: Interchange positions of 'Role' and 'Local time'. 2022-03-10 15:10:24 -08:00
Sayam Samal cccb3b1b32 settings: Move user details to the right side panel in profile section.
This commit moves the "Role" and "Joined" attributes to the right
side panel of settings/profile to maintain continuity between the
mutable fields.
2022-03-10 15:10:24 -08:00
Sayam Samal 2bf63c1e49 settings: Remove profile picture header in the profile section.
This commit removes the profile picture header and adds an overlay to
handle disabled avatar changes in an organization.
2022-03-10 15:10:24 -08:00
Sahil Batra cb15e0265d settings_users: Do not allow sorting by email if emails are hidden. 2022-03-09 13:56:57 -08:00
prashantpaidi 05af6fd8b4
recent topics: Disable browser autocomplete filter widget.
The browser autocomplete is annoying/unhelpful here.

Fixes #21349.
2022-03-09 13:56:14 -08:00
Greg Price 7852d8e015 topic_list_data: Move "if resolved" conditionals to a single place.
These two conditionals are each relying on the other to trigger
on the same condition, and to do complementary things.  Move them
together to a single place so that that relationship is easy to see,
and to refactor.
2022-03-07 21:35:00 -08:00
Steve Howell c43d48b22f stream create: Overhaul create-stream add-subscribers UI.
The most notable change here is that when you are adding
subscribers to a stream as part of creating the stream,
you can now use the same essential pill-based UI for
adding users as we do when you edit subscribers for an
existing stream.

We don't try to exactly mimic the edit-stream UI or
implementation, since when you are adding subscribers
during create-stream, we are just updating a list in
memory, whereas in the edit-stream UI, we immediately
send info to the server.

Fixes #20499
2022-03-07 16:58:58 -08:00
Steve Howell 2644fa9645 settings: Make list header sections consistent.
I made the header sections above all our settings
panel lists more consistent.

Before this change:

    * some lists had titles, others didn't
    * the placement of the filter box was random
    * alerts strangely went between the filter box
      and the list
    * filter boxes were too large
    * CSS was haphazard
    * forms were squished against tables

Now all the settings with list have consistent
HTML, CSS, and look-and-feel in the area directly above
their list of items.

With the exception of Custom Profile Fields, all the
lists with headers above them happen to be based on
ListWidget, but the header styling is not coupled
to ListWidget, because we want consistent headers
even if Custom Profile Fields has a non-ListWidget
list (due to its drag&drop features).
2022-03-04 14:37:28 -08:00
Steve Howell 87aa318e3a edit streams: Change headings and move filter box.
The new layout is:

    Add Subscribers

        [input pill] [Add]

    Subscribers             [filter]
    <list of subscribers>
2022-03-04 12:01:09 -08:00
Steve Howell 79b9759c0b edit streams: Show "(you)" next to your name.
We show "you" in the subscriber list. This is similar
to what we already did in the Users tab.
2022-03-04 12:01:09 -08:00
Steve Howell 5f95a33fa3 create streams: Remove "Stream permissions" header.
The header was more confusing than helpful, and we
want the create-stream UI to be less cluttered.

We don't really need the help-center text here, since
we already have ? icons next to the relevant headings
for the sub-sections.

We kill off some CSS, but we won't kill off stream-title
until the big upcoming changes for stream pills.
2022-03-04 12:01:09 -08:00
Steve Howell 1ff7d91af6 create streams: Use vanilla labels for name and description. 2022-03-04 12:01:09 -08:00
Steve Howell aaf0449059 edit streams: Change "Search" to "Filter".
We only change stream-edit for now, for tactical reasons.

(We have big upcoming changes to stream-create.)
2022-03-04 12:01:09 -08:00
Julia Bichler 24673b7a69 settings: Grey out muted streams in personal settings.
Muted streams are now greyed out in the personal settings,
also changes to the notification settings of a muted stream are
not possible anymore.

Also, add a bell-slash icon after the stream name of muted streams,
clicking on it unmutes the stream.

Fixes #19780.
2022-03-03 14:51:15 -08:00
Austin Riba 75a29d6b82 lightbox: Remove Pan/Zoom enable button.
With the recent changes to lightbox image handling in #21145 and #20788
it is no longer necessary to have panning and zooming disabled by
default. This commit removes the enable/disable button and instead
replaces it with a "Reset Image" button, and enables panning and zooming
as the default state of the lightbox.
2022-03-03 13:48:32 -08:00
Austin Riba eae0975b63 lightbox: Prevent long titles from altering layout.
This commit attempts to prevent images with long filenames,
descriptions, or author names displayed in the lightbox from altering
the layout of the page.

It also adds a title prop to both the filename and author, allowing a
user to hover and see a tooltip of the full text in the case where the
text is truncated.

Fixes #21058.
2022-03-03 13:48:32 -08:00
Anders Kaseorg 44767dd653 tippyjs: Avoid unsafe allowHTML API in favor of <template> elements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-03 10:13:24 -08:00
Steve Howell 8c1ed7359f manage streams: Promote "Announce stream" in UI.
The option to announce streams is tied to whether
it's public or not, so it makes sense to move it
here.
2022-03-03 10:08:08 -08:00
jai2201 a8b948c086 tippy: Fix `cancel button` tooltip in compose box.
Add `data-tippy-allowHTML="true"` in button tag and fix the tooltip
for cancel button in compose box.
2022-03-02 09:39:15 -08:00
Yogesh Sirsat 67870090f5
settings: Use "Label" consistently for custom profile field label.
We use Label as the heading for the field label column in the custom profile
fields table; but for some reason the edit UI called this "Name" instead.

Fixes #21260.
2022-03-01 21:08:34 -08:00
Austin Riba b22578f975 hash_util: Rename _uri functions to _url.
It's 2022 and the WHATWG no longer recognizes the term URI. Everything
is now a URL or a type of URL. Which is great because it's way less
confusing. Details here:
https://url.spec.whatwg.org/
2022-03-01 18:14:31 -08:00
Anders Kaseorg e090027adc CVE-2022-23656: Fix cross-site scripting vulnerability in tooltips.
An attacker could maliciously craft a full name for their account and
send messages to a topic with several participants; a victim who then
opens an overflow tooltip including this full name on the recent
topics page could trigger execution of JavaScript code controlled by
the attacker.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 14:26:42 -08:00
Tim Abbott 7cc553b75d spectators: Add divider before sidebar login/signup buttons.
This slightly improves the visuals of this component.
2022-03-01 11:51:46 -08:00
Aman Agrawal 7e365f7ee3 icons: Replace fa-globe icon with a custom globe icon. 2022-03-01 11:36:38 -08:00
Anders Kaseorg f244c2eca4 Revert "drafts: Use simplebar for scrollbar."
This reverts commit f3964673e7.

It broke drafts_scroll by confusing jQuery object APIs with DOM
element APIs.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-28 15:26:47 -08:00
Julia Bichler f3964673e7 drafts: Use simplebar for scrollbar.
This was originally merged in #21082 in a different variation.
2022-02-28 15:06:19 -08:00
Sahil Batra 9f89d7e069 left_sidebar: Move "Recent topics" higher in the sidebar.
This should increase its visual priority in the UI. We plan to move
"Private messages" to a different component more similar to STREAMS
soon.

Fixes #20869.
2022-02-28 12:09:24 -08:00
jai2201 d6c00521b3 settings: Clean up muted_topics/users rendering logic.
This commit removes the unnecessary `data-list-widget` attribute
present in the <div> and <tbody> tag for muted_topics and muted_users table.

It became unnecessary/useless in 19cf6d0e04 and
then was renamed while still useless.

Also uses the correct variable name `muted_topic` and `muted_user`
instead of `muted_topics` and `muted_users` to render a item of their list
in DOM through Listwidget.
2022-02-25 17:33:11 -08:00
jai2201 5e49ddf4e1 settings: Add sorting feature for list of alert words.
This changes the method of rendering list of alert words in DOM,
earlier it was rendered using 'for' loop over the array of alert_words
which is now changed to render using ListWidget, which gets a array
of objects from get_word_list() in alert_words.js.

The use of ListWidget helps to define a parent_container and $container
in table-body of alert-words-table using which we can now apply sorting over
alert words with the help of handle_sort() function in list_widget.js

Changed the method of adding alert_word_settings_item row in table body
through {{#with}} loop because of rendering through ListWidget, which was done
earlier using for loop over each alert-word in while rendering the list.

this commit also mocks template of render_alert_word_item
while mocking ListWidget.create() function in render_alert_words_ui().
and checks that ListWidget.create() is not called when variable `loaded`
is set as false.

Fixes #21142.
2022-02-25 17:33:11 -08:00
Aman Agrawal 5ae178b39c recent_topics: Show loading indicator before fetching initial messages.
Hide the loading indicator after initial fetch for recent topics.
2022-02-25 16:29:43 -08:00
Sahil Batra 9be82356cb invite: Add frontend support to send an invite which never expires.
Fixes part of #20337.
2022-02-24 16:32:20 -08:00
Sahil Batra cec8191bfa popovers: Add option to deactivate user to "Manage user" modal.
This commit adds option to deactivate user to "Manage user" modal.
A modal is opened on clicking the option to confirm the deactivation
and the "Manage user" modal is closed.
The error from the server, if any, is shown in the modal itself
and in case deactivation is done successfully, the modal is closed.

Fixes #18944.
2022-02-24 15:59:58 -08:00
Steve Howell 22660a78c7 edit subscribers: Generalize pill/button handling.
This will help us avoid some duplicate code when
we use input pills for stream-create.

See the long comment in set_up_handlers() for
more context.

We also rename:

    submit_add_subscriber_form -> subscribe_new_users

Ideally set_up_handlers() would also extract the
concept of clearing the pills as soon as you either
hit enter or clicked on the Add button, but our
current paradigm for clearing pills when you edit
subscribers for an existing stream on the Subscribers
tab is that we wait for the server to acknowledge
the request. I believe this is a bit of a misfeature,
but I am punting on that change for now.
2022-02-22 16:29:36 -08:00