Commit Graph

12502 Commits

Author SHA1 Message Date
sahil839 37620ffef0 gear_menu: Rename "Settings" option to "Personal settings".
Also includes change in markdown used in docs.
2021-07-01 11:47:14 -07:00
Dinesh 239228b317 tippyjs.js: Remove unnecessary `allowHTML: true`.
I accidentally added this while rebasing #18856.

This does no harm but it's best remove code that
isn't helpful in any way.
2021-07-01 11:46:25 -07:00
Dinesh d779a1cf2f timestamp_tooltip: Reformat tooltip content.
Reformats to a format like: 5/19/17, 2:42:53 AM IST (UTC+5.5).
2021-07-01 11:46:25 -07:00
sahil839 ac459b3042 muting_ui: Fix bug with same name of function parameter and a file.
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.
2021-07-01 08:44:27 -04:00
Tim Abbott 53df9a3958 settings: Move role to profile page.
This feels a bit more consistent with the fact that this field gets
displayed on the user's profile page.
2021-06-30 16:58:37 -07:00
sahil839 687a4ffbb1 settings: Show the date when a user joined the realm in profile panel.
This will also help us to cover up some space when there are no custom
profile fields.
2021-06-30 16:58:22 -07:00
sahil839 b94d6c1a20 settings: Move timezone setting from display settings to profile.
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.
2021-06-30 16:56:03 -07:00
sahil839 bb816e1998 settings: Separate "Your account" section in two different sections.
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.
2021-06-30 16:56:03 -07:00
Priyank Patel 5f74e78bee js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
Priyank Patel 968a8c4e50 js: Split out muted_users module from muting. 2021-06-30 16:32:55 -07:00
Priyank Patel 4dac12144d refactor: Rename variables that conflict with muting modules rename. 2021-06-30 16:32:55 -07:00
Priyank Patel 88b83de5bd muting: Refactor get_time_from_date_muted to util module.
This function will be later needed again when we split the
muted_users module from muting.
2021-06-30 16:32:55 -07:00
m-e-l-u-h-a-n 524f0cc3d3 profile: Add tooltip to hint unsubscription flow for private stream. 2021-06-30 15:17:27 -07:00
m-e-l-u-h-a-n 68700e9599 minor: Keep logic for formatting stream list item at one place. 2021-06-30 15:17:27 -07:00
m-e-l-u-h-a-n c6f8b9d807 profile: Add unsubscribe button in user profile modal.
We add unsubscribe button in the stream list that allows
users and admins to unsubscribe them using profile modal.

If a user attempts to unsubscribe from a private stream
we redirect them to do so from stream setting overlay
to avoid a really confusing user experience as we ask
for confirmation before unsubscribing such streams.
2021-06-30 15:17:26 -07:00
m-e-l-u-h-a-n 2ac5ba0bf8 stream settings: Rename stream_subscription_info for readability.
We rename `stream_subscription_info.hbs` and its related
variables and functions to `stream_subscription_request_info.hbs`.
So that its clear that it is used for displaying info about
requests sent for stream subscriptions.

This is a follow-up for #18957.
2021-06-30 14:54:28 -07:00
sahil839 efa19597bb settings: Show tooltip if avatar changes are disabled.
We show a tooltip besides "Profile picture" heading
to the users who cannot change their avatar explaining
that the avatar changes are disabled in organization.
2021-06-30 15:33:54 +05:30
sahil839 a537ecc587 settings: Fix live update of user-avatar upload widget.
We add disabled prop on buttons only and we add the css for
buttons (and some specific class elements) when disabled as
'cursor: not-allowed' or 'pointer-events: none' which means
the user cannot use these buttons when disabled.

This is not the case for the avatar widget as we use a div
element there and not button and neither those specific
classes which has appropriate styles defined.

We use the avatar image block in two ways - for showing image
and as a clickable target (which is actually a div element)
for uploading, so instead of adding 'disabled' prop we are
hiding (adding display: none) the div such that it is not
visible on hover and also cannot be clicked.
2021-06-30 15:00:51 +05:30
sahil839 d09da692c6 settings: Use switch case instead of if-else for message delete checks.
This is a prep commit for making zero as invalid value for
message_content_delete_limit_seconds, as that change would
add one more else-if and our eslint rules convert such cases
to switch case. Doing this here would keep the diff smaller
in the original commit of making zero as invalid value.
2021-06-29 17:37:53 -07:00
sahil839 6370b00f14 message_edit: Remove unnecessary check for allow_message_deleting.
We do not need to check whether allow_message_deleting is true
when checking for time limit, because we already have a condition
before that returns false if allow_message_deleting=False.
2021-06-29 17:37:52 -07:00
sahil839 4170a2e969 templates: Fix incorrect class name used for tooltips.
Tooltips of message retention and realm deactivation
should have appropriate class as per the setting and
not "realm_allow_message_deleting_tooltip" for all
the different tooltips.
2021-06-29 17:37:52 -07:00
m-e-l-u-h-a-n 4b870e0410 settings (stream): Add function to check if user can unsubscribe others. 2021-06-29 16:50:04 -07:00
m-e-l-u-h-a-n 14f46a831d popovers: Add data-user-id in user profile modal. 2021-06-29 16:50:04 -07:00
m-e-l-u-h-a-n 8070f5e1e2 CSS: Fix border color issue for stream list in profile modal.
This was missed in e10a315efd.
2021-06-29 16:50:04 -07:00
m-e-l-u-h-a-n f0141ee9c1 stream settings: Ignore deactivated user for stream subscription.
We ignore deactivated users when they are being added to streams.
To give current user information about the ignored user ids
we show it along with other details about subscribed and
unsubscribed users.

This partially addresses: #18949.
2021-06-29 16:46:40 -07:00
m-e-l-u-h-a-n a2b50bacee stream settings: Add checks to render `br` tags only when required.
This is required as we added `br` tags irrespective of whether
there were any users in the subscribed or already subscribed
category. This made the spacing here look odd. We now include
br tags inside conditionals to render them only when required.
2021-06-29 16:46:40 -07:00
m-e-l-u-h-a-n ffb811ef6e stream settings: Refactor logic for stream_subscriber_info display.
This refactor helps to avoid code duplication that occurs
if we need to add any extra info to the stream_subscriber_info
and also cleans up code in `add_subscriber_form` and
`.subscriber_list_remove form` handler to make it more readable.

It is preparatory commit to add information about ignored
deactivated users when bulk subscribing users to streams.
2021-06-29 16:46:37 -07:00
sahil839 c8849f8fe3 logo: Compute realm-logo url in frontend only.
This commit fixes the bug of always showing
day-mode realm logo when color scheme display
setting is set to automatic but the OS setting
is dark theme. This is because we cannot check
the OS setting on backend and we need to set
the logo url accordingly in frontend only.
So, we remove the logo url computation from
backend completely and instead compute it in
the frontend only.

Fixes #18778.
2021-06-29 13:42:44 -07:00
Aman Agrawal cb2d95d9ad hashchange: Don't narrow to default_view on `#reload`.
When the hash changes to `#reload...` before a reload, the app tries
to show default_view since there is no `case` handled for it. What we
want to do is ignore this hashchange, since we're about to be reloaded
(so it's not helpful) and if the timing is wrong, it can cause the
browser to reload back to "Recent topics" rather than saving the
user's view.

This fixes a bug introduced in 0e65225d06.

With tests from Riken Shan.
2021-06-29 13:39:01 -07:00
Ganesh Pawar 415159c5b9 user_status: Fix styling of modal. 2021-06-29 11:44:47 -07:00
Tim Abbott 7010777d6c compose: Remove unnecessary 10x margin.
This margin was ignored and will become a liability with future
changes to the compose box HTML.
2021-06-29 11:28:49 -07:00
Priyansh Garg 6cfe10fef2 compose-box: Fix compose-box from covering last messages of stream.
While writing a long message in compose-box, the last few messages of
the current stream gets covered by the compose-box and it gets pretty
annoying sometimes trying to figure out a way to read the last message
of the stream while writing. Right now, the only way to get past this
is to resize `compose-textarea` by using the resize tool at the
bottom-right corner of the `compose-textarea`. But, that small resize
tool is not always readily visible to the user.

The proposed solution in this commit is to reset the `max-height`
property of `#compose-textarea` everytime `bottom_whitespace_height`
is resized such that the total height of `#compose` is always less
than or equal to the height of `bottom_whitespace_height`.  Doing
this, the compose-box never covers the last message of the current
stream.

The only problem with this is that if the compose-box is closed at the
time of bottom-whitespace resize, we cannot find the
`compose_non_textarea_height` and so, we cannot reset the max-height
of `#compose-textarea`. To solve this, max-height of
`compose-textarea` is also reset everytime a new compose-box is opened
according to the value of `bottom_whitespace_height` at that time.

Thus, if the compose-box is already open at the time of
bottom-whitespace resize, the max-height of `#compose-textarea` will
also get reset at the same time, whereas, if the compose-box is closed
at the time of bottom-whitespace resize, the max-height of
`#compose-textarea` won't get reset at that time, but it will surely
get reset whenever the user will open the compose-box.

Tested on my Ubuntu Development Environment on Chrome and Firefox browsers.

Fixes: #16038.
2021-06-29 11:24:01 -07:00
Tim Abbott da596ef269 message_edit: Fix live update bug in left sidebar.
We've had for years a subtle bug, where after editing a topic in the
left sidebar that had previously had unread messages (but doesn't
anymore), the old topic might still appear in the sidebar.

The bug was hard to notice except for new organizations or in the
development environment, because the pre-edit topic appeared with a
sort key of -Infinity (that being the max ID in an empty list of
message IDs). But this is an important onboarding bug in reducing
faith in Zulip's topic editing just working, so I'm glad to have it
fixed.

Fixes #11901.
2021-06-29 10:00:52 -07:00
sahil839 e0fc6df2b4 settings: Fix live update of email change button.
This commit fixes a bug of not enabling/disabling
the email-change button when email_changes_disabled
setting is changed. Bug was because of using wrong
selector.
2021-06-28 22:14:55 -07:00
sahil839 c32a036449 settings: Remove unnecessary code.
The class "name_change_container" is used in the custom
profile fields form.

The name of custom profile field should not be affected
by this setting.

Also confirmed the behavior by testing on master itself,
that these fields are not hidden actually due to this
code being in settings_account itself.

We can also remove the class "name_change_container" as
there is no use of this class elsewhere.
2021-06-28 22:14:49 -07:00
sahil839 0f0e71b3f2 settings: Remove user-name-section from email input.
We handle the css using email-change-form and thus
there is no need for 'user-name-section' class as
this element is used for emails and not user names.
2021-06-28 22:11:24 -07:00
sahil839 e0667a80fe settings: Remove user-name-section class from some elements.
'user-name-section' class is only used to set css for its child
settings-info-icon. This commit removes the 'user-name-section'
class from elements which do not have 'settings-info-icon' as
their child element and also these elements are in not related
to user names.
2021-06-28 22:11:24 -07:00
sahil839 1cb72c77fe settings_users: Rename user-name-form to edit-user-form.
This commit renames user-name-form to edit-user-form as
the modal for which this id is used, is used to edit all
the user properties, not only name.
2021-06-28 22:11:24 -07:00
Steve Howell e311a0ad31 buddy list: Always include "me" in the list.
If a user sets themselves to unavailable, or otherwise
drops out of our presence data, we should still show
them at the top of their own buddy list.

See https://chat.zulip.org/#narrow/stream/137-feedback/topic/Users.20Sidebar/near/1220135
for more context.

I believe this change makes sense as a defensive
fallback, but it's quite possible that we may
want to change the server to record presence info
about users who are "unavailable" and then only
send that info to them (and not their peers).
2021-06-28 16:09:43 -07:00
Tim Abbott e76fd775ba settings: Remove unnecessary ancient table styling.
This effectively reverts d96d4e30ab,
which is a bug that hasn't been present for other reasons due to past
design changes.

It fixes a bug where the "Search operators" page had missing margin
between the table and post-table content..
2021-06-28 09:14:09 -07:00
aryanshridhar 8140a1a6ee info_overlay: Render search operators using info_overlay.
This commits ports the `search_operators.html` file from
./templates to handlebars, essentially creating a new file
as `search_operators.hbs` within /static/templates which is
then rendered using info_overlays.js.

As part of this migration, we rewrote the way internationalization was
done, since the previous implementation incorrectly did not support
languages with a different word order than English.

We also not consistently use periods at the end of the descriptions.

Co-authored-by: Tim Abbott <tabbott@zulip.com>

Fixes #18504.
2021-06-28 09:14:09 -07:00
aryanshridhar 942f4372f0 info_overlay: Render keyboard shortcuts using info_overlay.
This commits ports the `keyboard_shortcuts.html` file from
using the Django template to handlebars, essentially creating
a new file as `keyboard_shortcuts.hbs` within /static/templates
which is then rendered using info_overlays.js.

Fixes part of #18792.
2021-06-27 18:29:52 -07:00
Aman Agrawal 8c1ae1161b tippy: Clarify how to use `tippy-zulip-tooltip` class. 2021-06-27 18:11:34 -07:00
akshatdalton a7681d4a17 message_edit: Extract `toggle_resolve_topic` helper function.
This is a prep commit for #18988. Extracting it here, we
can avoid duplication which helps to avoid future bugs.
2021-06-26 16:42:44 -07:00
akshatdalton d17e5d080c refactor: Extract `RESOLVED_TOPIC_PREFIX` in message_edit.js.
This is a prep commit for #18988. Extracting it here, we
can avoid duplication which helps to avoid future bugs.
2021-06-26 16:40:58 -07:00
Dinesh afe6404167 timerender: Use tippy tooltip for topic header timestamp. 2021-06-25 18:10:42 -07:00
Dinesh 177dd05d0b timestamp: Move tooltip date, time rendering logic to tippyjs.js.
Makes use of `onShow` for all calculations and rendering
of date, time for tooltip.
2021-06-25 18:10:42 -07:00
Dinesh c10e56698c timestamp: Migrate message_time from title to tippyjs tooltip.
This keeps it consistent with other widgets in message body area.

Set the display position to top to be consistent with
compose control buttons.

Changed the tooltip content to be more readable like
Thursday, May 18, 2017
7:12:53 AM India Standard Time

Also changed timerender.get_full_datetime() to consider
users' 24 hour format preference.
2021-06-25 18:10:42 -07:00
Hashir Sarwar d1b18d2c07 compose: Show `compose_error` for deactivated users.
When a user tries to send a (group) private message to a deactivated
user, a compose error is displayed.

Fixes #13766.

Co-authored-by: Signior-X <b19188@students.iitmandi.ac.in>
2021-06-25 18:06:48 -07:00
Hashir Sarwar 130f1d7153 input_pill: Customize pills for deactivated users.
This modifies the appearance of pills for deactivated users
in the following ways:

* Adds `(deactivated)` with the deactivated user's name.
* Add a tooltip to the deactivated user's pill stating
that one can't send a message to this user.
* Color the deactivated user's pill reddish.

This now also adds tests for user_pills.

Part of #13766.

Co-authored-by: Signior-X <b19188@students.iitmandi.ac.in>
2021-06-25 18:06:42 -07:00
Hashir Sarwar 7b9ed4ff2e people: Allow deactivated users pills in compose box.
This commit treats deactivated users as valid users
for compose box which prevents the PM list to collapse
when a deactivated user in the PM list is clicked.

Part of #13766

Co-authored-by: Signior-X <b19188@students.iitmandi.ac.in>
2021-06-25 18:01:15 -07:00
sahil839 5504741239 settings: Remove intentional waiting time in deactivate account request.
The waiting time of 5000ms was probably added for testing UI of
spinner in 2f99e6b7b2 and was missed in review. This commit removes
the waiting time and now the user is deactivated almost instantly when
the button is clicked.
2021-06-25 16:36:41 -07:00
Anders Kaseorg 9518545128 js: Remove ancient IE createTextRange API.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-06-25 16:34:37 -07:00
Anders Kaseorg fa81ae3aa4 js: Simplify more code using default parameters and destructuring.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-06-25 16:34:04 -07:00
Ganesh Pawar 166bfa4cf8 user_status: Migrate from overlay to modal.
This also migrates from loading the modal dynamically rather than
statically once at page initialization.

With styling changes by tabbott to preserve the original look of the
UI.

Fixes #18278.
2021-06-25 09:43:55 -07:00
Ganesh Pawar 663743261a recent_topics: Return false in `is_in_focus` if a modal is present.
This prevents a bug where keypresses are received by recent_topics view
even if a modal is present on it, which prevents, for instance, the modal
from receiving text input.
2021-06-25 09:27:03 -07:00
sahil839 0b8b7c4441 settings: Use edit_fields_modal framework for user-info edit modal.
This commit modifies the user-info edit modal to use newly added
edit_fields_modal framework.

Fixes a part of #18417.
2021-06-24 16:55:23 -07:00
sahil839 b04647f219 settings: Use edit_fields_modal framework for linkifier-edit modal.
This commit modifies the linkifier-edit modal to use newly added
edit_fields_modal framework.

One important change is that we remove the "edit-linkifier-status"
element as the corresponding "edit-fields-modal-status" element
is added in edit_fields_modal.hbs and we also modify the css
accordingly. This "edit-fields-modal-status" is used only for
this modal and remains empty for others, so this change does not
cause problems with other modals.

There is another element which uses "edit-linkifier-status" as a
class, but the css we defined was for "edit-linkifier-status" as
id, so the css change is also safe.
2021-06-24 16:55:23 -07:00
sahil839 3da636a20e settings: Use edit_fields_modal framework for admin bot form.
This commit modifies the modal for editing bot information to
use edit_fields_modal framework.

We also change the id of form element of this modal such that
it makes sense with the actual use of modal and there is no
problem with this change as styling of this modal is not
affected.
2021-06-24 16:55:23 -07:00
sahil839 36560da0f0 modals: Add edit_fields_modal.js and edit_field_modals.hbs.
We create a new widget edit_fields_modal such that this common
framework can be used in bot-edit modal, linkifier-edit modal
and user-edit modal, which have very similar implementations.

The "edit-fields-modal-status" is used only for edit-linkifier
modal and remains empty for others, so this change does not
cause problems with other modals.
2021-06-24 16:55:22 -07:00
Dinesh be3b637603 message_view: Make timestamp a permalink to message.
The css edits are to override the `a` tag's default color
with our default values from body, body.night-mode.

Fixes part of #18699.
2021-06-24 16:37:32 -07:00
Priyam Seth 939d8dab7b compose: Extract compose_error.js.
This commit moves the compose_error function to its own module, which
will be useful for future work splitting the compose module.

We also simplify compose_not_subscribed_error to call the
compose_error show function.
2021-06-24 16:19:22 -07:00
sahil839 a14d649444 styles: Fix line-height of delete button of image-upload-widget.
This commit fixes the bug with the delete button of both profile
picture and realm-logo buttons. The button was shifted downwards
and was caused due to line height change in 5d64c21c38.

Found the correct value of 20px by checking the line-height in
one test organization on zulipchat.com where the button position
looks correct.
2021-06-24 14:36:58 -07:00
aryanshridhar ab0db73e62 topic_sidebar: Add support to copy topic link to clipboard.
This commits adds the support to copy a topic link
to the clipboard by introducing a new "Copy link to topic"
topic sidebar action which is placed below the
"Mark all messages as read" action.

Basically, this does the same job as right clicking upon the
topic name and selecting "Copy link".

Closes #18946
2021-06-24 11:26:55 -07:00
sahil839 98bb0f7b28 settings: Show spinner inside the confirm button for confirm_dialog.
We show a spinner inside the button instead of hiding the button
and then showing the spinner in the bottom area. We also disable
the button to avoid repetitive clicking by user.
2021-06-24 09:48:42 -07:00
m-e-l-u-h-a-n c36aa1126c settings (streams): Fix data-dismiss handling for stream creation form.
Click handler added for cancel button in stream creation form
incorrectly assumed data-dismiss to be present only in that
form inside `.subscription`. We now handle editing stream
properties like stream privacy and stream name/description
by making use of modal widget. So this assumption creates
a bug where closing these edit modal closes complete stream
edit pane. It was added in 1886f0a015.

We fix this by binding this handler to data-dismiss element
inside stream creation form.
2021-06-23 17:50:55 -07:00
m-e-l-u-h-a-n a57aa07a6d css: Extract modal related css rules.
Co-authored-by: Pragati Agrawal <pragati22066@gmail.com>
2021-06-23 17:50:55 -07:00
m-e-l-u-h-a-n dfe67d25b5 i18n: Fix translation tags in message_retention_settings. 2021-06-23 17:45:02 -07:00
m-e-l-u-h-a-n 6e5d8e4e90 i18n: Fix translation tags in subscription_stream_privacy modal. 2021-06-23 17:45:02 -07:00
m-e-l-u-h-a-n 152f979e3b streams: Remove dead CSS rule from subscriptions.css.
Co-authored-by: Pragati Agrawal <pragati22066@gmail.com>
2021-06-23 17:45:02 -07:00
m-e-l-u-h-a-n 41dc123cf1 streams: Reorder buttons in button-group to reflect the visual order.
Co-authored-by: Pragati Agrawal <pragati22066@gmail.com>
2021-06-23 17:45:02 -07:00
m-e-l-u-h-a-n 5de115a964 streams: Use consistent settings HTML structure in stream types modal.
We had our input elements for stream settings inside li tags
and their alignment was managed using CSS. We move away from
this HTML structure to have inputs and labels inside divs for
two reasons. First is that if we want to later refactor the HTML
to have some different design, then having them inside `ul`
requires complex changes to CSS and eventually we would have
to move away from using `li`s for the part that is changed to
have a different design. Second `li`s are generally not used
to organize input elements.

Above is an explanation of why this change is a preparatory
commit for shifting to have a tabbed design in the stream edit page.

So following changes are done to have a more consistent
HTML structure in stream types modal:

* Added modal-body and removed the non-standard
usage of the unordered list for settings header and inputs.

* Updated relevant CSS rules to have the same design during refactor.

Co-authored-by: Pragati Agrawal <pragati22066@gmail.com>
2021-06-23 17:45:02 -07:00
m-e-l-u-h-a-n 777f784e07 popovers: Extract user_profile_modal functions in separate module.
We had a lot of functions and click handlers that were only
involved with user profile modal and were not related to
popovers logic in any way. So we extract these functions
into a separate module `user_profile.js`.
2021-06-23 17:43:08 -07:00
Riken Shah 0e65225d06 hashchange: Show default view when the hash is unknown.
Fixes #18870.
2021-06-23 17:41:09 -07:00
Aman Agrawal 48addae20b tippyjs: Fix traceback on reaction tooltip.
It can happen that reactions are re-rendered while we are
in the process of showing tooltip for them. In that case,
we setup MutationObserver for an element not present in DOM
which results in weird behaviour. We avoid it by checking the
element again before setting up MutationObserver for it.

See https://chat.zulip.org/#narrow/stream/6-frontend/topic
/tippy.20bug/near/1206316 for details on the issue.
2021-06-23 12:17:55 -07:00
Anders Kaseorg 5d64c21c38 styles: Globally set font-size and a unitless line-height.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-06-23 09:10:50 -07:00
Anders Kaseorg 3691805253 styles: Remove invisible .stream_label::before rules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-06-23 09:10:50 -07:00
Anders Kaseorg cbec20cfdf message_body: Fix -3px alignment kludge using whitespace control.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-06-23 09:10:50 -07:00
m-e-l-u-h-a-n 6cce478bce popovers: Use keys instead of names for tab navigation in profile modal.
We used name parameter in tab component callback to handle our
custom logic when switching tabs in profile modal. Using name
here invites a posible bug as these name are tagged for
translation. So to avoid this we switch to use key (html id
for these tabs) for this as they are always constant.
2021-06-23 08:08:23 -07:00
m-e-l-u-h-a-n e10a315efd temaplate: Separate stream and user group tabs in user profile modal.
We had stream and group tab inside a common div with class
`subscription-group-list` due to this adding any info
elements like alert boxes that were specific to one of them
became difficult. To fix this we keep them in their own
`.tabcontent` div. This change also makes the handling of
display of different tabs a lot easier and cleans
up unnecessary javascript code that was handling the
display of common parent div of stream and group tab.
2021-06-23 08:08:23 -07:00
m-e-l-u-h-a-n 775b8eb05f template: Correct sequence of stream and group tab.
We show stream tab before user-group tab but in the template
this order was reversed that created confusion while editing
any one of them. So we correct their order in the template
to reflect the order we show in UI.
2021-06-23 08:08:23 -07:00
sahil839 4df22564f4 settings: Use confirm_dialog for deactivating own account modal.
This refactor changes two things - position of the modal, as it
is moved up by some amount because of using confirm_dialog and
also loading spinner of confirm_dialog widget is used.
2021-06-23 08:05:25 -07:00
Aman Agrawal 1295b47e3b navbar_alerts: Don't ask spectator for notifications access. 2021-06-22 17:18:56 -07:00
Aman Agrawal 534d169ead people: Stop queries about current user in web_public_view.
Since we don't have any info on the spectator in web_public_view,
we avoid doing such queries.
2021-06-22 16:56:34 -07:00
Priyank Patel 81e2c3825c js: Export variables instead of setting them on window. 2021-06-22 16:54:03 -07:00
Priyank Patel 043b0c6ef3 ts: Convert spoilers module to TypeScript. 2021-06-22 09:14:09 -07:00
Priyank Patel 91573531bb ts: Convert color_data module to TypeScript. 2021-06-22 09:14:09 -07:00
Priyank Patel adf83c6eb7 ts: Convert color_class module to TypeScript. 2021-06-22 09:14:09 -07:00
Priyank Patel d660f512fa ts: Convert list_util module to TypeScript. 2021-06-22 09:14:09 -07:00
Priyank Patel 6ed635b5ed ts: Convert night_mode module to TypeScript. 2021-06-22 09:14:09 -07:00
Priyank Patel 31abcaafb8 ts: Convert ready module to TypeScript. 2021-06-22 09:14:09 -07:00
Priyank Patel c862c673af ts: Convert blueslip module to TypeScript.
We turn off the eslint no-use-before-define for TypeScript files
because it does not work correctly for types. There is already
a typescript-eslint version of it that is enabled for TS.

We also update the error handler on window to use instanceof check
for ErrorEvent instead of checking the error property.
2021-06-22 09:09:36 -07:00
Priyank Patel f7235912ff ts: Convert ui_report module to TypeScript. 2021-06-22 09:09:36 -07:00
Priyank Patel 8a6f57d750 ts: Convert common module to TypeScript.
We also update the tippy.js mock in tests to expect a element
(zjquery FakeElement function) instead of zjquery instance, and get
rid of setting _tippy property itself to a noop function.
2021-06-22 09:09:36 -07:00
Priyank Patel 9418ae51fa ts: Convert i18n module to TypeScript.
We update our tsconfig target to ES2020 so that we don't get type
errors related to some properties not being in Intl that is used by
@formatjs/intl.
2021-06-22 09:09:36 -07:00
Priyank Patel f1a0a790fe ts: Convert page_params module to TypeScript.
The plan for type annotating the page_params is to set it to
Record<string, unknown> for now and then annotate individual
properties on it as we use it in typescript modules.
2021-06-22 09:09:36 -07:00
Priyank Patel 43da43701b refactor: Use variables to get TypeScript type narrowing.
We also add an explicit undefined check for the these return value
of the Map.get calls. This makes the TypeScript conversion diff
cleaner.
2021-06-22 09:09:36 -07:00
Priyank Patel 2a21f626a7 refactor: Use object destructuring for function parameter.
This make type annotating easier.
2021-06-22 09:09:36 -07:00
Priyank Patel fd45ef57fa ui_report: Do not pass jQuery element to the html method.
Although it works, this feature is not documented.
2021-06-22 09:09:36 -07:00
Priyank Patel 9e08c6db93 ui_report: Correctly check if remove_after is passed.
We use a simpler approach here which is to let it be undefined if
nothing was passed and use that in the if condition. This has two
benefits. There is no edge case where the condition will evaluate to
false if 0 was passed and it is easier to type annotate.
2021-06-22 09:09:36 -07:00
Priyank Patel 5ae523891b ui_report: Use numerical check for request status code. 2021-06-22 09:09:36 -07:00
Priyank Patel 97c8987e02 blueslip: Declare log properties directly on the Logger class.
This makes TypeScript type annotation easier (and maybe looks
cleaner.)
2021-06-22 09:09:36 -07:00
Tim Abbott fcb2f66725 popovers: Show user profile popover for all humans. 2021-06-21 17:16:50 -07:00
Anders Kaseorg b4a26bcafd lightbox_overlay: “Pan and Zoom” → “Pan & zoom”.
The ‘t’ helper operates on text strings, not HTML.  The ‘&’ works
fine, and is correctly escaped for output by Handlebars, like any text
string interpolated with ‘{{}}’.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-06-21 16:38:11 -07:00
aryanshridhar 477a066a4c delete_message: Move and rename the delete_message modal.
Moved the `delete_message` user-confirmation modal to
the `confirm_dialog` folder and renamed the modal to `confirm_delete_message.hbs`
to follow the common naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar df556a199a settings_invites: Move and rename the revoke_invite modal.
Moved `revoke_invite` user-confirmation modal to the
`confirm_dialog` folder and renamed the modal to
`confirm_revoke_invite.hbs` to follow the common naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar d0c683a8d7 settings_invites: Move and rename the resend_invite modal.
Moved `resend_invite` user-confirmation modal to the
`confirm_dialog` folder and renamed the modal to
to `confirm_resend_invite.hbs` to follow the common naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar 83473ba647 settings_emoji: Move and rename the emoji_settings_warning modal.
Moved `emoji_settings_warning` modal to the `confirm_dialog`
folder and renamed the modal to `confirm_emoji_settings_warning.hbs`
to follow the common naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar 4549cbe48c settings_users: Move and rename the deactivation_user modal.
Moved `deactivation_user` modal to the `confirm_dialog`
folder within `/static/templates` and renamed the modal to
to `confirm_deactivate_user.hbs` to follow the
common naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar c5d65555fa deactivation_stream: Move and rename the deactivation_stream modal.
Moved `deactivation_stream` user-confirmation modal to
the `confirm_dialog` folder and renamed the modal to
`confirm_deactivate_stream.hbs` to follow the common naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar 803a6dd60a deactivate_realm: Move and rename the deactivate_realm modal.
Moved `deactivate_realm` modal to the `confirm_dialog` folder
within `/static/templates` and renamed the modal to
`confirm_deactivate_realm.hbs` to follow the naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar 7fc8d97daa avatar: Move delete_user_avatar_modal to confirm_dialog folder.
Moved `confirm_delete_user_avatar` modal to the `confirm_dialog`
folder.
2021-06-21 10:36:35 -07:00
aryanshridhar 1d5f63564a user_groups: Move confirm_delete_user_modal to confirm_dialog folder.
Moved `confirm_delete_user` modal to the `confirm_dialog`
folder.
2021-06-21 10:36:35 -07:00
aryanshridhar 48a7f95fc8 muting_ui: Move confirm_mute_user modal to confirm_dialog folder.
Moved `confirm_mute_user` modal to `confirm_dialog` folder.
2021-06-21 10:36:35 -07:00
aryanshridhar 3cad4c7837 starred_messages_ui: Move user-confirmation modals to confirm_dialog folder.
Moved `confirm_unstar_all_messages` and `confirm_unstar_all_messages_in_topic`
modals to the `confirm_dialog` folder.
2021-06-21 10:36:35 -07:00
aryanshridhar beab7ea1dc delete_topic: Move and rename the delete_topic modal.
Moved `delete_topic` modal to `confirm_dialog` folder and
renamed the modal to `confirm_delete_topic.hbs`
to follow the confirm_dialog naming conventions.
2021-06-21 10:36:35 -07:00
aryanshridhar 1db2fbcd77 stream_create: Move and rename the subscription_invites_warning modal.
Moved `subscription_invites_warning` modal to `confirm_dialog`
folder and renamed the modal to `confirm_subscription_invites_warning.hbs`
to follow the naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar db0a69648a subs: Move and rename the unsubscribe_private_stream modal.
Moved `unsubscribe_private_stream` modal to the newly created
`confirm_dialog` folder found within `static/templates`.

Later renamed the modal to `confirm_unsubscribe_private_stream.hbs`
to follow a common naming convention.
2021-06-21 10:36:35 -07:00
Ganesh Pawar d9d7c55006 user_deactivation: Move modal_parent one level up in the DOM.
The user deactivate button is also present in the "Deactivated users"
tab, a sibling element of the current modal_parent, #admin-user-list.
Adding the confirm_dialog modal to #admin-user-list won't have any
effect in the "Deactivated users" tab.
Move it one level up, i.e. to the parent element of #admin-user-list
and #admin-deactivated-users-list.

Fixes #18928.
2021-06-21 10:22:33 -07:00
Ganesh Pawar 777eeb6b8f subs: Update `sub` object with additional properties in update_* functions.
Subsequent function calls require additional properties present
after calling `get_sub_for_settings` on the original sub object.

Fixes #18602
2021-06-20 17:08:16 -07:00
Ganesh Pawar 8c65b971c6 stream_creation_form: Replace `everyone` with `public` in stream_privacy_policy.
The passed `stream_privacy_policy_values` object
doesn't contain the `everyone` property.
2021-06-20 17:08:16 -07:00
Ganesh Pawar 6392a7122b open_modal: Pass extra arguments as object. 2021-06-20 17:08:16 -07:00
Aman Agrawal ad59fae407 lightbox_overlay: Fix `&` not being rendered as desired.
The attempt to render `&` doesn't work. So, just replacing it
with `and` to make it always work.
2021-06-20 12:46:30 -04:00
Ganesh Pawar 147cd8a366 message_edit_history: Dynamically load modal rather than statically.
message_history_cancel_btn is shifted down since the modal isn't
present before `show_history` is called.
2021-06-18 18:13:00 -07:00
Ganesh Pawar e73644593c message_edit_history: Move click handlers to message_edit_history.js. 2021-06-18 18:13:00 -07:00
Ganesh Pawar 72b1d3b5a6 deprecated_feature_notice: Make use of autoremove option in open_modal. 2021-06-18 18:13:00 -07:00
Ganesh Pawar 0b769bfcc8 overlays: Add `autoremove` option to `open_modal`.
`autoremove` will remove the modal element from the DOM
once the modal is hidden.
2021-06-18 18:13:00 -07:00
Ganesh Pawar f453db0df2 about_zulip: Mark strings for translation. 2021-06-18 18:13:00 -07:00
Ganesh Pawar a0e5a82d23 confirm_dialog: Correct documentation regarding loading_spinner. 2021-06-18 18:12:59 -07:00
Tim Abbott 10dcc4ac98 refactor: Use consistent name for RESOLVED_TOPIC_PREFIX. 2021-06-18 17:47:57 -07:00
Tim Abbott bfb6ff44d1 message_edit: Fix unicode encoding of resolve topic check.
We now encode resolved topics with just:

U+2714 HEAVY CHECK MARK, SPACE

Previously, the encoding was unintentionally this:

U+2714 HEAVY CHECK MARK, U+FE0F VARIATION SELECTOR-16, SPACE
2021-06-18 17:46:28 -07:00
Tim Abbott c705b7d5dd popover_menus: Add some comment documentation. 2021-06-18 17:25:45 -07:00
Aman Agrawal fa2825eaa0 popover_menus: Extract common popover properties to be reused. 2021-06-18 17:13:20 -07:00
Aman Agrawal 182f47b7c6 popover_menus: Extract popovers using tippy in a separate module. 2021-06-18 17:13:20 -07:00
Aman Agrawal 563f8aba1e compose_mobile_button: Use tippyjs for popover.
There are several benefits of using tippyjs here:
* Removes dependency on bootstrap.
* We don't have to manually handle show/hide of popover.
* There cannot be any memory leak since we don't store
  the instance.
2021-06-18 17:13:19 -07:00
Aman Agrawal f171b436f3 tippy: Hide stream settings popover on pressing `escape`.
Like all popovers, this behavior should be the same for tippy
popovers too.
2021-06-18 17:12:58 -07:00
Aman Agrawal 7c6fc5dff7 tippyjs: Use `one` instead of `on` to define event handlers.
Since the instance.popper can return same elements as the
instance may be used again by tippy, we use `one` to ensure
that we do not define multiple event handlers for the same element
repeatedly.
2021-06-18 17:12:58 -07:00
Aman Agrawal 444e9cd93f tippyjs: Show popovers on touch.
For tooltips we have set default to only show when pressed for a
small duration. For popovers, we show them on a simple touch.
2021-06-18 17:12:58 -07:00
Tim Abbott 081d74141b overlays: Don't close overlays when drawing selections.
This fixes the following bug:
* Open the streams modal.
* Click and hold in the word "Streams" at the top.
* Move pointer up out of the modal.
* Release.
* Expected: Some text is selected, but nothing else happens.
* Actual: The modal disappears.

We use the same fix we use for this class of issue in other places:
checking for whether a range is selected, and if so, doing nothing.
2021-06-18 17:01:19 -07:00
Tim Abbott a307de95de right sidebar: s/Filter users/Search people/.
We previously had a mix of "Filter users" and "Search people" for this
widget. "Search" is more correct because the right sidebar can only
show a subset of the organization in some settings.
2021-06-18 16:41:37 -07:00
aryanshridhar 8cd9fc7a74 popovers: Close user popover when clicked on stream name.
Earlier, when a user clicked on any stream name from the
user_popover, the stream page would open in the background,
but the user popover wouldn't close.

Fixed it by explicitly binding it to a click handler,
which closes the user popover before redirecting to stream
page.
2021-06-18 16:07:45 -07:00
m-e-l-u-h-a-n 4c319268a1 templates: Remove form-inline class from stream setting forms.
It is a class provided by bootstrap and one of its most
important job is to set the display of inputs and labels in
the form in such a way that if there is sufficient
horizontal space then they are shown side by side.

As we override most of the bootstrap classes to organize
content, CSS rules set by it were not applied. So we remove
these safely without having any visual changes. Also, we had
only three instances of this class in the complete template
directory.
2021-06-18 12:24:02 -07:00
Tim Abbott 696236b6fc left sidebar: Implement basic resolve topic option.
Fixes part of #18751.
2021-06-18 09:24:48 -07:00
Tim Abbott 639e2eef5e popover: Extract with_first_message_id helper. 2021-06-18 09:24:48 -07:00
m-e-l-u-h-a-n 433452a9b3 streams: Add function to get subscribed streams of a user.
We show only those streams whose subscribers can be seen by
logged-in user in subscribers list in stream edit page.
2021-06-17 17:57:20 -07:00
Tim Abbott 33d2ef67c3 i18n: Fix organization setting for default language.
This fixes a puppeteer failure introduced in
0a1eaf0384.
2021-06-17 17:49:21 -07:00
Tim Abbott 0a1eaf0384 i18n: Reorganize language_list logic.
This reorganization follows our modern coding conventions for avoid
leaving data in page_params that should be owned by a single module.
2021-06-17 17:22:10 -07:00
Gaurav Pandey 8fc3715ea8 settings: Remove language_list_dbl_col from page_params.
The language_list_dbl_col parameter in the page_params
is used by only the web client frontend. The value is
calculated in the backend and then passed as a page_param
which is unnecessary considering that the whole process
is beneficial for the front_end only. Hence move the entire
calculation code to the frontend.

Fixes part of #18673.
2021-06-17 17:02:27 -07:00
Gaurav Pandey 56d85fb833 settings: Remove default_language_name from page_params.
default_language_name was a part of page_params which is actually
redundant considering that we already have language_list and
default_language available to frontend which can be used to
get the default_language_name and hence prevents the backend
from sending an additional parameter.

Fixes part of #18673.
2021-06-17 16:56:21 -07:00
aryanshridhar 2d8fceff5d settings_emoji: Improve error handling for uploading custom emojis.
Previously, there wasn't any error message if a user tries to
upload a custom emoji with a name that already exists.

This commit essentially displays a error using `ui_report`
when the user tries to do so.

Fixes #18269.

Co-authored-by: yasiruRathnayaka97 <yasirurathnayaka97@gmail.com>
2021-06-17 15:53:47 -07:00
aryanshridhar 7227c12ba1 settings_emoji: Replace modal confirmation text to Confirm.
Followup of zulip#17926.
Basically, replaced the modal confirmation text to `Confirm`
to follow a common naming convention.
2021-06-17 15:53:47 -07:00
aryanshridhar e1c0273bd1 settings_emoji: Modify warning model text for a better understanding.
Modified and shortened the `emoji_settings_warning` modal message
to make it easily comprehensible for non-technical users.
2021-06-17 15:53:47 -07:00
Aman Agrawal 3e872b1fa5 timerender: Render past time till 24 hours before showing yesterday.
This avoids the issue of all the topics in recent topics marked
as yesterday after mid-night.

This change also affects other pieces of UI using this function
like buddy list in a similar way.
2021-06-17 15:18:08 -07:00
Tim Abbott 1b91545b37 subs: Document adding user groups to streams. 2021-06-16 16:30:43 -07:00
Gaurav Pandey ba62d2ff8c minor: Remove irrelevant comments in stream_edit.js.
Remove comments in the module stream_edit.js that became
irrelevant after changes in commit 96e035a.
2021-06-16 15:10:06 -07:00
sahil839 38fac6c359 settings: Add moderators and members options in edit_topic_policy.
This commit adds moderators, full members and members options for
edit_topic_policy in both the backend and frontend.
2021-06-16 15:04:29 -07:00
sahil839 828759d2ba models: Replace allow_community_topic_editing with edit_topic_policy.
This commit replaces the allow_community_topic_editing boolean with
integer field edit_topic_policy and includes both frontend and
backend changes.

We also update settings_ui.disable_sub_settings_onchange to not
change the color of label as we did previously when the setting
was a checkbox. But now as the setting is dropdown we keep the
label as it is and we don't do anything with label when disabling
dropdowns. Also, this function was used only here so we can safely
change this.
2021-06-16 14:59:36 -07:00
Aman Agrawal f26a76a9d8 message_controls: Hide irrelevant icons for spectators. 2021-06-16 10:19:07 -07:00
Aman Agrawal 0a84123f0b recipient_row: Hide edit & mute icons for spectator. 2021-06-16 10:18:27 -07:00
Aman Agrawal 5ffc95f6bb compose: Show login and hide drafts for spectators. 2021-06-16 10:18:22 -07:00
Aman Agrawal b99a720012 left_sidebar: Hide "Add streams" widget for spectators. 2021-06-16 10:16:40 -07:00
Aman Agrawal c0f23569b8 navbar: Show login button for spectators. 2021-06-16 10:16:04 -07:00
Aman Agrawal 99cd837421 css: Introduce class which will hide elements for spectators.
`.hidden-for-spectators` class can now be used to hide elements
which should not be visible to spectators.
2021-06-16 10:16:04 -07:00
Aman Agrawal 64f04e9913 web_public_view: Replace `web_public_visitor` with `spectator`.
We use `spectator` term instead of `web_public_visitor` as it is
more concise and better represents this type of users.
2021-06-16 07:46:34 -07:00
Wesley Aptekar-Cassels f08555bb31 shared: Bump version to 0.0.6. 2021-06-15 14:40:58 -07:00
Riken Shah b2ab448b71 gear_menu: Extract the gear menu as a handlebars template.
For this extraction, we need to move some context
parameter (from home_real in `views/home.py`) to extra
page_params parameter (of
build_page_params_for_home_page_load in
`lib/home.py`) so handlebars template can access them.

While moving I confirmed that these parameters are not
used elsewhere if some parameter is used elsewhere
(like `apps_page_url`) then I didn't remove it from the
context list, I just added it to the page_params list.

Fixes: #18795.
2021-06-15 12:17:45 -07:00
Riken Shah d2f7aaf6f6 refactor: Rename `enable_marketing_emails_enabled` param of page_params.
This is a prep commit to extract the gear menu as a
handlebars template.

We are renaming `enable_marketing_emails_enabled` to
`corporate_enabled` as it will be also used in the
handlebars template of the gear menu.
2021-06-15 12:05:37 -07:00
Ganesh Pawar 5e4b1e1867 deprecated_feature_notice: Migrate to handlebars. 2021-06-15 11:59:01 -07:00
Ganesh Pawar e3a099d732 deprecated_feature_notice: Move code to a separate module. 2021-06-15 11:58:45 -07:00
Ganesh Pawar 1d4b6c1320 about_zulip: Migrate to handlebars.
This results in moving the `zulip_merge_base` parameter to
page_params, so that it's available to JavaScript.

Since this is technically a tiny overlay, it needs to be initialized
before hashchange.js.
2021-06-15 11:55:20 -07:00
Ganesh Pawar c220c01ad2 user_status: Migrate to handlebars.
We also reorganize the click handlers to live in the main UI file for
the element, and depend less on initialization order.
2021-06-15 11:32:33 -07:00
Ganesh Pawar 8744b42beb message_history: Migrate to handlebars. 2021-06-15 11:31:01 -07:00
Steve Howell ab9c17ed3d minor: Use warn instead of error for widgets. 2021-06-14 17:46:16 -07:00
Steve Howell e98e4b5b02 todo widget: Check types for inbound events. 2021-06-14 17:46:16 -07:00
Steve Howell 50362a8c39 poll widget: Check types for inbound events. 2021-06-14 17:46:16 -07:00
Steve Howell 99cdfbcbe5 widgets: Clean up index handling.
We only need to bump up indexes if inbound
events suggest that we have incremented our
personal index from another device.

We don't want somebody else's runaway index
to affect our index.

(For both widgets the sender_id is part of
the key, so uniqueness across all senders is
not required for the integer part.)
2021-06-14 17:46:16 -07:00
Steve Howell 91b8049ecf minor: Add permission-related comments to widgets. 2021-06-14 17:46:16 -07:00
Steve Howell 5f73164210 poll widget: Prevent question updates from non-authors.
We now ignore question edits if the sender of the submessage
is not the message author.

The webapp UI prevents folks from editing the question for
somebody else's poll, but a determined person could use our
low level API to do it.  We will add safeguards on the server
side for this, but this change is sufficient to protect the
webapp (and mobile when they upgrade the library).
2021-06-14 17:46:16 -07:00
Steve Howell b62d71cf23 widgets: Check sender of submessage before widgetizing.
We refuse to activate a widget if the first submessage
event doesn't have the same sender as the message's
sender.
2021-06-14 17:46:16 -07:00
Signior-X c1833b74f0 login: Remove browser show password in IE, edge.
The Microsoft browsers such as IE and Edge has their own
show password that is a bit bugy and also conflicts with
the show password in Zulip that was added in #17305.
This fixes the issue by making the display none for the
ms-reveal that comes in the input.

More details can be found at
https://chat.zulip.org/#narrow/stream/101-design/topic/Show.20password/near/1173890
2021-06-14 16:35:25 -07:00
sahil839 aa5d2199b1 invite: Use handlebar template for invite-user overlay.
Fixes a part of #18794.
2021-06-14 13:46:57 -07:00
Ganesh Pawar f5f5943ee0 lightbox_overlay: Migrate to handlebars. 2021-06-14 13:41:36 -07:00
Dinesh cde8d095bb tippyjs: Fix blueslip error on popover add emoji reaction hover.
This tippyjs event listener was active on 'add emoji reaction'
option in sender's popover menu of a message but it was only
intended for the add reaction button in message reactions bar
at bottom of a message.

Both of those having common selector `.reaction_button` caused
errors in tippyjs near `observer.observe` having wrong args.

Edited the css selector to be more specific to only target
add reaction button in reactions row of message.

This was introduced in 99e6f25.
2021-06-13 22:31:57 -07:00
m-e-l-u-h-a-n 82394308fd stream-settings: Use util.strcmp instead of localeCompare for sorting. 2021-06-12 08:16:19 -07:00
m-e-l-u-h-a-n dfd37e797f invite.js: Use util.strcmp instead of localeCompare for sorting. 2021-06-12 08:16:19 -07:00
m-e-l-u-h-a-n 712e32805e todo_widget: Use util.strcmp instead of localeCompare for sorting. 2021-06-12 08:16:19 -07:00
m-e-l-u-h-a-n 59143c1d4d stream-edit: Use util.strcmp instead of localeCompare for sorting. 2021-06-12 08:16:19 -07:00
m-e-l-u-h-a-n f1d7971a7f popovers: Use util.strcmp instead of localeCompare for sorting. 2021-06-12 08:16:19 -07:00
m-e-l-u-h-a-n 5ad850f1ff minor: Refactor pill_typeahead.js to use include_users check.
Functions in pill_typeahead.js assumed the type of required pills
to be user by default. But this created several readability
issues with its code, as a result, this codebase appeared
hard to change because of hacky checks involved due to this
assumption.

To improve these we use `include_users` check wherever possible
and simplify the code to clarify the logic involved in typeahead
functions in this module.

Also updated existing stream_edit tests to adjust them with changed
code.
2021-06-12 07:59:43 -07:00
m-e-l-u-h-a-n edeb1bf53b minor: Fix return value and redundant variables in pill_typeahead. 2021-06-12 07:59:43 -07:00
Tim Abbott 8181a2fe57 css: Remove unnecessary font sizes in stream settings. 2021-06-11 17:15:46 -07:00
Tim Abbott 95efadaf86 css: Use default font size for buttons and dropdowns. 2021-06-11 17:15:45 -07:00
Tim Abbott 7291f2c1ca css: Avoid hardcoding font size in input pills.
This also fixes horizontal alignment issues when scaling.
2021-06-11 16:59:35 -07:00
Tim Abbott 6a7d4d96c5 settings: Fix size of dropdown_list_widget elements.
We remove the small CSS class, which set the font size as something
tiny, and also restructure it with a fixed height and more natural
markup for the reset link.
2021-06-11 16:58:52 -07:00
Tim Abbott 579a9d60e9 css: Remove 15px font usage in full profile.
Together, these larger font size declarations made the modal look
worse, in addition to just being inconsistent with the rest of the
app.
2021-06-11 16:03:39 -07:00
Tim Abbott 64f9721ce5 css: Use default font size for user search icon.
This icon always looked really small, so it's probably visually better
this way, and this lets us remove an unnecessary font-size override.
2021-06-11 16:03:39 -07:00
Tim Abbott 18bcff8c96 css: Remove font-size for message_edit_tooltip.
This looks better with the default font-size, though it needs an
alignment fix.
2021-06-11 16:03:39 -07:00
Tim Abbott 8efa8e378d css: Simplify preview_message_area CSS. 2021-06-11 16:03:39 -07:00
Tim Abbott 9a5b0b4f0a css: Remove useless undo_markdown_preview CSS.
These properties had no effect, since the compose_control_button CSS
has the same effect.
2021-06-11 16:03:39 -07:00
Tim Abbott 147e243113 css: Use default font for left sidebar private messages.
Previously, this used a slightly smaller font size than the default.
Given that it looks visually fine to use the default font size, it's
better to remove this inconsistency.

It's also worth noting that we plan to move this component to be
parallel to STREAMS in a way that is likely to also want the new font
size, so this is a step towards that goal.
2021-06-11 16:02:56 -07:00