Commit Graph

11727 Commits

Author SHA1 Message Date
aryanshridhar a82827ca75 template: Move `admin_tab` template to `settings` folder.
Moved `admin_tab` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder instead.
2021-04-26 09:37:27 -07:00
aryanshridhar 63d34500b0 template: Move `admin_settings_modals` template to `settings` folder.
Moved `admin_settings_modals` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder.
2021-04-26 09:37:24 -07:00
aryanshridhar 17133b5b1e template: Move `admin_profile_field_list` template to `settings` folder.
Moved `admin_profile_field_list` template to `/templates/settings/` folder
as earlier, it was inaccurately placed within the `/templates` folder
rather than the `/templates/settings` folder.
Also modified the node tests to reflect the new changes.
2021-04-26 09:37:20 -07:00
aryanshridhar 19699720bc template: Move `admin_linkifier_list` template to `settings` folder.
Moved `admin_linkifier_list` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
rather than the `/templates/settings` folder.
2021-04-26 09:37:17 -07:00
aryanshridhar 27934dca7e template: Move `admin_invites_list` template to `settings` folder.
Moved `admin_invites_list` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder instead.
2021-04-26 09:37:14 -07:00
aryanshridhar 19ffacf05d template: Move `admin_human_form` template to `settings` folder.
Moved `admin_human_form` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder.
2021-04-26 09:37:11 -07:00
aryanshridhar 983762726d template: Move `admin_export_list` template to `settings` folder.
Moved `admin_export_list` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
rather than the `/templates/settings` folder.
2021-04-26 09:37:08 -07:00
aryanshridhar 6b58fdb39d template: Move `admin_emoji_list` template to `settings` folder.
Moved `admin_emoji_list` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and should have been within the `/templates/settings` folder.
2021-04-26 09:37:05 -07:00
aryanshridhar 54d46c27d6 template: Move `admin_default_stream_list` template to `settings` folder.
Moved `admin_default_stream_list` template to `/templates/settings/`
folder as earlier, it was inaccurately placed within the `/templates`
folder and should have been within the `/templates/settings` folder
instead.
2021-04-26 09:37:01 -07:00
aryanshridhar 0e1c0d8be0 template: Move `admin_bot_form` template to `settings` folder.
Moved `admin_bot_form` template to `/templates/settings/` folder as
earlier, it was inaccurately placed within the `/templates` folder
and `settings` folder is specifically for storing administrative
UI templates.
2021-04-26 09:36:54 -07:00
Anders Kaseorg 6060d0d364 docs: Add missing space to compound verbs “log in”, “set up”, etc.
Noun: backup, checkout, cleanup, login, logout, setup, shutdown, signup,
timeout.

Verb: back up, check out, clean up, log in, log out, set up, shut
down, sign up, time out.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
Anders Kaseorg e3f2ffa681 docs: Capitalize “Markdown” consistently.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
Anders Kaseorg 178736c8eb docs: Fix spelling errors caught by codespell.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
PIG208 7b60ce1d70 js: Make alert_popup shared.
It allows the click handler for the "x" button, and the stacktrace
toggler to be shared between webapp and the portico pages.

Reimplements #17801.
2021-04-26 09:27:49 -07:00
PIG208 a84eea9b84 static: Make alert.css shared between app and portico.
This involves in two changes for styling.
1. The alert class is moved from alert.css to app_components.css as this
class serves nothing but to default .alert elements to be hidden. This
is only required in the webapp but not portico pages (where .alert
elements are preferred to be shown by default).
2. The import statement for alert.css is moved from app.js to common.js,
so that both the webapp and the portico pages can share the styles. This
will be fine to share the styles as .alert-display, .alert-animations,
.alert-box are more specific then .alert and they use nested class to
define styles for inner elements.

Undoes #17936 properly.
2021-04-26 09:27:05 -07:00
Aman Agrawal 4c4c2e46fb stream_creation_form: Fix footer padding overlapping with text. 2021-04-25 08:54:08 -07:00
Aman Agrawal 384156c307 stream_create: Use ListWidget to render list of all users.
This improves the UX of creating a stream for atleast 1000+ users
realm by showing the the stream creation form much faster than
before.

Search, user addition, scrolling worked smoothly on 15k+
users realm as tested on dev setup.

Also, simplebar is used to replace the default scrollbar.

Fixes #16805
2021-04-25 08:54:08 -07:00
scjess 7a58446c82 message_events: Support undefined stream_name.
When moving a topic within a stream that is deactivated, the stream
may not be present in stream_data.  Avoid throwing an exception in
this situation by leaving stream_name as undefined; existing logic
seems to anticipate that as a possibility, so we don't need a broader
change.

Longer term, we may want to just send to clients basic data about
archived streams that the user has access to.

Fixes: #17271
2021-04-25 08:44:21 -07:00
Anders Kaseorg bf056c8990 js: Extract password_quality module; remove zxcvbn from globals.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:08:52 -07:00
Anders Kaseorg 2864c93ba8 copy_and_paste: Use ES module from Turndown.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:08:52 -07:00
Anders Kaseorg 41dd50948a js: Consistently use ES module from SimpleBar.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:08:52 -07:00
Anders Kaseorg cef2ecf004 i18n: Pass language name with every response.
With a comment added by tabbott on live-update considerations.

See https://chat.zulip.org/#narrow/stream/9-issues/topic/FormatJS.20error.20in.20standalone.20pages/near/1168413 for context.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:00:27 -07:00
akshatdalton 1229945add refactor: Add helper function to handle muting/unmuting of a topic.
This commit adds a helper function: `mute_or_unmute_topic`
in `click_handlers.js` to mute and unmute a topic. This function
is called when a user mutes/unmutes a topic from its recipient bar
or `recent topics`.

This is a prep commit for `Allow unmuting of a topic from its recipient bar`.

Related issue: #15223.
2021-04-24 12:21:43 -07:00
Nikhil Maske 9f5efd208f topic_edit: Fix the behaviour of always_visible_topic_edit button.
The bug happens in the case when the topic name is not set and the
user clicks on always_visible_topic_edit button results into unusual
behaviour of the always_visible_topic_edit button. To fix this, this
commit fix the behaviour by hiding and showing the
always_visible_topic_edit button in the appropiate situations, at the
same time we hide/show similar buttons.

Fixes #17813.
2021-04-23 15:04:17 -07:00
Tim Abbott 78c7d749d9 passwords: Set title/aria-label attributes dynamically.
This allows us to use different "Show password" and "Hide password"
for these labels, which is more consistent with how other products
implement this.

It also lets us delete N duplicate copies of these strings in the HTML.
2021-04-23 15:01:37 -07:00
Tim Abbott ebcd587ee5 settings: Use consistent width for account settings modals.
The password change modal, in particular, was way too narrow to
display its error messages comfortably.
2021-04-23 15:01:37 -07:00
Tim Abbott 1d575007a3 settings: Improve error message for password change.
The "Save failed" standard text is appropriate for many of our
settings, but for changing one's password, we can go with just the
"Wrong password" part provided by the server.
2021-04-23 15:01:37 -07:00
Gaurav Pandey e80ddfe4e6 settings: Add show password feature to forms in settings modal.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Gaurav Pandey a9fcafc433 reset_confirm: Add show password feature to reset confirm page.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Gaurav Pandey 91c73025d2 register: Add show password feature to password fields.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Gaurav Pandey fa235e60ff login: Add show password feature to login page.
The show password feature is a functionality to
toggle the visibility of the password fields in forms
so that one can check if they have entered the correct
password or not. We implement this using an eye icon
toggling which converts input field type from password
to text and vice-versa.
Fixes part of #17301.
2021-04-23 15:01:37 -07:00
Aman Agrawal 2ceda13e31 tippy: Fix weird looking arrow for playground and copy code tooltips.
They were taking the height of the code block, we don't want them to,
hence we explicitly set their height to 0.
2021-04-23 11:59:18 -07:00
Aman Agrawal 9350bbd976 tippy: Fix font-family for copy code and playground tooltips. 2021-04-23 11:59:18 -07:00
Aman Agrawal 489daa7f7c tippy: Append tooltips to the parent of the `reference`.
This allows us to hide tooltips automatically when the
parent container is hidden while tooltip is active.

In an overlay, when a tooltip is active and `esc` is pressed,
the tooltip will remain active without this commit.

This has side effects of some properties of parent applying to
tooltips if property is directly set to `div`. Through manual testing,
only area where this was found was fixed.
2021-04-23 11:59:18 -07:00
Aman Agrawal 3410ff2e64 buddy_tooltips: Destroy tooltips if `reference` is not visible.
We destroy the tooltips for which `reference` was either removed
from DOM or is hidden.

We only need to do this for tooltips
contained in simplebar containers for which tooltips can
overflow the boundary of the simplebar container.

There are 4 approaches we could have done this:
1. Asked tippy.js maintainers to do this for us.
In https://github.com/atomiks/tippyjs/issues/938 the
maintainer said that it is the responsibility of
the user to do so.

2. Tracked whenever we update the DOM for such elements and hide
tooltips when we were hiding the `reference` elements. This had
various problems like it is hard trigger events when certain elements have
been removed from DOM when `html()` method is used to render
new content.

3. Run an `optimized` periodic job to destroy tooltips when
`reference` elements are hidden. This isn't a good method to
do this since it sucks power and adds latency.

4. Use a `MutationObserver` on the parent element and watch
for changes. This methods seems to work well with no bad
side effects. We use this approach.
2021-04-23 11:59:15 -07:00
Aman Agrawal fc18ec4c04 tippy: Insert tooltip element directly in `.message_reaction`.
Instead of inserting tooltip inside `body`, we directly insert
it inside the `reference` element. This helps us to automatically
hide the tooltip when we hide the `reference` element.

This avoids the bug of tooltip persisting when the message reaction
is removed while the tooltip is active.

To reproduce:
* React 👍 to a message.
* Hover over the reaction.
* Press `+` from keyboard.

You will see reaction tooltip persisting while the reaction is hidden,
also "Add emoji" icon is displayed with tooltip.

Doing the same for elements which are inside a simplebar container
and for which tooltips can span outside the simplebar container,
makes the tooltips not visible or cut at the edges of simplebar
container since simplebar containers have overflow set to `hidden`.
This is something that cannot fixed as per
https://github.com/Grsmto/simplebar/issues/347

So, for simplebar contained elements we insert the tooltip to
`body`.

`reference` element: Element for which tooltip is displayed.
2021-04-23 11:56:22 -07:00
Abhijeet Prasad Bodas bbbaa109ec settings: Add UI page for managing muted users.
This page is temporarily hidden except in the development environment,
because the "muted users" feature is incomplete.
2021-04-21 10:17:44 -07:00
Abhijeet Prasad Bodas e56db79af4 mute user: Add dev-only UI to mute/unmute a user.
Since the "mute users" feature isn't complete yet,
this UI is shown only in development setups.
Ideally we should have had this commit after the whole
feature was completed and merged, but doing so makes it
difficult to test and merge subparts of the feature one by
one (which is a better workflow, while we still decide what
exactly we want this feature to do).

This commit adds a new button in the user info popover
to mute or unmute the user, and uses a confirmation
dialog while muting, because muting a user accidently can lead
to the muter losing out on a lot of information.

TODOs when making this UI visible in production-
1. Make a /help page and link to it from the confirmation
dialog and the API docs.
2021-04-21 10:14:27 -07:00
Mateusz Mandera 977a2f7fa0 emails: Rename "missed message email" to "message notification email". 2021-04-21 10:10:54 -07:00
Anders Kaseorg dd3fa4ac52 templates: Mark all void tags as self-closing.
This reverses the policy that was set, but incompletely enforced, by
commit 951514dd7d.  The self-closing tag
syntax is clearer, more consistent, simpler to parse, compatible with
XML, preferred by Prettier, and (most importantly now) required by
FormatJS.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-21 09:49:34 -07:00
Sumanth V Rao a6d950f73e templates: Move admin_playground_list inside templates/settings. 2021-04-20 14:40:43 -07:00
Anders Kaseorg d381b4463e templates: Fix <br> → <br /> to be parseable by FormatJS.
Fixes #18220.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-20 14:39:53 -07:00
Wesley Aptekar-Cassels 367cf897fa shared: Bump version to 0.0.5. 2021-04-20 17:19:12 +08:00
m-e-l-u-h-a-n be7021268a setting(stream): Support user group pills when typeahead is unused.
This extra commit adds support for creating user group pills
in cases that do not use typeahead like, pasting the group
name, copying it from the user group pill.

This completes the remaining work required to support
addition of all members of a user groups to stream.

Fixes #15186.
2021-04-19 17:41:50 -07:00
m-e-l-u-h-a-n ce4cf66f3f setting(streams): Add pill support to subscribe all members of group.
We update the pills typeahead logic to also include user group
results and pass the "user_group" key in `opts` to enable this
option for Add subscriber form.

The changes includes:
* Exporting the `query_matches_name_description` function, to
  deduplicate the typeahead `matcher` logic.
* Creating a `people.is_known_user` function, to deduplicate
  the typeahead `sorter` logic.
* Add a new `user_group_pill.js`, to allow adding user group
  pills in input widgets that support pills.

This has been tested manually as well as by adding some new
node tests.
2021-04-19 17:41:50 -07:00
ryanreh99 e4d5ea69a0 refactor: Remove redundant typeahead_helper.sort_recipientbox_typeahead.
This commit removes`typeahead_helper.sort_recipientbox_typeahead`
which was introduced in 639ec9380a
for the private message recipient box when it used to accept comma
separated text input for recipients. All it doew was cleaning away
invalid recipients from string, like:
"a, , b" was cleaned to [a, b].

This can be now removed because it was now used only in
pill_typeahead.setup code path, and the pills code already handles
invalid cases by filtering out all falsy (invalid) recipients.
2021-04-19 17:41:50 -07:00
Aman Agrawal 57c657962e compose: Move control buttons into a file of their own.
These buttons are common with message_edit_form.hbs, we will
be sharing this file among compose and message_edit_form.
2021-04-19 16:54:54 -07:00
Aman Agrawal 11b09bba83 compose: Replace `message-control-button` with `compose_control_button`.
This is both more correct and also fixes this element having had a
name very similar to message_control_button, which refers to an
element in the message_controls section of a rendered message.
2021-04-19 16:54:10 -07:00
Aman Agrawal 70d444a8eb compose: Move to `hbs` file and append it to DOM on init.
We move compose.html to compose.hbs file while keeping
`#compose` still in `home.html` as a hanger
where append rest of the elements.

This will provide us with two benefits:
* We could share common elements between message_edit_form and
compose.
* We can insert compose directly in any element. We may decide to
do it for recent topics.
2021-04-19 16:53:30 -07:00
Aman Agrawal 4472986fae click_handlers: Delegate compose events to body.
This allows us to not rely on compose elements being present in
the DOM when we register these events.
2021-04-19 16:49:53 -07:00