From: Ambroise C Date: Thu, 13 Apr 2023 09:06:14 +0000 (+0200) Subject: SONAR-18964 Add column "Last SonarLint connection" to users list X-Git-Tag: 10.1.0.73491~446 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=52f08d64efd287608637fdfec2dd362ad4c590b9;p=sonarqube.git SONAR-18964 Add column "Last SonarLint connection" to users list --- diff --git a/server/sonar-web/src/main/js/apps/users/UsersList.tsx b/server/sonar-web/src/main/js/apps/users/UsersList.tsx index 8d20e705bbe..2b230b8cabd 100644 --- a/server/sonar-web/src/main/js/apps/users/UsersList.tsx +++ b/server/sonar-web/src/main/js/apps/users/UsersList.tsx @@ -19,6 +19,7 @@ */ import * as React from 'react'; import { CurrentUserContext } from '../../app/components/current-user/CurrentUserContext'; +import HelpTooltip from '../../components/controls/HelpTooltip'; import { translate } from '../../helpers/l10n'; import { IdentityProvider } from '../../types/types'; import { isLoggedIn, User } from '../../types/users'; @@ -51,6 +52,13 @@ export default function UsersList({ {translate('my_profile.scm_accounts')} {translate('users.last_connection')} + + {translate('users.last_sonarlint_connection')} + + {translate('my_profile.groups')} {translate('users.tokens')} {(manageProvider === undefined || users.some((u) => !u.managed)) && ( diff --git a/server/sonar-web/src/main/js/apps/users/__tests__/UsersApp-it.tsx b/server/sonar-web/src/main/js/apps/users/__tests__/UsersApp-it.tsx index 23fce172487..e3df7e0e1eb 100644 --- a/server/sonar-web/src/main/js/apps/users/__tests__/UsersApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/users/__tests__/UsersApp-it.tsx @@ -39,16 +39,16 @@ const ui = { managedFilter: byRole('button', { name: 'managed' }), localFilter: byRole('button', { name: 'local' }), showMore: byRole('button', { name: 'show_more' }), - aliceRow: byRole('row', { name: 'AM Alice Merveille alice.merveille never' }), + aliceRow: byRole('row', { name: 'AM Alice Merveille alice.merveille never never' }), aliceRowWithLocalBadge: byRole('row', { - name: 'AM Alice Merveille alice.merveille local never', + name: 'AM Alice Merveille alice.merveille local never never', }), aliceUpdateGroupButton: byRole('button', { name: 'users.update_users_groups.alice.merveille' }), aliceUpdateButton: byRole('button', { name: 'users.manage_user.alice.merveille' }), alicedDeactivateButton: byRole('button', { name: 'users.deactivate' }), bobUpdateGroupButton: byRole('button', { name: 'users.update_users_groups.bob.marley' }), bobUpdateButton: byRole('button', { name: 'users.manage_user.bob.marley' }), - bobRow: byRole('row', { name: 'BM Bob Marley bob.marley never' }), + bobRow: byRole('row', { name: 'BM Bob Marley bob.marley never never' }), loginInput: byRole('textbox', { name: /login/ }), userNameInput: byRole('textbox', { name: /name/ }), passwordInput: byLabelText(/password/), diff --git a/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx b/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx index 4d7ed05085f..601eb637aea 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx @@ -62,12 +62,15 @@ export default function UserListItem(props: UserListItemProps) { user={user} manageProvider={manageProvider} /> - + + + + + + + @@ -53,6 +62,7 @@ exports[`should render correctly 1`] = ` "managed": false, "name": "One", "scmAccounts": [], + "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100", } } /> @@ -84,6 +94,7 @@ exports[`should render correctly 1`] = ` "managed": false, "name": "One", "scmAccounts": [], + "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100", } } /> @@ -111,11 +122,12 @@ exports[`should render correctly without last connection date 1`] = ` "managed": false, "name": "One", "scmAccounts": [], + "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100", } } /> + + + @@ -144,6 +164,7 @@ exports[`should render correctly without last connection date 1`] = ` "managed": false, "name": "One", "scmAccounts": [], + "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100", } } /> @@ -175,6 +196,7 @@ exports[`should render correctly without last connection date 1`] = ` "managed": false, "name": "One", "scmAccounts": [], + "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100", } } /> diff --git a/server/sonar-web/src/main/js/types/users.ts b/server/sonar-web/src/main/js/types/users.ts index b5a5f55ba4c..c40de0fde6c 100644 --- a/server/sonar-web/src/main/js/types/users.ts +++ b/server/sonar-web/src/main/js/types/users.ts @@ -76,6 +76,7 @@ export interface User extends UserBase { externalProvider?: string; groups?: string[]; lastConnectionDate?: string; + sonarLintLastConnectionDate?: string; local: boolean; managed: boolean; scmAccounts?: string[]; diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 6290e025737..3d879075e4b 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -4397,6 +4397,8 @@ users.cannot_update_delegated_user=You cannot update the name and email of this users.minimum_x_characters=Minimum {0} characters users.email=Email users.last_connection=Last connection +users.last_sonarlint_connection=Last SonarLint connection +users.last_sonarlint_connection.help_text=The last time the user connected to this instance through SonarLint in connected mode. users.update_users_groups=Update {0}'s group membership users.update_groups=Update Groups users.manage_user=Update {0}