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: Minor fixes in CSS common to #groups and #streams overlay.

m-e-l-u-h-a-n4b5c073c0501
diff --git a/web/src/user_group_edit.js b/web/src/user_group_edit.js
index 8762bdc43ae..4ffa4c7bd31 100644
--- a/web/src/user_group_edit.js
+++ b/web/src/user_group_edit.js
@@ -201,6 +201,7 @@ export function initialize() {
const template_data = {
group_name: user_group.name,
group_description: user_group.description,
+ max_user_group_name_length: user_group_settings_ui.max_user_group_name_length,
};
const change_user_group_info_modal = render_change_user_group_info_modal(template_data);
dialog_widget.launch({
diff --git a/web/src/user_groups_settings_ui.js b/web/src/user_groups_settings_ui.js
index 5730bc02128..75b0bcdcc56 100644
--- a/web/src/user_groups_settings_ui.js
+++ b/web/src/user_groups_settings_ui.js
@@ -19,6 +19,11 @@ import * as user_groups from "./user_groups";
let group_list_widget;
+// Ideally this should be included in page params.
+// Like we have page_params.max_stream_name_length` and
+// `page_params.max_stream_description_length` for streams.
+export const max_user_group_name_length = 100;
+
export function set_up_click_handlers() {
$("#groups_overlay").on("click", ".left #clear_search_group_name", (e) => {
const $input = $("#groups_overlay .left #search_group_name");
@@ -177,6 +182,7 @@ export function setup_page(callback) {
function populate_and_fill() {
const template_data = {
can_create_or_edit_user_groups: settings_data.user_can_edit_user_groups(),
+ max_user_group_name_length,
};
const rendered = render_user_group_settings_overlay(template_data);
diff --git a/web/styles/subscriptions.css b/web/styles/subscriptions.css
index e08ec022f42..c759b93c654 100644
--- a/web/styles/subscriptions.css
+++ b/web/styles/subscriptions.css
@@ -410,8 +410,9 @@ h4.user_group_setting_subsection_title {
display: none;
font-size: 1.5em;
line-height: 1;
- margin: 9px 0;
+ margin: 9px;
font-weight: 600;
+ word-break: break-all;
.large-icon {
display: inline-block;
@@ -768,7 +769,7 @@ h4.user_group_setting_subsection_title {
.button-group {
padding-top: 5px;
margin-left: auto;
- margin-right: 15px;
+ margin-right: 18px;
.subscribe-button,
#preview-stream-button,
@@ -795,18 +796,23 @@ h4.user_group_setting_subsection_title {
margin-left: -3px;
margin-top: -5px;
white-space: nowrap;
+ max-width: 90%;
+ flex: auto;
+ min-width: 0;
+ overflow-x: clip;
+ text-overflow: ellipsis;
.group-name,
.sub-stream-name {
display: block;
- max-width: 100%;
+ width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
}
.button-group {
- margin-left: 1rem;
+ margin-left: auto;
.deactivate {
margin-right: 3px;
@@ -845,7 +851,7 @@ h4.user_group_setting_subsection_title {
.group_change_property_info,
.stream_change_property_info {
vertical-align: top;
- margin: -5px 0 0;
+ margin: 0 5px 0 0;
}
}
diff --git a/web/templates/user_group_settings/change_user_group_info_modal.hbs b/web/templates/user_group_settings/change_user_group_info_modal.hbs
index 828e4375135..d2f2e8ab12b 100644
--- a/web/templates/user_group_settings/change_user_group_info_modal.hbs
+++ b/web/templates/user_group_settings/change_user_group_info_modal.hbs
@@ -2,7 +2,7 @@
<label for="change_user_group_name">
{{t 'User group name' }}
</label>
- <input type="text" id="change_user_group_name" class="modal_text_input" value="{{ group_name }}" />
+ <input type="text" id="change_user_group_name" class="modal_text_input" value="{{ group_name }}" maxlength="{{max_user_group_name_length}}" />
</div>
<div>
<label for="change_user_group_description">
diff --git a/web/templates/user_group_settings/user_group_creation_form.hbs b/web/templates/user_group_settings/user_group_creation_form.hbs
index 4c694738550..547aeaf367e 100644
--- a/web/templates/user_group_settings/user_group_creation_form.hbs
+++ b/web/templates/user_group_settings/user_group_creation_form.hbs
@@ -9,7 +9,7 @@
{{t "User group name" }}
</label>
<input type="text" name="user_group_name" id="create_user_group_name" class="settings_text_input"
- placeholder="{{t 'User group name' }}" value="" autocomplete="off" />
+ placeholder="{{t 'User group name' }}" value="" autocomplete="off" maxlength="{{ max_user_group_name_length }}"/>
<div id="user_group_name_error" class="user_group_creation_error"></div>
</section>
<section class="block">