Add a copy button to copy the ssh key/gpg key
Bug: Issue 10047 Change-Id: If69f1a18065374000249b9157018c21024013085
This commit is contained in:
		@@ -19,6 +19,7 @@ limitations under the License.
 | 
			
		||||
<link rel="import" href="../../../bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html">
 | 
			
		||||
<link rel="import" href="../../../styles/gr-form-styles.html">
 | 
			
		||||
<link rel="import" href="../../shared/gr-button/gr-button.html">
 | 
			
		||||
<link rel="import" href="../../shared/gr-copy-clipboard/gr-copy-clipboard.html">
 | 
			
		||||
<link rel="import" href="../../shared/gr-overlay/gr-overlay.html">
 | 
			
		||||
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
 | 
			
		||||
<link rel="import" href="../../../styles/shared-styles.html">
 | 
			
		||||
@@ -69,6 +70,7 @@ limitations under the License.
 | 
			
		||||
              <th class="userIdHeader">User IDs</th>
 | 
			
		||||
              <th class="keyHeader">Public Key</th>
 | 
			
		||||
              <th></th>
 | 
			
		||||
              <th></th>
 | 
			
		||||
            </tr>
 | 
			
		||||
          </thead>
 | 
			
		||||
          <tbody>
 | 
			
		||||
@@ -87,6 +89,14 @@ limitations under the License.
 | 
			
		||||
                      data-index$="[[index]]"
 | 
			
		||||
                      link>Click to View</gr-button>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>
 | 
			
		||||
                  <gr-copy-clipboard
 | 
			
		||||
                      has-tooltip
 | 
			
		||||
                      button-title="Copy GPG public key to clipboard"
 | 
			
		||||
                      hide-input
 | 
			
		||||
                      text="[[key.key]]">
 | 
			
		||||
                  </gr-copy-clipboard>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>
 | 
			
		||||
                  <gr-button
 | 
			
		||||
                      data-index$="[[index]]"
 | 
			
		||||
 
 | 
			
		||||
@@ -95,7 +95,7 @@ limitations under the License.
 | 
			
		||||
 | 
			
		||||
      // Get the delete button for the last row.
 | 
			
		||||
      const button = Polymer.dom(element.root).querySelector(
 | 
			
		||||
          'tbody tr:last-of-type td:nth-child(5) gr-button');
 | 
			
		||||
          'tbody tr:last-of-type td:nth-child(6) gr-button');
 | 
			
		||||
 | 
			
		||||
      MockInteractions.tap(button);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,7 @@ limitations under the License.
 | 
			
		||||
<link rel="import" href="../../../bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html">
 | 
			
		||||
<link rel="import" href="../../../styles/gr-form-styles.html">
 | 
			
		||||
<link rel="import" href="../../shared/gr-button/gr-button.html">
 | 
			
		||||
<link rel="import" href="../../shared/gr-copy-clipboard/gr-copy-clipboard.html">
 | 
			
		||||
<link rel="import" href="../../shared/gr-overlay/gr-overlay.html">
 | 
			
		||||
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
 | 
			
		||||
<link rel="import" href="../../../styles/shared-styles.html">
 | 
			
		||||
@@ -65,6 +66,7 @@ limitations under the License.
 | 
			
		||||
              <th class="statusHeader">Status</th>
 | 
			
		||||
              <th class="keyHeader">Public key</th>
 | 
			
		||||
              <th></th>
 | 
			
		||||
              <th></th>
 | 
			
		||||
            </tr>
 | 
			
		||||
          </thead>
 | 
			
		||||
          <tbody>
 | 
			
		||||
@@ -79,6 +81,14 @@ limitations under the License.
 | 
			
		||||
                      data-index$="[[index]]"
 | 
			
		||||
                      link>Click to View</gr-button>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>
 | 
			
		||||
                  <gr-copy-clipboard
 | 
			
		||||
                      has-tooltip
 | 
			
		||||
                      button-title="Copy SSH public key to clipboard"
 | 
			
		||||
                      hide-input
 | 
			
		||||
                      text="[[key.ssh_public_key]]">
 | 
			
		||||
                  </gr-copy-clipboard>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>
 | 
			
		||||
                  <gr-button
 | 
			
		||||
                      link
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,7 @@ limitations under the License.
 | 
			
		||||
 | 
			
		||||
      // Get the delete button for the last row.
 | 
			
		||||
      const button = Polymer.dom(element.root).querySelector(
 | 
			
		||||
          'tbody tr:last-of-type td:nth-child(4) gr-button');
 | 
			
		||||
          'tbody tr:last-of-type td:nth-child(5) gr-button');
 | 
			
		||||
 | 
			
		||||
      MockInteractions.tap(button);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user