aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx')
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/ResolutionFacet.tsx11
1 files changed, 8 insertions, 3 deletions
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 32578f5dc75..c437f10efc4 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
@@ -37,6 +37,7 @@ interface Props {
resolved: boolean;
resolutions: string[];
stats: Dict<number> | undefined;
+ forceShow: boolean;
}
const RESOLUTIONS = [
@@ -55,10 +56,10 @@ export default class ResolutionFacet extends React.PureComponent<Props> {
};
handleItemClick = (itemValue: string, multiple: boolean) => {
- const { resolutions } = this.props;
+ const { resolutions, resolved } = this.props;
if (itemValue === '') {
// unresolved
- this.props.onChange({ resolved: !this.props.resolved, resolutions: [] });
+ this.props.onChange({ resolved: !resolved, resolutions: [] });
} else if (multiple) {
const newValue = orderBy(
resolutions.includes(itemValue)
@@ -115,9 +116,13 @@ export default class ResolutionFacet extends React.PureComponent<Props> {
};
render() {
- const { fetching, open, resolutions, stats = {} } = this.props;
+ const { resolutions, stats = {}, forceShow, fetching, open } = this.props;
const values = resolutions.map((resolution) => this.getFacetItemName(resolution));
+ if (values.length < 1 && !forceShow) {
+ return null;
+ }
+
return (
<FacetBox property={this.property}>
<FacetHeader