Commit 248301a4 authored by Phil Hughes's avatar Phil Hughes

Merge branch '3167-fix-copy-to-clipboard' into 'master'

Fix Copy to Clipboard for SSH Public Key on Pull Repository settings

Closes #3167

See merge request !2692
parents 9a7e25a5 86aedb54
......@@ -154,7 +154,7 @@ export default class MirrorPull {
// Show SSH public key container and fill in public key
this.toggleAuthWell(selectedAuthType);
this.toggleSSHAuthWellMessage(true);
$sshPublicKey.text(res.import_data_attributes.ssh_public_key);
this.setSSHPublicKey(res.import_data_attributes.ssh_public_key);
})
.fail(() => {
Flash('Something went wrong on our end.');
......@@ -205,4 +205,12 @@ export default class MirrorPull {
this.$wellSSHAuth.find('.js-btn-regenerate-ssh-key').toggleClass('hidden', !sshKeyPresent);
this.$wellSSHAuth.find('.js-ssh-public-key-pending').toggleClass('hidden', sshKeyPresent);
}
/**
* Sets SSH Public key to Clipboard button and shows it on UI.
*/
setSSHPublicKey(sshPublicKey) {
this.$sshPublicKeyWrap.find('.ssh-public-key').text(sshPublicKey);
this.$sshPublicKeyWrap.find('.btn-copy-ssh-public-key').attr('data-clipboard-text', sshPublicKey);
}
}
---
title: Fix Copy to Clipboard for SSH Public Key on Pull Repository settings
merge_request: 2692
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment