Enable Lab features for all users

(imported from commit 4e2658d28a5e02067ad472fec76c66f46592d520)
This commit is contained in:
David Roe
2015-08-19 23:50:35 -07:00
committed by Tim Abbott
parent 90e2f5053f
commit e5cb2a468f
5 changed files with 5 additions and 20 deletions

View File

@@ -28,10 +28,6 @@ exports.is_og_zulip_user = _.contains(og_zuliper_emails, page_params.email);
exports.twenty_four_hour_time = special_24_hour_people || iceland;
exports.left_side_userlist = _.contains(['customer7.invalid'], page_params.domain);
//This was set as a page_params variable already, because it's also used in
//the settings.html django template. See zerver/views/__init__.py:home(request).
exports.show_autoscroll_forever_option = page_params.show_autoscroll_forever_option;
exports.enable_new_user_app_alerts = ! _.contains(['employees.customer16.invalid'], page_params.domain);
// Still very beta:

View File

@@ -650,8 +650,7 @@ exports.setup_page = function () {
success: function (resp, statusText, xhr, form) {
var message = "Updated " + page_params.product_name + " Labs settings!";
var result = $.parseJSON(xhr.responseText);
var ui_settings_status = feature_flags.show_autoscroll_forever_option &&
$('#ui-settings-status').expectOne();
var ui_settings_status = $('#ui-settings-status').expectOne();
if (result.autoscroll_forever !== undefined) {
page_params.autoscroll_forever = result.autoscroll_forever;
@@ -664,8 +663,7 @@ exports.setup_page = function () {
},
error: function (xhr, error_type, xhn) {
var response = "Error changing settings";
var ui_settings_status = feature_flags.show_autoscroll_forever_option &&
$('#ui-settings-status').expectOne();
var ui_settings_status = $('#ui-settings-status').expectOne();
if (xhr.status.toString().charAt(0) === "4") {
// Only display the error response for 4XX, where we've crafted

View File

@@ -311,18 +311,15 @@
</ul>
</div>
{{#if_or page_params.show_autoscroll_forever_option page_params.show_default_desktop_notifications_option}}
<div class="ui-settings">
<div id="ui-settings" class="settings-section">
<div class="settings-section-title"><i class="icon-vector-beaker settings-section-icon"></i>{{ page_params.product_name }} Labs</div>
<div class="alert" id="ui-settings-status"></div>
<div class="ui-settings-form">
<p>
{{ page_params.product_name }} Labs is where you can try out some experimental new
features we're working on. Let us know what you think!
Warning: the below features are experimental features and may not work as well as you would like.
</p>
<div class="control-group">
{{#if page_params.show_autoscroll_forever_option}}
<div class="controls">
<input type="checkbox" name="autoscroll_forever" id="autoscroll_forever"
{{#if page_params.autoscroll_forever}}
@@ -332,9 +329,7 @@
<label for="autoscroll_forever" class="control-label">
Always auto-scroll to new messages
</label>
{{/if}}
{{#if page_params.show_default_desktop_notifications_option}}
<div class="controls">
<input type="checkbox" name="default_desktop_notifications" id="default_desktop_notifications"
{{#if page_params.default_desktop_notifications}}
@@ -344,7 +339,6 @@
<label for="default_desktop_notifications" class="control-label">
Enable desktop notifications for new streams
</label>
{{/if}}
</div>
<div class="control-group">
@@ -355,4 +349,4 @@
</div>
</div>
</div>
{{/if_or}}

View File

@@ -695,8 +695,7 @@ function render(template_name, args) {
var page_params = $.extend(page_param_checkbox_options, {
fullname: "Alyssa P. Hacker", password_auth_enabled: true,
avatar_url: "https://google.com",
domain: "zulip.com", show_autoscroll_forever_option: true,
show_default_desktop_notifications_option: true
domain: "zulip.com"
});
var checkbox_ids = ["enable_stream_desktop_notifications",

View File

@@ -1088,9 +1088,7 @@ def home(request):
name_changes_disabled = name_changes_disabled(user_profile.realm),
has_mobile_devices = num_push_devices_for_user(user_profile) > 0,
autoscroll_forever = user_profile.autoscroll_forever,
show_autoscroll_forever_option = user_profile.realm.domain in ("customer28.invalid", "zulip.com", "customer31.invalid"),
default_desktop_notifications = user_profile.default_desktop_notifications,
show_default_desktop_notifications_option = user_profile.realm.domain in ("customer13.invalid", "zulip.com",),
avatar_url = avatar_url(user_profile),
mandatory_topics = user_profile.realm.mandatory_topics,
)