From fa4e58413d81026bce22445882d1379a4f65929b Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Mon, 22 Feb 2021 12:30:21 +0100 Subject: [PATCH] SONAR-14483 Don't show new code filter on issues page for portfolios --- .../apps/issues/sidebar/CreationDateFacet.tsx | 3 +- .../__tests__/CreationDateFacet-test.tsx | 4 + .../CreationDateFacet-test.tsx.snap | 74 +++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) 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`] = `