From 9e0d06262a0bb9bc262f228688c7989e92fea486 Mon Sep 17 00:00:00 2001 From: Philippe Perrin Date: Fri, 16 Apr 2021 14:48:03 +0200 Subject: [PATCH] SONAR-12082 Fix broken layout on rules page --- .../js/apps/coding-rules/components/App.tsx | 44 ++--- .../coding-rules/components/BulkChange.tsx | 1 - .../coding-rules/components/PageActions.tsx | 2 +- .../__tests__/__snapshots__/App-test.tsx.snap | 170 ++++++++++-------- .../__snapshots__/BulkChange-test.tsx.snap | 1 - .../__snapshots__/PageActions-test.tsx.snap | 6 +- 6 files changed, 120 insertions(+), 104 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx index aa85dcf6644..4c4cd01d70e 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx @@ -595,27 +595,29 @@ export class App extends React.PureComponent {
- {this.state.openRule ? ( - - - {this.state.usingPermalink - ? translate('coding_rules.see_all') - : translate('coding_rules.return_to_list')} - - ) : ( - this.renderBulkButton() - )} - {!this.state.usingPermalink && ( - - )} +
+ {this.state.openRule ? ( + + + {this.state.usingPermalink + ? translate('coding_rules.see_all') + : translate('coding_rules.return_to_list')} + + ) : ( + this.renderBulkButton() + )} + {!this.state.usingPermalink && ( + + )} +
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx index d07f5e43566..a9bd55566d3 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx @@ -100,7 +100,6 @@ export default class BulkChange extends React.PureComponent { return ( <> diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx index 4c4d8b9ed4d..c8b1ce624c0 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx @@ -33,7 +33,7 @@ export interface PageActionsProps { export default function PageActions(props: PageActionsProps) { return ( -
+
- + - + + selectedIndex={0} + /> +
@@ -315,10 +319,14 @@ exports[`should render correctly: loading 1`] = ` - +
+ +
@@ -447,28 +455,32 @@ exports[`should render correctly: open rule 1`] = ` - - - coding_rules.return_to_list - - + + coding_rules.return_to_list + + + selectedIndex={0} + /> + @@ -531,16 +543,20 @@ exports[`should render correctly: using permalink 1`] = ` - - - coding_rules.see_all - + + + coding_rules.see_all + + diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/BulkChange-test.tsx.snap b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/BulkChange-test.tsx.snap index 89150cbd13d..45021122b8d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/BulkChange-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/BulkChange-test.tsx.snap @@ -63,7 +63,6 @@ exports[`should not a disabled button when edition is not possible 1`] = ` exports[`should render correctly 1`] = `