From 2c05aa5ac2f73714c6fd6d11d532c980ae4da26f Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Wed, 4 Oct 2017 16:00:17 +0200 Subject: SONAR-9495 Better rendering of long parameter value in QP changelog --- .../js/apps/quality-profiles/changelog/Changelog.tsx | 6 +++--- .../quality-profiles/changelog/ParameterChange.tsx | 19 ++++++------------- .../quality-profiles/changelog/SeverityChange.tsx | 2 +- .../src/main/js/apps/quality-profiles/styles.css | 9 +++++++++ 4 files changed, 19 insertions(+), 17 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 422ee1b8a81..5c5250d52ea 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 @@ -74,13 +74,13 @@ export default function Changelog(props: Props) { {!isBulkChange && translate('quality_profiles.changelog', event.action)} - + {event.ruleName} - {event.params && } + {event.params && } ); }); @@ -95,7 +95,7 @@ export default function Changelog(props: Props) { {translate('user')} {translate('action')} {translate('rule')} - {translate('parameters')} + {translate('parameters')} {rows} diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ParameterChange.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ParameterChange.tsx index d62d11d7c25..e8d2ec75551 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ParameterChange.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/ParameterChange.tsx @@ -26,20 +26,13 @@ interface Props { } export default function ParameterChange({ name, value }: Props) { - if (value == null) { - return ( -
- {translateWithParameters( - 'quality_profiles.changelog.parameter_reset_to_default_value', - name - )} -
- ); - } - return ( -
- {translateWithParameters('quality_profiles.parameter_set_to', name, value)} +
+ {value == null ? ( + translateWithParameters('quality_profiles.changelog.parameter_reset_to_default_value', name) + ) : ( + translateWithParameters('quality_profiles.parameter_set_to', name, value) + )}
); } diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/SeverityChange.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/SeverityChange.tsx index 3c744e731a9..f48045dc07d 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/changelog/SeverityChange.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/changelog/SeverityChange.tsx @@ -27,7 +27,7 @@ interface Props { export default function SeverityChange({ severity }: Props) { return ( -
+
{translate('quality_profiles.severity_set_to')}
); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/styles.css b/server/sonar-web/src/main/js/apps/quality-profiles/styles.css index 84993d5134f..cf390d50180 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/styles.css +++ b/server/sonar-web/src/main/js/apps/quality-profiles/styles.css @@ -77,3 +77,12 @@ .quality-profile-comparison-table { table-layout: fixed; } + +.quality-profile-changelog-rule-cell { + line-height: 1.5; +} + +.quality-profile-changelog-parameter { + max-width: 270px; + word-break: break-word; +} -- cgit v1.2.3