From 6ec5c28e9786945584ba74e7c81bdb5aa9bccf4e Mon Sep 17 00:00:00 2001 From: Shubham Dhama Date: Thu, 29 Mar 2018 03:23:20 +0530 Subject: [PATCH] org settings: Move property types out of `_setup` function. Since we don't have any string needed to be translated in property_types we can move it outside `_setup` function to get to the safe side if they needed to get accessed before `_setup` is called. --- static/js/settings_org.js | 144 +++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/static/js/settings_org.js b/static/js/settings_org.js index 1fd32c4b69..73cf41a68d 100644 --- a/static/js/settings_org.js +++ b/static/js/settings_org.js @@ -10,6 +10,78 @@ exports.reset = function () { meta.loaded = false; }; +var org_profile = { + name: { + type: 'text', + }, + description: { + type: 'text', + }, +}; + +var org_settings = { + msg_editing: { + allow_message_deleting: { + type: 'bool', + }, + allow_edit_history: { + type: 'bool', + }, + }, + msg_feed: { + inline_image_preview: { + type: 'bool', + }, + inline_url_embed_preview: { + type: 'bool', + }, + mandatory_topics: { + type: 'bool', + }, + }, + language_notify: { + default_language: { + type: 'text', + }, + send_welcome_emails: { + type: 'bool', + }, + }, +}; + +var org_permissions = { + org_join: { + restricted_to_domain: { + type: 'bool', + }, + invite_required: { + type: 'bool', + }, + disallow_disposable_email_addresses: { + type: 'bool', + }, + invite_by_admins_only: { + type: 'bool', + }, + }, + user_identity: { + name_changes_disabled: { + type: 'bool', + }, + email_changes_disabled: { + type: 'bool', + }, + }, + other_permissions: { + add_emoji_by_admins_only: { + type: 'bool', + }, + bot_creation_policy: { + type: 'integer', + }, + }, +}; + exports.set_create_stream_permission_dropdwon = function () { var menu = "id_realm_create_stream_permission"; $("#id_realm_waiting_period_threshold").parent().hide(); @@ -225,78 +297,6 @@ function _set_up() { // Populate authentication methods table exports.populate_auth_methods(page_params.realm_authentication_methods); - var org_profile = { - name: { - type: 'text', - }, - description: { - type: 'text', - }, - }; - - var org_settings = { - msg_editing: { - allow_message_deleting: { - type: 'bool', - }, - allow_edit_history: { - type: 'bool', - }, - }, - msg_feed: { - inline_image_preview: { - type: 'bool', - }, - inline_url_embed_preview: { - type: 'bool', - }, - mandatory_topics: { - type: 'bool', - }, - }, - language_notify: { - default_language: { - type: 'text', - }, - send_welcome_emails: { - type: 'bool', - }, - }, - }; - - var org_permissions = { - org_join: { - restricted_to_domain: { - type: 'bool', - }, - invite_required: { - type: 'bool', - }, - disallow_disposable_email_addresses: { - type: 'bool', - }, - invite_by_admins_only: { - type: 'bool', - }, - }, - user_identity: { - name_changes_disabled: { - type: 'bool', - }, - email_changes_disabled: { - type: 'bool', - }, - }, - other_permissions: { - add_emoji_by_admins_only: { - type: 'bool', - }, - bot_creation_policy: { - type: 'integer', - }, - }, - }; - function populate_data_for_request(data, changing_property_types) { _.each(changing_property_types, function (v, k) { var field = changing_property_types[k];