Commit Graph

12728 Commits

Author SHA1 Message Date
Aman Agrawal c1c6674809 emails: Retheme to purple colors to match present logo. 2021-08-01 21:27:42 -07:00
Tim Abbott 8755a76cf6 user_settings: Add types for all managed settings. 2021-08-01 15:30:17 -07:00
Sahil Batra 998d710275 frontend: Add new user_settings module for user's settings.
We add a new user_settings module similar to page_params
module in frontend and use it to access user's personal
settings instead of page_params.
2021-08-01 15:30:17 -07:00
Sahil Batra ea44b6bcc1 events: Use user_settings event in frontend live-update code.
We now use the newly added "user_settings" event in the frontend
code instead of previous "update_global_notifications" and
"update_display_settings" events which are now depreceated.
2021-08-01 15:30:17 -07:00
Alya Abbott 8fdc662b20 portico: Clean up /for/open-source.
- Remove essay portion and link to /for/communities instead.
- Copy over relevant quotes from /for/communities.
- Move "Join the hundreds of open-source projects we sponsor."
2021-07-30 12:30:38 -07:00
Tim Abbott 399dc5046b Revert "narrow: Do not mark messages as read in mentioned narrow."
This reverts commit 5e97ec9ad9.

This change has been pretty confusing for users, and so we need to do
something more in order to make the UI acceptable to change this
default.
2021-07-29 17:31:51 -07:00
Priyam Seth 3ce7a9dd08 compose: Move warn functions from compose.js to compose_validate.js.
This commit moves the warn_if_private_stream_is_linked,
needs_subscribe_warning, and warn_if_mentioning_unsubscribed_user
to compose_validate.js from compose.js.

These warning functions are very naturally part of the compose box
validation system, though they're a bit different in being called from
the typeahead codebase.

Part of splitting compose.js into more natural modules.
2021-07-29 15:22:31 -07:00
Priyank Patel 1711dcbc6f ts: Convert settings_data module to TypeScript. 2021-07-29 11:30:18 -07:00
Priyank Patel 6b93fe0cd7 ts: Convert settings_config module to TypeScript. 2021-07-29 11:30:18 -07:00
aryanshridhar 3443f62d9a user_status: Trigger input focus once the modal is shown.
Previously, once the user opens the "Set user status" UI,
the focus isn't automatically set to the input bar.

This is so because the input field isn't visible at
the time when UI is loaded because of the bootstrap
fade property which delays the event.

Added a fix to trigger the focus event on input bar
only when the modal is completely shown.

Fixes #19417.
2021-07-29 11:26:26 -07:00
aryanshridhar 94b872828b MDLW: Render tippy tooltip once the selected items surpasses the limit.
This commit enhances our Multiselect dropdown list widget by
displaying a tippy tooltip over the dropdown button once it's
text changes to `n selected` where n is the number of items
selected by user which exceeds the limit passed.

It essentially helps the user to identify the dropdown items they
have selected by just hovering over the dropdown toggle button.
2021-07-29 10:09:03 -07:00
aryanshridhar 7c588d4747 dropdown_list_widget: Add support for Multiselect dropdown list widget (MDLW).
This commit adds the support to select multiple dropdown items by inheriting
dropdown list widget and overriding some of it's properties.

The parameters that can be passed along with it are-

- widget_name: The desired name of the widget.
- data: The data that needs to be populated as dropdown items.
- default_text: The default text to be rendered when none of the items is selected.
- on_update: Function to trigger once the filter button is pressed.
- on_close: Function to trigger once the dropdown is successfully closed after filtering.
- value: The default value that is initially selected by user.
- limit: The maximum number of dropdown items to display on button text.

This widget can later be implemented in recent topic view to replace the
several ellipses filter button and also within the organisation user's page
to quickly sort the users list according to their org role.
2021-07-29 10:09:03 -07:00
aryanshridhar 0d20a20b07 dropdown_list_widget: Improve keyboard focus events.
Previously, our dropdown list widget was lacking several
keyUp/keyDown keyboard focus events due to which the user
couldn't shift the focus from the dropdown item to it's
search input.

This commit essentially binds several additional keyboard events
by defining a `dropdown_focus_events` function which helps
in enhancing our keyboard focus events.

Due to the above changes, it removes the custom event binded
to dropdown list widget because of which we fallback to our
deprecated keydown event handler functions present in /third/bootstrap.
2021-07-29 10:09:03 -07:00
aryanshridhar 5c2bafc6b0 dropdown_list_widget: Refactor dropdown_list_widget to constructor function.
This is a prep commit for adding the support of Multiselect
dropdown list widget by prototypal inheritance.

The following change actually revamps the dropdown list widget
into a constructor function, due to which the widget is now to
be initialized with the `new` keyword (which adds a property
to __proto__ object that links to the constructor function's
prototype object).

Example-
const foo = new DropdownListWidget({....});

Due to the above change, this commit also modifies the declaration
of dropdown_list_widget across all our instances.
2021-07-29 10:09:03 -07:00
Aman Agrawal bbcc4798b7 for-companies: Change header image. 2021-07-29 09:22:09 -07:00
Eeshan Garg 5555864e54 docs: Add doc root links to sidebar.
A recent commit (5a94bfcb88)
introduced a couple of regressions:

* The part of help.js that highlights the active page in the
  sidebar raised an exception on /help and /api since there
  was nothing to highlight for the doc roots in the sidebar
  anymore.
* Moving the doc root links to the header after the logo made
  it such that on narrow mobile widths, there was no way to get
  to the doc root since the links in the header were truncated.

With a CSS change by tabbott to avoid awkward vertical spacing.
2021-07-28 17:40:14 -07:00
Priyank Patel 1e94f6ac96 util: Rewrite same_recipents to not use switch.
In this case, for TypeScript narrowing to work correctly, we need
a if statement that check that both of the type are same. The one
condition we had that checked that both have the same type doesn't
work with TypeScript narrowing yet.
2021-07-28 17:32:09 -07:00
Priyank Patel c37cde1202 util: Make less function required for lower_bound. 2021-07-28 17:32:09 -07:00
Priyank Patel bf3aa8bd26 rtl: Use _.sortedIndex instead of util.lower_bound.
Since we plan to remove the one last caller of util.lower_bound we
migrate this to use _.sortedIndex so we can just remove it
completly.
2021-07-28 17:32:09 -07:00
Priyank Patel 899d7bba5a util: Cleanup CachedValue class.
We use a Symbol for unassigned_value_sentinel and explictly assign
the compute_value property instead of using Object.assign. Both of
these are needed to type annotate it easily.
2021-07-28 17:32:09 -07:00
Priyank Patel 288fe6d388 js: Use method chaining for multiple array operations.
Makes it cleaner and is easier to type annotate.
2021-07-28 17:32:09 -07:00
Priyam Seth 3ec55e7976 compose: Move keydown and keyup from compose.js to compose_ui.js.
This commit moves the handle_keydown and handle_keydown functions
of compose.js to compose_ui.js.

Part of splitting compose.js.
2021-07-28 14:01:40 -07:00
Tim Abbott 2a2654d5f5 css: Fix vertical alignment of unread message pills.
I'm not entirely sure what broken this, but both the unread message
pills and the \vdots menu were not centered vertically.

Fix for the unread message pills should be general and complete, since
it just declares center alignment, but the \vdots menu is a hack;
further cleanup of that element's CSS is needed to end up with
something good.
2021-07-28 12:04:38 -07:00
Tim Abbott 8532e22fcd user_status: Simplify user status popover labels. 2021-07-28 10:02:51 -07:00
Riken Shah 4eeb6be787 user_status: Add default emoji for common statuses.
Co-authored-by: Yash Rathore <33805964+YashRE42@users.noreply.github.com>
2021-07-28 10:02:51 -07:00
Riken Shah cea961b129 user_info_popover: Show status emoji.
In this commit,

* We show status emoji alongside status text in the user
info popover.

* Updated clear status button to also clear status emoji.
2021-07-28 10:02:51 -07:00
Riken Shah 297379029d user_status: Add UI changes for status emoji feature.
In this commit, we update the UI to:

*  Display emoji on the buddy list (right side sidebar).

*  Display the emoji picker on the set status overlay.

It also updates the `z-index` of
`#set_user_status_modal`, which was changed from 105
to 1050 in 166bfa4cf8. We change it back to 105, so
emoji-popover can be visible on top of the
`#set_user_status_modal`.

We also remove the `tabindex` property from the
`#set_user_status_modal` so it can allow keyboard
events for emoji popover.
2021-07-28 10:02:50 -07:00
Riken Shah 840ab92f7f user_status: Add architecture to support status emoji feature.
In this commit, we only update the existing architecture
to support the status emoji feature:

* We add the `user_status_emoji_info` map so we can
keep track of the users' staus emoji.

* Listen to the server event to update/set the
`user_status_emoji_info` map.

* Add `status_emoji_info` field, when getting user's data.
2021-07-28 09:50:11 -07:00
Riken Shah 6c003a7802 refactor: Move emoji details related code to `emoji.js`.
As `reaction.js` and `user_status.js` has similar code to
get emoji details, it makes more sense to extract this as a
single function.
2021-07-28 09:35:00 -07:00
Tim Abbott 63ed398c22 Revert "composebox_typeahead: Trigger foucs to send button only after keyup event."
This reverts commit 3531463ac9.

I also add a comment explaining why this commit was wrong, that should
help us avoid doing this cleanup again.
2021-07-27 18:39:43 -07:00
sahil839 b8854a9d92 settings: Add full members and moderators options in custom emoji setting. 2021-07-27 16:41:23 -07:00
sahil839 4b1313a92b models: Replace add_emoji_by_admins_only with add_custom_emoji_policy.
This commit replaces boolean field add_emoji_by_admins_only with an
integer field add_custom_emoji_policy as we would also add full members
and moderators option for this setting in further commits.
2021-07-27 16:41:22 -07:00
Anders Kaseorg 17749cb608 archive: Remove non-functional archive code.
This removes a bunch of non-functional duplicate JavaScript, HTML, and
CSS that was interfering with maintenance on the functional originals,
because it was never clear how to update the duplicates or how to
check that you’d updated the duplicates correctly.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-07-27 16:25:24 -07:00
akshatdalton 3531463ac9 composebox_typeahead: Trigger foucs to send button only after keyup event.
As explained in the commit 3a35a0b72c9b2c46ed0afa6456d4a5a80a2c12f9:
`nextFocus` is set on a keydown event to indicate where
we should focus on keyup. We can't focus at the time of
keydown because we need to wait for typeahead. And we
can't compute where to focus at the time of keyup because
only the keydown has reliable information about whether it
was a Tab or a Shift+Tab.

Though the previous configuration didn't show any bug but we should
follow the same logic here also.
2021-07-27 16:17:31 -07:00
akshatdalton 30435d7943 composebox_typeahead: Prevent default actions only after triggering the focus.
In this case, we need to prevent the default actions
only after triggering the focus of the selected element.

This was known to cause a bug where after starting a new
topic, if one presses the tab key, then focus was not shifted
from the topic input box to the compose box. This commit fixes
that bug.

See: https://chat.zulip.org/#narrow/stream/9-issues/topic/tab.20key.20not.20working.20from.20topic.20input.20box/near/1235022.
2021-07-27 16:17:31 -07:00
M@ 53540432e1
compose: Fix typos in error message for too-long compose content. 2021-07-27 16:03:19 -07:00
Sahil Batra 355f6e9b53 settings: Move 'enter_sends' setting to property_types dict.
This commit moves "enter_sends" setting to property_types dict.
With this change, changing enter_sends setting also sends an
event of type "update_display_settings" and thus enables us
to live-update the UI.
2021-07-27 15:52:53 -07:00
Sahil Batra dafd32bd09 compose: Extract compose.toggle_entry_sends_ui function.
This commit extracts the code for hiding and showing the
send button according to 'enter_sends' setting value in
a separate function.
2021-07-27 15:52:53 -07:00
akshatdalton 3a35a0b72c composebox_typeahead: Re-add comment to explain the need of `nextFocus` variable.
This commit re-adds the comment to explain the need
of `nextFocus` variable which was deleted in
3b0694693b.
2021-07-27 15:41:29 -07:00
Aman Agrawal 0889ded057 plans: Make faq header linkable. 2021-07-27 12:55:54 -07:00
sahil839 cfd64cf951 settings_ui: Add option for changing label on disabling input.
We only disable the dropdown and keep the label as it is when
disabling a dropdown input, but for a check-box we need to
change label style also while disabling it.

Till now disable_sub_settings_on_change was used only for
dropdown but will be used for a check-box in the next commit.
2021-07-26 17:48:01 -07:00
sahil839 c7e756f984 setting: Allow only owners to change "Who can invite users" setting. 2021-07-26 17:48:01 -07:00
sahil839 ca0bb5b9d8 settings: Add nobody option for invite_to_realm_policy in frontend. 2021-07-26 17:48:01 -07:00
Tim Abbott 24c0c27ecc lint: Fix trailing whitespace in account-settings.hbs.
This was introduced in b9aed2df19.
2021-07-26 16:46:29 -07:00
Ganesh Pawar 0811bda192 dialog_widget: Clear error element when clicked on the submit button. 2021-07-26 16:37:16 -07:00
Ganesh Pawar b9aed2df19 change_email_modal: Remove duplicate id attribute.
This also naturally fixes the bug where the change_email_modal wouldn't
show the old email in the input box.
2021-07-26 16:37:15 -07:00
Ganesh Pawar 45799f1f1d delete_topic: Remove unnecessary `close_modal` call.
91b83cf09f migrated delete_topic modal
to confirm_dialog. confirm_dialog closes the modal after clicking on
the Confirm button. So manually closing the modal is redundant.
2021-07-26 16:37:15 -07:00
Eeshan Garg 72fba69c02 help: Activate sidebar scrollbar when hamburger is clicked.
On mobile, when you go to our /help pages, you cannot scroll the
sidebar content. As for testing, the bug can be reproduced by
using a mobile display in Chrome inspector. One caveat of this
bug is that if you go to /help with a mobile display toggled,
the scrollbar won't work. However, if you switch between
different mobile displays, it starts working.

This commit adds some JS that sets the right CSS properties
when the hamburger is clicked.
2021-07-26 15:30:55 -07:00
Mateusz Mandera 119f1da04a bots: Rename is_cross_realm_bot API field to is_system_bot.
Cross realm bots will soon stop being a thing. This param is responsible
for displaying "System Bot" in the user info popover - so this rename is the
right way to handle the situation.

We will likely want to rename the `cross_realm_bots` section as well,
but that is a more involved API migration.
2021-07-24 15:46:40 -07:00
Ganesh Pawar cc6aad75c6 widgets: Margin-left for the box-shadow to be visible on the left. 2021-07-24 09:52:14 -07:00
Ganesh Pawar 43a3a73a0d widgets: Avoid adding the widget_elem if it already exists.
Fixes #18631
2021-07-24 09:52:14 -07:00
Tim Abbott ab2ef76baa login: Fix hash being lost with redirects.
This fixes the following flow being broken:

* You start on
  http://zulipdev.com:9991/accounts/go/?next=/upgrade%23sponsorship
  (which we link to from e.g. /plans/)

* The form on that page has
  `action=/accounts/go/?next=%2Fupgrade%23sponsorship`, i.e. it has correctly
  URL-encoded the `next `value.

* You enter a realm name and hit submit.

* That redirects you to
  `http://realm-26.zulipdev.com:9991/upgrade#sponsorship`, would is
  correct if you are already logged in.

* However, if you're not logged in, `/upgrade` will serve a redirect
  to the login page, landing you at
  `http://realm-26.zulipdev.com:9991/devlogin/?next=/upgrade/#sponsorship`.
  This page works.  But in production, it would instead be:
  `http://realm-26.zulipdev.com:9991/login/?next=/upgrade/#sponsorship`.
  On this page, password login works but social login does not.
  Note that the `next=` value is no longer URL-encoded, and thus is
  parsed by the browser as `?next=/upgrade` + a hash of
  `#sponsorship`.

* If you now login with Google auth, you find yourself on
  `http://realm-26.zulipdev.com:9991/#sponsorship` (no /upgrade).

The root cause was that we have a bit of JavaScript in signup.js and
dev-login.js that is intended to handle this; but it was broken for
the social login case for unknown legacy reasons.

This bug appears to date from the original
b62bdde303 which introduced `next`
support for social backends in the first place.
2021-07-24 09:50:15 -07:00
Tim Abbott 71abf8c812 plans: Use black font for first line of pricing details.
This helps the user visually focus on the less fine print text.
2021-07-23 22:49:54 -07:00
Tim Abbott 4b6e2c4e4d plans: Explain annual billing model more clearly. 2021-07-23 21:31:31 -07:00
Alya Abbott cb82ea2ed8 portico: Add general info at the top of /for/x pages. 2021-07-23 18:17:44 -07:00
Eeshan Garg 09e6ac79dd landing_pages: Add screenshots for /for/events and /for/research.
This commit adds more specific screenshots to our events and
research pages. The newer screenshots are properly sized such that
they fit well in a 400px width.

We also move a quote to improve the visual design.
2021-07-23 14:07:14 -07:00
Eeshan Garg a4dbb30543 for_education: Add better screenshots with proper size.
The screenshots we have currently don't really fit into the width
available and the font looks too small. This commit adds newer
screenshots that have been scaled to fit a width of 400px such that
the font is readable with a small amount of content.
2021-07-23 14:03:41 -07:00
Riken Shah 67f4851ded user_status: Add `get_emoji_info` function.
This is a prep commit to add the status emoji feature.

This function will add missing/extra parameters to the
emoji info object, that would need by the template to
render an emoji.

Co-authored-by: Yash Rathore <33805964+YashRE42@users.noreply.github.com>
2021-07-23 13:03:32 -07:00
Riken Shah b7b18cdfd3 emoji_picker: Update architecture to support status emoji.
This is a prep commit to add the status emoji feature.

We update the templates associated with the emoji
picker to add class `status_emoji` to `emoji` in the
popover.  So we can later add the events when the user
selects the emoji.

We also update the functions in `emoji_picker.js` to
support opening emoji picker popover in the 'set_status_
overlay`.

We also increase the `z-index` of the `popover-flex`
class (This class is only added to popover-emoji content
if the view is mobile), so in the mobile view the emoji
popover doesn't go behind the '#set_user_status_modal'.
2021-07-23 13:03:13 -07:00
Riken Shah 98710d67a2 refactor: Rename Set a status message/Edit status message button text.
In this commit,

* We rename `Set a status message` to `Set a status`
and
* We rename `Edit status message` to `Edit status`

for more clarity.
2021-07-23 12:57:51 -07:00
manavdesai27 9cebd1ec80 markdown: Fixed hr visibility in day theme.
Tweaked by tabbott to use a simpler approach proposed by the author in
the PR.
2021-07-23 12:48:43 -07:00
Aman Agrawal e977f42819 case-studies: Add links back to /for/education page.
Transfer case study title to hero image.
Used the same education background for image.
2021-07-23 12:25:03 -07:00
PIG208 60e3429da3 bots: Remove the need to debounce for dispatching bot events.
We rely on calling eventually_render_bots from the event handling
code path for bot events to both updating the list and switching
the tab.

Now we decouple the logic and make render_bots take care of
rendering the list of bots only and switch the tab upon calling
the success handler of creating the bot.

Fixes: zulip#17743
2021-07-23 11:26:42 -07:00
Eeshan Garg 78ff74d3fd landing_page: Fix anchor links on landing pages.
As it turns out, anchor links on headings only worked on our /help and
/api pages but were broken everywhere else. This commit adds the
required JS to scroll properly when an anchor link on any of our
various landing pages is clicked. We already have similar code to
accomplish this in help.js.

We verified with console logging, browser Sources inspection, and
checking source files that help.js and landing-page.js are never
included in the same page, but we add comments to make this
architecture clear.

Fixes #19349.
2021-07-23 10:29:41 -07:00
Tim Abbott 5e591f840b css: Fix night styling for deactivated pills.
The new styling isn't perfect, but it's also not obviously broken.

We also move the existing day theme styling to the appropriate files.
2021-07-22 15:29:00 -07:00
Tim Abbott 99e6618f07 compose: Fix validation treating welcome bot as deactivated. 2021-07-22 15:22:20 -07:00
Priyansh Garg c541699b9b compose: Fix expanded compose un-collapsible in presence of navbar_alerts.
The distance of compose-box from the top is hardcoded in the existing
code as `50px`, which only considers the height of the `.header`, plus the
padding-bottom of the header. This results in a bug where the top bar of
compose-box gets hidden behind the header if navbar_alerts is also present
in the view.

This commit calculates the top distance of the compose-box dynamically,
whenever the compose-box is opened and set the `top` property of the
compose-box accordingly.

Tested on my Ubuntu development environment.

Fixes: #19249.
2021-07-22 14:25:48 -07:00
Abhijeet Prasad Bodas d0b3801596 ui_init: Fix "Error: Unknown user_id in get_by_user_id: 0".
For spectators (logged view), we send user_id=0 via page_params.

The people module does not know about this user ID, and so throws the
exception. Earlier `people.get_by_user_id` was not called on page load,
but only when determining settings permissions with `settings_data.user_has_permission`.

But 231c536cad made it so that that function
is always called, so we need to handle the spectator case explicitly.

Co-authored-by: Gaurav Pandey <gauravguitarrocks@gmail.com>
2021-07-22 14:06:13 -07:00
Priyansh Garg 9fe61944e9 compose: Fix compose-preview size in expanded mode.
The CSS properties used to make the `#compose-textarea` full-size
were missing for the `#preview_message_area`, thus, it was just
getting to the height as specified in the `max-height` property
of `#preview_compose_box`.

Adding the missing CSS properties resolved the problem, but only
for not-too-long messages. For very-long messages, the preview
message area was overflowing the parent container (attaining the
maximum height possible according to the content, due to the absence
of max-height), which led to the controls below compose-box to
disappear.

Adding an additional property of `height: 1.5em` solved this problem,
as if a height lower than min-height is set to an element, it attains
its min-height.

Tested manually on my Ubuntu Development environment.

Fixes: #19243.
2021-07-22 12:51:04 -07:00
Aman Agrawal df3fc22e92 for-events: Change header image. 2021-07-22 12:03:35 -07:00
Aman Agrawal 45758ad14f plans: Add buttons to /for pages. 2021-07-22 11:57:32 -07:00
aryanshridhar 049ec674df move_topic: Toggle checkbox by clicking it's label as well.
This commit adds the support to toggle `send_notification`
checkbox by clicking over its corresponding label as well.

It is a similar case as the checkboxes within organization
settings.
2021-07-22 11:07:49 -07:00
aryanshridhar 89e60ef938 message_edit: Toggle checkbox by clicking it's label as well.
This commit adds the support to toggle `send_notification`
checkbox by clicking over its corresponding label as well.

It is a similar case as the checkboxes within organization
settings.
2021-07-22 11:07:49 -07:00
Aryan Shridhar 3991fb3ea6 Revert "message_edit: Replace checkboxes with settings_checkbox partial."
This reverts commit 54a1c73c78.
2021-07-22 11:07:49 -07:00
Sahil Batra 318d71469b api: Remove '/users/me/enter-sends' endpoint.
We remove the '/users/me/enter-sends' endpoint
and 'enter_sends' setting will now be edited
using the '/settings' endpoint.
2021-07-22 11:01:43 -07:00
Ganesh Pawar a2aea23da4 stream_ui: Fix subscription button out of sync.
cb4797e3b7 rearranged the stream templates
but didn't change the selector for the subscibe button.

Fixes #19290
2021-07-21 22:02:33 -07:00
Tim Abbott b03cab8ced plans: Update descriptions of plans.
These descriptions are both more accurate (there were embarrassingly a
few errors in the previous text about what was actually included in
what plan), as well as making clear that Zulip's free self-hostable
version includes essentially all the non-services features of
enterprise editions of competing products.
2021-07-21 17:47:55 -07:00
Aman Agrawal 56ce1f9f63 portico: Add pricing widget from /plans to for-education page. 2021-07-21 12:13:25 -07:00
Aman Agrawal ef74b41777 portico: Use final versions of illustrations for /for pages. 2021-07-21 10:44:53 -07:00
aryanshridhar 54a1c73c78 message_edit: Replace checkboxes with settings_checkbox partial.
This commits replaces the custom `send_notification` message_edit
checkboxes with our `settings_checkbox` partial.

The main intention is to also support the feature of selecting a
checkbox by clicking over its corresponding label as we have
in the case of the organization settings checkboxes.

Due to above change, this commit also removes the redundant
`break-row` HTML class along with it styles.
2021-07-21 10:43:18 -07:00
Sahil Batra 7662b088f5 sponsorship: Fix alignment of inputs in sponsorship form.
All the inputs of form has 'width: 100%' property but then
also the width of inputs were different because of box-sizing
property. The select input had 'box-sizing: border-box' style
but the others did not, so this commit adds this style to
the other inputs - text type input and the textarea input,
to fix the alignment.

Adding 'box-sizing: border-box' changes the actual height of
the normal text type input because the default input height
of 20px set by bootstrap now includes padding and border also,
so we add 'height: 30px' style to make its height same as the
select input.

Fixes #19332.
2021-07-21 08:58:09 -07:00
Aman Agrawal 3c024b2fba portico: Add /for/education, /for/events, /for/research pages.
These modern landing pages cover use cases previously not detailed on
our website. Technically, we had a /for/research page before, but it
wasn't finished or linked everywhere.

Removed "function-url-quotes" stylelint rule
since I need to use quotes in url to use an
svg as list bullet point. There are spacing issues
using it as an image. Also, using quotes in url
is actually the recommended way to do it otherwise
there could be issue with escaping.
2021-07-20 22:37:52 -07:00
Vishnu KS 199d3859fb billing: Make create_ajax_request accept callback function.
This is a prep commit for the Stripe checkout migration.

create_ajax_request function used to create an ajax request to our
billing API and on completion redirect to one of the URLs in our
website. The stripe migration requires the ajax request function to
execute Stripe javascript code post the request completion to redirect
to Stripe checkout page. So this commit updates the function to accept a
callback function which gets executed post the request completion.
2021-07-20 14:43:38 -07:00
Priyank Patel 231c536cad settings_data: Break circular dependency with people. 2021-07-20 14:28:48 -07:00
m-e-l-u-h-a-n c7be17eb73 stream settings: Use buddy list logic for filtering users.
Our logic for filtering subscribed users in stream setting was
buggy and gave irrelevant filters based on email matching.

We correct it by using same logic as we use for filtering in
buddy list.
2021-07-20 14:27:58 -07:00
Eeshan Garg 09a3ebf1e4 landing_page: Link to case studies in the top navigation. 2021-07-20 12:35:11 -07:00
Eeshan Garg 13e566815d landing_page: Fix top navigation dropdowns for mobile screens.
A recent PR introduced a bug where navigation dropdowns on the
landing page would not open for tablet/mobile screens. This
commit fixes that issue by using the proper media query to
differentiate between touch and mouse-based devices.
2021-07-20 11:33:56 -07:00
sahil839 b5b7862571 settings: Use '/settings' endpoint for changing notification settings.
We have merged the '/settings/display' and 'settings/notifications'
endpoints to '/settings' in backend. This commit updates the frontend
code to '/settings' endpoint for updating notification settings
instead of '/settings/notifications' endpoint.
2021-07-19 21:14:33 -07:00
sahil839 bbee0fdf6f settings: Use '/settings' endpoint for changing display settings.
We have merged the '/settings/display' and 'settings/notifications'
endpoints to '/settings' in backend. This commit updates the
frontend code to '/settings' endpoint for updating display settings
instead of '/settings/display' endpoint.
2021-07-19 21:14:33 -07:00
Alya Abbott 89724e5bb4 billing: Edit helper text on sponsorship application
* nonprofit -> non-profit
* Edit pass on defautl helper text to use more user-oriented language.
2021-07-19 17:26:45 -07:00
m-e-l-u-h-a-n b23fd2f1f3 stream settings: Move subscription_result template to stream_settings.
This commit moves stream_subscription_request_result.hbs to
stream_settings folder to have a consistent file structure
for stream setting templates.
2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n 70aa957e55 stream settings: Move stream list templates to stream_settings.
We move templates related to listing streams in left pannel of
stream settings overlay to stream_settings folder by making
following changes:

* Rename `subscriptions.hbs` to `browse_streams_list.hbs`.
* Move `settings_stream_list.hbs` to stream_settings folder.
* Rename `subscription.hbs` to `browse_streams_list_item.hbs`.
* Move `settings_stream_list_item.hbs` to stream_settings folder.
2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n 62c9b2916e stream settings: Move small independent templates to stream_settings.
We do following changes to two small independet templates used
in stream_settings area:

* Move subscription_setting_icon.hbs to stream settings folder
  to have a consistent folder structure for stream settings templates.
* Rename `subscription_count.hbs` to `subscriber_count.hbs`.
* Move `subscriber_count.hbs` to `stream_settings` folder.
2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n a61048e167 stream settings: Move subscription_table_body.hbs to stream_settings.
Following changes are done to subscription_table_body.hbs:

* Rename subscription_table_body.hbs to stream_settings_overlay.hbs,
  to have a uniform naming pattern for stream settings templates.

* Move it to stream_settings folder.
2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n 1a5566bf9b stream settings: Move stream_creation_form.hbs to stream_settings. 2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n cf0f74c7ce stream settings: Move stream_types.hbs to stream_settings folder. 2021-07-19 10:54:11 -07:00
sahil839 0594207180 realm_logo: Rename realm_logo.rerender to realm_logo.render.
As realm_logo.rerender is now used for initial rendering of
logo as well in c8849f8, so we rename this function from
rerender to render.
2021-07-19 09:45:29 -07:00
Dinesh dd1fccd2c2 tippy: Fix blueslip error on edit history timestamp hover.
The timestamp in edit history ui also has .message_time.
We had a tippy hover event attached to .message_time
whose code assumes it to belong to an actual message
which caused an error on hovering the message timestamp
in edit history.

This commit fixes it by making the selector more specific.
2021-07-19 09:34:52 -07:00
Tim Abbott a5afbb60ff ui_init: Initialize people before right_sidebar.
Because the right_sidebar initialization calls user_has_permission, in
organizations that has a waiting period before users become full
members, and only full members can send invitations, Zulip will throw
an exception on startup.
2021-07-19 00:33:02 -07:00
Tim Abbott 0268a4d06a css: Use separate CSS for create_stream_plus_button.
This part of the second commit in #19218 was actually important to the
first commit working.
2021-07-18 23:52:39 -07:00
Tim Abbott 4e876191c3 billing: Fix typo in Standard spelling. 2021-07-18 21:18:55 -07:00
Tim Abbott d7ef0c7232 billing: Fix options and help text for sponsorship requests.
This makes several changes:

* Fixes a bug where the help text explaining our policies was not displayed.
* No help text was defined for many organization types.
* Copy-edits the help text somewhat.
* Offers all of the organization type options.
* Removes the 100% coverage requirement because it's annoying to test
  the e.currentTarget click handler.
2021-07-18 20:48:27 -07:00
Alya Abbott 12d9ad957c billing: Clean up sponsorship form helper text.
- Change to match proposed hero text.
- Fix incorrect statement about event sponsorship; commercial
events should not be sponsored.
2021-07-18 12:15:33 -07:00
sahil839 ceb5333352 images: Rename loader.svg to loader-white.svg for clarity.
We rename loader.svg to loader-white.svg as this svg contains
white rectangles for clarity as we have also added loader-black.svg
which is same but with black rectangles instead of white.
2021-07-18 11:44:17 -07:00
sahil839 fb53556cef loading: Use img tag for loading indicator instead of object tag.
We use img tag for showing the loading spinner in message edit form
and dialog-widget submit button, instead of object tag because using
object tag gives the following error- "Refused to display
'https://chat.zulip.org/' in a frame because it set 'X-Frame-Options'
to 'deny'." in the browser console.

As mentioned by Anders in czo, this is probably because we’re loading
the SVG using an <object> tag as if it’s totally-not-an-IE3-ActiveX-
control.

We also need to add a new svg file similar to loader.svg with the
change that the retangles are filled with black color. This needs
to be done because we cannot get access to the svg document if we
use img tag and so we cannot change the color of rectangles using
jquery as we were doing before to show the spinner depending on
day/night mode. So, now we just set the src attribute of img tag
to the correct svg file depending on day/night mode.

Discussed in #issues > loading tail-spin.svg denied by X-Frame-Options.
2021-07-18 11:44:17 -07:00
sahil839 be8e7fdfb6 upload_widget: Use img tag for tail-spin.svg instead of object tag.
We use img tag for showing the loading spinner in image_upload_widget
instead of object tag because using object tag gives the following
error "Refused to display 'https://chat.zulip.org/' in a frame because
it set 'X-Frame-Options' to 'deny'." in console.

As mentioned by Anders in czo, this is probably because we’re loading
the SVG using an <object> tag as if it’s totally-not-an-IE3-ActiveX-
control.

Discussed in #issues > loading tail-spin.svg denied by X-Frame-Options.
2021-07-18 11:44:17 -07:00
m-e-l-u-h-a-n f377f8a963 stream settings: Move stream setting modals to stream_settings folder.
We do following changes in this commit to have a uniform file
structure for stream setting templates.

* Move change_stream_info_modal.hbs to stream_settings folder.
* Rename subscription_stream_privacy_modal.hbs to
  stream_privacy_setting_modal.hbs.
* Move stream_privacy_setting_modal.hbs to stream_settings folder.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n 36c8923797 stream settings: Move subscription_settings.hbs to stream_settings.
This commmit does following two changes to subscription_settings.hbs:

* Rename subscription_settings to stream_settings to have a uniform
naming pattern for stream settings.
* Move it to stream_settings folder.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n 662d485c15 stream settings: Move stream_settings_checkboxes.hbs to stream_settings. 2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n ee7188e625 stream settings: Move subscription_type.hbs to stream settings folder.
We do follwing changes in this migration:
* Rename subscription_type.hbs to stream_permission_description.
* Move it to stream_settings folder.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n cc983f2b5a stream settings: Move stream privacy icon template to stream_settings.
This commit does following two changes:
* Rename subscription_privacy template to stream_privacy_icon so
that its purpose is clear from its name.
* Move it stream_settings folder.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n c213ed575a stream settings: Move stream description templates to stream_settings. 2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n d82da45564 stream settings: Migrate stream member list template to separate folder. 2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n 661ce2dc25 stream settings: Rename subscription_members.hbs to stream_members.hbs.
This is preparatory commit for migrating stream settings related
templates into a separate folder and have a common naming scheme
for them.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n a63a23087f tooltips: Remove unnecessary checks for message action buttons in tippy.
We handled tooltips for failed message action buttons separately
through our default tippy-zulip-tooltip class because of
a diffrent html structure for these buttons. But as we refactored
html for those buttons to have same structure as for other buttons
in message action this extra check is no more needed.
2021-07-18 11:33:32 -07:00
m-e-l-u-h-a-n e7b1de8ace message view: Show failed message icon tooltips similar to other icons.
We had tooltips bound to failed message action icons, because of
slightly different html structure for these action buttons as
compared to other message action buttons. There were some minor
problems due to this. First there was difference of delay
in which we show other normal action button tooltips. Second
we had to add extra checks to handle tooltip content for these
buttons in tippyjs module.

This is fixed by having same html structure for failed message
buttons as for other message action buttons.
2021-07-18 11:33:32 -07:00
aryanshridhar 594c66edc5 move_topic: Improve the style for dropdown toggle button.
Earlier, the `stream_header_colorblock` wasn't properly styled
with the dropdown toggle button from a UI perspective. This was so
because they had a few space between them due to inconsistencies
in their border radius.

This commit adds an border-radius property to the move topic
dropdown toggle button to eliminate the above issue and
improve it's overall look.
2021-07-16 12:58:15 -07:00
aryanshridhar f4e44228a7 message_edit: Improve the style for dropdown toggle button.
Earlier, the `stream_header_colorblock` wasn't properly styled
with the dropdown toggle button from a UI perspective. This was so
because they had a few space between them due to inconsistencies
in their border radius.

This commit adds an border-radius property to the message_edit
dropdown toggle button to eliminate the above issue and
improve it's overall look.
2021-07-16 12:58:15 -07:00
aryanshridhar 1a2782f95d message_edit: Adjust the height of stream_header_colorblock.
Previously, the message edit `stream_header_colorblock` used
to incorrectly extend down till the textarea which caused
the UI to be buggy.

Fixed this by adding a `margin-bottom` property similar to
what we did in case of Move topic dropdown.

This minor change accidentally was missed within commit
7c25bd1aa8.
2021-07-16 12:58:15 -07:00
Tim Abbott 8f74261d48 drafts: Delete old drafts on page load, not modal launch.
This fixes a bad user experience where clicking to open the drafts
modal causes the number of drafts that you're looking at to suddenly
change.
2021-07-16 12:50:51 -07:00
aryanshridhar af4bd34873 stream_create: Remove unnecessary export keyword.
There's no need for the `create_handlers_for_users`
function to be exported as it's called within its
scope itself.
2021-07-16 08:53:56 -07:00
aryanshridhar d8e2fa5f9c stream_create: Avoid re-initialization of event handlers.
Previously, Everytime the user triggers the Stream create UI
by pressing the `Create stream` button, the
`create_handlers_for_users` function would reinitialize which
created duplicate event handlers for its elements.
This could lead to multiple click events being triggered over the
same element.

One such example was filed as #19255, where the click event was
triggering twice and hence the "Copy from stream" dropdown
would remain folded (closed).

Fixed this by - Initializing the `create_handlers_for_users` function
within the main `set_up_handlers` function, which is triggered only
once upon the opening of Stream create UI.

Fixes #19255.
2021-07-16 08:53:56 -07:00
Wesley Aptekar-Cassels 21fbc94e37 css: Remove some redundant styles.
These links (in addition to the recent topics one) were all already set
as block elements by a rule further up in this same file.
2021-07-15 15:08:50 -07:00
sahil839 711aca3fde settings: Show correct email in user-info form.
This commit fixes the bug of showing custom email to admin in
the user-info form even when email_address_visibility is set
to admins only.

This commit fixes it to show the correct email according to
email_address_visibility values.
2021-07-15 14:26:40 -07:00
Priyansh Garg 3136c08904 compose: Fix compose top-right buttons misalignment. 2021-07-15 14:12:29 -07:00
Eeshan Garg 6036524651 landing_page: Restructure top-level navigation.
This commit restructures the top-level navigation on our landing
page using dropdowns in a manner that allows us to advertise some
important pages to our visitors:

- Use cases for companies, open source projects, and communities.
- Miscellaneous pages about the product are now accessible from the
  "Product" dropdown.
- "Resources" are a few key resources our users may want to consult
  if they need help or support.
2021-07-15 10:56:47 -07:00
Eeshan Garg faa695e86d registration: Collect organization type on sign-up. 2021-07-15 09:58:27 -07:00
sahil839 2f44a08b37 settings: Convert settings_overlay.html to handlebars template.
Fixes #18796.
2021-07-15 08:59:23 -07:00
aryanshridhar 7c25bd1aa8 message_edit: Refactor message_edit to use dropdown_list_widget.
Implemented dropdown_list_widget in message_edit UI
which enables the functionality to search for streams
while moving a particular message across streams.

This matches the UI we have in the "move topic" widget.

Fixes #18416.
2021-07-15 08:27:55 -07:00
sahil839 6a3f22480d settings_emoji: Rename can_admin_emoji to can_delete_emoji. 2021-07-14 14:57:09 -07:00
sahil839 61acf68aa4 emoji: Allow emoji authors to delete the emoji always.
Previously, non-admin emoji authors were allowed to
delete the emoji only if add_emoji_by_admins_only
was false. But, as add_emoji_by_admins_only setting
is for who can add emoji and not delete emojis, it
should not affect the behavior of deleting emojis
and users should always be allowed to delete the
emojis which. they added themselves
2021-07-14 14:57:08 -07:00
Kerry Jackson 5d91a34119 search_icon: Fix contrast color of icon.
Fixes #19053.
2021-07-14 14:53:45 -07:00
sahil839 e736d9d275 settings: Add moderators and full members options in user-group setting.
This commit adds moderators and full members options for user group
settings in frontend.
2021-07-14 14:38:44 -07:00
sahil839 1148937c7b settings: Show tip always in user group settings page.
This commit changes the behavior to show the tip, explaining
which user roles are allowed to edit user groups, to user
with all roles because it is better to show the user which
other roles are allowed to edit. Previously the tip was shown
to non-admin users only.
2021-07-14 14:38:43 -07:00
Tim Abbott a5eb3abc52 css: Fix settings alignment for dialog widget modal. 2021-07-14 13:32:26 -07:00
Tim Abbott c5b455d5c2 dialog_widget: Simplify rendering logic.
This makes the templates a lot more readable.
2021-07-14 13:32:26 -07:00
Tim Abbott e0135e278d dialog_widget: Fix race focusing submit button.
Opening the modal before adding the on_shown handler makes it possible
that the modal could full appear before the handler runs.
2021-07-14 13:32:26 -07:00
Tim Abbott 6fb0d414b4 dialog_widget: Remove is_confirm_dialog variable.
Making the controls declarative makes the system more flexible for
future use cases.
2021-07-14 13:32:24 -07:00
sahil839 fd55df9f7c settings: Use dialog_widget for bot-edit form and remove edit_fields_modal.
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.
2021-07-14 13:02:26 -07:00
sahil839 0b21ca725e settings: Use dialog_widget for edit-user-info modal.
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.
2021-07-14 13:02:26 -07:00
sahil839 e0ab9e52b5 settings: Use dialog_widget for edit-linkifier modal.
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.
2021-07-14 13:02:26 -07:00
sahil839 f6d8204d23 dialog_widget: Color of button should be according to use of modal.
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.
2021-07-14 13:02:26 -07:00
sahil839 dff374a48b frontend: Remove html_submit_button paramter passed to 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.
2021-07-14 13:02:25 -07:00
sahil839 ec3c5547ff frontend: Add dialog_widget module and refactor confirm_dialog.
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.
2021-07-14 12:58:00 -07:00
sahil839 71969f5196 confirm_dialog: Add post_render support in confirm_dialog.
This will be used by other modals when we will migrate
those to use the same code as that of confirm_dialog.
2021-07-14 12:21:24 -07:00
sahil839 c87c4f92ee confirm_dialog: Rename variables and classes used in templates.
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.
2021-07-14 12:21:24 -07:00
Gaurav Pandey 269f6fb577 compose: Fix overlaping expand-compose icon.
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.
2021-07-14 11:40:16 -07:00
Gaurav Pandey 5e97ec9ad9 narrow: Do not mark messages as read in mentioned narrow.
The current behaviour marks messages as read when in mentioned
narrow. This is not the ideal behaviour, hence do not mark them
as read.

Fixes #19098.
2021-07-14 11:39:46 -07:00
akshatdalton 66ba35d7fe search_operators: Add info about `is:resolved` keyword. 2021-07-13 23:48:45 -07:00
akshatdalton 272901326c narrow_banner: Add banner for no resolved topics found search. 2021-07-13 23:36:24 -07:00