aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/quality-profiles/details
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-profiles/details')
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx10
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRules-test.tsx.snap10
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesDeprecatedWarning-test.tsx.snap11
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowOfType-test.tsx.snap44
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowTotal-test.tsx.snap40
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesSonarWayComparison-test.tsx.snap12
7 files changed, 115 insertions, 17 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
index c7a20068385..93bad2515b0 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx
@@ -91,17 +91,19 @@ export default class ProfileRules extends React.PureComponent<Props, State> {
loadAllRules() {
return searchRules({
languages: this.props.profile.language,
- ps: 1,
- facets: 'types'
+ facets: 'types',
+ organization: this.props.organization || undefined,
+ ps: 1
});
}
loadActivatedRules() {
return searchRules({
- qprofile: this.props.profile.key,
activation: 'true',
+ facets: 'types',
+ organization: this.props.organization || undefined,
ps: 1,
- facets: 'types'
+ qprofile: this.props.profile.key
});
}
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx
index 5ea85d8a669..e2cd08698ce 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx
@@ -30,7 +30,6 @@ interface Props {
}
export default function ProfileRulesDeprecatedWarning(props: Props) {
- const url = getDeprecatedActiveRulesUrl({ qprofile: props.profile }, props.organization);
return (
<div className="quality-profile-rules-deprecated clearfix">
<span className="pull-left">
@@ -39,7 +38,9 @@ export default function ProfileRulesDeprecatedWarning(props: Props) {
<i className="icon-help spacer-left" />
</Tooltip>
</span>
- <Link className="pull-right" to={url}>
+ <Link
+ className="pull-right"
+ to={getDeprecatedActiveRulesUrl({ qprofile: props.profile }, props.organization)}>
{props.activeDeprecatedRules}
</Link>
</div>
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRules-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRules-test.tsx.snap
index c366398e56e..2fd0450b1bd 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRules-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRules-test.tsx.snap
@@ -74,7 +74,15 @@ exports[`should show a button to activate more rules for admins 1`] = `
className="button js-activate-rules"
onlyActiveOnIndex={false}
style={Object {}}
- to="/organizations/foo/rules#qprofile=foo|activation=false"
+ to={
+ Object {
+ "pathname": "/organizations/foo/rules",
+ "query": Object {
+ "activation": "false",
+ "qprofile": "foo",
+ },
+ }
+ }
>
quality_profiles.activate_more
</Link>
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesDeprecatedWarning-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesDeprecatedWarning-test.tsx.snap
index 54fa91cc49d..4072c84db21 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesDeprecatedWarning-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesDeprecatedWarning-test.tsx.snap
@@ -21,7 +21,16 @@ exports[`should render correctly 1`] = `
className="pull-right"
onlyActiveOnIndex={false}
style={Object {}}
- to="/organizations/foo/rules#qprofile=bar|activation=true|statuses=DEPRECATED"
+ to={
+ Object {
+ "pathname": "/organizations/foo/rules",
+ "query": Object {
+ "activation": "true",
+ "qprofile": "bar",
+ "statuses": "DEPRECATED",
+ },
+ }
+ }
>
18
</Link>
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowOfType-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowOfType-test.tsx.snap
index 62866095c17..1a879d91adf 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowOfType-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowOfType-test.tsx.snap
@@ -17,7 +17,16 @@ exports[`should render correctly 1`] = `
<Link
onlyActiveOnIndex={false}
style={Object {}}
- to="/organizations/foo/rules#qprofile=bar|activation=true|types=BUG"
+ to={
+ Object {
+ "pathname": "/organizations/foo/rules",
+ "query": Object {
+ "activation": "true",
+ "qprofile": "bar",
+ "types": "BUG",
+ },
+ }
+ }
>
3
</Link>
@@ -29,7 +38,16 @@ exports[`should render correctly 1`] = `
className="small text-muted"
onlyActiveOnIndex={false}
style={Object {}}
- to="/organizations/foo/rules#qprofile=bar|activation=false|types=BUG"
+ to={
+ Object {
+ "pathname": "/organizations/foo/rules",
+ "query": Object {
+ "activation": "false",
+ "qprofile": "bar",
+ "types": "BUG",
+ },
+ }
+ }
>
7
</Link>
@@ -54,7 +72,16 @@ exports[`should render correctly if there is 0 rules 1`] = `
<Link
onlyActiveOnIndex={false}
style={Object {}}
- to="/coding_rules#qprofile=bar|activation=true|types=VULNERABILITY"
+ to={
+ Object {
+ "pathname": "/coding_rules",
+ "query": Object {
+ "activation": "true",
+ "qprofile": "bar",
+ "types": "VULNERABILITY",
+ },
+ }
+ }
>
0
</Link>
@@ -88,7 +115,16 @@ exports[`should render correctly if there is missing data 1`] = `
<Link
onlyActiveOnIndex={false}
style={Object {}}
- to="/coding_rules#qprofile=bar|activation=true|types=VULNERABILITY"
+ to={
+ Object {
+ "pathname": "/coding_rules",
+ "query": Object {
+ "activation": "true",
+ "qprofile": "bar",
+ "types": "VULNERABILITY",
+ },
+ }
+ }
>
5
</Link>
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowTotal-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowTotal-test.tsx.snap
index f8686659326..05ad9a31580 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowTotal-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesRowTotal-test.tsx.snap
@@ -13,7 +13,15 @@ exports[`should render correctly 1`] = `
<Link
onlyActiveOnIndex={false}
style={Object {}}
- to="/organizations/foo/rules#qprofile=bar|activation=true"
+ to={
+ Object {
+ "pathname": "/organizations/foo/rules",
+ "query": Object {
+ "activation": "true",
+ "qprofile": "bar",
+ },
+ }
+ }
>
<strong>
3
@@ -27,7 +35,15 @@ exports[`should render correctly 1`] = `
className="small text-muted"
onlyActiveOnIndex={false}
style={Object {}}
- to="/organizations/foo/rules#qprofile=bar|activation=false"
+ to={
+ Object {
+ "pathname": "/organizations/foo/rules",
+ "query": Object {
+ "activation": "false",
+ "qprofile": "bar",
+ },
+ }
+ }
>
<strong>
7
@@ -50,7 +66,15 @@ exports[`should render correctly if there is 0 rules 1`] = `
<Link
onlyActiveOnIndex={false}
style={Object {}}
- to="/coding_rules#qprofile=bar|activation=true"
+ to={
+ Object {
+ "pathname": "/coding_rules",
+ "query": Object {
+ "activation": "true",
+ "qprofile": "bar",
+ },
+ }
+ }
>
<strong>
0
@@ -82,7 +106,15 @@ exports[`should render correctly if there is missing data 1`] = `
<Link
onlyActiveOnIndex={false}
style={Object {}}
- to="/coding_rules#qprofile=bar|activation=true"
+ to={
+ Object {
+ "pathname": "/coding_rules",
+ "query": Object {
+ "activation": "true",
+ "qprofile": "bar",
+ },
+ }
+ }
>
<strong>
5
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesSonarWayComparison-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesSonarWayComparison-test.tsx.snap
index 481846b23ad..7edb44e1c23 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesSonarWayComparison-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRulesSonarWayComparison-test.tsx.snap
@@ -21,7 +21,17 @@ exports[`should render correctly 1`] = `
className="pull-right"
onlyActiveOnIndex={false}
style={Object {}}
- to="/organizations/foo/rules#qprofile=bar|activation=false|compareToProfile=baz|languages=Java"
+ to={
+ Object {
+ "pathname": "/organizations/foo/rules",
+ "query": Object {
+ "activation": "false",
+ "compareToProfile": "baz",
+ "languages": "Java",
+ "qprofile": "bar",
+ },
+ }
+ }
>
158
</Link>