stream-settings: Live update visibility of folder dropdown.

An error was raised where we tried to live update the folder name
in folder dropdown even when there was no dropdown visible
to the non-admin user in settings page. This was because
"There are no channel folders configured in this organization."
text was shown even when a folder was recently created in the
realm as we did not live update the visibility of dropdown on
creating or archiving a folder.

This commit fixes the bug by live-updating the visibility
of folder dropdown when creating or archiving a folder.
This commit is contained in:
Sahil Batra
2025-08-14 09:28:40 +05:30
committed by Tim Abbott
parent 331d210dac
commit 0a8238b993
7 changed files with 52 additions and 14 deletions

View File

@@ -56,7 +56,6 @@
component so that we can show dropdown button and button to create
a new folder on same line without having to add much CSS with
hardcoded margin and padding values. --}}
{{#if (or is_admin realm_has_channel_folders)}}
<label class="settings-field-label" for="{{channel_folder_widget_name}}_widget">
{{t "Channel folder"}}
{{> ../help_link_widget link="/help/channel-folders" }}
@@ -75,13 +74,12 @@
}}
{{/if}}
</div>
{{else}}
<span class="settings-field-label">
{{t "There are no channel folders configured in this organization."}}
{{> ../help_link_widget link="/help/channel-folders" }}
</span>
{{/if}}
</div>
<span class="settings-field-label no-folders-configured-message">
{{t "There are no channel folders configured in this organization."}}
{{> ../help_link_widget link="/help/channel-folders" }}
</span>
</div>
<div class="advanced-configurations-container {{#if is_stream_edit}}settings-subsection-parent{{/if}}">

View File

@@ -91,7 +91,6 @@
group_setting_labels=../group_setting_labels
channel_folder_widget_name="folder_id"
is_admin=../is_admin
realm_has_channel_folders=../realm_has_channel_folders
}}
{{/with}}
<div class="stream_details_box">