Uppy doesn't allow uploading another file and replacing the exisiting
one in the same session due to `maxNumberOfFiles: 1` set by us.
We don't want to remove this restriction, so only way to allow
replacing files easily is to just resert the current uppy session
after the last upload finishes.
Our backend deletes any existing upload by default. So, this works
as expected on all fronts.
This commit fixes a bug where uploading the same file a second time
in the same browser session would appear to the user to stall with
`Uploading [filename]...` in the composebox. This is because
`tus-js-client` makes a HEAD request to check for already-uploaded
files -- and, if found, that request is used in the `upload-success`
callback. That left the callback with no response body to parse, to
know what URL to insert.
Store the `/user_uploads/...` URL in the file metadata after a
successful upload, and if the fingerprint matches a previous upload,
pull that URL (and filename, as it may have changed server-side) out
of the previous upload's metadata.
Co-authored-by: Shubham Padia <shubham@zulip.com>
We only need the name to get the translated status, there's not much
point passing the complete file object as an argument. This will help us
in making future changes where the file name may not be coming either
from the file object or file.name.
The fill color is ignored when we generate webfonts in our main app.
For our help center beta project using Astro, we would have needed to
come up with a way to change fill colors for all the icons. Since, there
was no reason for us to keep the fill colors in the SVGs, we decided to
remove it instead and add a lint rule to keep that in check.
See
https://chat.zulip.org/#narrow/channel/6-frontend/topic/fill.20in.20our.20current.20svg.20icons
for more details.
Until a demo organization creator sets an email address, we want to
restrict other users from joining the organization. Therefore, we
disable changing the "invite_required" setting for the organization
until they set their email address. Otherwise, the owner could
share the demo organization URL with someone and they could create
an account via the homepage.
Checks the demo organization owner delivery email address state
on the server-side.
Disables updating the organization setting in the web app UI.
The test `get_conversation_participants` didn't need
rewiring in the first place.
The filter was not properly created - the field `channel_id`
was wrongly being used instead of `stream_id`.
Once the filter was fixed, the code automatically returned
the expected stream_id and topic, without rewiring.
This eliminated the use of override_rewire in that test.
Fixes part of #32326.
This commit effectively shifts the mocking to a
lower level by mocking `typeahead_list_item.hbs`
instead of higher-level functions like `render_person`,
`render_user_group` and `render_stream`. This helps
eliminate the rewiring of those functions.
These functions are rigorously tested in
`typeahead_helper.test.cjs`.
Fixes part of #32326.
This commit removes unnecessary use of override_rewire
in drafts.test.cjs, and creates data instead of mocking
functions returning that data.
It helped eliminate `stream_data.rewire_get_color` and
`sub_store.rewire_get`.
Fixes part of #32326.
The hotkey for 'Toggle compose preview' was not working due to
a small logical bug introduced in 26f664be69.
We were calling `compose.show_preview_area()` when the compose
is already in preview mode, instead of `compose.clear_preview_area()`.
This commit fixes the bug.
This should greatly reduce the symptoms of a bug where a stale
realm_users cache (missing a newly created user) results in the web
client missing the new user and throwing exceptions.
This commit adds code to redirect '#groups/new' to '#groups/your'
if realm is on limited plan like we do when user does not have
permission to create groups.
This commit adds code to live update the UI when
can_create_user_groups setting changes.
The elements that are live updated are -
- Icon button at the top left panel
- Button shown in right panel when no group
is selected.
- Text shown in right panel mentioning whether
user has permission.
We do not live update the text shown when left
panel is empty as it is somewhat complex to
handle all conditions correctly for it.
"stream-advanced-configurations" was being used as ID for
advanced configurations section in both stream edit and
creation UI, which is not correct as ID should be unique.
This commit fixes it by removing the ID and instead using
class in selectors. Also, there was some unused CSS, as
we do not have dropdown widget buttons in advanced
configurations section, written using the duplicate ID so
removed that as well.
In update_web_public_stream_privacy_option_state, when showing
and hiding the web-public option, "hidden" prop was set while
hiding the option and ".show()" was called to show the option.
Now once the UI was live updated by calling "show" setting
hidden attribute again to hide did not work because
"display: block" CSS applied by calling "show" kept the
option visible. This commit updated code to show the option
by setting "hidden" attribute to "false".
This commit fixes the use of "stream_permission_settings"
as ID for "Channel permissions" subsection in both
stream edit and creation UI, which was not correct since
ID should be unique.
To fix this ID was removed from the element and following
changes are done -
- $("#stream_settings") element is now used as a container
for live update functions for stream edit UI.
- "stream-permissions" class is used to access the element
instead of ID.
- Advanced configurations container also had "stream-permissions"
class before, and that was removed in this commit so that
"Channel permissions" container can be identified uniquely
and thus some CSS changes were needed.
- Also, fixed "update_stream_privacy_choices" function to
not use ":visible" in selectors.
Previously, when leaving the group by clicking "checkmark"
icon in group row, group details were opened in right panel
as well due to event propagation.
We keep the behavior of opening the group in right panel
after joining the group by clicking on "+" icon in the
group row.
For narrow widths, left panel is kept open while joining
or leaving the group, same like we do for stream settings.
When clicking on "Cancel" button in the footer in stream
creation UI, left panel should be shown for mobile widths.
Previously, it resulted in a buggy view showing both left
and right panels.
This change makes the behavior consistent with what we
have for streams UI.
There is no change in behavior for wider screens.