From 2bf160e29360643f447b03c0e9e301f5ab6fb481 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Mon, 24 Jun 2019 10:29:46 +0200 Subject: [PATCH] SONAR-12167 Prevent facet spinner from overlapping with button --- .../apps/issues/sidebar/CreationDateFacet.tsx | 3 +- .../apps/issues/sidebar/ResolutionFacet.tsx | 3 +- .../js/apps/issues/sidebar/SeverityFacet.tsx | 3 +- .../js/apps/issues/sidebar/StandardFacet.tsx | 7 ++-- .../js/apps/issues/sidebar/StatusFacet.tsx | 3 +- .../main/js/apps/issues/sidebar/TypeFacet.tsx | 3 +- .../__snapshots__/StandardFacet-test.tsx.snap | 20 ++-------- .../__snapshots__/StatusFacet-test.tsx.snap | 5 +-- .../__snapshots__/TypeFacet-test.tsx.snap | 5 +-- .../main/js/components/facet/FacetHeader.tsx | 14 +++++-- .../js/components/facet/ListStyleFacet.tsx | 3 +- .../facet/__tests__/FacetHeader-test.tsx | 4 ++ .../__snapshots__/FacetHeader-test.tsx.snap | 34 +++++++++++++--- .../ListStyleFacet-test.tsx.snap | 40 ++++--------------- .../main/js/components/search-navigator.css | 5 --- 15 files changed, 66 insertions(+), 86 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx index ba6b59c2df9..13bf358cbc1 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx @@ -32,7 +32,6 @@ import DateRangeInput from '../../../components/controls/DateRangeInput'; import { isSameDay, parseDate } from '../../../helpers/dates'; import { translate } from '../../../helpers/l10n'; import { formatMeasure } from '../../../helpers/measures'; -import DeferredSpinner from '../../../components/common/DeferredSpinner'; interface Props { component: T.Component | undefined; @@ -279,6 +278,7 @@ class CreationDateFacet extends React.PureComponent { return ( { values={this.getValues()} /> - {this.props.open && this.renderInner()} ); diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx index 958245f1ad6..8a667b7d93d 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx @@ -25,7 +25,6 @@ import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; import { translate } from '../../../helpers/l10n'; -import DeferredSpinner from '../../../components/common/DeferredSpinner'; import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint'; interface Props { @@ -116,6 +115,7 @@ export default class ResolutionFacet extends React.PureComponent { { values={values} /> - {this.props.open && ( <> {RESOLUTIONS.map(this.renderItem)} diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx index 4bd9b25755a..0a8916e945d 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx @@ -26,7 +26,6 @@ import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; import SeverityHelper from '../../../components/shared/SeverityHelper'; import { translate } from '../../../helpers/l10n'; -import DeferredSpinner from '../../../components/common/DeferredSpinner'; import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint'; interface Props { @@ -100,6 +99,7 @@ export default class SeverityFacet extends React.PureComponent { return ( { values={values} /> - {this.props.open && ( <> {SEVERITIES.map(this.renderItem)} diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx index 51dde5811c3..d932ecdc790 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx @@ -19,7 +19,6 @@ */ import * as React from 'react'; import { sortBy, without, omit } from 'lodash'; -import DeferredSpinner from '../../../components/common/DeferredSpinner'; import FacetBox from '../../../components/facet/FacetBox'; import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; @@ -300,6 +299,7 @@ export default class StandardFacet extends React.PureComponent { <> { renderSonarSourceSecurityCategory(this.state.standards, item) )} /> - {this.props.sonarsourceSecurityOpen && ( <> {this.renderSonarSourceSecurityList()} @@ -317,6 +316,7 @@ export default class StandardFacet extends React.PureComponent { { renderOwaspTop10Category(this.state.standards, item) )} /> - {this.props.owaspTop10Open && ( <> {this.renderOwaspTop10List()} @@ -334,6 +333,7 @@ export default class StandardFacet extends React.PureComponent { { renderSansTop25Category(this.state.standards, item) )} /> - {this.props.sansTop25Open && ( <> {this.renderSansTop25List()} diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx index ea83e7a20c2..33ef4e83e7d 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx @@ -26,7 +26,6 @@ import FacetItem from '../../../components/facet/FacetItem'; import FacetItemsList from '../../../components/facet/FacetItemsList'; import StatusHelper from '../../../components/shared/StatusHelper'; import { translate } from '../../../helpers/l10n'; -import DeferredSpinner from '../../../components/common/DeferredSpinner'; import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint'; interface Props { @@ -100,6 +99,7 @@ export default class StatusFacet extends React.PureComponent { return ( { values={values} /> - {this.props.open && ( <> diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx index 3c4b92588bd..bf3d9f9f428 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx @@ -21,7 +21,6 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { Link } from 'react-router'; import { orderBy, without } from 'lodash'; -import DeferredSpinner from '../../../components/common/DeferredSpinner'; import FacetBox from '../../../components/facet/FacetBox'; import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; @@ -143,6 +142,7 @@ export class TypeFacet extends React.PureComponent { { values={values} /> - {this.props.open && ( <> {ISSUE_TYPES.map(this.renderItem)} diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/StandardFacet-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/StandardFacet-test.tsx.snap index 363f646c08b..a38caf5b816 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/StandardFacet-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/StandardFacet-test.tsx.snap @@ -20,15 +20,12 @@ exports[`should render empty sub-facet 1`] = ` property="sansTop25" > -
@@ -64,6 +61,7 @@ exports[`should render sub-facets 1`] = ` property="sonarsourceSecurity" > - - - - diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/TypeFacet-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/TypeFacet-test.tsx.snap index 2f78c19d462..47aafc2c20b 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/TypeFacet-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/TypeFacet-test.tsx.snap @@ -99,6 +99,7 @@ exports[`should render open by default 1`] = ` > - void; @@ -69,7 +71,7 @@ export default class FacetHeader extends React.PureComponent { this.props.values != null && this.props.values.length > 0 && this.props.onClear != null; return ( -
+
{this.props.onClick ? ( @@ -91,6 +93,12 @@ export default class FacetHeader extends React.PureComponent { {this.renderValueIndicator()} + {this.props.fetching && ( + + + + )} + {showClearButton && (