]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-17726 Remove the "reload" link on the Rules page (#7205)
authorDavid Cho-Lerat <117642976+david-cho-lerat-sonarsource@users.noreply.github.com>
Fri, 9 Dec 2022 15:35:30 +0000 (16:35 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 9 Dec 2022 20:03:10 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/PageActions-test.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/PageActions-test.tsx.snap

index 8b06ba939e5d64351c75e4e27e13faeeb238a335..e14c9daa65794ef9745c913a1a9e41aeba53a66f 100644 (file)
@@ -624,12 +624,7 @@ export class App extends React.PureComponent<Props, State> {
                       this.renderBulkButton()
                     )}
                     {!usingPermalink && (
-                      <PageActions
-                        loading={this.state.loading}
-                        onReload={this.handleReload}
-                        paging={paging}
-                        selectedIndex={selectedIndex}
-                      />
+                      <PageActions paging={paging} selectedIndex={selectedIndex} />
                     )}
                   </div>
                 </div>
index f2090308027b5acf0e7f58b6ab4b1d025ea2b3cc..16847565f79be894a8a629a62b66d585090b3f39 100644 (file)
  */
 import * as React from 'react';
 import PageCounter from '../../../components/common/PageCounter';
-import ReloadButton from '../../../components/controls/ReloadButton';
-import DeferredSpinner from '../../../components/ui/DeferredSpinner';
 import PageShortcutsTooltip from '../../../components/ui/PageShortcutsTooltip';
 import { translate } from '../../../helpers/l10n';
 import { Paging } from '../../../types/types';
 
 export interface PageActionsProps {
-  loading: boolean;
-  onReload: () => void;
   paging?: Paging;
   selectedIndex?: number;
 }
@@ -41,10 +37,6 @@ export default function PageActions(props: PageActionsProps) {
         upAndDownLabel={translate('coding_rules.to_select_rules')}
       />
 
-      <DeferredSpinner loading={props.loading}>
-        <ReloadButton onClick={props.onReload} />
-      </DeferredSpinner>
-
       {props.paging && (
         <PageCounter
           className="spacer-left"
index caa1dd1b0e5d6c946181ccee86d0081d958be02b..ab677f7550d54b8b058266b12db30086d2a2ebd1 100644 (file)
@@ -24,10 +24,9 @@ import PageActions, { PageActionsProps } from '../PageActions';
 
 it('should render correctly', () => {
   expect(shallowRender()).toMatchSnapshot('default');
-  expect(shallowRender({ loading: true })).toMatchSnapshot('loading');
   expect(shallowRender({ paging: { total: 100 } as Paging })).toMatchSnapshot('with paging');
 });
 
 function shallowRender(props: Partial<PageActionsProps> = {}) {
-  return shallow<PageActionsProps>(<PageActions loading={false} onReload={jest.fn()} {...props} />);
+  return shallow<PageActionsProps>(<PageActions {...props} />);
 }
index 8c93e7442c98898555be0bb1b3c4af1015f40d8e..f90b687a909016cba3e7b507aee3db2a7a180733 100644 (file)
@@ -252,8 +252,6 @@ exports[`should render correctly: loaded 1`] = `
                 total={0}
               />
               <PageActions
-                loading={false}
-                onReload={[Function]}
                 paging={
                   Object {
                     "pageIndex": 0,
@@ -383,10 +381,7 @@ exports[`should render correctly: loading 1`] = `
               className="display-flex-space-between"
             >
               <div />
-              <PageActions
-                loading={true}
-                onReload={[Function]}
-              />
+              <PageActions />
             </div>
           </div>
         </div>
index b9407f80f4b4ec6bd8b3e7c1da709edc0a2c237b..c8c2a7420a6b6c3b2df4638f305820d41723fbe7 100644 (file)
@@ -9,32 +9,6 @@ exports[`should render correctly: default 1`] = `
     leftAndRightLabel="issues.to_navigate"
     upAndDownLabel="coding_rules.to_select_rules"
   />
-  <DeferredSpinner
-    loading={false}
-  >
-    <ReloadButton
-      onClick={[MockFunction]}
-    />
-  </DeferredSpinner>
-</div>
-`;
-
-exports[`should render correctly: loading 1`] = `
-<div
-  className="display-flex-center"
->
-  <PageShortcutsTooltip
-    className="big-spacer-right"
-    leftAndRightLabel="issues.to_navigate"
-    upAndDownLabel="coding_rules.to_select_rules"
-  />
-  <DeferredSpinner
-    loading={true}
-  >
-    <ReloadButton
-      onClick={[MockFunction]}
-    />
-  </DeferredSpinner>
 </div>
 `;
 
@@ -47,13 +21,6 @@ exports[`should render correctly: with paging 1`] = `
     leftAndRightLabel="issues.to_navigate"
     upAndDownLabel="coding_rules.to_select_rules"
   />
-  <DeferredSpinner
-    loading={false}
-  >
-    <ReloadButton
-      onClick={[MockFunction]}
-    />
-  </DeferredSpinner>
   <PageCounter
     className="spacer-left"
     label="coding_rules._rules"