]> source.dussan.org Git - sonarqube.git/commitdiff
Add username to token modal
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Tue, 18 Jun 2019 11:32:40 +0000 (13:32 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 28 Jun 2019 06:45:40 +0000 (08:45 +0200)
server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx
server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/TokensFormModal-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 6c313fe85ad505a5d9503fdbae895e0013b69131..567a143b99c9ce2b412d2a6edbddfaebcdf29514 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
 import TokensForm from './TokensForm';
 import Modal from '../../../components/controls/Modal';
 import { translate } from '../../../helpers/l10n';
@@ -30,11 +31,16 @@ interface Props {
 }
 
 export default function TokensFormModal(props: Props) {
-  const header = translate('users.tokens');
   return (
-    <Modal contentLabel={header} onRequestClose={props.onClose}>
+    <Modal contentLabel={translate('users.tokens')} onRequestClose={props.onClose}>
       <header className="modal-head">
-        <h2>{header}</h2>
+        <h2>
+          <FormattedMessage
+            defaultMessage={translate('users.user_X_tokens')}
+            id="users.user_X_tokens"
+            values={{ user: <em>{props.user.name}</em> }}
+          />
+        </h2>
       </header>
       <div className="modal-body modal-container">
         <TokensForm login={props.user.login} updateTokensCount={props.updateTokensCount} />
index f989b7c3d4c8343606a80d4fff5f9c1351e0222c..77879640815151561eee2e59e5f837b7f58e51f7 100644 (file)
@@ -9,7 +9,17 @@ exports[`should render correctly 1`] = `
     className="modal-head"
   >
     <h2>
-      users.tokens
+      <FormattedMessage
+        defaultMessage="users.user_X_tokens"
+        id="users.user_X_tokens"
+        values={
+          Object {
+            "user": <em>
+              John Doe
+            </em>,
+          }
+        }
+      />
     </h2>
   </header>
   <div
index 065d5e7e04b36424bfd285dad6927a36c700ac28..a5dbd86a899a95b5c376b61bbc1e5352af908e03 100644 (file)
@@ -3100,6 +3100,7 @@ users.update=Update users
 users.tokens=Tokens
 users.tokens.sure=Sure?
 users.tokens.revoke=Revoke
+users.user_X_tokens=Tokens of {user}
 users.no_tokens=No tokens
 users.generate=Generate
 users.generate_tokens=Generate Tokens