Commit Graph

911 Commits

Author SHA1 Message Date
sahil839 909a3cde76 realm: Replace allow_message_deleting with delete_own_message_policy.
This commit replaces 'allow_message_deleting' boolean setting
with an integer setting 'delete_own_message_policy'. We have a
separate dropdown now for deciding which user-roles can delete
messages sent by themselves and the time-limit setting droddown
is different.

This new setting has two options - everyone and admins only. Other
options including moderators will be added further.

We also remove the "Never" option from the original time-limit
dropdown, as admins are always allowed to delete message. This
never option resembled the case of only admins being allowed to
delete but this state is now resembled by setting the dropdown
to "admins only" and we also disable the time-limit dropdown in
this case as admins are allowed to delete irrespective of limit.

Note, this setting is only for deleting messages sent by the
deleting user themselves, and only admins are allowed to delete
messages sent by others as before.
2021-09-30 14:59:31 -07:00
Sahil Batra 8b638648dc settings: Remove inline-block from subsection-parent elements.
This commit removes inline-block class from the subsection-parent
elements in notification settings because we do not need different
subsections to be inline. This was working correctly till now
because the widths of the subsections were large enough to not
be able to fit in same line.
2021-09-28 12:40:09 -07:00
Sahil Batra c233ee9935 settings: Migrate twenty_four_hour_time setting to RealmUserDefault.
This commit removes the existing default_twenty_four_hour_time field in
Realm table which was used to set the twenty_four_hour_time setting of
new user on joining and instead we now use the twenty_four_hour_time
field of RealmUserDefault table for the same.

With some tweaks by tabbott to clarify the documentation.
2021-09-23 10:44:42 -07:00
Alya Abbott b773048031 user docs: Add documentation for configuring new user defaults.
Also remove a redundant link on customize-settings-for-new-users page.
2021-09-21 16:43:35 -07:00
Sahil Batra ba1fe77996 settings: Add UI for realm-level default of enter_sends settings. 2021-09-21 14:56:25 -07:00
Sahil Batra 22ec3c7993 settings: Add UI for realm-level default of presence-enabled setting. 2021-09-21 14:39:13 -07:00
Sahil Batra d4c8284d24 settings: Add UI for realm-level defaults of notification settings.
This commit adds UI for realm-level defaults of user notification
settings. We do not have "Send test notification" option here.
2021-09-16 15:46:41 -07:00
Sahil Batra 90e4740455 settings: Use class instead of id for email batching period setting.
This commit removes the id from email notification batching period
setting dropdown and adds class such that we can use same template
for the realm-level settings as well. We also add 'setting_'
prefix as we do for other settings and modify the JS code accordingly.
2021-09-16 15:46:41 -07:00
Alya Abbott 9df8fbde48 user docs: Document message notification email custom batching.
Also adjust the label slightly for better readability.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2021-09-15 17:39:51 -07:00
Sahil Batra 96d6bf28db settings: Add UI for realm-level defaults of display settings.
This commit adds a new module settings_defaults.js which calls
the functions in settings_display passing appropriate container
element and settings object as parameters.
We also add one more parameter for_realm_settings to some of the
functions in settings_dislay to differentiate between the user
and realm-level settings.
2021-09-15 09:56:32 -07:00
Sahil Batra cc65ed103c settings: Use correct object in notification settings template.
In commit 40f4316, we changed the code to pass user settings
with settings_object variable, but this change was missed
during rebasing.
2021-09-14 10:13:44 -07:00
Sahil Batra 40f4316972 settings: Pass user settings using settings_object variable.
Instead of passing user settings directly as user_settings
variable to the settings templates, we pass them using
settings_object variable.

This change is important so that we can use the exisiting
display_settings and notification_settings template for
realm-level default settings by passing realm-level
settings using settings_source variable.
2021-09-13 08:32:31 -07:00
Sahil Batra afeb4b2113 settings: Add condition for time and default language settings UI.
We would have the UI for default language and time settign only for
user settings for now and not for realm-level settings because we
still need to migrate the backend to support the new model and will
be done in further commits.
2021-09-13 08:32:31 -07:00
Sahil Batra cb9109dccf templates: Add condition for showing stream notification settings.
We need to show the stream-specific notification settings only in
user notification settings and not for realm-level default settings.
This commit is a prep commit and adds a condition to make sure that
stream-specific settings are shown only for user-settings.
2021-09-13 08:32:31 -07:00
Sahil Batra 6651842dc6 settings: Split email notification settings.
This commit splites email notification settings in two
parts - one with heading "Email message notifications"
containing batchning period, message-content and
organization-name settings and the other with heading
"Other emails" containing login, digest and marketing
emails settings.

Fixes #19717.
2021-09-12 16:43:55 -07:00
Sahil Batra 60112405ba settings: Restructure 'Personal settings > Notifications' section.
We remove the 'Other notification settings' heading and increase the
font size of 'Desktop message notifications' and 'Mobile message
notifications' headings as these are now on the same level with
'Notification triggers' heading.

We also add status elements to show saving indicator along the mobile,
desktop and email headings which was previously shown with the
"Other notification settings" heading.
2021-09-12 16:43:55 -07:00
Sahil Batra 14e383ad7a settings: Rename headings in notification settings UI.
This commit renames 'desktop' and 'mobile' headings in
notification settings UI to 'desktop message notifications'
and 'mobile message notifications' respectively.
2021-09-12 16:43:55 -07:00
Abhijeet Prasad Bodas e023c13cdc email notifications: Frontend work for custom batching periods.
This utilizes the API added in 5db4fe8652.

We still need /help/ documentation updates for this feature.

Fixes #15280.
2021-09-10 14:28:33 -07:00
Sahil Batra 9cc4290140 settings: Rename "Send test notification" to "Test desktop notification". 2021-08-21 07:48:38 -07:00
Sahil Batra fef825d56f settings: Rename class of notification settings elements.
We rename class of notification settings except checkboxes
by prefixing them with 'setting_' for clarity.

We do not change class of checkboxes because settings_checkbox
is used by other templates also and if we only change class
of those using notification_settings_checkboxes then live
update code will break and will need to add separate condition
for differentiating between which partial template is used.
2021-08-20 07:51:23 -07:00
Sahil Batra d05730a199 settings: Rename classes for display settings elements.
We rename the class of display setting elements by prefixing
them with 'setting_' for clarity.
2021-08-20 07:51:11 -07:00
Sahil Batra 9c17e7019d settings: Add 'user_' prefix to presence_enabled setting element.
This commit adds 'user_' prefix to presence_enabled setting
element such that we can have unique ids when we add a realm-level
setting for this.
2021-08-20 07:50:51 -07:00
Sahil Batra 7b79980be9 settings: Add prefix to checkboxes used in notification_settings.
This commit adds prefix paramter with value "user_" to the
settings_checkbox and notification_settings_checkboxes references
in notification_settings.hbs such that ids are unique when we use
notification_settings.hbs for realm-level settings UI.
2021-08-20 07:50:51 -07:00
Sahil Batra 32a43985d7 settings: Create user_notification_settings.hbs template.
This commit creates a new template user_notification_settings.hbs
for user notification settings and notification_settings.hbs will
be used as a common template for user-level and realm-level
settings.
2021-08-20 07:50:51 -07:00
Sahil Batra 032d347b4f settings: Refactor frontend code for notification settings.
This is a prep commit for adding UI for realm-level default
of user settings. We refactor the code to use  classes
instead of ids such that we can use the common code for the
new settings.
2021-08-20 07:50:51 -07:00
Sahil Batra c5cc4fb114 settings: Refactor default-language modal code.
We add a prefix to id of default_language_modal.hbs
such that we can use the same code for user settings
and realm-level settings.
We also add a class "default_language_modal" to the
modal div to avoid duplicate css.
2021-08-20 07:50:51 -07:00
Sahil Batra cf1a7c4d1c settings: Add prefix to settings_checkbox references in display_settings.
This commit adds prefix paramter with value "user_" to the
settings_checkbox references in display_settings.hbs such
that ids are unique when we use display_settings.hbs for
realm-level settings UI.
2021-08-20 07:50:51 -07:00
Sahil Batra 8bf5b3a399 settings: Create user_display_settings.hbs template.
This commit creates a new template user_display_settings.hbs
for user display settings and display_settings.hbs will be
used as a common template for user-level and realm-level
settings.
2021-08-20 07:50:50 -07:00
Sahil Batra 3adf5e6383 settings: Refactor frontend code for display settings.
This is a prep commit for adding UI for realm-level
default of user settings. We refactor the code to use
classes instead of ids such that we can use the common
code for the new settings.
2021-08-20 07:40:20 -07:00
Anders Kaseorg dd2f979541 templates: Add missing tabnabbing protection for target="_blank" links.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-07 06:25:30 -07:00
Sahil Batra 998d710275 frontend: Add new user_settings module for user's settings.
We add a new user_settings module similar to page_params
module in frontend and use it to access user's personal
settings instead of page_params.
2021-08-01 15:30:17 -07:00
aryanshridhar 7c588d4747 dropdown_list_widget: Add support for Multiselect dropdown list widget (MDLW).
This commit adds the support to select multiple dropdown items by inheriting
dropdown list widget and overriding some of it's properties.

The parameters that can be passed along with it are-

- widget_name: The desired name of the widget.
- data: The data that needs to be populated as dropdown items.
- default_text: The default text to be rendered when none of the items is selected.
- on_update: Function to trigger once the filter button is pressed.
- on_close: Function to trigger once the dropdown is successfully closed after filtering.
- value: The default value that is initially selected by user.
- limit: The maximum number of dropdown items to display on button text.

This widget can later be implemented in recent topic view to replace the
several ellipses filter button and also within the organisation user's page
to quickly sort the users list according to their org role.
2021-07-29 10:09:03 -07:00
sahil839 b8854a9d92 settings: Add full members and moderators options in custom emoji setting. 2021-07-27 16:41:23 -07:00
sahil839 4b1313a92b models: Replace add_emoji_by_admins_only with add_custom_emoji_policy.
This commit replaces boolean field add_emoji_by_admins_only with an
integer field add_custom_emoji_policy as we would also add full members
and moderators option for this setting in further commits.
2021-07-27 16:41:22 -07:00
sahil839 c7e756f984 setting: Allow only owners to change "Who can invite users" setting. 2021-07-26 17:48:01 -07:00
sahil839 ca0bb5b9d8 settings: Add nobody option for invite_to_realm_policy in frontend. 2021-07-26 17:48:01 -07:00
Tim Abbott 24c0c27ecc lint: Fix trailing whitespace in account-settings.hbs.
This was introduced in b9aed2df19.
2021-07-26 16:46:29 -07:00
Ganesh Pawar b9aed2df19 change_email_modal: Remove duplicate id attribute.
This also naturally fixes the bug where the change_email_modal wouldn't
show the old email in the input box.
2021-07-26 16:37:15 -07:00
sahil839 be8e7fdfb6 upload_widget: Use img tag for tail-spin.svg instead of object tag.
We use img tag for showing the loading spinner in image_upload_widget
instead of object tag because using object tag gives the following
error "Refused to display 'https://chat.zulip.org/' in a frame because
it set 'X-Frame-Options' to 'deny'." in console.

As mentioned by Anders in czo, this is probably because we’re loading
the SVG using an <object> tag as if it’s totally-not-an-IE3-ActiveX-
control.

Discussed in #issues > loading tail-spin.svg denied by X-Frame-Options.
2021-07-18 11:44:17 -07:00
sahil839 6a3f22480d settings_emoji: Rename can_admin_emoji to can_delete_emoji. 2021-07-14 14:57:09 -07:00
sahil839 e736d9d275 settings: Add moderators and full members options in user-group setting.
This commit adds moderators and full members options for user group
settings in frontend.
2021-07-14 14:38:44 -07:00
sahil839 1148937c7b settings: Show tip always in user group settings page.
This commit changes the behavior to show the tip, explaining
which user roles are allowed to edit user groups, to user
with all roles because it is better to show the user which
other roles are allowed to edit. Previously the tip was shown
to non-admin users only.
2021-07-14 14:38:43 -07:00
sahil839 fd55df9f7c settings: Use dialog_widget for bot-edit form and remove edit_fields_modal.
This commit changes the bot-edit modal to use dialog_widget instead of
edit_fields_modal.

This commit also removes edit_fields_modal module as it is no longer used.
2021-07-14 13:02:26 -07:00
sahil839 eaf69bbf16 edit_fields_modal: Show error message in the body not heading.
Placing error message at the top of the body looks better than
placing it below the heading.
2021-07-06 15:15:50 -07:00
sahil839 19362f393e edit_fields_modal: Rename modal_body_html and modal_label.
This commit renames modal_body_html and modal_label to
html_body and html_heading respectively. This change
will help us easily deduplicating the confirm_dialog
and edit_fields_modal code.
2021-07-06 15:15:50 -07:00
sahil839 4875f6d3bb settings: Add status-and-availability help link with presence setting. 2021-07-05 14:27:56 -07:00
sahil839 7eb183fdf7 settings: Move presence-enabled setting to 'Account & privacy'.
The presence setting is more suited in 'Account & privacy'
section as it is not related to notifications in anyway
and resembles privacy of user by allowing user to hide
his status of being online.
2021-07-05 14:27:56 -07:00
Riken Shah ce2821bc28 settings_checkbox: Fix incorrect line wrapping in mobile view.
The issue was text label has `display: inline-block`
property which caused it to go to a new line in smaller
width screens.

This commit fixes it by changing its display property to `inline`.

Fixes #19075.
2021-07-01 17:46:26 -07:00
Tim Abbott 53df9a3958 settings: Move role to profile page.
This feels a bit more consistent with the fact that this field gets
displayed on the user's profile page.
2021-06-30 16:58:37 -07:00
sahil839 687a4ffbb1 settings: Show the date when a user joined the realm in profile panel.
This will also help us to cover up some space when there are no custom
profile fields.
2021-06-30 16:58:22 -07:00