aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy <47277647+jeremy-davis-sonarsource@users.noreply.github.com>2019-02-08 15:38:46 +0100
committersonartech <sonartech@sonarsource.com>2019-02-11 09:11:45 +0100
commitf5d0d6237b0e52afcb1981953a7c08baee794915 (patch)
tree55d559a806a46539f5cf1ef3e8ffc1794c274580
parent223a718fb3dfdf1f49ae61d149ccaeb0b8e31b21 (diff)
downloadsonarqube-f5d0d6237b0e52afcb1981953a7c08baee794915.tar.gz
sonarqube-f5d0d6237b0e52afcb1981953a7c08baee794915.zip
Bugfixing (#1227)
* SONAR-11656 Fix Quality Profile changelog order * SONAR-11715 Fix license threshold modal close button * Fix account tokens header label
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/Changelog-test.tsx23
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
3 files changed, 25 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx
index 6a29ffc2ed7..ea5e152909c 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx
@@ -21,7 +21,6 @@ import * as React from 'react';
import { Link } from 'react-router';
import { sortBy } from 'lodash';
import * as isSameMinute from 'date-fns/is_same_minute';
-import * as startOfMinute from 'date-fns/start_of_minute';
import ChangesList from './ChangesList';
import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
import { translate } from '../../../helpers/l10n';
@@ -39,7 +38,7 @@ export default function Changelog(props: Props) {
const sortedRows = sortBy(
props.events,
// sort events by date, rounded to a minute, recent events first
- e => -Number(startOfMinute(parseDate(e.date))),
+ e => -Number(parseDate(e.date)),
e => e.action
);
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/Changelog-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/Changelog-test.tsx
index af66ac441e9..4afbc84b778 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/Changelog-test.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/Changelog-test.tsx
@@ -79,3 +79,26 @@ it('should render ChangesList', () => {
expect(changesList.length).toBe(1);
expect(changesList.prop('changes')).toBe(params);
});
+
+it('should render events sorted by time and action', () => {
+ const events = [
+ createEvent({ date: '2019-02-07T14:03:45', action: 'DEACTIVATED' }),
+ createEvent({ date: '2019-02-07T14:03:14', action: 'DEACTIVATED' }),
+ createEvent({ date: '2019-02-07T14:03:14', action: 'ACTIVATED' }),
+ createEvent({ date: '2019-02-07T14:03:07', action: 'ACTIVATED' })
+ ];
+ const changelog = shallow(<Changelog events={events} organization={null} />);
+ const rows = changelog.find('tbody').find('tr');
+
+ const getAction = (index: number) =>
+ rows
+ .at(index)
+ .childAt(2)
+ .childAt(0)
+ .text();
+
+ expect(getAction(0)).toBe('quality_profiles.changelog.DEACTIVATED');
+ expect(getAction(1)).toBe('quality_profiles.changelog.ACTIVATED');
+ expect(getAction(2)).toBe('quality_profiles.changelog.DEACTIVATED');
+ expect(getAction(3)).toBe('quality_profiles.changelog.ACTIVATED');
+});
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 909c8e9d0fe..ece2787933c 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -1503,7 +1503,7 @@ my_account.no_project_notifications=You have not set project notifications yet.
my_account.profile=Profile
my_account.security=Security
my_account.tokens_description=If you want to enforce security by not providing credentials of a real {instance} user to run your code scan or to invoke web services, you can provide a User Token as a replacement of the user login. This will increase the security of your installation by not letting your analysis user's password going through your network.
-my_account.tokens_last_usage=Last usage
+my_account.tokens_last_usage=Last use
my_account.projects=Projects
my_account.projects.description=Those projects are the ones you are administering.
my_account.projects.no_results=You are not administering any project yet.