Add login reminders 64/664/1 stable-3.0-gnu
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 16 Nov 2019 03:25:04 +0000 (22:25 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sat, 16 Nov 2019 04:47:38 +0000 (23:47 -0500)
We got feedback that it was confusing when you are logged out, but not
aware of it.  The "Reply" button under comments or at the top do not
appear, but people who are not used to the interface spend a long time
looking for how to reply, before realizing they are not logged in.

This patch adds a small text "Please log in to comment" where the reply
buttons normally are.

Change-Id: I726ade168947eb3e2790574c3caea0b67af4fd98

polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html
polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.html

index 8579762..98acd30 100644 (file)
@@ -361,6 +361,13 @@ limitations under the License.
           z-index: var(--reply-overlay-z-index);
         }
       }
+      .topLoginReminder {
+        border-bottom: 1px dotted rgb(221, 221, 221);
+        padding-bottom: 0.3em;
+        margin-bottom: .3em;
+        font-style: italic;
+        color: rgb(33,33,33);
+      }
     </style>
     <div class="container loading" hidden$="[[!_loading]]">Loading...</div>
     <div
@@ -452,6 +459,9 @@ limitations under the License.
                     disabled="[[_replyDisabled]]"
                     on-tap="_handleReplyTap">[[_replyButtonLabel]]</gr-button>
               </div>
+              <span class="topLoginReminder" hidden$="[[_loggedIn]]">
+                Please log in to reply.
+              </span>
               <div
                   id="commitMessage"
                   class$="commitMessage [[_computeCommitClass(_commitCollapsed, _latestCommitMessage)]]">
index 8c80b37..5605f60 100644 (file)
@@ -45,7 +45,7 @@ limitations under the License.
       #container.unresolved {
         background-color: var(--unresolved-comment-background-color);
       }
-      #commentInfoContainer {
+      .commentInfoContainer {
         border-top: 1px dotted var(--border-color);
         display: flex;
       }
@@ -54,6 +54,12 @@ limitations under the License.
         margin: auto 0;
         padding: .5em .7em;
       }
+      .loginReminderLabel {
+        font-family: var(--font-family);
+        margin: auto 0;
+        padding: .5em .7em;
+        font-style: italic;
+      }
       .pathInfo {
         display: flex;
         align-items: baseline;
@@ -87,7 +93,10 @@ limitations under the License.
             on-comment-discard="_handleCommentDiscard"
             on-comment-save="_handleCommentSavedOrDiscarded"></gr-comment>
       </template>
-      <div id="commentInfoContainer"
+      <div class="commentInfoContainer" hidden$="[[_showActions]]">
+        <span class="loginReminderLabel">Please log in to comment.</span>
+      </div>
+      <div class="commentInfoContainer"
           hidden$="[[_hideActions(_showActions, _lastComment)]]">
         <span id="unresolvedLabel" hidden$="[[!unresolved]]">Unresolved</span>
         <div id="actions">