Просмотр исходного кода

Bugfixing (#1227)

* SONAR-11656 Fix Quality Profile changelog order
* SONAR-11715 Fix license threshold modal close button
* Fix account tokens header label
tags/7.7
Jeremy 5 лет назад
Родитель
Сommit
f5d0d6237b

+ 1
- 2
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
);


+ 23
- 0
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');
});

+ 1
- 1
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.

Загрузка…
Отмена
Сохранить