From 9eb8d93a0d958b830b1f759dd0917629bd79c8e6 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Mon, 7 Aug 2017 05:23:16 +0500 Subject: Updating user access token UI (#7091) * Updating user access token UI Updating help text Updating tokenlistClass Updating string for token Updating translations Updating translations Updating translations * Updating translations * Minor UI fix * Update manage_tokens_modal.jsx * Update user_settings_security.jsx * Update en.json * Fix merge conflicts --- i18n/en.json | 28 +++---- .../manage_tokens_modal/manage_tokens_modal.jsx | 14 ++-- webapp/components/delete_channel_modal.jsx | 6 +- .../user_settings_security.jsx | 96 ++++++++++++---------- webapp/i18n/en.json | 51 ++++++------ webapp/sass/components/_alerts.scss | 1 - webapp/sass/components/_modal.scss | 4 - 7 files changed, 104 insertions(+), 96 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index 730017e95..3b2d2662e 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -3157,7 +3157,7 @@ }, { "id": "app.user_access_token.disabled", - "translation": "User access tokens are disabled on this server. Please contact your system administrator for details." + "translation": "Personal access tokens are disabled on this server. Please contact your system administrator for details." }, { "id": "app.user_access_token.invalid_or_missing", @@ -3601,11 +3601,11 @@ }, { "id": "authentication.roles.system_user_access_token.name", - "translation": "User Access Token" + "translation": "Personal Access Token" }, { "id": "authentication.roles.system_user_access_token.description", - "translation": "A role with the permissions to create, read and revoke user access tokens" + "translation": "A role with the permissions to create, read and revoke personal access tokens" }, { "id": "authentication.permissions.create_post_public.name", @@ -3617,27 +3617,27 @@ }, { "id": "authentication.permissions.create_user_access_token.name", - "translation": "Create User Access Token" + "translation": "Create Personal Access Token" }, { "id": "authentication.permissions.create_user_access_token.description", - "translation": "Ability to create user access tokens" + "translation": "Ability to create personal access tokens" }, { "id": "authentication.permissions.read_user_access_token.name", - "translation": "Read User Access Tokens" + "translation": "Read Personal Access Tokens" }, { "id": "authentication.permissions.read_user_access_token.description", - "translation": "Ability to read user access tokens' id, description and user_id fields" + "translation": "Ability to read personal access tokens' id, description and user_id fields" }, { "id": "authentication.permissions.revoke_user_access_token.name", - "translation": "Revoke User Access Token" + "translation": "Revoke Personal Access Token" }, { "id": "authentication.permissions.revoke_user_access_token.description", - "translation": "Ability to revoke user access tokens" + "translation": "Ability to revoke personal access tokens" }, { "id": "authentication.permissions.create_group_channel.description", @@ -6217,23 +6217,23 @@ }, { "id": "store.sql_user_access_token.get_by_user.app_error", - "translation": "We couldn't get the user access tokens by user" + "translation": "We couldn't get the personal access tokens by user" }, { "id": "store.sql_user_access_token.get_by_token.app_error", - "translation": "We couldn't get the user access token by token" + "translation": "We couldn't get the personal access token by token" }, { "id": "store.sql_user_access_token.get.app_error", - "translation": "We couldn't get the user access token" + "translation": "We couldn't get the personal access token" }, { "id": "store.sql_user_access_token.delete.app_error", - "translation": "We couldn't delete the user access token" + "translation": "We couldn't delete the personal access token" }, { "id": "store.sql_user_access_token.save.app_error", - "translation": "We couldn't save the user access token" + "translation": "We couldn't save the personal access token" }, { "id": "store.sql_user.analytics_get_inactive_users_count.app_error", diff --git a/webapp/components/admin_console/manage_tokens_modal/manage_tokens_modal.jsx b/webapp/components/admin_console/manage_tokens_modal/manage_tokens_modal.jsx index c31325291..fdef870e5 100644 --- a/webapp/components/admin_console/manage_tokens_modal/manage_tokens_modal.jsx +++ b/webapp/components/admin_console/manage_tokens_modal/manage_tokens_modal.jsx @@ -26,7 +26,7 @@ export default class ManageTokensModal extends React.PureComponent { user: PropTypes.object, /** - * The user access tokens for a user, object with token ids as keys + * The personal access tokens for a user, object with token ids as keys */ userAccessTokens: PropTypes.object, @@ -86,7 +86,7 @@ export default class ManageTokensModal extends React.PureComponent {
); @@ -98,14 +98,14 @@ export default class ManageTokensModal extends React.PureComponent { className='manage-teams__team' >
-
+
{token.description}
-
+
@@ -167,7 +167,7 @@ export default class ManageTokensModal extends React.PureComponent { diff --git a/webapp/components/delete_channel_modal.jsx b/webapp/components/delete_channel_modal.jsx index fd5447524..92589ce42 100644 --- a/webapp/components/delete_channel_modal.jsx +++ b/webapp/components/delete_channel_modal.jsx @@ -4,7 +4,7 @@ import {Modal} from 'react-bootstrap'; import TeamStore from 'stores/team_store.jsx'; -import {FormattedMessage} from 'react-intl'; +import {FormattedMessage, FormattedHTMLMessage} from 'react-intl'; import {browserHistory} from 'react-router/es6'; @@ -64,9 +64,9 @@ export default class DeleteChannelModal extends React.Component {
- ), confirmMessage: (
), @@ -1056,17 +1056,17 @@ export default class SecurityTab extends React.Component { confirmTitle: ( ), confirmMessage: (
), @@ -1093,6 +1093,7 @@ export default class SecurityTab extends React.Component { createTokensSection = () => { let updateSectionStatus; + let tokenListClass = ''; if (this.props.activeSection === 'tokens') { const tokenList = []; @@ -1107,7 +1108,11 @@ export default class SecurityTab extends React.Component { className='setting-box__item' >
- {token.description} + + {token.description}
); } - let extraInfo; + let extraInfo; if (isMobile()) { extraInfo = ( ); @@ -1161,7 +1167,7 @@ export default class SecurityTab extends React.Component { ); @@ -1175,7 +1181,7 @@ export default class SecurityTab extends React.Component {
@@ -1191,8 +1197,8 @@ export default class SecurityTab extends React.Component {
@@ -1225,6 +1231,10 @@ export default class SecurityTab extends React.Component {
); } else if (this.state.tokenCreationState === TOKEN_CREATED) { + if (tokenList.length === 0) { + tokenListClass = ' hidden'; + } + newTokenSection = (


- - {this.state.newToken.description} -
- - {this.state.newToken.id} -
- +
+ + {this.state.newToken.description} +
+
+ + {this.state.newToken.id} +
+ {this.state.newToken.token} @@ -1279,10 +1291,10 @@ export default class SecurityTab extends React.Component { className='padding-top' >
-
+
{tokenList} + {noTokenText}
-
{newTokenSection}
@@ -1296,7 +1308,7 @@ export default class SecurityTab extends React.Component { return ( diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index ebbb8662f..509499c1d 100755 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -764,9 +764,9 @@ "admin.select_team.close": "Close", "admin.select_team.select": "Select", "admin.select_team.selectTeam": "Select Team", - "admin.service.userAccessTokensTitle": "Enable User Access Tokens: ", - "admin.service.userAccessTokensDescription": "When true, users can create user access tokens for integrations in Account Settings > Security. They can be used to authenticate against the API and give full access to the account.

To manage who can create user access tokens, go to the System Console > Users page.", - "admin.service.userAccessTokensNameLabel": "Name: ", + "admin.service.userAccessTokensTitle": "Enable Personal Access Tokens: ", + "admin.service.userAccessTokensDescription": "When true, users can create personal access tokens for integrations in Account Settings > Security. They can be used to authenticate against the API and give full access to the account.

To manage who can create personal access tokens, go to the System Console > Users page.", + "admin.service.userAccessTokensDescLabel": "Name: ", "admin.service.userAccessTokensIdLabel": "Token ID: ", "admin.service.attemptDescription": "Number of login attempts allowed before a user is locked out and required to reset their password via email.", "admin.service.attemptExample": "E.g.: \"10\"", @@ -979,24 +979,24 @@ "admin.team_analytics.activeUsers": "Active Users With Posts", "admin.team_analytics.totalPosts": "Total Posts", "admin.true": "true", - "admin.manage_tokens.userAccessTokensNone": "No user access tokens.", - "admin.manage_tokens.manageTokensTitle": "Manage User Access Tokens", - "admin.manage_tokens.userAccessTokensDescription": "User access tokens function similar to session tokens and can be used by integrations to authenticate against the REST API. Learn more about user access tokens.", + "admin.manage_tokens.userAccessTokensNone": "No personal access tokens.", + "admin.manage_tokens.manageTokensTitle": "Manage Personal Access Tokens", + "admin.manage_tokens.userAccessTokensDescription": "Personal access tokens function similar to session tokens and can be used by integrations to interact with this Mattermost server. Learn more about personal access tokens.", "admin.manage_roles.saveError": "Unable to save roles.", "admin.manage_roles.additionalRoles": "Select additional permissions for the account. Read more about roles and permissions.", "admin.manage_roles.postAllRoleTitle": "post:all", "admin.manage_roles.postAllRole": "Access to post to all Mattermost channels including direct messages.", "admin.manage_roles.postAllPublicRoleTitle": "post:channels", "admin.manage_roles.postAllPublicRole": "Access to post to all Mattermost public channels.", - "admin.manage_roles.allowUserAccessTokens": "Allow this account to generate user access tokens.", + "admin.manage_roles.allowUserAccessTokens": "Allow this account to generate personal access tokens.", "admin.manage_roles.systemAdmin": "System Admin", "admin.manage_roles.systemMember": "Member", "admin.manage_roles.manageRolesTitle": "Manage Roles", "admin.manage_roles.cancel": "Cancel", "admin.manage_roles.save": "Save", - "admin.user_item.userAccessTokenPostAll": "(with post:all user access tokens)", - "admin.user_item.userAccessTokenPostAllPublic": "(with post:channels user access tokens)", - "admin.user_item.userAccessTokenYes": "(with user access tokens)", + "admin.user_item.userAccessTokenPostAll": "(with post:all personal access tokens)", + "admin.user_item.userAccessTokenPostAllPublic": "(with post:channels personal access tokens)", + "admin.user_item.userAccessTokenYes": "(with personal access tokens)", "admin.user_item.authServiceEmail": "Sign-in Method: Email", "admin.user_item.authServiceNotEmail": "Sign-in Method: {service}", "admin.user_item.confirmDemoteDescription": "If you demote yourself from the System Admin role and there is not another user with System Admin privileges, you'll need to re-assign a System Admin by accessing the Mattermost server through a terminal and running the following command.", @@ -1352,7 +1352,7 @@ "delete_channel.cancel": "Cancel", "delete_channel.confirm": "Confirm DELETE Channel", "delete_channel.del": "Delete", - "delete_channel.question": "This will delete the channel from the team and make its contents inaccessible for all users. Are you sure you wish to delete the {display_name} channel?", + "delete_channel.question": "This will delete the channel from the team and make its contents inaccessible for all users.

Are you sure you wish to delete the {display_name} channel?", "delete_post.cancel": "Cancel", "delete_post.comment": "Comment", "delete_post.confirm": "Confirm {term} Delete", @@ -2480,27 +2480,28 @@ "user.settings.push_notification.send": "Send mobile push notifications", "user.settings.push_notification.status": "Trigger push notifications when", "user.settings.push_notification.status_info": "Notification alerts are only pushed to your mobile device when your online status matches the selection above.", - "user.settings.tokens.confirmCreateTitle": "Create System Admin User Access Token", - "user.settings.tokens.confirmCreateMessage": "You are generating a user access token with System Admin permissions. Are you sure want to create this token?", + "user.settings.tokens.confirmCreateTitle": "Create System Admin Personal Access Token", + "user.settings.tokens.confirmCreateMessage": "You are generating a personal access token with System Admin permissions. Are you sure want to create this token?", "user.settings.tokens.confirmCreateButton": "Yes, Create", - "user.settings.tokens.confirmDeleteTitle": "Delete {name} Token?", - "user.settings.tokens.confirmDeleteMessage": "Any integrations using this token will no longer be able to access the Mattermost API. You cannot undo this action. Are you sure want to delete this token?", + "user.settings.tokens.confirmDeleteTitle": "Delete Token?", + "user.settings.tokens.confirmDeleteMessage": "Any integrations using this token will no longer be able to access the Mattermost API. You cannot undo this action.

Are you sure want to delete the {description} token?", "user.settings.tokens.confirmDeleteButton": "Yes, Delete", "user.settings.tokens.tokenId": "Token ID: ", "user.settings.tokens.delete": "Delete", - "user.settings.tokens.userAccessTokensNone": "No user access tokens.", - "user.settings.tokens.description": "User access tokens function similar to session tokens and can be used by integrations to authenticate against the REST API.", - "user.settings.tokens.description_mobile": "User access tokens function similar to session tokens and can be used by integrations to authenticate against the REST API. Create new tokens on your desktop.", - "user.settings.tokens.name": "Name: ", - "user.settings.tokens.nameDescription": "Give a name for your token, so you remember what it’s used for. A token is generated after you hit \"Save\".", + "user.settings.tokens.userAccessTokensNone": "No personal access tokens.", + "user.settings.tokens.description": "Personal access tokens function similar to session tokens and can be used by integrations to authenticate against the REST API.", + "user.settings.tokens.description_mobile": "Personal access tokens function similar to session tokens and can be used by integrations to authenticate against the REST API. Create new tokens on your desktop.", + "user.settings.tokens.name": "Token Description: ", + "user.settings.tokens.nameHelp": "Enter a description for your token to remember what it does.", + "user.settings.tokens.nameRequired": "Please enter a description.", "user.settings.tokens.save": "Save", "user.settings.tokens.cancel": "Cancel", - "user.settings.tokens.id": "ID: ", - "user.settings.tokens.token": "Token: ", - "user.settings.tokens.copy": "Please copy the token below. You won't be able to see it again!", + "user.settings.tokens.id": "Token ID: ", + "user.settings.tokens.token": "Access Token: ", + "user.settings.tokens.copy": "Please copy the access token below. You won't be able to see it again!", "user.settings.tokens.create": "Create New Token", - "user.settings.tokens.title": "User Access Tokens", - "user.settings.tokens.clickToEdit": "Click 'Edit' to manage your user access tokens", + "user.settings.tokens.title": "Personal Access Tokens", + "user.settings.tokens.clickToEdit": "Click 'Edit' to manage your personal access tokens", "user.settings.security.active": "Active", "user.settings.security.close": "Close", "user.settings.security.currentPassword": "Current Password", diff --git a/webapp/sass/components/_alerts.scss b/webapp/sass/components/_alerts.scss index e0444de39..cb4c9c9e1 100644 --- a/webapp/sass/components/_alerts.scss +++ b/webapp/sass/components/_alerts.scss @@ -11,4 +11,3 @@ margin: 1px 0 0 10px; padding: 4px 10px; } - diff --git a/webapp/sass/components/_modal.scss b/webapp/sass/components/_modal.scss index f92ae042e..b98ec85c9 100644 --- a/webapp/sass/components/_modal.scss +++ b/webapp/sass/components/_modal.scss @@ -103,10 +103,6 @@ } } - .alert { - margin-bottom: 0; - } - .custom-textarea { border-color: $light-gray; color: inherit; -- cgit v1.2.3-1-g7c22