aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-web/src/main/js/apps/users/UsersList.tsx8
-rw-r--r--server/sonar-web/src/main/js/apps/users/__tests__/UsersApp-it.tsx6
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx1
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserListItem-test.tsx.snap26
-rw-r--r--server/sonar-web/src/main/js/types/users.ts1
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
7 files changed, 43 insertions, 6 deletions
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({
<th className="nowrap" />
<th className="nowrap">{translate('my_profile.scm_accounts')}</th>
<th className="nowrap">{translate('users.last_connection')}</th>
+ <th className="nowrap">
+ {translate('users.last_sonarlint_connection')}
+ <HelpTooltip
+ className="sw-ml-1"
+ overlay={translate('users.last_sonarlint_connection.help_text')}
+ />
+ </th>
<th className="nowrap">{translate('my_profile.groups')}</th>
<th className="nowrap">{translate('users.tokens')}</th>
{(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,13 +62,16 @@ export default function UserListItem(props: UserListItemProps) {
user={user}
manageProvider={manageProvider}
/>
- <td className="thin nowrap text-middle">
+ <td className="thin text-middle">
<UserScmAccounts scmAccounts={user.scmAccounts || []} />
</td>
<td className="thin nowrap text-middle">
<DateFromNow date={user.lastConnectionDate} hourPrecision={true} />
</td>
<td className="thin nowrap text-middle">
+ <DateFromNow date={user.sonarLintLastConnectionDate} hourPrecision={true} />
+ </td>
+ <td className="thin nowrap text-middle">
<UserGroups
groups={user.groups || []}
manageProvider={manageProvider}
diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx
index cfd69e9e579..76b58716685 100644
--- a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx
@@ -29,6 +29,7 @@ jest.mock('../../../../components/intl/DateTimeFormatter');
const user: User = {
active: true,
lastConnectionDate: '2019-01-18T15:06:33+0100',
+ sonarLintLastConnectionDate: '2019-01-16T15:06:33+0100',
local: false,
login: 'obi',
name: 'One',
diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserListItem-test.tsx.snap b/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserListItem-test.tsx.snap
index 513b7808d29..536a0a54c27 100644
--- a/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserListItem-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserListItem-test.tsx.snap
@@ -20,11 +20,12 @@ exports[`should render correctly 1`] = `
"managed": false,
"name": "One",
"scmAccounts": [],
+ "sonarLintLastConnectionDate": "2019-01-16T15:06:33+0100",
}
}
/>
<td
- className="thin nowrap text-middle"
+ className="thin text-middle"
>
<UserScmAccounts
scmAccounts={[]}
@@ -41,6 +42,14 @@ exports[`should render correctly 1`] = `
<td
className="thin nowrap text-middle"
>
+ <DateFromNow
+ date="2019-01-16T15:06:33+0100"
+ hourPrecision={true}
+ />
+ </td>
+ <td
+ className="thin nowrap text-middle"
+ >
<UserGroups
groups={[]}
onUpdateUsers={[MockFunction]}
@@ -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",
}
}
/>
<td
- className="thin nowrap text-middle"
+ className="thin text-middle"
>
<UserScmAccounts
scmAccounts={[]}
@@ -132,6 +144,14 @@ exports[`should render correctly without last connection date 1`] = `
<td
className="thin nowrap text-middle"
>
+ <DateFromNow
+ date="2019-01-16T15:06:33+0100"
+ hourPrecision={true}
+ />
+ </td>
+ <td
+ className="thin nowrap text-middle"
+ >
<UserGroups
groups={[]}
onUpdateUsers={[MockFunction]}
@@ -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}