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.

invites: Do not show streams if user cannot subscribe others.

Sahil Batra016917679ed0
diff --git a/web/src/invite.ts b/web/src/invite.ts
index b08d185c1d6..27db00f9a2a 100644
--- a/web/src/invite.ts
+++ b/web/src/invite.ts
@@ -340,6 +340,7 @@ function open_invite_user_modal(e: JQuery.ClickEvent<Document, undefined>): void
new_stream_announcements_stream: stream_data.get_new_stream_announcements_stream(),
show_select_default_streams_option: stream_data.get_default_stream_ids().length !== 0,
user_has_email_set: !settings_data.user_email_not_configured(),
+ can_subscribe_other_users: settings_data.user_can_subscribe_other_users(),
});
function invite_user_modal_post_render(): void {
diff --git a/web/styles/app_components.css b/web/styles/app_components.css
index 62815a7f2c3..8863e9253c3 100644
--- a/web/styles/app_components.css
+++ b/web/styles/app_components.css
@@ -529,7 +529,8 @@ div.overlay {
.upgrade-tip,
.upgrade-or-sponsorship-tip,
-.tip {
+.tip,
+.invite-stream-notice {
position: relative;
display: block;
background-color: hsl(46deg 63% 95%);
diff --git a/web/styles/dark_theme.css b/web/styles/dark_theme.css
index 5f6a2daf0eb..bcec6960977 100644
--- a/web/styles/dark_theme.css
+++ b/web/styles/dark_theme.css
@@ -825,7 +825,8 @@
.upgrade-tip,
.upgrade-or-sponsorship-tip,
- .tip {
+ .tip,
+ .invite-stream-notice {
color: inherit;
background-color: hsl(46deg 28% 38% / 27%);
border: 1px solid hsl(49deg 38% 46%);
diff --git a/web/templates/invite_user_modal.hbs b/web/templates/invite_user_modal.hbs
index e885e23b06a..6acccf6f3f8 100644
--- a/web/templates/invite_user_modal.hbs
+++ b/web/templates/invite_user_modal.hbs
@@ -3,14 +3,20 @@
{{#if development_environment}}
<div class="alert" id="dev_env_msg"></div>
{{/if}}
- {{#unless user_has_email_set }}
+ {{#if (not user_has_email_set) }}
<div class="tip">
{{#tr}}
You must <z-link>configure your email</z-link> to access this feature.
{{#*inline "z-link"}}<a href="/help/demo-organizations#configure-email-for-demo-organization-owner" target="_blank" rel="noopener noreferrer">{{> @partial-block }}</a>{{/inline}}
{{/tr}}
</div>
- {{/unless}}
+ {{else if (not can_subscribe_other_users)}}
+ <div class="invite-stream-notice">
+ {{#tr}}The users you invite will be automatically added to <z-link>default streams</z-link> for this organization, as you do not have permission to configure which streams new users join.
+ {{#*inline "z-link"}}<a target="_blank" rel="noopener noreferrer" href="#organization/default-streams-list">{{> @partial-block}}</a>{{/inline}}
+ {{/tr}}
+ </div>
+ {{/if}}
<div class="input-group">
<div id="invite_users_option_tabs_container" class="new-style"></div>
<div id="invitee_emails_container">
@@ -55,6 +61,7 @@
{{/if}}
</select>
</div>
+ {{#if can_subscribe_other_users}}
<div>
<label>{{t "Channels they should join" }}</label>
<div id="streams_to_add">
@@ -90,4 +97,5 @@
</div>
</div>
</div>
+ {{/if}}
</form>