Commit Graph

244 Commits

Author SHA1 Message Date
Lauryn Menard 6b4ab21562 narrow-banner: Exclude bots when checking org sending pms policy.
Private messages between a user and a bot are not restricted by
the organization's policy setting for sending private messages.
So, for the empty banner text, we set the default title for
a single bot for the "pm-with" narrow.

Group private messages that include a bot are restricted by
this policy setting, so those messages stay the same.

Also, since bot's aren't people, we update the text for valid
"pm-with", "sender" and "group-pm-with" operands to include the
user's full name in the title.

When there are multiple people in the "pm-with" narrow, we still
send a generic "these people" message instead of listing all the
users in the narrow.

Finally, we make the default message end in a period instead of
an exclamation mark.
2022-11-04 14:37:45 -07:00
jai2201 6f9e97921d pm_section: Create collapsible private messages section.
This commit introduces the change of rendering private messages
section as collapsible, whose data-fetching logic came with zulip#21357.

We now have separated out `Private messages` from `top_left_corner`
section and shifted it below the `global_filters` in a different
separate section along with stream list with common scroll bar
in left-sidebar.

The new PM section will be opened by-default on loading the page
and will have a toggle-icon in its header, clicking on which makes the
section collapse/expand accordingly.

In default view, only recent 5 PM threads would be shown
and would append the active conversation as the 6th one at last
if not present in those 5, similar to how topics list work.

In PM section with unreads, a maximum of 8 conversations
would be shown and rest of them would be hidden behind
the 'more conversations' li-item, clicking on which takes
to the zoomedIn view of PM section where all the present
PM threads would be visible and rest of the sections of left-sidebar
will get collapsed.

Fixes #20870.

Co-authored-by: Aman Agrawal <amanagr@zulip.com>
2022-10-26 13:47:08 -07:00
Lauryn Menard c9044f7acd recent-topics: Rename to "Recent conversations" in web-app and docs.
Replaces instances of "recent topics" in the web-app and documentation
to be "recent conversations".

Renames both `recent-topics.md` files in the help center to be
`recent-conversations.md` and updates/redirects links to new URL.

Does not update instances of "recent topics" in frontend code comments
and does not update the main overview changelog, for now.

Does not change case study text where "recent topics" was referenced
in a quote, but does change generic text references to be "recent
conversations".
2022-10-21 10:28:19 -07:00
Lauryn Menard 8089910dcb narrow: Update browser title when in a narrow search view.
Sets a default value of "Search results" for complicated narrow search
views and updates logic to use `filter.get_title` as a helper to
generate better titles for some common search views.

Does not update the existing behavior for narrow searches that have
"pm-with" or "group-pm-with" operators.

Note as of this change, the default search title and titles generated
from `filter.get_title` will be translated into the user's preferred
language.

Fixes #22952.
2022-10-18 17:13:51 -07:00
Sahil Batra 0fc19732bc message_edit: Allow only content edit in message_edit_form.
We now allow only content edit in message_edit_form which can
be opened by pencil icon in the message row, "Edit message"
option in popover and by using e hotkey.

As a result of this change, we also do not show topic and stream
edit options when using "View source" options.

We would instead support changing stream and topic from the modal
which will be opened from the "Move message" option in message
actions popover.
2022-10-12 10:50:05 -07:00
Julia Bichler 4bb381fc80 message_edit: Support sending notifications with topic changes.
Previously we did not send notification for topic-only edits.
Now, we add backend support for sending notification to topic-only
edits as well.

We would add support for this in webapp in further commits since
message edit UI will be updated as well. We just make sure that no
notifications are sent when editing topic using pencil icon in
message header.

We also change the API default for moving a topic to only notify the
new location, not the old one; this matches the current defaults in
the web UI.

Includes many tests.

We also update the puppeteer tests to test only content edit as
we are going to change the UI to not allow topic editing from
message edit UI. Also fixing the existing tests to pass while
doing topic edits is somewhat complex as notification message
is also sent to new topic by default.

Fixes #21712.

Co-authored-by: Aman Agrawal <amanagr@zulip.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2022-10-11 11:35:41 -07:00
sayamsamal 19e292989c misc: Improve app title bar for stream and topic views.
We want to be able to differentiate between the stream and the topic
in the title bar, but the current implementation displays both the
steam name and the topic name in the same way which becomes difficult
to comprehend at a glance.

In this commit, we make the following changes,

- <stream_name> to #<stream_name> (when viewing the entire stream)

- <topic_name> to #<stream_name> > <topic_name> (when viewing a topic)

These changes help us differentiate between a stream and a topic with
with a quick glance.

Fixes #22969.
2022-10-07 16:43:50 -07:00
Sahil Batra 12ba5cb814 settings: Add default label and hint when creating "Prounouns" custom field.
Label and hint can be edited, but we just fill it by default values for
convenience.
2022-10-06 17:56:26 -07:00
Ganesh Pawar 5b75fcd3e7 settings: Convert `form` to `div` in `Full name` input.
This prevents the web app from being reloaded when the user presses
`Enter`.

Fixes #22906
2022-09-29 17:11:15 -07:00
Yogesh Sirsat 6db88f0d39 settings_bots: Move "Add a new bot" tab inside a modal.
"Add a new bot" tab from personal `settings > bots` moving this
into a modal form, so we can trigger this form from other places
too without duplicating the code.

Fixes part of #20309.
2022-09-23 12:06:51 -07:00
Ganesh Pawar a1ac78f34e delete custom emoji: Add confirmation dialog.
Fixes part of #22812.
2022-09-17 11:55:33 -07:00
Yogesh Sirsat 2328dc0d4e custom_profile_fields: Confirmation modal for delete profile field. 2022-09-16 15:04:01 -07:00
Anders Kaseorg 0aff5e16ee puppeteer_tests: Skip apparently broken part of message-basics test.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-12 17:19:05 -07:00
Anders Kaseorg 02fceb7eb6 puppeteer_tests: Avoid some ElementHandle casts.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-11 17:41:41 -07:00
Anders Kaseorg 78eed03574 puppeteer_tests: Fix compose test trying to click local echoes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-11 17:41:41 -07:00
Anders Kaseorg dfda6d2895 puppeteer_tests: Remove jQuery dependency.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-11 12:53:20 -07:00
Anders Kaseorg 96f15e3665 puppeteer_tests: Add helper to correctly test @class in an XPath query.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-11 12:53:20 -07:00
Anders Kaseorg 663f1a387d puppeteer_lib: Explode CommonUtils class.
This may have originally made sense as a class that managed the
browser state, but it has since turned into a dumping ground for
mostly pure functions that don’t make sense to instantiate.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-11 12:53:20 -07:00
Anders Kaseorg 5ea44bc4ee puppeteer_tests: Convert now-deprecated waitForXPath, $x methods.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-09 21:33:41 -07:00
Riken Shah 3176733914 puppeteer: Fix dropdown click flake in `admin.ts`.
The reason for the flake was we were not waiting enough
time for the dropdown to render search results when we
type `rome`

To fix this, We are waiting until the dropdown input value
evaluates to be `rome`.

We also update variable name from
`verona_in_dropdown` to correct `rome_in_dropdown`.
2022-09-09 08:56:48 -07:00
Ganesh Pawar 10a0bf4de4
settings: Add confirmation dialog to delete linkifiers.
Fixes part of #22812.
2022-09-07 11:29:18 -07:00
Ganesh Pawar 92b4bb7ffc
settings: Add confirmation dialog to delete code playgrounds.
Fixes part of #22812.
2022-09-07 11:28:08 -07:00
evykassirer 69685c2864 drafts: Create a section to show drafts from the current conversation.
Fixes #21716.

By allowing users to view drafts that are addressed to their current narrow,
we hope to help them more easily find and continue previously drafted
messages.
2022-08-25 23:12:31 -07:00
Riken Shah 6e725fb3c3 puppeteer: Fix flake in `user-deactivation.ts`.
The reason for the flake was we were not waiting enough
time for the deactivation row to render.

To fix this, We are relying on the input from the user
deactivation screen to focus.
2022-08-17 11:58:16 -07:00
Riken Shah 6f2f3504b5 puppeteer: Fix flake in`navigation.ts`.
The reason for the flake was we were not waiting for the
settings modal to open completely.

To fix this we now wait until the profile tab is focused to
detect if the settings modal is open completely (i.e ready
for the interaction).
2022-08-17 11:38:21 -07:00
Riken Shah 6242602276 puppeteer: Fix `subscribe_toogle.ts` long pending flake.
The issue with the existing code is that we use the
`page.waitForSelector` function to detect if the element
is visible and interactable.

`page.waitForSelector` only ensures that the element is
visible and doesn't guarantees that the element is
interactable. Most of the time it is enough but sometimes
it is too fast and our test fails.

To fix this we change our approach to check the button
text on the stream settings page (`/#streams/stream_id`).
Either it could be `Subscribe` or `Unsubscribe`.
2022-08-16 13:01:31 -07:00
Ganesh Pawar e758ec400b alert word: Convert inline form to modal. 2022-08-15 19:07:38 -07:00
Tim Abbott 40086c4406 puppeteer: Disable user deactivation test for now. 2022-08-11 17:19:41 -07:00
Riken Shah 7cda08445c puppeteer: Fix `test_narrow_public_streams` test in `message-basics.ts`.
It was introduced in
56b2b838ee commit.

It fixes `test_narrow_public_streams` test which checks
that, there are no bookends in ` /streams/public`. The
issue was there were no bookends by default when we
were checking in the Denmark stream. We fix this by
unsubscribing from the Denmark stream which will
create a bookend.
2022-08-10 16:16:50 -07:00
Adam Sah 56b2b838ee narrow: /streams/public should not have bookends.
Fixes #18280.
2022-08-09 16:21:39 -07:00
yogesh sirsat 87ba3c1549 custom_profile_fields: Convert edit profile field form into a modal.
This allows this component to follow existing design patterns, rather
than being its own unusual element with various quirks.

The implementation is approximately the same as before I just migrated
"Edit custom profile field" form into modal, like "Add new custom
profile field" form modal.

Fixes: #21634
2022-08-05 17:26:56 -07:00
yogesh sirsat 526b55c6fc custom_profile_fields: Convert new profile field form to a modal.
This lets us remove this fairly ugly user interface widget, which was
inconsistent with the rest of the settings UI.

The implementation is approximately the same as before I just migrated
"Add new custom profile field" form into a modal, status update
notifications about these forms will be displayed inside their modal,
and made some little design changes as discussed on CZO.

Fixes part of: #21634
2022-08-05 17:26:56 -07:00
Anders Kaseorg 27eed09a84 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-08-04 13:52:06 -07:00
Sahil Batra 1455f290f2 settings_bots: Use same modal that is used in admin bot-edit form.
We change the edit form opened from "Personal" settings section
to be same as the form opened from "Organization" section.
2022-07-31 16:56:03 -07:00
yogesh sirsat f264795770 deactivate_users: Change submit button text of confirmation modal.
Change submit button text of both bot and user deactivation confirm
modal from "Confirm" to "Deactivate".
Calling `launch()` function from `dialog_widget.js` because
`confirm_dialog.js` set submit button text to "Confirm".
2022-07-27 17:09:48 -07:00
yogesh sirsat 9f21e34592 settings_users: Add ? in deactivate confirmation modal title. 2022-07-27 17:09:48 -07:00
yogesh sirsat d090347ea9 settings_bots: Change of text in bot deactivate confirmation modal.
Also, add `?` at the end of title of the this modal.
2022-07-27 17:09:48 -07:00
Anders Kaseorg 4ebcc9ba95 puppeteer_tests: Fix type errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-07-06 17:23:16 -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
yogesh sirsat 42ca3a797a settings_users: Modal title clear assert error message. 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
Tim Abbott 627144b0c7 settings: Simplify setting organization default language.
The changes in the last few commits changed the semantics of the
organization default language to no longer be the primary source of
information for a user's language when creating a new account.

Here, we change the settings UI and /help/ documentation to reflect
this.
2022-04-28 15:03:26 -07:00
yogesh sirsat c5bb9cb08a settings_users: Confirmation modal for "Reactivate" user.
The implementation closely follows `handle_deactivation()`.

Using the same existing reactivate confirmation modal.

Also, this commit will also lead to open confirmation modal
to reactivate bots in settings > bots, and currently there is no
existing confirmation modal for deactivating bots.

This commit is a follow-up of #21436.
2022-03-24 12:39:12 -07:00
Steve Howell 29e4342738 puppeteer tests: Split stream tests to two files.
This is just moving code around.
2022-03-18 12:20:48 -04:00
Steve Howell db5f39c506 puppeteer tests: Try to diagnose/fix unsubscribe flakes.
Doing these in a loop may help us figure out whether the
flakes are somehow related to the initial conditions when
we run the test vs. some race that can happen later in the
loop.

I add the console statements mostly to facilitate debugging,
but they appear to actually reduce the problem, as the code
comments indicate.
2022-03-18 12:20:48 -04:00
Steve Howell a5ec78c6ab puppeteer tests: Avoid stream creation flake.
We have a flake related to verifying that the app
prevents us from creating stream with duplicate names,
and my hypothesis is that it has to do with us not
waiting for the stream creation UI to fully appear. This flake
is probably a consequence of us recently making the stream
creation UI more like the stream editing UI, and thus
waiting for Desdemona to appear was giving us false
confidence that the page actually loaded.

I could be completely wrong about this solving the
flake, but the code change here is sensible regardless.
2022-03-18 12:20:48 -04:00
Anders Kaseorg da0658967c js: Fix no-jquery/no-event-shorthand.
The event shorthand methods were deprecated in jQuery 3.3.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-17 13:10:23 -07:00
Anders Kaseorg f84a2c08d5 js: Prefix jQuery object variable names with $.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-16 12:52:07 -07:00
Steve Howell c43d48b22f stream create: Overhaul create-stream add-subscribers UI.
The most notable change here is that when you are adding
subscribers to a stream as part of creating the stream,
you can now use the same essential pill-based UI for
adding users as we do when you edit subscribers for an
existing stream.

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

Fixes #20499
2022-03-07 16:58:58 -08:00