From: Wouter Admiraal Date: Fri, 15 Jul 2022 10:27:11 +0000 (+0200) Subject: SONAR-12270 Fix confusing deprecated param badge X-Git-Tag: 9.6.0.59041~215 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=27a39bde6814a0498fa3aeb86b9e2163f2007bd0;p=sonarqube.git SONAR-12270 Fix confusing deprecated param badge --- diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx b/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx index 6312309f071..b2b63f0ba0f 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx @@ -47,18 +47,6 @@ export default class Params extends React.PureComponent { )} - {this.props.showDeprecated && param.deprecatedKey && ( -
- {param.deprecatedKey} -
- )} - - {this.props.showDeprecated && param.deprecatedKey && param.deprecatedKeySince && ( -
- -
- )} -
{param.required ? 'required' : 'optional'}
{param.since && ( @@ -66,6 +54,18 @@ export default class Params extends React.PureComponent { {translateWithParameters('since_x', param.since)} )} + + {this.props.showDeprecated && param.deprecatedKey && ( +
+
{translate('replaces')}:
+ {param.deprecatedKey} + {param.deprecatedKeySince && ( +
+ +
+ )} +
+ )} ); } diff --git a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/Params-test.tsx b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/Params-test.tsx index f4e8284be00..70c17c3cb23 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/Params-test.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/Params-test.tsx @@ -48,7 +48,7 @@ it('should not render deprecated parameters', () => { it('should render deprecated key', () => { const params = [ - { ...DEFAULT_PARAM, deprecatedKey: 'foo-deprecated', deprecatedSince: '5.0' }, + { ...DEFAULT_PARAM, deprecatedKey: 'foo-deprecated', deprecatedKeySince: '5.0' }, { ...DEFAULT_PARAM, deprecatedSince: '5.0', internal: true } ]; expect( diff --git a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/Params-test.tsx.snap b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/Params-test.tsx.snap index 67798d734fb..fa368985497 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/Params-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/Params-test.tsx.snap @@ -137,23 +137,29 @@ exports[`should render deprecated key 1`] = ` foo
- + optional
+
+ replaces + : +
foo-deprecated -
-
- optional +
+ +
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 43a38d5a5c9..8ed3dc0259c 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -162,6 +162,7 @@ refresh=Refresh reload=Reload remove=Remove rename=Rename +replaces=Replaces reset_verb=Reset reset_to_default=Reset To Default resolution=Resolution