Commit Graph

9325 Commits

Author SHA1 Message Date
jai2201 511c589e2d message-edit: Add maxlength attribute for editing topic names. 2022-07-15 15:16:55 -07:00
jai2201 97ffeb0b7e message-edit: Avoid hardcoding maxlength for message_edit_form. 2022-07-15 15:16:55 -07:00
jai2201 3853a65a4c compose: Avoid hardcoding maxlength for stream/topic names.
Note that previously, the limit for stream names was 30, even though
stream names have been up to 60 characters in length for years.
2022-07-15 15:15:48 -07:00
jai2201 96be6678e4 stream-edit: Restrict users to maxlength in input for `Stream name`. 2022-07-15 15:10:40 -07:00
jai2201 475b442963 stream-edit: Avoid hardcoding maxlength for stream description. 2022-07-15 15:10:40 -07:00
jai2201 51f2a7f5f4 stream-settings: Rename variables for stream name/description maxlength. 2022-07-15 15:10:40 -07:00
evykassirer be3222dcf0 Move function declaration out of for loop. 2022-07-14 15:16:53 -07:00
Sahil Batra af01107b59 sub_store: Remove role field and SubscriptionRole type.
This commit removes role field from StreamSubscription
type and also removes SubscriptionRole type since we are
not moving forward with stream administrator concept and
instead working on new permssions model as per #19525.
2022-07-13 17:07:44 -07:00
Sahil Batra 2bcd55dade settings_config: Remove stream-admins option for wildcard mention policy.
This commit removes the stream-admins option for wildcard mention policy
in webapp since we are not moving forward with stream administrator
concept and instead working on new permssions model as per #19525. There
is no functional change, we only remove the by_stream_admins_only key and
instead use by_admins_only with the correct code value.
2022-07-13 17:07:44 -07:00
Sahil Batra 0d20d132b7 settings_bots: Declare bot types as global variables in the module.
We declare bot type variables globally in the module rather than in
set_up function as we would extract a new function in further commit
that will use these.
2022-07-13 16:34:55 -07:00
Sahil Batra 6a56c0dc8c settings_users: Rename get_bot_owner_widget_and_set_role_values.
This commit renames get_bot_owner_widget_and_set_role_values to
edit_bot_post_render, since we will modify the function to do
a couple of more things in further commits and this would be
an appropriate name rather than mentioning all the things in
the name.
2022-07-13 16:34:55 -07:00
Sahil Batra 45f0a138c3 settings: Rename admin_bot_form.hbs to edit_bot_form.hbs.
We rename the file because in further commits we will use
the same modal for the bot edit form in Personal settings
section and that can be done by bot-owners who are not
admins.
2022-07-13 16:34:55 -07:00
Sahil Batra a57358c5be settings_bots: Remove redundant code.
This commit removes the redundant code to update the
"src" attribute of bot avatar on changing avatar added
in f7ca0117e6.

We do not need to add version to the url since the backend
already sends url with latest version number and also we
already re-render the bots page after recieving realm_bot/update
event.
2022-07-13 16:34:55 -07:00
Anders Kaseorg a7263583db landing-page: Remove unused hero-screen class.
It’s unused since commit 7f32c26731.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-07-13 16:32:01 -07:00
Alya Abbott 4b8556ed13 images: Move /apps images into dedicated apps image directory. 2022-07-13 15:14:19 -07:00
YashRE42 20f36431ec presence: Rename hbs templates to not have the word "user".
This is a prep commit for enabling a two section layout in the
buddy_list. The sections will be for "users" and "others".

Hence, this commit performs a simple rename of:
- `user_presence_row.hbs` -> `presence_row.hbs`
- `user_presence_rows.hbs` -> `presence_rows.hbs`
And then a search and replace of `user_presence_row` to
`presence_row` (which also handles the second rename).

It also makes one modification in buddy_list.js where it changes a
template variable we're passing from "users" to "row_members".
2022-07-13 14:34:44 -07:00
YashRE42 900a776293 buddy_list: Rename other_key to new_key in buddy_list.insert_new_html.
This is a prep commit for adding a two section layout to the
buddy_list. It frees the "other_key" name which we intent to use
extensively in future commits.
2022-07-13 14:34:43 -07:00
Riken Shah 5fdd93cf32 message_scroll: Hide scroll to bottom button when using keypress.
We added  `is_keypress_scrolling` flag in `message_scroll.js` to keep
track of if keypress is used for scrolling.

Fixes #21844.
2022-07-13 13:56:10 -07:00
Riken Shah 3ba89e7779 message_scroll: Use CSS transition for scroll to bottom button.
We are abandoning jQuery animation because it build up queue
when there is continous switch in animation state.
i.e When user goes ↑↓↑↓↑↓… at the bottom.

Also added `aria-hidden` to `#scroll-to-bottom-button-container` so
that this widget doesn't interfere with screen readers.
2022-07-13 13:50:55 -07:00
Tim Abbott 737145e4e0 i18n: Simpify default_language conditional. 2022-07-12 17:25:43 -07:00
Aman Agrawal df6ad8154a default_language_modal: Add more space around languages displayed.
We use 3 columns on wide screens and come down to 1 column on
narrow screens to ensure that the languages are properly
displayed.
2022-07-12 17:23:15 -07:00
evykassirer 1b24bfcc31 mark as read: Fix banner not closing when x is clicked.
Previously, the X in the mark-as-read banner did nothing.
2022-07-12 16:34:26 -07:00
evykassirer a434b0ef19 Move hide_mark_as_read_turned_off_banner to unread_ui from narrow. 2022-07-12 16:28:34 -07:00
Lauryn Menard 32d396fdc7 help-docs: Remove `mac-cmd-style` CSS rule.
Removes the `mac-cmd-style` CSS rule that was introduced in
d3e8348 when support for updating keyboard shortcuts with
the `Ctrl` key to the Mac cmd key, `⌘`, was added.

Removing the rule makes the font-size and font-family CSS more
consistent with other keyboard shortcuts in the documentation.

Also, removes the parameter in `adjust_mac_shortcuts` that added
the CSS class / rule to these specific keyboard shortcuts.
2022-07-12 12:17:41 -07:00
Anders Kaseorg d3f2203459 input_pill: Remove random IDs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-07-11 11:44:47 -07:00
Anders Kaseorg fc6b4ff6aa input_pill: Identify pills by DOM nodes, not random IDs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-07-11 11:44:47 -07:00
aparna-bhatt f97fa80433 stream settings: Remove background click handler in "Manage Streams".
This click handler reset the stream creation form; it's not clear why
that behavior would be useful, or why we'd want anything to happen
when clicking in these background areas, so the correct thing to do is
just remove the handler.

Fixes: #21785
2022-07-08 14:32:02 -07:00
N-Shar-ma 082e9adcea typeahead: Don't match descriptions for streams and user groups.
Uptil now, both names and descriptions of streams and user groups were
matched to show the typeahead suggestions. This led to unexpected
behaviour like for a clear mention of a certain stream, the typeahead
menu suggested a completely different stream which had a mention of
the first stream in it's description.

To prevent such bugs and also since description matching is not really
useful for streams and user groups, only names will be matched.
2022-07-08 14:28:29 -07:00
Lauryn Menard 24d1d08553 mac_shortcuts: Render shortcuts with `Fn` key correctly.
Updates the `adjusts_mac_shortcuts` function to render shortcuts
with the `Fn` key as a separate html element (e.g. `Fn` + `arrow`)
instead of rendering the shortcut as one block (e.g. `Fn + arrow`).

Also, because keyboard shortcuts should be rendered with each key
as a separate html element, updates `adjusts_mac_shortcuts` to
only change html elements that are an exact match to a keyboard
key. Html elements with whitespace will be ignored (e.g. `Enter`
becomes `Return`, but `Enter or Backspace` is not changed though
it previously would have been changed to `Return or Delete`).

Fixes #22112 (in combination with #22273).
2022-07-07 17:38:26 -07:00
Ganesh Pawar c6d636ef48 realm_domains_modal: Migrate modal to dialog_widget. 2022-07-07 14:56:45 -07:00
Anders Kaseorg 6648fc4bf1 dropdown_list_widget: Simplify ternary expression.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-07-06 17:23:16 -07:00
Gaurav Pandey 3aa9e4c553 recent_topics: Link timestamp to latest message.
Link the timestamp in recent topics to the
"near" link of the latest message within that topic.
Fixes #21356.
2022-06-28 13:31:27 -07:00
Tim Abbott d6739078ad message_edit: Change initial default for old thread notifications.
After some discussion with the community, we've concluded that in most
cases, one probably wants to notify only the destination thread, not
the source location; so let's make that the default.

We preserve the model that we remember what you did during the last
move in a given browser session, which is very helpful if you're doing
an operation N times in a row.

Fixes #21838.
2022-06-28 13:23:34 -07:00
Advait J 6ceb7b5462 streams: Enable or disable subscribers tab based on access to subscribers.
This commit adds a function to disable the subscribers tab for private
streams if a user is not subscribed to the stream and is not an admin.
We also live update the state of subscribers tab on changing privacy
of stream.

Fixes #20916.

Co-authored-by: Sahil Batra <sahil@zulip.com>
2022-06-28 13:19:26 -07:00
Anders Kaseorg 25f6b53e90 docs: Capitalize Handlebars consistently.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-06-27 13:35:10 -07:00
Anders Kaseorg 028c2e4ec9 ui_init: Remove unused .subscription_header hover handlers.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-06-21 12:54:51 -07:00
Anders Kaseorg a6e2453323 emojisets: Use Google modern for emoji picker with text theme.
Followup to commit f743dda008 (#19672).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-06-06 15:53:32 -07:00
evykassirer e039bdd1e1 narrow: Replace pm_string() with _id and _email variants.
This makes the format returned by these functions more clear.
2022-06-02 16:41:06 -07:00
Aman Agrawal 66b80c8ae8 admin: Use language_selection_widget to set notification language.
Fixes #21948
2022-06-01 17:08:00 -07:00
Aman Agrawal 59e676b1f5 gear_menu: Allow spectators to select their default language.
Set the default_language as cookie and reload the page so that
the spectator can immediately see the language change in effect.

We can reload the page forcefully for spectators since there is
no chance of any work being lost. It is possible that the spectator
may lose the selected message on doing so.

This requires a new dependency, to be able to set cookies from
frontend JavaScript.

Fixes #21961
2022-06-01 17:08:00 -07:00
Aman Agrawal 2c177f3c53 settings_display: Extract function to launch language selection modal.
It will be used to launch it for spectators using the same shared
code.
2022-06-01 17:08:00 -07:00
Anders Kaseorg f2d0ae3255 stream_create: Fix crash on stream creation error.
Commit a9ca5f603b (#15863) incorrectly
translated this; stream_name_error is not a jQuery object.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-05-31 22:54:57 -07:00
Anders Kaseorg ddcd69cb41 gear_menu: Link to /devlogin/ in development environment.
It’d be nicer to use hash_util.build_login_link which also remembers
the current hash, but that doesn’t help when the gear menu is only
rendered once at page load time.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-05-31 22:54:11 -07:00
Lani 5a9cba1bba emoji_picker: Allow filtering emojis by unicode characters in emoji picker.
This PR implements literal emoji match in the emoji picker (for reactions)
and in emoji typeaheads (in compose box)

Tested on mobile browser by opening the emoji picker with the
reaction button, selecting an emoji via the native keyboard, and
ensuring the selected emoji appears in the emoji picker’s search
result.

Fixes #21714.
2022-05-31 10:02:57 -07:00
Lani 986dbc44b7 composebox_typeahead: Make reaction_type available in composebox emojis.
In order to make it possible to search emojis with emoji literals,
we need to make the reaction_type of every emoji available in the
emoji objects used by the composebox.
2022-05-31 10:02:57 -07:00
Lauryn Menard bb45c04136 frontend: Update when communities directory checkbox is disabled.
Changes the admin UI for the communities directory checkbox to use
the `realm_push_notifications_enabled` page param instead of the
`server_web_public_streams_enabled` page param.

Updates help center documentation about the communities directory
to have clearer information about how the setting works for
self-hosted communitites.
2022-05-27 17:08:15 -07:00
Sahil Batra c382f8c9a6 stream_edit: Capitalize "ID" when showing invalid stream ID errors.
This commit changes the error message, shown while trying to deactivate
a non existent stream from stream settings UI, from "Invalid stream id"
to "Invalid stream ID".
2022-05-27 17:06:03 -07:00
Aman Agrawal e6e975b470 recent_topics: Don't restore filters for spectators.
This fixes the bug where spectators can have filters selected
in recent topics if a logged in user has selected filters in the
same browser.

Log in, select a filter and log out to reproduce this.
2022-05-27 14:40:11 -07:00
Sahil Batra f38ab85f02 user_groups: Pass user group object instead of id to get_recursive_subgroups.
We directly pass the user group object to get_recursive_subgroups as we
already have the object in the caller. We can add separate function which
will accept id as parameter in the future if required.
2022-05-17 14:51:55 -07:00
Sahil Batra dfd7902c77 user_groups: Rename subgroups fields to direct_subgroup_ids.
This commit renames subgroups and subgroup_ids field sent in user
group objects to direct_subgroup_ids for better readability.
2022-05-17 14:51:45 -07:00
somesh202 6ef8cdb380 org_settings: Add main feature to change bot role.
This commit attempts to refactor the `handle_bot_form` by adding new
field for `Role` in the `Manage bot` modal.

It uses the `/json/users/` url for passing the role of a bot and allow
changing it as in case of a normal user.

Fixes: #21105
2022-05-10 14:09:57 -07:00
somesh202 0b92e4c22f org_settings: Fix formatting and field ordering for bot modal.
This commit fixes the formatting of the "Manage bot" modal and re-orders
the field labels as per the bot-list table.
2022-05-10 14:09:57 -07:00
somesh202 b1cafb1280 org_settings: Add "Role" column in bot-list table.
This commit adds a new "Role" column for the bot-list table in the
org-settings, and removes the user_id column from the same.
The role of a bot is fetched using the `get_user_type` function inside
bot_info().
This also adds the `sort_role` in the sort_fields which sorts the role
column in the bot-list table.
2022-05-10 14:09:57 -07:00
yogesh sirsat 496273ddbc popovers: New function for hiding all user info popovers.
New function `hide_all_user_info_popovers` closes all user info
popovers, instead of calling multiple functions everytime to close
user info popover now we can just call this new function.

This commit is a follow-up of #21460.
2022-05-05 17:43:28 -07:00
Tim Abbott 24f527cb59 home: Don't send /register response for spectators.
In very large communities, computing page_params can be quite
expensive. Because we've moved the homepage for communities with web
public streams enabled to be the Zulip app, and it's common for
automation to frequently poll the homepage of a Zulip organization,
we'd like to keep those homepages cheap (as the login pages are).

We address this by prototyping something we may end up wanting to do
anyway -- having the web application do a `POST /register` API call in
order to fetch most page_params, and merging those with the mostly
webapp configuration page_params that we leave in the / response for
convenience.

This exact implementation is messy in a few ways:

* We rely on the assumption that ui_init.initialize_everything happens
  before all code that needs to inspect the page_params properties we
  are fetching via /register. This is likely mostly true, but nothing
  in the implementation enforces it.
* The bundle of ~25 keys that are in page_params ideally would be
  considered individually, with some moved to the /register API
  response and perhaps others eliminated or namespaced inside a
  webapp_settings object.
* It's weird to have the spectators network sequence different that
  from logged-in users, and potentially a maintainability risk.
* We might be able to arrange that the initial `/` response be
  cacheable, now that we're no longer embedding our metadata inside
  it. We've made no effort to do that as of yet.

Despite those issues, this commit solves an immediate problem and will
give us helpful experience with a model closer to the one we'll want
in order to happily support a web client that can be run locally
against a production Zulip server's data.

Co-authored-by: Anders Kaseorg <anders@zulip.com>
2022-05-05 15:20:46 -07:00
Anders Kaseorg 44fcb6009b ui_init: Move loaded indicator to initialize_everything.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-05-05 15:20:46 -07:00
Tim Abbott d180f7ccfc right sidebar: Clean up rendered description logic.
Previously, we were masking the realm_description raw Markdown with
rendered Markdown, which was a type error.

When we switch to calling /register explicitly in a few commits, this
results in a bug, since the raw Markdown ends up taking priority.

Fix this by just using a different name for this different concept.
2022-05-05 15:17:07 -07:00
yogesh sirsat 918c0b039b popovers: Hide "Send private message" if user not have PM permissions.
If an organization does not allow to send private messages, it will
not display the "Send private message" option in the profile popover.

Currently, there are only two options in settings, first is to allow
every type of user to send PMs and the second is to disable send PMs
for everyone, hence I am just checking that the second option is not
selected.

Fixes: #21888
2022-05-05 14:02:34 -07:00
Sahil Batra eebc776bf5 user_groups: Add is_user_in_group function.
This commit adds function to check whether a user
belongs to the user group or not.

Fixes part of #19525.
2022-05-05 13:51:57 -07:00
Sahil Batra 41880759cf user_groups: Add get_recursive_subgroups function in frontend.
This commit adds get_recursive_subgroups function to get all
subgroups of a user group.
2022-05-05 13:51:53 -07:00
Sahil Batra c52a135eb3 user_groups: Swap parameter order in is_direct_member_of function.
This commit swaps the parameter order in is_direct_member_of
function to have user_id followed by user_group_id since user_id
is a member of user_group_id and not the other way around.
2022-05-05 13:48:01 -07:00
Sahil Batra 6bca2453cf user_groups: Rename is_member_of function to is_direct_member_of. 2022-05-05 13:48:01 -07:00
Sahil Batra a5b3510cb3 user_groups: Add functions to update subgroups data on receiving events. 2022-05-05 13:48:01 -07:00
Sahil Batra e2b9d6ebeb user_groups: Add subgroups field to user group objects. 2022-05-05 13:48:01 -07:00
Ganesh Pawar 59e810790f user_groups: Convert inline form to modal.
Fixes part of #21298.
2022-05-04 17:46:30 -07:00
yogesh sirsat a57e2cfe9a settings_users: Display status update notifications inside modal.
This commit will lead to display status update notifications of
edit user/bot inside their edit form modal.

This commit is a follow-up of #21490.
2022-05-04 17:30:40 -07:00
yogesh sirsat 7b4f7b4a85 settings_bots: Confirmation modal for "Deactivate" bot.
In settings, clicking on deactivate bot button will lead to open
confirmation modal, and displaying all status update notifications
inside this confirmation modal.

This commit is a follow-up of zulip#21490.
2022-05-04 17:30:40 -07:00
yogesh sirsat 3260353aeb dialog_widget: Add shared function for api requests from modals.
This function will replace `settings_ui.do_settings_change` for api
requests which confirms from modals to make loading indicator and
error handling easy and clean inside modals.

Also replacing some previous code blocks of `channel` with this function
in `settings_users.js` which was being used for confirmations modals.

This has the side effect of doing better in-modal error handling for
accessing the user info modal from the "Manage user" button in user
info popovers.

Additionally, we now show a loading indicator while waiting for the
server in these modals.

CZO: #frontend > Error handling inside modals.
2022-05-04 17:30:10 -07:00
Raghav Luthra bbda7a5bb0 stream_settings: Replace non-standard tooltip for "Announce stream" hint.
The tooltip for the "Announce Stream" hint was not consistent with the
rest of the settings so it has now been replaced with the standard tippy
tooltip. The "?" icon has also been replaced by the "i" icon to match
the other settings.

Fixes: #21312.
2022-05-04 17:12:07 -07:00
Sahil Batra aab82d1f16 settings: Hide email address if not available in user-edit form. 2022-05-04 12:52:43 -07:00
Lauryn Menard 44c9b788f9 settings: Add realm setting for Zulip communities directory.
Adds `want_advertise_in_communities_directory` to the realm model
to track organizations that give permission to be listed on such
a site / directory on zulip.com.

Adds a checkbox to the organization profile admin for
organizations to give permission to be advertised in the
Zulip communities directory.

Adds a help center article about the Zulip communities directory
and uses a shared intro documentation file to create sections in
the articles on creating an organization profile and moderating
open organizations.

Co-authored-by: Alya Abbott <alya@zulip.com>
2022-05-04 11:13:28 -07:00
Anders Kaseorg 1ac8673989 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-05-04 09:56:07 -07:00
Aman Agrawal 814abf6764 resize: Don't use `visible` selector to find element states.
This change decreases the time required to open compose
after clicking a message. The amount of time reduced varies with pc.

The time reduction was around 0.4s to 0.6s for me after using a
6x CPU slowdown. This may not sound convincing but the profile
uploaded in #21979 clearly shows the root cause of having a message
click take 10s was the `:visible` query.

Fixes #21979
2022-05-03 09:19:01 -07:00
Tim Abbott 4538792517 message controls: Use login_to_access modal for reactions/stars.
Hiding these UI widgets causing layout issues -- specifically, the
position of the \vdots menu looks off with these elements missing.

Enabling this buttons (and opening the login_to_access modal on click)
provides a light advertisement for these features, seems to be the
standard practice for forum-like software, and will also be easier to
maintain.

This effectively reverts f26a76a9d8, in
addition to adding new logic.
2022-04-29 16:35:49 -07:00
Aman Agrawal 64ea9125f3 narrow_banner: Simplify empty narrow messages for spectators. 2022-04-29 16:35:49 -07:00
Aman Agrawal 43d789993f login_to_access: Change message displayed for empty narrows.
We change the generic message copy while we're at it.

Also, show login_to_access modal when a spectator tries to access
a stream that either does not exist is is not web-public.
2022-04-29 16:35:49 -07:00
Tim Abbott 362761757b spectators: Fix double modal bug with message edit history.
Previously, clicking MOVED/EDITED buttons on a message would pop up
the message edit history modal, which would (after a brief loading
indicator) get a 400 error for the server and then pop the
login_to_access modal on top of the error in that modal.

Fix this with an explicit login_to_access check. This feels like the
cleanest way to avoid churning the UI (hover behaviors, etc.) as would
be required to make this not clickable.

Fixes #21963.
2022-04-29 16:35:49 -07:00
Dinesh 68572e6bc8 compose: Display current narrow in go to conversation tooltip. 2022-04-28 12:57:42 -07:00
Dinesh 43107e1424 compose_box: Add button to go the narrow message is being composed to.
This'll be shown only when in a different narrow from what
you're composing to.

Takes care of updating display of the button on moving from
one narrow to another and also on changing inputs. This is
what contributes to majority of js code in this commit.

We are not displaying this for private messages since we do not
have a consistent design for both stream and private compose areas.
See https://chat.zulip.org/#narrow/stream/101-design/topic/narrow.20to.20topic.2Fpms.20when.20composing/near/1318548

Thanks to Vlad Korobov for the icon and for proposing various
designs.
2022-04-28 12:57:42 -07:00
Somesh Ranjan d00fa63aa4 compose: Fix sorting of wildcard mentions in case of PMs.
This commit attemts to fix the sorting of wildcard mentions by moving
them below the silent mentions in case of PMs.
It adds a condition in compare_people_for_relevance function to check
for private message type and sorts the wildcard mention below the silent
ones.
It also adds test for sort broadcast mentions and compare_people_for_relevance
function in case of private message types.

Fixes: #21643
2022-04-28 12:53:46 -07:00
Aman Agrawal 86a6318d30 public access: Fix in-app links to public access option.
We also update these links to the new dedicated article on the topic,
and also remove the zulip.com/zulipchat.com hardcoding.

Fixes #21941.
2022-04-28 12:09:08 -07:00
Aman Agrawal 00fffd1681 help: Rename `web-public-streams` page to `public-access-option`. 2022-04-28 12:09:08 -07:00
Aman Agrawal 44efc8eb37 web_public_view: Redirect to current narrow after login.
Add current hash as `next` URL to all login buttons
a spectator can access while in app.
2022-04-28 10:47:49 -07:00
Anders Kaseorg 567859d15d dropdown_list_widget: Convert DropdownListWidget to ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-04-27 22:09:10 -07:00
Anders Kaseorg d131327760 dropdown_list_widget: Convert MultiSelectDropdownListWidget to ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-04-27 22:09:10 -07:00
Anders Kaseorg 59c4680370 dropdown_list_widget: Reorder MultiSelectDropdownListWidget constructor.
ES6 class constructors must call the superclass constructor before
accessing this.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-04-27 22:09:10 -07:00
Anders Kaseorg 175dd999ac dropdown_list_widget: Separate setup method from constructor.
This refactoring is required so the next commit can reorder the
constructor.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-04-27 22:09:10 -07:00
Lauryn Menard 1292338537 frontend: Add `org_type` to realm settings updates and events.
Adds a drop-down menu for updating the organization type in the
`organization_profile_admin` page. Implements front end for
this setting to work / update like other organization profile,
notification and permissions settings.

One special note about this dropdown is that the listed options
should change once an organization has successfully set a type
other than 'unspecified' in the database. To accomplish this
the initial settings overlay build checks the realm_org_type
value in the page_params to select the correct options list,
and when the dropdown value is reset, either for update events
or for discarding changes, the page_params value is again used
to check for whether the 'unspecified' value should be present
as an option in the dropdown menu.

Adds basic node test for the `server_events_dispatch`.
Also adds a new help center documentation article for this
organization setting that is linked to in the UI.

Fixes #21692.
2022-04-26 16:29:12 -07:00
Dinesh 1c0368c402 compose_state: Add is_topic_field_empty().
This is required for adding a narrow-to-recipient button which
we do not want to show when topic field is empty.
2022-04-26 12:58:28 -07:00
Dinesh d363ea6158 compose: Extract update_on_recipient_change().
Runs when there's a change in recipient fields of compose box.
Moved the `update_fade` function to this.

This is a preparatory commit to add a feature to go to the
narrow you're composing to where we want to update the
button visibility when the recipients changes. The update could be
run in the function this commit adds.
2022-04-26 12:58:19 -07:00
sayamsamal 9488022d86 message_feed_ui: Remove "Unmute topic" from message action menu.
See the previous commit for background.
2022-04-25 17:35:02 -07:00
sayamsamal 86607ba318 message_feed_ui: Remove "Mute topic" from message action menu.
This change is motivated by a few considerations:

* The message actions menu has grown quite a bit and is at risk of
  feeling cluttered, especially with the upcoming Read Receipts feature.
* Conceptually, this menu is for interactions with the message, not
  its topic. There are other convenient ways to do this, in the topic
  recipient bar and left sidebar; hopefully removing this isn't much of
  an inconvenience. (If we add something back, we'd probably want a
  full "Topic actions" popover, not just this single item)
* Combined with the next commit, this removes the last copy of the
  topic name in this popover, which is helpful to its shape/layout,
  since topic names have much more variable length than the labels
  present here.

Fixes #21432
2022-04-25 17:29:36 -07:00
Aman Agrawal d0a697fba7 recent_topics: Disable filter buttons for spectator.
Instead of setting `disable` attribute to the elements, we make
them look like disabled and remove interactions with them. This
helps us keep the hotkey handling logic for navigation easier
to manage.

Fixes #21279
2022-04-22 15:33:26 -07:00
Sahil Batra 77fd03e426 invite: Add custom option for invite expiration time in frontend. 2022-04-20 13:31:37 -07:00
Sahil Batra 93eb5799ef invite: Pass time value to valid_to.
This is a prep commit for adding
custom expiration option.
2022-04-20 13:31:37 -07:00
Sahil Batra 61365fbe21 invites: Use expiration time in minutes instead of days.
This commit changes the invite API to accept invitation
expiration time in minutes since we are going to add a
custom option in further commits which would allow a user
to set expiration time in minutes, hours and weeks as well.
2022-04-20 13:31:37 -07:00
Raghav Luthra 22a5d008c1 user_settings: Add a setting to display names of users who reacted.
Added a setting to the bottom of Settings > Display settings > Theme section
to display the reacting users on a message when numnber of reactions are
small.

This is a preparatory commit for #20980.
2022-04-19 17:30:16 -07:00
George A. Michel 6c6986e2d3 popovers: Introduce case sensitivity to move topic button behavior.
Previously, the confirm button would be disabled when the user
attempted to change the capitalization of a topic, but still keep
it in the same stream. This commit fixes this discrepancy.
2022-04-19 16:10:35 -07:00
George A. Michel ca60660dc3 popovers: Replace move topic error with conditionally disabled button.
This commit changes the behavior of the move topic modal in
'stream_popover.js'. Instead of relying on an error banner, it
will now disable the submit button whenever an identically named
topic exists in the currently selected stream. To accomplish this,
it introduces a callback, update_submit_button_disabled_state(),
and calls it in three cases:

1. When the modal is initially loaded.
2. When the dropdown is changed.
3. When the topic name is changed.

The case insensitivity of topic comparison has been preserved.

Fixes #21711.
2022-04-19 16:03:38 -07:00
Sahil Batra 69a7cf9b7b streams: Check/uncheck the announce checkbox as per the previous state.
On changing the stream announce from being disabled to enabled, we
check/uncheck it based on its previous state when it was enabled.
2022-04-17 17:27:22 -07:00