From: Wouter Admiraal Date: Mon, 22 Feb 2021 11:30:21 +0000 (+0100) Subject: SONAR-14483 Don't show new code filter on issues page for portfolios X-Git-Tag: 8.8.0.42792~120 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa4e58413d81026bce22445882d1379a4f65929b;p=sonarqube.git SONAR-14483 Don't show new code filter on issues page for portfolios --- 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 4c7b00194a7..b05c71c38d3 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 @@ -34,6 +34,7 @@ import DateRangeInput from '../../../components/controls/DateRangeInput'; import FacetBox from '../../../components/facet/FacetBox'; import FacetHeader from '../../../components/facet/FacetHeader'; import FacetItem from '../../../components/facet/FacetItem'; +import { isPortfolioLike } from '../../../types/component'; import { Query } from '../utils'; interface Props { @@ -229,7 +230,7 @@ export class CreationDateFacet extends React.PureComponent - {component ? ( + {component && !isPortfolioLike(component.qualifier) ? ( { @@ -40,6 +41,9 @@ it('should render correctly', () => { }) ).toMatchSnapshot('created after timestamp'); expect(shallowRender({ component: mockComponent() })).toMatchSnapshot('project'); + expect( + shallowRender({ component: mockComponent({ qualifier: ComponentQualifier.Portfolio }) }) + ).toMatchSnapshot('portfolio'); }); it.each([ diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/CreationDateFacet-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/CreationDateFacet-test.tsx.snap index e073a3a2358..d3936e2f771 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/CreationDateFacet-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/CreationDateFacet-test.tsx.snap @@ -357,6 +357,80 @@ exports[`should render correctly: created at 1`] = ` `; +exports[`should render correctly: portfolio 1`] = ` + + +
+
+ +
+
+ + + + +
+
+
+`; + exports[`should render correctly: project 1`] = `