FEATURE: Share Topic modal improvements (#12834)

FEATURE: Share Topic modal improvements (#12834)

This PR includes few commits that improve the new “Share Topic” modal: same icon for notify button as the notification, advanced options are only showed for staff, but the topic name should be visible to everyone.

diff --git a/app/assets/javascripts/discourse/app/controllers/create-invite.js b/app/assets/javascripts/discourse/app/controllers/create-invite.js
index d0c5b2b..1126276 100644
--- a/app/assets/javascripts/discourse/app/controllers/create-invite.js
+++ b/app/assets/javascripts/discourse/app/controllers/create-invite.js
@@ -19,8 +19,9 @@ export default Controller.extend(
     invite: null,
     invites: null,
 
-    autogenerated: false,
     showAdvanced: false,
+    limitToEmail: false,
+    autogenerated: false,
 
     type: "link",
 
@@ -32,8 +33,9 @@ export default Controller.extend(
       this.setProperties({
         invite: null,
         invites: null,
-        autogenerated: false,
         showAdvanced: false,
+        limitToEmail: false,
+        autogenerated: false,
       });
 
       this.setInvite(Invite.create());
diff --git a/app/assets/javascripts/discourse/app/templates/modal/create-invite.hbs b/app/assets/javascripts/discourse/app/templates/modal/create-invite.hbs
index 1bb823f..4b64084 100644
--- a/app/assets/javascripts/discourse/app/templates/modal/create-invite.hbs
+++ b/app/assets/javascripts/discourse/app/templates/modal/create-invite.hbs
@@ -52,15 +52,17 @@
 
     {{#if isEmail}}
       {{#if showAdvanced}}
-        <div class="input-group invite-custom-message">
-          <label for="invite-message">{{i18n "user.invited.invite.custom_message"}}</label>
-          {{textarea id="invite-message" value=buffered.custom_message}}
-        </div>
+        {{#if currentUser.staff}}
+          <div class="input-group invite-custom-message">
+            <label for="invite-message">{{i18n "user.invited.invite.custom_message"}}</label>
+            {{textarea id="invite-message" value=buffered.custom_message}}
+          </div>
+        {{/if}}
       {{/if}}
     {{/if}}
 
-    {{#if currentUser.staff}}
-      {{#if showAdvanced}}
+    {{#if showAdvanced}}
+      {{#if currentUser.staff}}
         <div class="input-group invite-to-topic">
           {{choose-topic
             selectedTopicId=buffered.topicId
@@ -69,11 +71,21 @@
             label="user.invited.invite.invite_to_topic"
           }}
         </div>
+      {{else}}
+        <div class="input-group">
+          <label for="invite-topic">{{i18n "user.invited.invite.invite_to_topic"}}</label>
+          {{input
+            name="invite-topic"
+            class="invite-topic"
+            value=buffered.topicTitle
+            readonly=true
+          }}
+        </div>
       {{/if}}
     {{/if}}
 
-    {{#if currentUser.staff}}
-      {{#if showAdvanced}}
+    {{#if showAdvanced}}
+      {{#if currentUser.staff}}
         <div class="input-group invite-to-groups">
           <label>{{i18n "user.invited.invite.add_to_groups"}}</label>
           {{group-chooser
@@ -86,8 +98,8 @@
       {{/if}}
     {{/if}}
 
-    {{#if currentUser.staff}}
-      {{#if showAdvanced}}
+    {{#if showAdvanced}}
+      {{#if currentUser.staff}}
         <div class="input-group invite-expires-at">
           {{future-date-input
             displayLabel=(i18n "user.invited.invite.expires_at")
@@ -121,10 +133,12 @@
     }}
   {{/if}}
 
-  {{d-button
-    action=(action "toggleAdvanced")
-    class="show-advanced"
-    icon="cog"
-    title=(if showAdvanced "user.invited.invite.hide_advanced" "user.invited.invite.show_advanced")
-  }}
+  {{#if currentUser.staff}}
+    {{d-button
+      action=(action "toggleAdvanced")
+      class="show-advanced"
+      icon="cog"
+      title=(if showAdvanced "user.invited.invite.hide_advanced" "user.invited.invite.show_advanced")
+    }}
+  {{/if}}
 </div>
diff --git a/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs b/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs
index cf9591c..066bdf3 100644
--- a/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs
+++ b/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs
@@ -21,7 +21,7 @@
       {{d-button
         class="btn-primary"
         label="topic.share.notify_users.title"
-        icon="users"
+        icon="hand-point-right"
         action=(action "toggleNotifyUsers")
       }}
 

GitHub sha: b32c7df0

This commit appears in #12834 which was approved by ZogStriP. It was merged by udan11.