Commit Graph

13514 Commits

Author SHA1 Message Date
Greg Price d583fcec59 shared: Bump version to 0.0.9. 2022-03-11 17:27:08 -08:00
Austin Riba 4301148bee shared: Add first Flow types for typeahead module
[greg: simplified to just the function we need right now,
 leaving the rest for later]
2022-03-11 17:23:16 -08:00
Anders Kaseorg b4675d978f icons: Clean up globe icon.
The previous icon had a slight asymmetry, some not-quite-straight
lines, and curves with an excessive number of nodes resulting from
some kind of vector → raster → vector workflow.  Rebuild it from
scratch.  This will be visually equivalent but render more
efficiently.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-11 10:10:12 -08:00
somesh202 68a1912f89 compose: Disable 'c' and 'x' hotkeys while compose is open.
The most plausible situations through which one would press these
hotkeys with the compose box still open are accidents (basically,
you're trying to type but the browser focus is unexpectedly not in the
compose textarea).

So we disable these keyboard shortcuts when the compose box is open,
regardless of where keyboard focus lies.

Fixes #21128.
2022-03-10 16:23:50 -08:00
Tim Abbott ed4ff268a8 compose: Save drafts when starting compose might destroy content.
Starting composing a message to a new recipient will clear the compose
box. Previously, we were saving drafts before doing so only in the
compose_actions.respond_to_message code path (i.e. when starting a
reply). Logically, this behavior should apply regardless of why we're
initiating a new message, so it belongs in compose_actions.start.

Fixes #21128.
Fixes #21171.
2022-03-10 16:17:51 -08:00
jai2201 ea65da462e stream-settings: Use CSS nesting at media breakpoints.
Avoid writing repeated class name of `#subscription_overlay` and `subscription_settings`
for CSS at media breakpoints.
2022-03-10 16:00:21 -08:00
Tim Abbott e374d7ef7d css: Deduplicate a subscriptions.css heading. 2022-03-10 15:59:56 -08:00
jai2201 f68961533a stream settings: Remove dead preview-stream CSS.
Remove the CSS written for class 'preview-stream', which stopped
existing in the application in 368b585980.
2022-03-10 15:54:46 -08:00
Tim Abbott 6b6a1d53f7 stream settings: Remove Bootstrap collapse class.
This class was leftover from a very old version of this design, and
had the side effect of settings `overflow: hidden` on the panel.

This, in turn, resulted in the focus outlines for clicking on
checkboxes looking broken.
2022-03-10 15:49:18 -08:00
Tim Abbott 89afe55076 stream settings: Fix inconsistent headings for subscribers panel.
Previously, these two headers were inconsistent with the rest of the
application, and with "Edit subscribers". We make them the same as
"Edit subscribers".
2022-03-10 15:27:52 -08:00
Tim Abbott f9539617ee stream settings: Remove doubled 10px margin after heading. 2022-03-10 15:21:48 -08:00
NerdyLucifer 10e6fd04e7 stream_settings: Fix fonts & margins in create/edit stream form.
In "stream_types.hbs"
For "Who can access the stream?" and "Who can post to the stream?" replace
"h4" with "label" to make the for smaller and to remove boldness.
For "Message retention for stream" replace the "h4" with "label"
and add class="stream-title".

In "subscriptions.css":
Add "margin:25px auto" to "#announce-new-stream" to ensure equal
gaps above and below it.
Reduce margin and paddings for ".radio-input-parent".
For "select" set "width: fit-content" and
"height: fit-content" to ensure that the text in the
dropdown is clearly visible.

Fixes: #21322
2022-03-10 15:20:20 -08:00
NerdyLucifer 5f472b1607 stream_settings: Implement dropdown widget for "stream post policy".
In stream edit and stream create replace the existing checkbox
format for choosing "stream post policy" with dropdown widget.

In "stream_types.hbs" implement the dropdown menu and remove
the checkbox format for selecting "stream post policy".

In "stream_create.js" and "stream_edit.js" edit the code for
"stream_post_policy" to extract the "stream post policy" value
from the dropdown menu after submitting the form.
2022-03-10 15:11:35 -08:00
NerdyLucifer 1eb1aa70ed stream_settings: Improve stream_post_policy_values order, description.
In "stream_data.js/stream_post_policy_values", change, the object to match
the following order and description of these policies:

1. Everyone [Default]
2. Admins, moderators and full members
3. Admins and moderators
4. Admins only

This sorts from least to most restrictive.
2022-03-10 15:11:06 -08:00
Sayam Samal 681414caf1 user_profile_modal: Interchange posititons of "Joined" and "Role" fields.
This commit swaps the posititon of "Joined" and "Role" fields in the
User Profile Modal to make it consistent with settings/profile.
2022-03-10 15:10:24 -08:00
Sayam Samal 4227f74638 user_info_popover: Interchange positions of 'Role' and 'Local time'. 2022-03-10 15:10:24 -08:00
Sayam Samal 2f606ffbd9 settings: Fix text alignment issues in profile picture overlay.
Fixes #21342
2022-03-10 15:10:24 -08:00
Sayam Samal 9b378b0718 settings: Add responsiveness to textarea fields.
This commit adds responsiveness to textarea fields to improve the
responsive flow of the page.
2022-03-10 15:10:24 -08:00
Sayam Samal cccb3b1b32 settings: Move user details to the right side panel in profile section.
This commit moves the "Role" and "Joined" attributes to the right
side panel of settings/profile to maintain continuity between the
mutable fields.
2022-03-10 15:10:24 -08:00
Sayam Samal 2bf63c1e49 settings: Remove profile picture header in the profile section.
This commit removes the profile picture header and adds an overlay to
handle disabled avatar changes in an organization.
2022-03-10 15:10:24 -08:00
Sayam Samal d5821858dc settings: Fix hidden delete button in profile picture section.
This commit fixes the issue where the delete (x) button on the
top right corner of the profile picture section remains hidden
even when a hover action is performed on the profile photo.
2022-03-10 15:10:24 -08:00
Steve Howell 8e05a9fcf7 unread: Replace sender_id with other_user_id.
Note that we still send sender_id for legacy mobile
clients.
2022-03-10 13:33:21 -08:00
Tim Abbott 84bdf86246 message_edit: Don't display resolved topics as MOVED.
We loop through edit history entries and see if any of them
are more interesting than a (un)resolve topic edit, extending
the existing loop we had.

We also update the associated node tests.

Fixes #19919.

Co-authored by: Lauryn Menard <lauryn@zulip.com>
2022-03-10 12:00:53 -08:00
Lauryn Menard 93f3021dfb edit_history: Update simulated edit history entries in frontend.
Updates the simulated edit history entries that are saved when
`update_messages` events are received for the modern data
structure on the server for `message.edit_history` entries.

Also cleans up a misnamed field in said entries, `edited_by`.
2022-03-10 11:50:48 -08:00
Lauryn Menard c9c980d7b0 url_preview: Fix 'Edited' notification for url preview events.
Uses the `rendering_only` field in the `update_message` event
to filter the addition of `last_edit_timestamp` to the message,
which is what triggers the addition of an `Edited` notification
when a message is rerendered in the web app.

Also, removes the deletion of `msg.last_edit_timestr` since this is
regenerated every time the message is rendered, and so it did nothing
beyond confusing the code.
2022-03-09 15:49:50 -08:00
Sahil Batra cbac466658 compose: Show topic required error if topic is "(no topic)".
We already show the error if topic input is empty and it is
not allowed to send messages without topic in the organization,
and this commit also shows error when topic is "(no topic)".

The topic is set to "(no topic)" when someone sends a message
with empty topic input box and when it is allowed to send message
without topics in the organization.

This is not ideal behavior as we may want to treat "(no topic)"
differently from empty topic, but we can fix this in future and
this commit can be a short term fix.

Fixes #21344.
2022-03-09 15:29:13 -08:00
Sahil Batra cb15e0265d settings_users: Do not allow sorting by email if emails are hidden. 2022-03-09 13:56:57 -08:00
prashantpaidi 05af6fd8b4
recent topics: Disable browser autocomplete filter widget.
The browser autocomplete is annoying/unhelpful here.

Fixes #21349.
2022-03-09 13:56:14 -08:00
Anders Kaseorg cbca80c846 styles: Fix some invalid CSS.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-09 09:37:31 -08:00
Greg Price a71fad9d6b shared: Bump version to 0.0.8. 2022-03-08 20:35:10 -08:00
Greg Price 760cfcc603 resolved_topic: Implement resolve, unresolve, and display.
We have two different frontend implementations of computing the
un-resolved form of a topic name, and they have a subtle -- but
intentional -- difference in behavior.

Factor them both out into the resolve_topic module, along with
their inverse, and with comments and tests.
2022-03-07 21:35:00 -08:00
Greg Price 7852d8e015 topic_list_data: Move "if resolved" conditionals to a single place.
These two conditionals are each relying on the other to trigger
on the same condition, and to do complementary things.  Move them
together to a single place so that that relationship is easy to see,
and to refactor.
2022-03-07 21:35:00 -08:00
Greg Price 7bf0fd3fa3 resolved_topic: Add and use predicate is_resolved.
We leave in place a couple of sites where the `startsWith` is
entangled with other string manipulation.  We'll handle those next.
2022-03-07 21:35:00 -08:00
Greg Price 624cdb0a14 resolved_topic: Start module, in shared package.
For the moment, just move the RESOLVED_TOPIC_PREFIX constant.
More next.
2022-03-07 21:35:00 -08:00
Greg Price dd1091c59a shared: Add a gitignore, for node_modules. 2022-03-07 21:35:00 -08: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
Dinesh 57b8e43dbb dialog_widget: Mention post_render in optional parameters for launch(). 2022-03-07 12:44:36 -08:00
Tim Abbott 5d136887b5 policies: Fix effective date on most recent DPA update.
The effective date on the DPA should have been February 7, because we
didn't actually update the zulip.com website until that day.

(This commit was added to the internal zulip.com branch during
deployment of the last DPA update, so users always saw the correct
information).
2022-03-07 12:01:25 -08:00
Tim Abbott 5ee5a7e635 specators: Fix persistent recent topics loading indicator.
This unfortunately requires somewhat ugly duplicated code, but I think
it's the best option for now.

I expect we will somewhat soon work on the transition to no longer
have two duplicate fetches here, and doing so will let us remove this
secondary code path.

Fixes #21304.
2022-03-04 15:51:09 -08:00
Steve Howell 2644fa9645 settings: Make list header sections consistent.
I made the header sections above all our settings
panel lists more consistent.

Before this change:

    * some lists had titles, others didn't
    * the placement of the filter box was random
    * alerts strangely went between the filter box
      and the list
    * filter boxes were too large
    * CSS was haphazard
    * forms were squished against tables

Now all the settings with list have consistent
HTML, CSS, and look-and-feel in the area directly above
their list of items.

With the exception of Custom Profile Fields, all the
lists with headers above them happen to be based on
ListWidget, but the header styling is not coupled
to ListWidget, because we want consistent headers
even if Custom Profile Fields has a non-ListWidget
list (due to its drag&drop features).
2022-03-04 14:37:28 -08:00
Tim Abbott 0c015c7bf3 css: Deduplicate CSS for .always_visible_topic_edit. 2022-03-04 13:25:30 -08:00
Junchen Liu e3237ae7e1 css: Fix hover color for "Edit topic" icon in recipient bars.
Previously, this had different hover behavior from the adjacent
elements, which seems like a bug.

The CSS for this component is shared with Recent Topics; we migrate
the styling for on_hover_topic_read for consistency.

Fixes #21273.
2022-03-04 13:25:30 -08:00
Greg Price 188c500802 shared: Bump version to 0.0.7. 2022-03-04 12:57:56 -08:00
Austin Riba 7dbd092afa shared: Avoid using all replaceAll.
Because Zulip Mobile supports some older iOS browser versions that
don't have replaceAll support yet, and mobile is averse to doing the
infrastructure work required to add a, polyfill we avoid using them in
the shared module for now.

See https://caniuse.com/mdn-javascript_builtins_string_replaceall
2022-03-04 12:29:31 -08:00
Anders Kaseorg baa11303ff alert_words: Fix alert words with HTML special characters.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-04 12:26:49 -08:00
Anders Kaseorg ef706e51c3 js: Convert .split(…).join(…) pattern to .replace().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-04 12:26:49 -08:00
Anders Kaseorg 513207523c js: Fix various sloppy uses of String#replace.
Prefer a regexp match over using String#replace to strip expected
prefixes and suffixes because (a) it implicitly verifies that the
input has the expected format and (b) it won’t unexpectedly strip from
the middle of the string.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-04 12:26:49 -08:00
Steve Howell ea082af2ae edit stream: Make filter input more narrow.
You generally only need to type a few characters to filter
down to just a few folks, even in gigantic realms.

I tried not to make it **too** small, just in case, but
the default width was kind of gaudy.
2022-03-04 12:08:54 -08:00
Steve Howell 87aa318e3a edit streams: Change headings and move filter box.
The new layout is:

    Add Subscribers

        [input pill] [Add]

    Subscribers             [filter]
    <list of subscribers>
2022-03-04 12:01:09 -08:00
Steve Howell 79b9759c0b edit streams: Show "(you)" next to your name.
We show "you" in the subscriber list. This is similar
to what we already did in the Users tab.
2022-03-04 12:01:09 -08:00