]> source.dussan.org Git - sonarqube.git/commitdiff
display name of just created token
authorStas Vilchik <vilchiks@gmail.com>
Wed, 20 Jan 2016 10:07:40 +0000 (11:07 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 20 Jan 2016 10:07:40 +0000 (11:07 +0100)
server/sonar-web/src/main/js/apps/account/templates/account-tokens.hbs
server/sonar-web/src/main/js/apps/account/tokens-view.js
server/sonar-web/src/main/js/apps/users/templates/users-tokens.hbs
server/sonar-web/src/main/js/apps/users/tokens-view.js

index 3b0d29d938bb9d7dc7ff3fff8625f86e1e48ead7..faae3a4e20c177f1ba81528281e7f97399fd4323 100644 (file)
 {{#if newToken}}
   <div class="panel panel-white big-spacer-top">
     <div class="alert alert-warning">
-      Make sure you copy the token now. You won’t be able to see it again!
+      New token "{{newToken.name}}" has been created. Make sure you copy it now, you won’t be able to see it again!
     </div>
 
     <table class="data">
       <tr>
 
         <td class="thin">
-          <button class="js-copy-to-clipboard" data-clipboard-text="{{newToken}}">Copy</button>
+          <button class="js-copy-to-clipboard" data-clipboard-text="{{newToken.token}}">Copy</button>
         </td>
         <td class="nowrap">
-          <code class="text-success">{{newToken}}</code>
+          <code class="text-success">{{newToken.token}}</code>
         </td>
       </tr>
     </table>
index 55beb5689bda9eccec5384880e88e1d9f6b35d23..1a6f6b192d9238c540c55cbaf8f34d45ae6409a5 100644 (file)
@@ -57,7 +57,7 @@ export default Marionette.ItemView.extend({
     let tokenName = this.$('.js-generate-token-form input').val();
     generateToken(this.model.id, tokenName)
         .then(response => {
-          this.newToken = response.token;
+          this.newToken = response;
           this.requestTokens();
         })
         .catch(error => {
index 2cadb3a143792f95f6961c3f0093bf866089f10f..e520db60f5ae58ca7b9a6f5f608cde67cb790458 100644 (file)
   {{#if newToken}}
     <div class="panel panel-white big-spacer-top">
       <div class="alert alert-warning">
-        Make sure you copy the token now. You won’t be able to see it again!
+        New token "{{newToken.name}}" has been created. Make sure you copy it now, you won’t be able to see it again!
       </div>
 
       <table class="data">
         <tr>
 
           <td class="thin">
-            <button class="js-copy-to-clipboard" data-clipboard-text="{{newToken}}">Copy</button>
+            <button class="js-copy-to-clipboard" data-clipboard-text="{{newToken.token}}">Copy</button>
           </td>
           <td class="nowrap">
-            <code class="text-success">{{newToken}}</code>
+            <code class="text-success">{{newToken.token}}</code>
           </td>
         </tr>
       </table>
index 56c0b8e16f4facbdc396a69acd3caacaa8fc6247..12989a52a52a6782adac7cfc7443b17b74ad21d6 100644 (file)
@@ -58,7 +58,7 @@ export default Modal.extend({
     let tokenName = this.$('.js-generate-token-form input').val();
     generateToken(this.model.id, tokenName)
         .then(response => {
-          this.newToken = response.token;
+          this.newToken = response;
           this.requestTokens();
         })
         .catch(error => {