Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

user_groups: Show not-allowed cursor on labels also.

Shubham Padia5980f4a502fe
diff --git a/web/src/user_group_edit.js b/web/src/user_group_edit.js
index 848cadb0bd4..e300184873f 100644
--- a/web/src/user_group_edit.js
+++ b/web/src/user_group_edit.js
@@ -123,9 +123,10 @@ function update_group_permission_settings_elements(group) {
});
} else {
$permission_pill_container_elements.find(".input").prop("contenteditable", false);
- $permission_pill_container_elements.addClass("group_setting_disabled");
- $permission_pill_container_elements.each(function () {
+ const $permission_input_groups = $group_permission_settings.find(".input-group");
+ $permission_input_groups.addClass("group_setting_disabled");
+ $permission_input_groups.each(function () {
settings_components.initialize_disable_btn_hint_popover(
$(this),
$t({defaultMessage: "You do not have permission to edit this setting."}),
diff --git a/web/styles/subscriptions.css b/web/styles/subscriptions.css
index 4b97f557cb7..fb736a3f841 100644
--- a/web/styles/subscriptions.css
+++ b/web/styles/subscriptions.css
@@ -688,8 +688,18 @@ h4.user_group_setting_subsection_title {
}
}
-.group_setting_disabled.pill-container {
+.group_setting_disabled {
cursor: not-allowed;
+ /* This ensures that we do not see the not allowed cursor in the
+ extra space of a div */
+ width: fit-content;
+
+ /* This specific rules are needed to override the default settings
+ of these elements */
+ .pill-container,
+ .group-setting-label {
+ cursor: not-allowed;
+ }
.input {
pointer-events: none;
diff --git a/web/templates/user_group_settings/group_permissions.hbs b/web/templates/user_group_settings/group_permissions.hbs
index 5dd70dc3ae9..bc61fdaa2fe 100644
--- a/web/templates/user_group_settings/group_permissions.hbs
+++ b/web/templates/user_group_settings/group_permissions.hbs
@@ -1,5 +1,5 @@
<div class="input-group can-manage-group-container">
- <label>{{t "Who can manage this group" }}</label>
+ <label class="group-setting-label">{{t "Who can manage this group" }}</label>
<div class="pill-container person_picker prop-element" id="id_{{can_manage_group_widget_name}}" data-setting-widget-type="group-setting-type">
<div class="input" contenteditable="true"
data-placeholder="{{t 'Add roles, groups or users' }}">
@@ -9,7 +9,7 @@
</div>
<div class="input-group can-mention-group-container">
- <label>{{t "Who can mention this group" }}</label>
+ <label class="group-setting-label">{{t "Who can mention this group" }}</label>
<div class="pill-container person_picker prop-element" id="id_{{can_mention_group_widget_name}}" data-setting-widget-type="group-setting-type">
<div class="input" contenteditable="true"
data-placeholder="{{t 'Add roles, groups or users' }}">
@@ -19,7 +19,7 @@
</div>
<div class="input-group can-add-members-group-container">
- <label>{{t "Who can add members to this group" }}</label>
+ <label class="group-setting-label">{{t "Who can add members to this group" }}</label>
<div class="pill-container person_picker prop-element" id="id_{{can_add_members_group_widget_name}}" data-setting-widget-type="group-setting-type">
<div class="input" contenteditable="true"
data-placeholder="{{t 'Add roles, groups or users' }}">
@@ -29,7 +29,7 @@
</div>
<div class="input-group can-join-group-container">
- <label>{{t "Who can join this group" }}</label>
+ <label class="group-setting-label">{{t "Who can join this group" }}</label>
<div class="pill-container person_picker prop-element" id="id_{{can_join_group_widget_name}}" data-setting-widget-type="group-setting-type">
<div class="input" contenteditable="true"
data-placeholder="{{t 'Add roles, groups or users' }}">
@@ -39,7 +39,7 @@
</div>
<div class="input-group can-leave-group-container">
- <label>{{t "Who can leave this group" }}</label>
+ <label class="group-setting-label">{{t "Who can leave this group" }}</label>
<div class="pill-container person_picker prop-element" id="id_{{can_leave_group_widget_name}}" data-setting-widget-type="group-setting-type">
<div class="input" contenteditable="true"
data-placeholder="{{t 'Add roles, groups or users' }}">