Commit Graph

893 Commits

Author SHA1 Message Date
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
sahil839 b94d6c1a20 settings: Move timezone setting from display settings to profile.
The user timezone is only used for user's profile, so we can
move this setting to the Profile panel of settings and this
will also help us in covering some space when there are no
custom profile fields for the organization.
2021-06-30 16:56:03 -07:00
sahil839 bb816e1998 settings: Separate "Your account" section in two different sections.
We separate "Your account" section to two different sections -
"Profile" section for user name, custom profile fields, and avatar
and "Account & Security" section for email, password, role, api-key
and deactivating button.

Another important change here is that the modal for changing name
is removed and now the name has a simple input text box and it
behaves similar to inputs for custom-profile-fields.

Fixes #18848.
2021-06-30 16:56:03 -07:00
sahil839 efa19597bb settings: Show tooltip if avatar changes are disabled.
We show a tooltip besides "Profile picture" heading
to the users who cannot change their avatar explaining
that the avatar changes are disabled in organization.
2021-06-30 15:33:54 +05:30
sahil839 a537ecc587 settings: Fix live update of user-avatar upload widget.
We add disabled prop on buttons only and we add the css for
buttons (and some specific class elements) when disabled as
'cursor: not-allowed' or 'pointer-events: none' which means
the user cannot use these buttons when disabled.

This is not the case for the avatar widget as we use a div
element there and not button and neither those specific
classes which has appropriate styles defined.

We use the avatar image block in two ways - for showing image
and as a clickable target (which is actually a div element)
for uploading, so instead of adding 'disabled' prop we are
hiding (adding display: none) the div such that it is not
visible on hover and also cannot be clicked.
2021-06-30 15:00:51 +05:30
sahil839 4170a2e969 templates: Fix incorrect class name used for tooltips.
Tooltips of message retention and realm deactivation
should have appropriate class as per the setting and
not "realm_allow_message_deleting_tooltip" for all
the different tooltips.
2021-06-29 17:37:52 -07:00
sahil839 c32a036449 settings: Remove unnecessary code.
The class "name_change_container" is used in the custom
profile fields form.

The name of custom profile field should not be affected
by this setting.

Also confirmed the behavior by testing on master itself,
that these fields are not hidden actually due to this
code being in settings_account itself.

We can also remove the class "name_change_container" as
there is no use of this class elsewhere.
2021-06-28 22:14:49 -07:00
sahil839 0f0e71b3f2 settings: Remove user-name-section from email input.
We handle the css using email-change-form and thus
there is no need for 'user-name-section' class as
this element is used for emails and not user names.
2021-06-28 22:11:24 -07:00
sahil839 e0667a80fe settings: Remove user-name-section class from some elements.
'user-name-section' class is only used to set css for its child
settings-info-icon. This commit removes the 'user-name-section'
class from elements which do not have 'settings-info-icon' as
their child element and also these elements are in not related
to user names.
2021-06-28 22:11:24 -07:00
sahil839 1cb72c77fe settings_users: Rename user-name-form to edit-user-form.
This commit renames user-name-form to edit-user-form as
the modal for which this id is used, is used to edit all
the user properties, not only name.
2021-06-28 22:11:24 -07:00
sahil839 0b8b7c4441 settings: Use edit_fields_modal framework for user-info edit modal.
This commit modifies the user-info edit modal to use newly added
edit_fields_modal framework.

Fixes a part of #18417.
2021-06-24 16:55:23 -07:00
sahil839 b04647f219 settings: Use edit_fields_modal framework for linkifier-edit modal.
This commit modifies the linkifier-edit modal to use newly added
edit_fields_modal framework.

One important change is that we remove the "edit-linkifier-status"
element as the corresponding "edit-fields-modal-status" element
is added in edit_fields_modal.hbs and we also modify the css
accordingly. This "edit-fields-modal-status" is used only for
this modal and remains empty for others, so this change does not
cause problems with other modals.

There is another element which uses "edit-linkifier-status" as a
class, but the css we defined was for "edit-linkifier-status" as
id, so the css change is also safe.
2021-06-24 16:55:23 -07:00
sahil839 3da636a20e settings: Use edit_fields_modal framework for admin bot form.
This commit modifies the modal for editing bot information to
use edit_fields_modal framework.

We also change the id of form element of this modal such that
it makes sense with the actual use of modal and there is no
problem with this change as styling of this modal is not
affected.
2021-06-24 16:55:23 -07:00
sahil839 36560da0f0 modals: Add edit_fields_modal.js and edit_field_modals.hbs.
We create a new widget edit_fields_modal such that this common
framework can be used in bot-edit modal, linkifier-edit modal
and user-edit modal, which have very similar implementations.

The "edit-fields-modal-status" is used only for edit-linkifier
modal and remains empty for others, so this change does not
cause problems with other modals.
2021-06-24 16:55:22 -07:00
sahil839 4df22564f4 settings: Use confirm_dialog for deactivating own account modal.
This refactor changes two things - position of the modal, as it
is moved up by some amount because of using confirm_dialog and
also loading spinner of confirm_dialog widget is used.
2021-06-23 08:05:25 -07:00
aryanshridhar df556a199a settings_invites: Move and rename the revoke_invite modal.
Moved `revoke_invite` user-confirmation modal to the
`confirm_dialog` folder and renamed the modal to
`confirm_revoke_invite.hbs` to follow the common naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar d0c683a8d7 settings_invites: Move and rename the resend_invite modal.
Moved `resend_invite` user-confirmation modal to the
`confirm_dialog` folder and renamed the modal to
to `confirm_resend_invite.hbs` to follow the common naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar 83473ba647 settings_emoji: Move and rename the emoji_settings_warning modal.
Moved `emoji_settings_warning` modal to the `confirm_dialog`
folder and renamed the modal to `confirm_emoji_settings_warning.hbs`
to follow the common naming convention.
2021-06-21 10:36:35 -07:00
aryanshridhar 4549cbe48c settings_users: Move and rename the deactivation_user modal.
Moved `deactivation_user` modal to the `confirm_dialog`
folder within `/static/templates` and renamed the modal to
to `confirm_deactivate_user.hbs` to follow the
common naming convention.
2021-06-21 10:36:35 -07:00