mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
settings: Do not show channel folder UI in production.
This commit hides channel folder widgets in production till we are ready to launch this feature.
This commit is contained in:
@@ -16,6 +16,7 @@ import * as group_permission_settings from "./group_permission_settings.ts";
|
||||
import type {AssignedGroupPermission, GroupGroupSettingName} from "./group_permission_settings.ts";
|
||||
import * as group_setting_pill from "./group_setting_pill.ts";
|
||||
import {$t} from "./i18n.ts";
|
||||
import {page_params} from "./page_params.ts";
|
||||
import * as people from "./people.ts";
|
||||
import {
|
||||
realm_default_settings_schema,
|
||||
@@ -1953,7 +1954,13 @@ export function get_group_assigned_user_group_permissions(group: UserGroup): {
|
||||
return group_assigned_user_group_permissions;
|
||||
}
|
||||
|
||||
export function set_up_folder_dropdown_widget(sub?: StreamSubscription): DropdownWidget {
|
||||
export function set_up_folder_dropdown_widget(
|
||||
sub?: StreamSubscription,
|
||||
): DropdownWidget | undefined {
|
||||
if (!page_params.development_environment) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const folder_options = (): dropdown_widget.Option[] => {
|
||||
const folders = channel_folders.get_channel_folders();
|
||||
const options: dropdown_widget.Option[] = folders.map((folder) => ({
|
||||
|
@@ -13,6 +13,7 @@ import {$t, $t_html} from "./i18n.ts";
|
||||
import * as keydown_util from "./keydown_util.ts";
|
||||
import * as loading from "./loading.ts";
|
||||
import * as onboarding_steps from "./onboarding_steps.ts";
|
||||
import {page_params} from "./page_params.ts";
|
||||
import * as resize from "./resize.ts";
|
||||
import * as settings_components from "./settings_components.ts";
|
||||
import * as settings_config from "./settings_config.ts";
|
||||
@@ -399,12 +400,14 @@ function create_stream(): void {
|
||||
...group_setting_values,
|
||||
};
|
||||
|
||||
assert(folder_widget !== undefined);
|
||||
const folder_id = folder_widget.value();
|
||||
if (folder_id !== settings_config.no_folder_selected) {
|
||||
// We do not include "folder_id" in request data if
|
||||
// new stream will not be added to any folder.
|
||||
data.folder_id = JSON.stringify(folder_id);
|
||||
if (page_params.development_environment) {
|
||||
assert(folder_widget !== undefined);
|
||||
const folder_id = folder_widget.value();
|
||||
if (folder_id !== settings_config.no_folder_selected) {
|
||||
// We do not include "folder_id" in request data if
|
||||
// new stream will not be added to any folder.
|
||||
data.folder_id = JSON.stringify(folder_id);
|
||||
}
|
||||
}
|
||||
|
||||
// Subscribe yourself and possible other people to a new stream.
|
||||
|
@@ -26,6 +26,7 @@ import * as dropdown_widget from "./dropdown_widget.ts";
|
||||
import {$t, $t_html} from "./i18n.ts";
|
||||
import * as keydown_util from "./keydown_util.ts";
|
||||
import * as narrow_state from "./narrow_state.ts";
|
||||
import {page_params} from "./page_params.ts";
|
||||
import type {User} from "./people.ts";
|
||||
import * as people from "./people.ts";
|
||||
import * as popovers from "./popovers.ts";
|
||||
@@ -274,6 +275,7 @@ export function show_settings_for(node: HTMLElement): void {
|
||||
can_access_stream_email: stream_data.can_access_stream_email(sub),
|
||||
group_setting_labels: settings_config.all_group_setting_labels.stream,
|
||||
has_billing_access: settings_data.user_has_billing_access(),
|
||||
is_development_environment: page_params.development_environment,
|
||||
});
|
||||
scroll_util.get_content_element($("#stream_settings")).html(html);
|
||||
|
||||
|
@@ -26,6 +26,7 @@ import * as message_live_update from "./message_live_update.ts";
|
||||
import * as message_view_header from "./message_view_header.ts";
|
||||
import * as narrow_state from "./narrow_state.ts";
|
||||
import * as overlays from "./overlays.ts";
|
||||
import {page_params} from "./page_params.ts";
|
||||
import {postprocess_content} from "./postprocess_content.ts";
|
||||
import * as resize from "./resize.ts";
|
||||
import * as scroll_util from "./scroll_util.ts";
|
||||
@@ -870,6 +871,7 @@ function setup_page(callback: () => void): void {
|
||||
realm_has_archived_channels,
|
||||
has_billing_access: settings_data.user_has_billing_access(),
|
||||
is_admin: current_user.is_admin,
|
||||
is_development_environment: page_params.development_environment,
|
||||
};
|
||||
|
||||
const rendered = render_stream_settings_overlay(template_data);
|
||||
|
@@ -89,6 +89,7 @@
|
||||
group_setting_labels=../group_setting_labels
|
||||
channel_folder_widget_name="folder_id"
|
||||
is_admin=../is_admin
|
||||
is_development_environment=../is_development_environment
|
||||
}}
|
||||
{{/with}}
|
||||
<div class="stream_details_box">
|
||||
|
@@ -43,6 +43,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if is_development_environment}}
|
||||
<div class="channel-folder-subsection {{#if is_stream_edit}}settings-subsection-parent{{/if}}">
|
||||
<div class="channel-folder-title-container {{#if is_stream_edit}}subsection-header{{/if}}">
|
||||
<h3 class="stream_setting_subsection_title">{{t "Folders"}}</h3>
|
||||
@@ -75,6 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="advanced-configurations-container {{#if is_stream_edit}}settings-subsection-parent{{/if}}">
|
||||
<div class="advance-config-title-container {{#if is_stream_edit}}subsection-header{{/if}}">
|
||||
|
Reference in New Issue
Block a user