This commit changes the bot-edit modal to use dialog_widget instead of
edit_fields_modal.
This commit also removes edit_fields_modal module as it is no longer used.
This commit changes the edit-user-info modal to use
dialog_widget instead of edit_fields_modal.
The edit_fields_modal module will be removed in
further commits to avoid code duplication.
This commit changes the edit-linkifier modal to use
dialog_widget instead of edit_fields_modal.
The edit_fields_modal module will be removed in
further commits to avoid code duplication.
We show red color for confirmation modals and green for other
modals with input fields.
As of this commit, only confirmation modals use dialog_widget but
some other modals with input fields will be migrated to use
dialog_widget.
We used html_submit_button to pass text to be present in the modal
submit button. There are only two possible options as of now -
"Confirm" and "Save changes" and the correct one can be determined
using is_confirm_modal parameter. So, we remove this paramter for
now and we can add it later if we have more type of modals using
this widget.
This commit adds a new dialog_widget.js file containing most
of the code of confirm_dialog.js with some minor changes and
changes confirm_dialog to be a wrapper around dialog_widget.js.
We pass 'is_confim_dialog' as true in dialog_widget for a
confirm_dialog modal. This commit also renames confirm_dialog.hbs
and confirm_dialog_heading.hbs to dialog_widget.js,
dialog_widget.hbs and dialog_widget_heading.hbs respectively.
This commit renames the variables, functions used in confirm_dialog.js
and classes and ids used in confirm_dialog.hbs.
This change is made so that we can easily migrate edit_fields_modal to
use this same code with some more changes.
We will change the file names and correspondingly import variables in
the next commit.
The expand-compose icon currently overlaps with the
recipient input field of private message compose box.
Reduce the size of the division to fix overlap.
Added CSS property of cursor as pointer to the copy
icon in about_zulip section which indicates the
icon to be clickable.
(This minor adjustment was probably missed in a74b52db22)
As we want subscriber list to occupy rest of available space
in the tab, we use relative units (vh) and calc to set the
max-height property dynamically without losing scroll behavior
for stream list.
This avoids showing a highlighted checkmark for resolve topics, which
looks weird given that the topic name itself contains a "resolve
topic" checkmark.
We are doing this to avoid annoying behavior, when
"enter sends" is enabled, and the user accidentally hits
"Enter" and has to deal with the error message.
Fixes#19182
We improved it in the following ways:
* Show the error message with the maximum character
limit.
* Disable the send button.
* When the user tries to send the message via hotkeys
i.e, When "Press enter to send" is enabled or the user
uses "Shift" + "Enter" shortcut, Flash the red border
around the compose box.
Also renamed `check_and_set_overflow_text` to
`check_overflow_text` for better clarity.
This bug was found when the user tries to send a
over character limit message, i.e It has failed the
validation but it still shows the "Sending..." text.
This commit essentially migrates our custom email tooltip
to tippy tooltip for displaying user's email when their
names would overflow past the right edge of user popover.
This also removes the `email_tooltip` and `tooltip_holder` HTML
classes aloong with their CSS styles as they no longer used.
We use subs as a common variable name for a collection of stream
data structure used in settings, in lot of modules. So this
rename clears a bunch of related shadowed variables.
Another minor issue fixed in this commit is behaviour of cursor
on hovering message retention setting label. We fix it by changing
this element this to be a div instead by label. It could be fixed
by adding a css rule for this instead of changing it to div rather
than label but this looked more stable to future refactors.
Labels for stream post/privacy value settings were not properly
linked with their input element so clicking on labels did not
toggle radio buttons. We fix this by having inputs elements inside
label elements to have correct linking.
We remove icons (hash | lock | globe) in permission description of
an stream, as it is pretty obvious as we use them at quite a number
of places with stream names, also it does not fits well with rest of
the text in that area.
Previously stream permissions were hard to find and understand
as they were displayed like a paragraph in description format.
We improve them by using a list item for each different permission.
We had a common title `stream settings` for two cases
when no stream was selected and also when settings for
a particular stream were shown.
To improve this situation we now show `Settings for {stream_name}`
when settings for a particular stream are shown.
We move away from a single scrollable page to have a tabs settings
structure instead.
This commit consists of the minimal changes required to set up toggler
component. And the subsequent commits would include all the UI UX
changes required for updating the layouts.
Co-authored-by: Ryan Rehman <ryanrehman99@gmail.com>
Similar to what mentioned in 2e196fd5d3
previous sea-green colour didn't meet the WCAG AA standard
guidelines for color contrast. This changes meets WCAG AAA
standard.
When editing a topic name (and the topic name has some link
in it) through the recipient bar, the external link icon
overlaps with the stream name. Shifting the code now
ensures that the external link icon would appear to the
right of the topic edit form box.
Also see: https://chat.zulip.org/#narrow/stream/9-issues/topic/topic.20edit.20recipient.20bar
This commits removes the redundant `compute_show_invites` function
which computes the `show_invites` page parameter in `lib/users.py`.
It is so because, commit 13399833b0 removed
the `show_invites` context variable passed in index.html.
Hence, the `show_invites` page_param key is no
longer required to compute in backend as it can be switched with
`settings_data.user_can_invite_others_to_realm()` in the frontend.
This commits also removes the `test_compute*` tests in
`test_home` that concerned with the `show_invites` page parameter
as they are no longer required.
This reverts commit 5a61c9bb14 (#18849),
which had a number of bugs:
• It had a poor interaction with Ctrl+Shift+L resulting in double link
formatting.
• It didn’t work at all in Firefox.
• It didn’t check whether what you’re pasting into is even a compose
box.
• On pasting into the message edit box, it would throw “Error: Cannot
read property 'text' of undefined”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
We extract the code for checking night mode setting on
the basis of color_scheme value and using matchMedia when
color_scheme is set to automatic. This is currently used
in rendering the correct logo only.
This is a prep commit for fixing loading indicator not
visible on message-edit button in night-mode.
Our dropdown-toggle buttons are meant to have the same size as select
elements, but looked weird if you selected a stream with non-English
characters in its name.
We fix this by copying some styling details settings from our common
input/select styling.
Fixes#18479.
This commit makes a working toggler in compose_actions that adds the
compose-fullscreen class to the compose that removes the max-height
from the compose textarea and adds flex elements above so that the
height automatically adjust with the device height. This results in
making the compose box full screen sized.
The compose_height.js maintains the state of the height of the compose
box. Also, when the compose box is closed, the compose box is reset to
it's default behaviour and original height. So, everytime user need
not toggle off the compose full size and only for specific message
it is used.
It also adds destroy autosize on compose_height state change.
It destroys the autosize of textarea when the full
screen sized compose box is toggled on. And everytime when it is
turned off, it reinitialises the autosize. This also adds a
condition in autosize_textarea to only autosize when composebox
is not in full height state.
Fixes#17660
We extends composebox_typeahead to support autocompletion
suggestions on editing the topic of a message from message
edit form as well as from recipient bar.
Tweaked by tabbott to have correct keyboard interaction without
needing to patch Bootstrap.
Fixes: #16368.
This change ensures that we pop up the typeahead when one
has entered just `@`. This will make clear to the user
about the @-mentions feature in Zulip.
This also makes us consistent with expectations from other
chatting apps like Slack, Discord, etc.
Added few test cases and modified the present ones.
Fixes: #19142.
Fix a bug where the compose box cut the message without warning the user
the message pasted was longer than the allowed. It was fixed by stopping
cutting the message off and showing an indicator whenever the limit exceeds
and removing the indicator as soon as message gets less than that.
The cut off for showing the indicator is set as 90% of the limit.
Fixes#15909
Co-authored-by: João Maurício <carvalho.joaomauricio@gmail.com>
We show the text, which is either the linkifier label or the URL
(depending what generated the topic link).
For the desktop app at least, we probably as a follow-up want to also
show the URL.
(Though maybe it'd be better to just make the desktop app display the
URL).
Generally, tooltips placed at top look good. If the tooltip cannot
fit at top, it will by default be placed at opposite side.
Removed the unnecessary top placement definitions.
We add some additional delay so that user doesn't have to see
them every time but it is the delay is short enough so that
a user can view the full name of long streams without waiting
too long.
This commit changes the pastehandler to have a case when
a url is tried to paste on composebox. It instead of
directly pasting it, changes the content as we do using
ctrl + shift + L, just the difference is here it uses,
the copied text instead of url and cursor moves forward.
Fixes#18692
This commit migrates the `navbar.html` Django template
to handlebars by creating a new file as `navbar.hbs`
within `/static/templates` which is then rendered
using `ui_init` module.
As a part of migration, we also remove the `search_pills_enabled`
and `embedded` parameters from the context attribute as they
are no longer needed now.
Fixes part of #18792.
Right now, on clicking `quote and reply` on any message, the quoted
message is always inserted at the top of compose-box irrespective of
the current cursor position. Also, after insertion of the quoted
message, the cursor is shifted at the end of the compose box.
This commit changes this behaviour to insertion of quoted message
at the current cursor position with a newline at the end of quote
and moving the cursor position to that newline after insertion.
A newline is added at the beginning of quoted message only if there
was some content already present in compose box before the previous
cursor position.
Tested on Google Chrome and Firefox browsers on Ubuntu dev environment.
Fixes: #16836
Similar to the previous commit, the tooltip was not
completely visible in this case and this bug was
similar to the one corrected in recipient bar icons.
Here, the tooltip was partially visible. This bug was similar
to the one that is corrected for recipient bar icons.
I have removed the class attribute `tippy-zulip-tooltip`
for Filter stream title as this will be handled by the
new changes.
This commit renames confirm_dialog_yes_button class to
confirm_dialog_submit_button. This will help in keeping
a general class name when deduplicating the code for
confirm_dialog and edit_fields_modal.
This commit renames the html_yes_button parameter of confirm
dialog widget to html_submit_button and also all the related
variables in confirm_dialog.js.
This will help in keeping a general name when deduplicating
the code for confirm_dialog and edit_fields_modal.
This commit changes the error message element of confirm_dialog to be
above the text of dialog and to be a nice box using already defined
"alert" class.
This commit renames modal_body_html and modal_label to
html_body and html_heading respectively. This change
will help us easily deduplicating the confirm_dialog
and edit_fields_modal code.
Currently, the "Home" link at the top takes one to the doc root,
i.e., /help or /api. This is a little misleading since "Home"
seems to be more synonymous with the Zulip homepage.
This commit adds a proper backlink to the top logo that takes you to
the homepage and renames "Home" to be more specific. The text after
"|" will now take you to the doc root instead (/help or /api). Note
that this allows us to link the /help and /api pages from the
homepage while ensuring that backlinks allow the visitor to get back
to the homepage.
This commit first moves the compose.validate() function out
with the functions that are needed by it. Then one by one
checked for which function is now not needed in compose.js.
This moves all validation related functions out of "compose.js"
to "compose_validate.js".
Splitting compose announce variables out of compose.js.
This commit moves the "user_acknowledged_all_everyone" and
"user_acknowledged_announce" out of compose.js to reduce
cyclic dependency of compose_validate on compose.js.
Moving wildcard mentions to compose_validate.
The wildcard mention settings are mostly used while validating.
Also to reduce the cyclic dependence of compose in
compose_validate, the related wildcard mentions are moved out to
compose_vaidate.js.
This also converts reset_acknowledged functions to set values
by passing values.
This commit migrates the `right_sidebar.html` Django template
to handlebars by creating a new file as `right_sidebar.hbs`
which is then rendered using `ui_init` module.
It also removes the tests in `test_home` due to the template
migration, since these elements aren't rendered on the backend
anymore.
We also remove `test_compute_show_invites_and_add_streams*`.
Fixes part of #18792.
This commit migrates the `left_sidebar.html` Django template
to handlebars by creating a new file as `left_sidebar.hbs`
which is then rendered using `ui_init` module.
These are the minor changes introduced by virtue of template
migration -
- The `compute_show_invites_and_add_streams` function now
only concerns with the invite_to_realm_policy.
- Renamed the `compute_show_invites_and_add_streams` function
to `compute_show_invites` due to the above change.
- Fixes relevant `test_home.py` tests due to the above
changes.
Fixes part of #18792.
We've been unhappy with this fragile nth-last-child logic since the
big navbar rewrite a few years ago.
Now that we have TippyJS tooltips in the navbar area, it actually
causes a bug: Hovering the "subscribe count" widget makes the search
icon jump.
Fix this by just adding a CSS class to the two elements that are
intended to be modified by this logic.
We currently have the resolved topics prefix shown as part of
the topic name in the left sidebar. However this causes inconsistency
while showing topic names. Hence this adds support for showing the
prefix in the cutter to the left of the topic name.
Fixes#18989.
This commit changes the code to scroll to the top after closing the
message edit form to make sure the cursor it at same position and
the scroll does not distract the user when the request of message
edit is processing. Though the scrolling is not visible distinctly
in much case and is visible only when there is some delay, but it
is fine to change this code as the logic is correct and to be on
safer side.
We now show loading indicator inside the 'save' button
instead of hiding the buttons to show the loading
indicator. Both the save and clear buttons are disabled
when the request is processing. We do not change color
of the buttons just change the cursor to indicate that
button are disabled and nothing happens on clicking them.
The reason for disabling the cancel button is that it
is actually not possible to cancel the action once
loading has started, so it is actually better to disable
it only such that users are not confused.
This commit adds a wrapper div element around the button
because we wanted to add two css properties to the button-
'pointer-events: none' such that nothing happens on click
and 'cursor: not-allowed' to indicate that buttons are
disabled. But these boht styles cannot be added to same
element because 'pointer-events: none' overrides the
'cursor: not-allowed' style and normal cursor is visible.
That's why we add a wrapper to add 'cursor: not-allowed'
style to it and add 'pointer-events: none' to the button.
Additional changes are added in `tippyjs.js` to ensure
that the tooltip doesn't hide behind the message
box or it is not limited by the parent container, in
case of recipient bar icons.
We wrap the general stream name, description and type properties in
a "general_settings" div.
The "regular_subscription_settings" div was already present, so the
only change made was renaming this to "personal_settings".
We also wrap the email and adding of members settings in a new
"subscriber_settings" div.
This is a prep commit which will be helpful when we want to display
only one section and hide the other two.
Co-authored-by: Ryan Rehman <ryanrehman99@gmail.com>
The current system to change stream information like Stream name and
description isn't consistent with what we use everywhere else. It's
also slightly difficult to maintain.
Co-authored-by: Pragati Agrawal <pragati22066@gmail.com>
The presence setting is more suited in 'Account & privacy'
section as it is not related to notifications in anyway
and resembles privacy of user by allowing user to hide
his status of being online.
This commit adds a new trigger for compose.start that is
"new private message". It will clear the message recipients
whenever compose.start is called with this trigger.
This solves the bug, when a person is in a PM narrow and
clicks the new private message button, it opens the
composebox with the recipients filled out with whoever
you're narrowed to, rather than opening a new, blank PM.
CZO link for the issue
https://chat.zulip.org/#narrow/stream/9-issues/topic/.22New.20private.20message.22.20isn't/near/1222712
This shortcut now renarrows to an empty topic, rather than to the
stream, as long as the topic input is nonempty.
This was debated in the original implementation of this feature:
https://github.com/zulip/zulip/pull/9511#discussion_r190323319
Having seen the experience in practice, the current behavior is
surprising and we should migrate to the other option originally
considered. In particular, the argument that "narrowing to the stream
would still tell you the topic is empty" turns out to be inaccurate,
since the history within the stream may not be in the most recent
messages in the stream.
Fixes#19122.
d779a1c tweaked `get_full_datetime` to return a string instead
of a {date, time} object. This function is used for recent topics
too but wasn't fixed to use the string.
This resulted in showing 'undefined undefined' in tooltip.
Previously, we showed a `Copied!` alert on copying link to a message
irrespective of the fact that the link was copied or not.
Hence add an event listener that shows the `Copied!` tooltip only
if the action was successful.
Fixes#19019.
Previously, we showed a `Copied!` alert on copying a message
irrespective of the fact that the message was copied or not.
Hence add an event listener that shows the `Copied!` tooltip only
if the action was successful.
Fixes#19019.
If highlight_toggle is called before activate_section_or_default,
then 3 hash change event take place for single hash change.
For example if hash is changed from "#settings/profile" in the
browser to "#organization/organization-permissions", then the
cycle is-
"#settings/profile" -> "#organization/organization-profile" ->
"#organization/organization-permissions".
This is because "highlight_toggle" also leads to call of
"activate_section_or_default" with section as default section
(i.e. organization-profile) then the correct section is opened
again as activate_section_or_default is called in hashchange.js
after highlight_toggle.
The middle hash of the above example depends on the last open
section in organization area or is the default section which is
"organization-profile" when overlay is opened first time after
reload.
This is also consistent with the code for opening overlay from
gear menu where "highlight_toggle" is called later.
Reproducer:
* Open the settings overlay from gear menu, the profile (user profile
not organization profile) is opened.
* Note the current hash in browser is "#settings/profile".
* Now directly change the hash to be "#organization/organization-permissions".
You will notice that the content is fine, but there is problem in left
sidebar and the hash. The left sidebar content is still of user
settings and not organization settings and the hash in the browser is
"#settings/organization-permissions".
Now the bug was due to normal_settings.activate_section_or_default
call instead of org_settings.activate_section_or_default.
Calling from normal_settings leads to hash_prefix being "#settings"
which changes the hash in the browser and also toggles the left
sidebar to display settings part instead of organization. The right
section content is of organization-permissions only because it
depends only on section and not prefix.
So, this commit adds a if-else condition deciding what to call based
on the hash.
The issue was text label has `display: inline-block`
property which caused it to go to a new line in smaller
width screens.
This commit fixes it by changing its display property to `inline`.
Fixes#19075.
Previously, there were cases where the table contents started to
overlap with the table heading when scrolled down the table.
This was mostly visible in `Custom Emoji` organization UI,
where the images and action table column contents started to
overlap with the table headers.
Rectified the bug by adding a CSS `z-index` property to
`table-sticky-headers` class which takes care of all
such overlapping issues.
Fixes#18906.
Previously the header of settings overlay
was 'SETTINGS / {name_of_section}'.
This commit changes it to be one of the two
mentioned below according to the opened
section-
1. 'PERSONAL SETTINGS / {name_of_section}'
2. 'ORGANIZATION SETTINGS / {name_of_section}'
Note - Have kept the header as original in
case of mobile as the above text will be
too long.
The parameter passed to 'handle_topic_updates' is 'muted_topics'
and there is also a javascript file with same name.
So 'muted_topics.get_muted_topics' gives error, and this commit
fixes this by changing the parametr name to 'muted_topics_list'.
This was introduced in 5f74e78bee.
The user timezone is only used for user's profile, so we can
move this setting to the Profile panel of settings and this
will also help us in covering some space when there are no
custom profile fields for the organization.
We separate "Your account" section to two different sections -
"Profile" section for user name, custom profile fields, and avatar
and "Account & Security" section for email, password, role, api-key
and deactivating button.
Another important change here is that the modal for changing name
is removed and now the name has a simple input text box and it
behaves similar to inputs for custom-profile-fields.
Fixes#18848.