// their concurrent execution even in case when one or more of these tasks not
// scheduled.
def yarnInstallTasks = allprojects.findResults { it -> it.tasks.findByName('yarn') }
+
+// Drop :server:sonar-ui-common:yarn from the list because it will be creating a circular dependency
+yarnInstallTasks.eachWithIndex { t, i -> if (t.path == ':server:sonar-ui-common:yarn') yarnInstallTasks.remove(i) }
+
yarnInstallTasks.drop(1).eachWithIndex { it, i -> it.mustRunAfter(yarnInstallTasks[0..i]) }
// by default, Yarn will update lock file if it is not up to date with "package.json"
}
}
+yarn.configure {
+ dependsOn tasks.getByPath(':server:sonar-ui-common:yarn_run')
+}
+
yarn_run {
def docsVersion = version.split("[.-]").take(2).join('.')
environment = [ GATSBY_DOCS_VERSION: docsVersion ]
"react-helmet": "5.2.1",
"react-typography": "0.16.19",
"rehype-react": "6.1.0",
- "sonar-ui-common": "1.0.33",
+ "sonar-ui-common": "../sonar-ui-common/build/dist",
"typography": "0.16.19"
},
"devDependencies": {
faye-websocket "^0.10.0"
uuid "^3.0.1"
-sonar-ui-common@1.0.33:
+sonar-ui-common@../sonar-ui-common/build/dist:
version "1.0.33"
- resolved "https://repox.jfrog.io/repox/api/npm/npm/sonar-ui-common/-/sonar-ui-common-1.0.33.tgz#8eb6f40b1ab81b802a8eb92fd549598432e9dc26"
- integrity sha1-jrb0Cxq4G4Aqjrkv1UlZhDLp3CY=
dependencies:
"@types/react-select" "1.2.6"
classnames "2.2.6"
+++ /dev/null
-/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
\ No newline at end of file
--- /dev/null
+description = 'SonarSource :: Sonar UI Common'
+
+sonarqube {
+ properties {
+ property "sonar.sources", "components,helpers"
+ property "sonar.exclusions", "**/__tests__/**"
+ property "sonar.test", "components,helpers"
+ property "sonar.test.inclusions", "**/__tests__/**"
+ property "sonar.eslint.reportPaths", "eslint-report.json"
+ property "sonar.javascript.lcov.reportPaths", "coverage/lcov.info"
+ property "sonar.coverage.exclusions", "components/icons/*,helpers/testUtils.ts,helpers/keycodes.ts"
+ property "sonar.typescript.lcov.reportPaths", "build/coverage/lcov.info"
+ property "sonar.eslint.reportPaths", "build/eslint-report.json"
+ }
+}
+
+yarn_run {
+ ['config', 'scripts', 'components', 'helpers'].each {
+ inputs.dir(it).withPathSensitivity(PathSensitivity.RELATIVE)
+ }
+ ['package.json', 'tsconfig.json', 'yarn.lock'].each {
+ inputs.file(it).withPathSensitivity(PathSensitivity.RELATIVE)
+ }
+ outputs.cacheIf { true }
+ args = ['build']
+ ignoreExitValue = false
+}
+
+"yarn_check-ci" {
+ // Note that outputs are not relocatable, because contain absolute paths, and that's why inputs are not relativized
+ ['config', 'scripts', 'components', 'helpers'].each {
+ inputs.dir(it)
+ }
+ ['package.json', 'yarn.lock', 'tsconfig.json'].each {
+ inputs.file(it)
+ }
+
+ dependsOn(yarn)
+}
+
+"yarn_validate-ci" {
+ // Note that outputs are not relocatable, because contain absolute paths, and that's why inputs are not relativized
+ ['config', 'scripts', 'components', 'helpers'].each {
+ inputs.dir(it)
+ }
+ ['.eslintrc', 'package.json', 'yarn.lock', 'tsconfig.json'].each {
+ inputs.file(it)
+ }
+ outputs.file("eslint-report.json")
+ outputs.dir("coverage")
+ outputs.cacheIf { true }
+
+ dependsOn(yarn)
+}
+
+def sources = fileTree(dir: "components") + fileTree(dir: "config") + fileTree(dir: "helpers")
+
+task licenseCheckWeb(type: com.hierynomus.gradle.license.tasks.LicenseCheck) {
+ source = sources
+}
+licenseMain.dependsOn licenseCheckWeb
+
+task licenseFormatWeb(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {
+ source = sources
+}
+licenseFormat.dependsOn licenseFormatWeb
\ No newline at end of file
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
const parentBbox = event.currentTarget.getBoundingClientRect();
const mouseXPos = (event.pageX - parentBbox.left) / parentBbox.width;
const xRange = xScale.range();
+
const speed = event.deltaMode
? (25 / event.deltaMode) * this.props.zoomSpeed
: this.props.zoomSpeed;
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
xArray[1] > xRange[0] && xArray[1] < xRange[xRange.length - 1]
? xScale.invert(xArray[1])
: undefined;
- if (this.props.startDate !== startDate || this.props.endDate !== endDate) {
- this.props.updateZoom(startDate, endDate);
- }
+ this.props.updateZoom(startDate, endDate);
};
renderBaseLine = (xScale: XScale, yScale: YScale) => {
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
jest.mock('lodash', () => {
const lodash = jest.requireActual('lodash');
- return { ...lodash, throttle: (f) => f };
+ return { ...lodash, throttle: (f: any) => f };
});
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ disableZoom: false, updateZoom: () => {} })).toMatchSnapshot(
+ 'Zoom enabled'
+ );
+ expect(shallowRender({ formatYTick: (t) => `Nicer tick ${t}` })).toMatchSnapshot('format y tick');
+ expect(shallowRender({ width: undefined })).toMatchSnapshot('no width');
+ expect(shallowRender({ height: undefined })).toMatchSnapshot('no height');
+ expect(shallowRender({ showAreas: undefined })).toMatchSnapshot('no areas');
});
it('should render leak correctly', () => {
expect(updateTooltip).toBeCalled();
});
+it('should handle scroll correcly', () => {
+ let updateZoom = jest.fn();
+ let preventDefault = jest.fn();
+ let wrapper = shallowRender({ updateZoom });
+ wrapper.instance().handleWheel(({
+ preventDefault,
+ deltaX: 1,
+ deltaY: -2,
+ deltaZ: 0,
+ pageX: 100,
+ pageY: 1,
+ currentTarget: ({
+ getBoundingClientRect: () => ({
+ bottom: 0,
+ height: 100,
+ width: 50,
+ left: 0,
+ right: 0,
+ top: 10,
+ x: 12,
+ y: 23,
+ toJSON: () => '',
+ }),
+ } as any) as SVGElement,
+ } as any) as React.WheelEvent<SVGElement>);
+ expect(preventDefault).toBeCalled();
+ expect(updateZoom).toBeCalledWith(new Date('2019-10-01T06:24:00.000Z'), undefined);
+
+ updateZoom = jest.fn();
+ preventDefault = jest.fn();
+ wrapper = shallowRender({ updateZoom });
+ wrapper.instance().handleWheel(({
+ preventDefault,
+ deltaX: 1,
+ deltaY: 2,
+ deltaZ: 0,
+ pageX: 100,
+ pageY: 1,
+ deltaMode: 25,
+ currentTarget: ({
+ getBoundingClientRect: () => ({
+ bottom: 0,
+ height: 100,
+ width: 50,
+ left: 0,
+ right: 0,
+ top: 10,
+ x: 12,
+ y: 23,
+ toJSON: () => '',
+ }),
+ } as any) as SVGElement,
+ } as any) as React.WheelEvent<SVGElement>);
+ expect(preventDefault).toBeCalled();
+ expect(updateZoom).toBeCalledWith(undefined, new Date('2019-10-02T20:48:00.000Z'));
+});
+
+it('should handle mouse out correcly', () => {
+ const updateTooltip = jest.fn();
+ const wrapper = shallowRender({ updateTooltip: undefined });
+ wrapper.setState({
+ mouseOver: true,
+ selectedDate: new Date(),
+ selectedDateXPos: 1,
+ selectedDateIdx: 1,
+ });
+ wrapper.instance().handleMouseOut();
+ expect(wrapper.state().mouseOver).toBe(true);
+
+ wrapper.setProps({ updateTooltip });
+ wrapper.instance().handleMouseOut();
+ expect(wrapper.state().mouseOver).toBe(false);
+ expect(wrapper.state().selectedDate).toBeUndefined();
+ expect(wrapper.state().selectedDateXPos).toBeUndefined();
+ expect(wrapper.state().selectedDateIdx).toBeUndefined();
+ wrapper.instance().handleMouseOut();
+});
+
+it('should handle click correcly', () => {
+ const updateSelectedDate = jest.fn();
+ const wrapper = shallowRender({ updateSelectedDate });
+ wrapper.setState({ selectedDate: new Date() });
+
+ wrapper.instance().handleClick();
+ expect(updateSelectedDate).toBeCalledWith(wrapper.state().selectedDate);
+
+ wrapper.setProps({ updateSelectedDate: undefined });
+ updateSelectedDate.mockClear();
+ wrapper.instance().handleClick();
+ expect(updateSelectedDate).not.toBeCalled();
+});
+
function shallowRender(props?: Partial<AdvancedTimeline['props']>) {
return shallow<AdvancedTimeline>(
<AdvancedTimeline
{
name: 'test-1',
type: 'test-type-1',
+ translatedName: '',
data: [
{
x: new Date('2019-10-01'),
{
name: 'test-2',
type: 'test-type-2',
+ translatedName: '',
data: [
{
x: new Date('2019-10-03'),
);
}
-function mockData(i: number, date: string) {
+function mockData(i: number, date: string): T.Chart.Serie {
return {
name: `t${i}`,
type: 'type',
+ translatedName: '',
data: [{ x: new Date(date), y: i }],
};
}
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
+import { scaleTime } from 'd3-scale';
import { shallow } from 'enzyme';
import * as React from 'react';
import testTheme from '../../../config/jest/testTheme';
},
];
+it('should render correctly', () => {
+ expect(shallowRender({ width: undefined })).toMatchSnapshot('no width');
+ expect(shallowRender({ height: undefined })).toMatchSnapshot('no height');
+});
+
it('should draw a graph with lines', () => {
const wrapper = shallowRender();
expect(wrapper.find('.line-chart-grid').exists()).toBe(true);
expect(shallowRender({ showAreas: true }).find('.line-chart-area').exists()).toBe(true);
});
+it('should handle zoom update correctly', () => {
+ const updateZoom = jest.fn();
+ const startDate = new Date('1970-01-01T00:00:00.001Z');
+ const endDate = new Date('2000-01-01T00:00:00.001Z');
+ let wrapper = shallowRender({ updateZoom, startDate, endDate });
+ wrapper
+ .instance()
+ .handleZoomUpdate(scaleTime().domain([startDate, endDate]).range([0, 150]), [3, 50]);
+ expect(updateZoom).toBeCalledWith(
+ new Date('1970-08-08T03:21:36.001Z'),
+ new Date('1980-01-01T08:00:00.001Z')
+ );
+
+ updateZoom.mockClear();
+
+ // We throttle the handleZoomUpdate so re-render to avoid issue
+ wrapper = shallowRender({ updateZoom, startDate, endDate });
+ wrapper
+ .instance()
+ .handleZoomUpdate(scaleTime().domain([startDate, endDate]).range([0, 150]), [-1, 151]);
+ expect(updateZoom).toBeCalledWith(undefined, undefined);
+});
+
function shallowRender(props: Partial<ZoomTimeLine['props']> = {}) {
return shallow<ZoomTimeLine>(
<ZoomTimeLine
</svg>
`;
+exports[`should render correctly: Zoom enabled 1`] = `
+<svg
+ className="line-chart"
+ height={100}
+ width={100}
+>
+ <defs>
+ <clipPath
+ id="chart-clip"
+ >
+ <rect
+ height={34}
+ transform="translate(0,-5)"
+ width={30}
+ />
+ </clipPath>
+ </defs>
+ <g
+ transform="translate(60, 26)"
+ >
+ <g>
+ <g
+ key="0"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={24}
+ y2={24}
+ />
+ </g>
+ <g
+ key="0.2"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={22.4}
+ y2={22.4}
+ />
+ </g>
+ <g
+ key="0.4"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={20.8}
+ y2={20.8}
+ />
+ </g>
+ <g
+ key="0.6"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={19.200000000000003}
+ y2={19.200000000000003}
+ />
+ </g>
+ <g
+ key="0.8"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={17.6}
+ y2={17.6}
+ />
+ </g>
+ <g
+ key="1"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={16}
+ y2={16}
+ />
+ </g>
+ <g
+ key="1.2"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={14.400000000000002}
+ y2={14.400000000000002}
+ />
+ </g>
+ <g
+ key="1.4"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={12.800000000000002}
+ y2={12.800000000000002}
+ />
+ </g>
+ <g
+ key="1.6"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={11.2}
+ y2={11.2}
+ />
+ </g>
+ <g
+ key="1.8"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={9.600000000000001}
+ y2={9.600000000000001}
+ />
+ </g>
+ <g
+ key="2"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={8}
+ y2={8}
+ />
+ </g>
+ <g
+ key="2.2"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={6.399999999999999}
+ y2={6.399999999999999}
+ />
+ </g>
+ <g
+ key="2.4"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={4.800000000000002}
+ y2={4.800000000000002}
+ />
+ </g>
+ <g
+ key="2.6"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={3.1999999999999993}
+ y2={3.1999999999999993}
+ />
+ </g>
+ <g
+ key="2.8"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={1.6000000000000023}
+ y2={1.6000000000000023}
+ />
+ </g>
+ <g
+ key="3"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={0}
+ y2={0}
+ />
+ </g>
+ </g>
+ <g
+ transform="translate(0, 20)"
+ >
+ <text
+ className="line-chart-tick"
+ key="0"
+ textAnchor="end"
+ transform="rotate(-35, 1.875, 24)"
+ x={1.875}
+ y={24}
+ >
+ October
+ </text>
+ <text
+ className="line-chart-tick"
+ key="1"
+ textAnchor="end"
+ transform="rotate(-35, 5.625, 24)"
+ x={5.625}
+ y={24}
+ >
+ 06 AM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="2"
+ textAnchor="end"
+ transform="rotate(-35, 9.375, 24)"
+ x={9.375}
+ y={24}
+ >
+ 12 PM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="3"
+ textAnchor="end"
+ transform="rotate(-35, 13.125, 24)"
+ x={13.125}
+ y={24}
+ >
+ 06 PM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="4"
+ textAnchor="end"
+ transform="rotate(-35, 16.875, 24)"
+ x={16.875}
+ y={24}
+ >
+ Wed 02
+ </text>
+ <text
+ className="line-chart-tick"
+ key="5"
+ textAnchor="end"
+ transform="rotate(-35, 20.625, 24)"
+ x={20.625}
+ y={24}
+ >
+ 06 AM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="6"
+ textAnchor="end"
+ transform="rotate(-35, 24.375, 24)"
+ x={24.375}
+ y={24}
+ >
+ 12 PM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="7"
+ textAnchor="end"
+ transform="rotate(-35, 28.125, 24)"
+ x={28.125}
+ y={24}
+ >
+ 06 PM
+ </text>
+ </g>
+ <g>
+ <path
+ className="line-chart-path line-chart-path-0"
+ d="M0,16L15,8"
+ key="test-1"
+ />
+ <path
+ className="line-chart-path line-chart-path-1"
+ d="M30,0Z"
+ key="test-2"
+ />
+ </g>
+ <g>
+ <circle
+ className="line-chart-dot line-chart-dot-1"
+ cx={30}
+ cy={0}
+ key="test-20"
+ r="2"
+ />
+ </g>
+ <rect
+ className="chart-mouse-events-overlay"
+ height={24}
+ onWheel={[Function]}
+ width={30}
+ />
+ </g>
+</svg>
+`;
+
+exports[`should render correctly: format y tick 1`] = `
+<svg
+ className="line-chart"
+ height={100}
+ width={100}
+>
+ <g
+ transform="translate(60, 26)"
+ >
+ <g>
+ <g
+ key="0"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={24}
+ >
+ Nicer tick 0
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={24}
+ y2={24}
+ />
+ </g>
+ <g
+ key="0.2"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={22.4}
+ >
+ Nicer tick 0.2
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={22.4}
+ y2={22.4}
+ />
+ </g>
+ <g
+ key="0.4"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={20.8}
+ >
+ Nicer tick 0.4
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={20.8}
+ y2={20.8}
+ />
+ </g>
+ <g
+ key="0.6"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={19.200000000000003}
+ >
+ Nicer tick 0.6
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={19.200000000000003}
+ y2={19.200000000000003}
+ />
+ </g>
+ <g
+ key="0.8"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={17.6}
+ >
+ Nicer tick 0.8
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={17.6}
+ y2={17.6}
+ />
+ </g>
+ <g
+ key="1"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={16}
+ >
+ Nicer tick 1
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={16}
+ y2={16}
+ />
+ </g>
+ <g
+ key="1.2"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={14.400000000000002}
+ >
+ Nicer tick 1.2
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={14.400000000000002}
+ y2={14.400000000000002}
+ />
+ </g>
+ <g
+ key="1.4"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={12.800000000000002}
+ >
+ Nicer tick 1.4
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={12.800000000000002}
+ y2={12.800000000000002}
+ />
+ </g>
+ <g
+ key="1.6"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={11.2}
+ >
+ Nicer tick 1.6
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={11.2}
+ y2={11.2}
+ />
+ </g>
+ <g
+ key="1.8"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={9.600000000000001}
+ >
+ Nicer tick 1.8
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={9.600000000000001}
+ y2={9.600000000000001}
+ />
+ </g>
+ <g
+ key="2"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={8}
+ >
+ Nicer tick 2
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={8}
+ y2={8}
+ />
+ </g>
+ <g
+ key="2.2"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={6.399999999999999}
+ >
+ Nicer tick 2.2
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={6.399999999999999}
+ y2={6.399999999999999}
+ />
+ </g>
+ <g
+ key="2.4"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={4.800000000000002}
+ >
+ Nicer tick 2.4
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={4.800000000000002}
+ y2={4.800000000000002}
+ />
+ </g>
+ <g
+ key="2.6"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={3.1999999999999993}
+ >
+ Nicer tick 2.6
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={3.1999999999999993}
+ y2={3.1999999999999993}
+ />
+ </g>
+ <g
+ key="2.8"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={1.6000000000000023}
+ >
+ Nicer tick 2.8
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={1.6000000000000023}
+ y2={1.6000000000000023}
+ />
+ </g>
+ <g
+ key="3"
+ >
+ <text
+ className="line-chart-tick line-chart-tick-x"
+ dx="-1em"
+ dy="0.3em"
+ textAnchor="end"
+ x={0}
+ y={0}
+ >
+ Nicer tick 3
+ </text>
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={0}
+ y2={0}
+ />
+ </g>
+ </g>
+ <g
+ transform="translate(0, 20)"
+ >
+ <text
+ className="line-chart-tick"
+ key="0"
+ textAnchor="end"
+ transform="rotate(-35, 1.875, 24)"
+ x={1.875}
+ y={24}
+ >
+ October
+ </text>
+ <text
+ className="line-chart-tick"
+ key="1"
+ textAnchor="end"
+ transform="rotate(-35, 5.625, 24)"
+ x={5.625}
+ y={24}
+ >
+ 06 AM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="2"
+ textAnchor="end"
+ transform="rotate(-35, 9.375, 24)"
+ x={9.375}
+ y={24}
+ >
+ 12 PM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="3"
+ textAnchor="end"
+ transform="rotate(-35, 13.125, 24)"
+ x={13.125}
+ y={24}
+ >
+ 06 PM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="4"
+ textAnchor="end"
+ transform="rotate(-35, 16.875, 24)"
+ x={16.875}
+ y={24}
+ >
+ Wed 02
+ </text>
+ <text
+ className="line-chart-tick"
+ key="5"
+ textAnchor="end"
+ transform="rotate(-35, 20.625, 24)"
+ x={20.625}
+ y={24}
+ >
+ 06 AM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="6"
+ textAnchor="end"
+ transform="rotate(-35, 24.375, 24)"
+ x={24.375}
+ y={24}
+ >
+ 12 PM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="7"
+ textAnchor="end"
+ transform="rotate(-35, 28.125, 24)"
+ x={28.125}
+ y={24}
+ >
+ 06 PM
+ </text>
+ </g>
+ <g>
+ <path
+ className="line-chart-path line-chart-path-0"
+ d="M0,16L15,8"
+ key="test-1"
+ />
+ <path
+ className="line-chart-path line-chart-path-1"
+ d="M30,0Z"
+ key="test-2"
+ />
+ </g>
+ <g>
+ <circle
+ className="line-chart-dot line-chart-dot-1"
+ cx={30}
+ cy={0}
+ key="test-20"
+ r="2"
+ />
+ </g>
+ <rect
+ className="chart-mouse-events-overlay"
+ height={24}
+ width={30}
+ />
+ </g>
+</svg>
+`;
+
+exports[`should render correctly: no areas 1`] = `
+<svg
+ className="line-chart"
+ height={100}
+ width={100}
+>
+ <g
+ transform="translate(60, 26)"
+ >
+ <g>
+ <g
+ key="0"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={24}
+ y2={24}
+ />
+ </g>
+ <g
+ key="0.2"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={22.4}
+ y2={22.4}
+ />
+ </g>
+ <g
+ key="0.4"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={20.8}
+ y2={20.8}
+ />
+ </g>
+ <g
+ key="0.6"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={19.200000000000003}
+ y2={19.200000000000003}
+ />
+ </g>
+ <g
+ key="0.8"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={17.6}
+ y2={17.6}
+ />
+ </g>
+ <g
+ key="1"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={16}
+ y2={16}
+ />
+ </g>
+ <g
+ key="1.2"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={14.400000000000002}
+ y2={14.400000000000002}
+ />
+ </g>
+ <g
+ key="1.4"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={12.800000000000002}
+ y2={12.800000000000002}
+ />
+ </g>
+ <g
+ key="1.6"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={11.2}
+ y2={11.2}
+ />
+ </g>
+ <g
+ key="1.8"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={9.600000000000001}
+ y2={9.600000000000001}
+ />
+ </g>
+ <g
+ key="2"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={8}
+ y2={8}
+ />
+ </g>
+ <g
+ key="2.2"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={6.399999999999999}
+ y2={6.399999999999999}
+ />
+ </g>
+ <g
+ key="2.4"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={4.800000000000002}
+ y2={4.800000000000002}
+ />
+ </g>
+ <g
+ key="2.6"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={3.1999999999999993}
+ y2={3.1999999999999993}
+ />
+ </g>
+ <g
+ key="2.8"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={1.6000000000000023}
+ y2={1.6000000000000023}
+ />
+ </g>
+ <g
+ key="3"
+ >
+ <line
+ className="line-chart-grid"
+ x1={0}
+ x2={30}
+ y1={0}
+ y2={0}
+ />
+ </g>
+ </g>
+ <g
+ transform="translate(0, 20)"
+ >
+ <text
+ className="line-chart-tick"
+ key="0"
+ textAnchor="end"
+ transform="rotate(-35, 1.875, 24)"
+ x={1.875}
+ y={24}
+ >
+ October
+ </text>
+ <text
+ className="line-chart-tick"
+ key="1"
+ textAnchor="end"
+ transform="rotate(-35, 5.625, 24)"
+ x={5.625}
+ y={24}
+ >
+ 06 AM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="2"
+ textAnchor="end"
+ transform="rotate(-35, 9.375, 24)"
+ x={9.375}
+ y={24}
+ >
+ 12 PM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="3"
+ textAnchor="end"
+ transform="rotate(-35, 13.125, 24)"
+ x={13.125}
+ y={24}
+ >
+ 06 PM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="4"
+ textAnchor="end"
+ transform="rotate(-35, 16.875, 24)"
+ x={16.875}
+ y={24}
+ >
+ Wed 02
+ </text>
+ <text
+ className="line-chart-tick"
+ key="5"
+ textAnchor="end"
+ transform="rotate(-35, 20.625, 24)"
+ x={20.625}
+ y={24}
+ >
+ 06 AM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="6"
+ textAnchor="end"
+ transform="rotate(-35, 24.375, 24)"
+ x={24.375}
+ y={24}
+ >
+ 12 PM
+ </text>
+ <text
+ className="line-chart-tick"
+ key="7"
+ textAnchor="end"
+ transform="rotate(-35, 28.125, 24)"
+ x={28.125}
+ y={24}
+ >
+ 06 PM
+ </text>
+ </g>
+ <g>
+ <path
+ className="line-chart-path line-chart-path-0"
+ d="M0,16L15,8"
+ key="test-1"
+ />
+ <path
+ className="line-chart-path line-chart-path-1"
+ d="M30,0Z"
+ key="test-2"
+ />
+ </g>
+ <g>
+ <circle
+ className="line-chart-dot line-chart-dot-1"
+ cx={30}
+ cy={0}
+ key="test-20"
+ r="2"
+ />
+ </g>
+ <rect
+ className="chart-mouse-events-overlay"
+ height={24}
+ width={30}
+ />
+ </g>
+</svg>
+`;
+
+exports[`should render correctly: no height 1`] = `<div />`;
+
+exports[`should render correctly: no width 1`] = `<div />`;
+
exports[`should render leak legend correctly 1`] = `
<Fragment>
<rect
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly: no height 1`] = `<div />`;
+
+exports[`should render correctly: no width 1`] = `<div />`;
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
.icon-checkbox {
display: inline-block;
line-height: 1;
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
.icon-radio {
position: relative;
display: inline-block;
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
.select-list-container {
min-width: 500px;
box-sizing: border-box;
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
return mount(dom(overrides));
}
-function dom(overrides) {
+function dom<K>(overrides: Partial<BoxedTabsProps<K>>) {
return (
<BoxedTabs
className="boxed-tabs"
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { shallow } from 'enzyme';
import * as React from 'react';
import { KeyCodes } from '../../../helpers/keycodes';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { shallow } from 'enzyme';
import * as React from 'react';
import testTheme from '../../../config/jest/testTheme';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import { mount, shallow } from 'enzyme';
+import * as React from 'react';
+import OutsideClickHandler from '../OutsideClickHandler';
+
+jest.useFakeTimers();
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+it('should register for click event', () => {
+ const addEventListener = jest.spyOn(window, 'addEventListener');
+ const removeEventListener = jest.spyOn(window, 'removeEventListener');
+
+ const wrapper = shallowRender();
+
+ jest.runAllTimers();
+
+ expect(addEventListener).toHaveBeenCalledWith('click', expect.anything());
+
+ wrapper.instance().componentWillUnmount();
+
+ expect(removeEventListener).toHaveBeenCalledWith('click', expect.anything());
+});
+
+it('should call event handler on click on window', () => {
+ const onClickOutside = jest.fn();
+
+ const map: { [key: string]: EventListener } = {};
+ window.addEventListener = jest.fn((event, callback) => {
+ map[event] = callback as EventListener;
+ });
+
+ mount(
+ <div id="outside-element">
+ <OutsideClickHandler onClickOutside={onClickOutside}>
+ <div id="children" />
+ </OutsideClickHandler>
+ </div>
+ );
+
+ jest.runAllTimers();
+
+ map['click'](new Event('click'));
+ expect(onClickOutside).toHaveBeenCalled();
+});
+
+function shallowRender(props: Partial<OutsideClickHandler['props']> = {}) {
+ return shallow<OutsideClickHandler>(
+ <OutsideClickHandler onClickOutside={jest.fn()} {...props}>
+ <div id="children" />
+ </OutsideClickHandler>
+ );
+}
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { shallow } from 'enzyme';
import * as React from 'react';
import testTheme from '../../../config/jest/testTheme';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
*/
import { mount } from 'enzyme';
import * as React from 'react';
+import testTheme from '../../../config/jest/testTheme';
import { resizeWindowTo, setNodeRect } from '../../../helpers/testUtils';
-import ScreenPositionFixer from '../ScreenPositionFixer';
+import { ScreenPositionFixer } from '../ScreenPositionFixer';
jest.mock('lodash', () => {
- const lodash = require.requireActual('lodash');
+ const lodash = jest.requireActual('lodash');
lodash.throttle = (fn: any) => () => fn();
return lodash;
});
expect(children).toHaveBeenCalledTimes(3);
});
-function mountRender(props: ScreenPositionFixer['props']) {
- return mount(<ScreenPositionFixer {...props} />);
+function mountRender(props: Partial<ScreenPositionFixer['props']>) {
+ // eslint-disable-next-line react/no-children-prop
+ return mount(<ScreenPositionFixer theme={testTheme} children={() => <div />} {...props} />);
}
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { shallow } from 'enzyme';
import * as React from 'react';
import { click } from '../../../helpers/testUtils';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
*/
import { shallow } from 'enzyme';
import * as React from 'react';
-import Tooltip, { TooltipInner } from '../Tooltip';
+import Tooltip, { TooltipInner, TooltipProps } from '../Tooltip';
jest.useFakeTimers();
jest.mock('react-dom', () => {
- const actual = require.requireActual('react-dom');
+ const actual = jest.requireActual('react-dom');
return Object.assign({}, actual, {
- findDOMNode: () => undefined,
+ findDOMNode: jest.fn().mockReturnValue(undefined),
});
});
+beforeEach(jest.clearAllMocks);
+
it('should render', () => {
- expect(
- shallow(
- <TooltipInner overlay={<span id="overlay" />} visible={false}>
- <div id="tooltip" />
- </TooltipInner>
- )
- ).toMatchSnapshot();
+ expect(shallowRenderTooltipInner()).toMatchSnapshot();
expect(
shallow(
<TooltipInner overlay={<span id="overlay" />} visible={true}>
it('should open & close', () => {
const onShow = jest.fn();
const onHide = jest.fn();
- const wrapper = shallow(
- <TooltipInner onHide={onHide} onShow={onShow} overlay={<span id="overlay" />}>
- <div id="tooltip" />
- </TooltipInner>
- );
+ const wrapper = shallowRenderTooltipInner({ onHide, onShow });
+
wrapper.find('#tooltip').simulate('mouseenter');
jest.runOnlyPendingTimers();
wrapper.update();
it('should not open when mouse goes away quickly', () => {
const onShow = jest.fn();
const onHide = jest.fn();
- const wrapper = shallow(
- <TooltipInner onHide={onHide} onShow={onShow} overlay={<span id="overlay" />}>
- <div id="tooltip" />
- </TooltipInner>
- );
+ const wrapper = shallowRenderTooltipInner({ onHide, onShow });
wrapper.find('#tooltip').simulate('mouseenter');
wrapper.find('#tooltip').simulate('mouseleave');
});
it('should not render tooltip without overlay', () => {
- const wrapper = shallow(
- <Tooltip overlay={undefined}>
- <div id="tooltip" />
- </Tooltip>
- );
+ const wrapper = shallowRenderTooltip();
expect(wrapper.type()).toBe('div');
});
it('should not render empty tooltips', () => {
- expect(
- shallow(
- <Tooltip overlay={undefined} visible={true}>
- <div id="tooltip" />
- </Tooltip>
- )
- ).toMatchSnapshot();
- expect(
- shallow(
- <Tooltip overlay="" visible={true}>
- <div id="tooltip" />
- </Tooltip>
- )
- ).toMatchSnapshot();
+ expect(shallowRenderTooltip()).toMatchSnapshot();
+ expect(shallowRenderTooltip()).toMatchSnapshot();
});
+
+it('should adjust arrow position', () => {
+ const wrapper = shallowRenderTooltipInner();
+
+ expect(wrapper.instance().adjustArrowPosition('left', { leftFix: 10, topFix: 20 })).toEqual({
+ marginTop: -20,
+ });
+ expect(wrapper.instance().adjustArrowPosition('right', { leftFix: 10, topFix: 20 })).toEqual({
+ marginTop: -20,
+ });
+ expect(wrapper.instance().adjustArrowPosition('top', { leftFix: 10, topFix: 20 })).toEqual({
+ marginLeft: -10,
+ });
+ expect(wrapper.instance().adjustArrowPosition('bottom', { leftFix: 10, topFix: 20 })).toEqual({
+ marginLeft: -10,
+ });
+});
+
+function shallowRenderTooltip() {
+ return shallow<TooltipProps>(
+ <Tooltip overlay={undefined}>
+ <div id="tooltip" />
+ </Tooltip>
+ );
+}
+
+function shallowRenderTooltipInner(props?: Partial<TooltipProps>) {
+ return shallow<TooltipInner>(
+ <TooltipInner overlay={<span id="overlay" />} {...props}>
+ <div id="tooltip" />
+ </TooltipInner>
+ );
+}
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<div
+ id="children"
+/>
+`;
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
});
function shallowRender(children?: ClipboardBase['props']['children']) {
- return shallow<ClipboardBase>(<ClipboardBase>{children}</ClipboardBase>);
+ return shallow<ClipboardBase>(<ClipboardBase>{children || (() => null)}</ClipboardBase>);
}
function mountRender(children?: ClipboardBase['props']['children']) {
- return mount<ClipboardBase>(<ClipboardBase>{children}</ClipboardBase>);
+ return mount<ClipboardBase>(<ClipboardBase>{children || (() => null)}</ClipboardBase>);
}
});
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import * as classNames from 'classnames';
import * as Clipboard from 'clipboard';
import * as React from 'react';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
const wrapper = shallowRender();
expect(wrapper).toMatchSnapshot();
- expect(wrapper.find(DateTimeFormatter).props().children(date)).toMatchSnapshot('children');
+ expect(wrapper.find(DateTimeFormatter).props().children!(date)).toMatchSnapshot('children');
});
it('should render correctly when there is no date', () => {
.dive()
.dive()
.find(FormattedRelative)
- .props()
- .children(date);
+ .props().children!(date);
expect(children).toHaveBeenCalledWith('less_than_1_hour_ago');
});
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
import * as React from 'react';
import './NavBar.css';
-interface Props extends React.HTMLProps<HTMLDivElement> {
+export interface NavBarProps {
children?: React.ReactNode;
className?: string;
height: number;
left: number;
}
-export default class NavBar extends React.PureComponent<Props, State> {
+export default class NavBar extends React.PureComponent<
+ NavBarProps & React.HTMLProps<HTMLDivElement>,
+ State
+> {
throttledFollowHorizontalScroll: () => void;
- constructor(props: Props) {
+ constructor(props: NavBarProps) {
super(props);
this.state = { left: 0 };
this.throttledFollowHorizontalScroll = throttle(this.followHorizontalScroll, 10);
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { shallow } from 'enzyme';
import * as React from 'react';
import MandatoryFieldMarker, { MandatoryFieldMarkerProps } from '../MandatoryFieldMarker';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { shallow } from 'enzyme';
import * as React from 'react';
import MandatoryFieldsExplanation, {
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
*/
import { shallow } from 'enzyme';
import * as React from 'react';
-import NavBar from '../NavBar';
+import NavBar, { NavBarProps } from '../NavBar';
it('should render correctly', () => {
const wrapper = shallowRender();
expect(wrapper).toMatchSnapshot();
});
-function shallowRender(props: Partial<NavBar['props']> = {}) {
+function shallowRender(props: Partial<NavBarProps> = {}) {
return shallow(
<NavBar height={42} {...props}>
<div className="my-navbar-content" />
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
it('should correctly compute the popup arrow positioning', () => {
const wrapper = shallowRender({ arrowOffset: -2 });
- const getPlacementSpy = jest.spyOn(wrapper.instance(), 'getPlacement');
expect(
wrapper.instance().adjustArrowPosition(PopupPlacement.BottomLeft, { leftFix: 10, topFix: 10 })
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
.update-center-meta-data {
margin: 16px 0;
padding: 16px 16px 8px 16px;
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import * as React from 'react';
import './MetaData.css';
import MetaDataVersions from './MetaDataVersions';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import classNames from 'classnames';
import * as React from 'react';
import { AdvancedDownloadUrl, MetaDataVersionInformation } from './update-center-metadata';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import * as React from 'react';
import MetaDataVersion from './MetaDataVersion';
import { MetaDataVersionInformation } from './update-center-metadata';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { shallow } from 'enzyme';
import * as React from 'react';
import { waitAndUpdate } from '../../../../helpers/testUtils';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { shallow } from 'enzyme';
import * as React from 'react';
import MetaDataVersion, { MetaDataVersionProps } from '../MetaDataVersion';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { shallow } from 'enzyme';
import * as React from 'react';
import { click } from '../../../../helpers/testUtils';
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { MetaDataInformation, MetaDataVersionInformation } from '../update-center-metadata';
export function mockMetaDataVersionInformation(
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
export interface MetaDataInformation {
category?: string;
isSonarSourceCommercial?: boolean;
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
require('whatwg-fetch');
const content = document.createElement('div');
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
*/
/* eslint-disable camelcase */
import Initializer, { getMessages } from '../init';
-import { hasMessage, translate, translateWithParameters } from '../l10n';
+import {
+ getLocalizedCategoryMetricName,
+ getLocalizedMetricDomain,
+ getLocalizedMetricName,
+ getShortMonthName,
+ getShortWeekDayName,
+ getWeekDayName,
+ hasMessage,
+ translate,
+ translateWithParameters,
+} from '../l10n';
const originalMessages = getMessages();
const MSG = 'my_message';
expect(hasMessage('foo', 'bar')).toBe(false);
});
});
+
+describe('getLocalizedMetricName', () => {
+ const metric = { key: 'new_code', name: 'new_code_metric_name' };
+
+ it('should return the metric name translation', () => {
+ Initializer.setMessages({ 'metric.new_code.name': 'metric.new_code.name_t' });
+ expect(getLocalizedMetricName(metric)).toBe('metric.new_code.name_t');
+ });
+
+ it('should return the metric short name', () => {
+ Initializer.setMessages({ 'metric.new_code.short_name': 'metric.new_code.short_name_t' });
+ expect(getLocalizedMetricName(metric, true)).toBe('metric.new_code.short_name_t');
+ });
+
+ it('should fallback on name if short name is absent', () => {
+ Initializer.setMessages({ 'metric.new_code.name': 'metric.new_code.name_t' });
+ expect(getLocalizedMetricName(metric, true)).toBe('metric.new_code.name_t');
+ });
+
+ it('should fallback on metric name if translation is absent', () => {
+ expect(getLocalizedMetricName(metric)).toBe('new_code_metric_name');
+ });
+
+ it('should fallback on metric key if nothing else is available', () => {
+ expect(getLocalizedMetricName({ key: 'new_code' })).toBe('new_code');
+ });
+});
+
+describe('getLocalizedCategoryMetricName', () => {
+ it('should return metric category name translation', () => {
+ Initializer.setMessages({
+ 'metric.new_code.extra_short_name': 'metric.new_code.extra_short_name_t',
+ });
+ expect(getLocalizedCategoryMetricName({ key: 'new_code' })).toBe(
+ 'metric.new_code.extra_short_name_t'
+ );
+ });
+
+ it('should fallback on metric name if extra_short_name is absent', () => {
+ Initializer.setMessages({ 'metric.new_code.name': 'metric.new_code.name_t' });
+ expect(getLocalizedCategoryMetricName({ key: 'new_code' })).toBe('metric.new_code.name_t');
+ });
+});
+
+describe('getLocalizedMetricDomain', () => {
+ it('should return metric domain name translation', () => {
+ Initializer.setMessages({ 'metric_domain.domain': 'metric_domain.domain_t' });
+ expect(getLocalizedMetricDomain('domain')).toBe('metric_domain.domain_t');
+ });
+
+ it('should fallback on metric domain name', () => {
+ expect(getLocalizedMetricDomain('domain')).toBe('domain');
+ });
+});
+
+describe('getShortMonthName', () => {
+ it('should properly translation months', () => {
+ Initializer.setMessages({ Jan: 'Jan_t' });
+ expect(getShortMonthName(0)).toBe('Jan_t');
+ });
+});
+
+describe('getWeekDayName', () => {
+ it('should properly translation weekday', () => {
+ Initializer.setMessages({ Sunday: 'Sunday_t' });
+ expect(getWeekDayName(0)).toBe('Sunday_t');
+ });
+});
+
+describe('getShortWeekDayName', () => {
+ it('should properly translation short weekday', () => {
+ Initializer.setMessages({ Sun: 'Sun_t' });
+ expect(getShortWeekDayName(0)).toBe('Sun_t');
+ });
+});
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import {
+ addNoFooterPageClass,
+ addSideBarClass,
+ addWhitePageClass,
+ removeNoFooterPageClass,
+ removeSideBarClass,
+ removeWhitePageClass,
+} from '../pages';
+
+describe('class adders', () => {
+ it.each([
+ [addSideBarClass, 'sidebar-page'],
+ [addNoFooterPageClass, 'no-footer-page'],
+ [addWhitePageClass, 'white-page'],
+ ])('%s should add the class', (fct, cls) => {
+ const toggle = jest.spyOn(document.body.classList, 'toggle');
+ fct();
+ expect(toggle).toBeCalledWith(cls, true);
+ });
+});
+
+describe('class removers', () => {
+ it.each([
+ [removeSideBarClass, 'sidebar-page'],
+ [removeNoFooterPageClass, 'no-footer-page'],
+ [removeWhitePageClass, 'white-page'],
+ ])('%s should add the class', (fct, cls) => {
+ const toggle = jest.spyOn(document.body.classList, 'toggle');
+ fct();
+ expect(toggle).toBeCalledWith(cls, false);
+ });
+});
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { collapsedDirFromPath, cutLongWords, fileFromPath } from '../path';
+import {
+ collapsedDirFromPath,
+ collapsePath,
+ cutLongWords,
+ fileFromPath,
+ limitComponentName,
+ splitPath,
+} from '../path';
describe('#collapsedDirFromPath()', () => {
it('should return null when pass null', () => {
expect(cutLongWords('This is a test')).toBe('This is a test');
});
});
+
+describe('collapsePath', () => {
+ it('should fail fast if path is not a string', () => {
+ expect(collapsePath({} as string)).toBe('');
+ });
+
+ it('should not collapse short path', () => {
+ const path = 'my/path';
+ expect(collapsePath(path)).toBe(path);
+ });
+
+ it('should collapse path longer than the limit', () => {
+ const path = 'my/long/path/very/long/path';
+ expect(collapsePath(path, 10)).toBe('my/.../very/long/path');
+ expect(collapsePath(path, 5)).toBe('my/.../long/path');
+ expect(collapsePath(path, 2)).toBe('my/.../path');
+ });
+});
+
+describe('splitPath', () => {
+ it('should split path properly', () => {
+ expect(splitPath('my/super/path')).toEqual({ head: 'my/super', tail: 'path' });
+ expect(splitPath('my/super/very/long/path')).toEqual({
+ head: 'my/super/very/long',
+ tail: 'path',
+ });
+ });
+});
+
+describe('limitComponentName', () => {
+ const name = 'my/super/name';
+
+ it('should fail fast if component name is not a string', () => {
+ expect(limitComponentName({} as string)).toBe('');
+ });
+
+ it('should limiit component name longer than the limit', () => {
+ expect(limitComponentName(name)).toBe(name);
+ expect(limitComponentName(name, 10)).toBe('my/super/n...');
+ });
+});
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import {
+ getCoverageRatingAverageValue,
+ getCoverageRatingLabel,
+ getDuplicationsRatingAverageValue,
+ getDuplicationsRatingLabel,
+ getSizeRatingAverageValue,
+ getSizeRatingLabel,
+} from '../ratings';
+
+describe('getCoverageRatingLabel', () => {
+ it('should fail', () => {
+ expect(() => {
+ getCoverageRatingLabel(-1);
+ }).toThrow();
+ });
+ it.each([
+ [1, '≥ 80%'],
+ [2, '70% - 80%'],
+ [3, '50% - 70%'],
+ [4, '30% - 50%'],
+ [5, '< 30%'],
+ ])('should return the correct label for %s', (rating, label) => {
+ expect(getCoverageRatingLabel(rating)).toBe(label);
+ });
+});
+
+describe('getCoverageRatingAverageValue', () => {
+ it.each([
+ [1, 90],
+ [2, 75],
+ [3, 60],
+ [4, 40],
+ [5, 15],
+ ])('should return the correct value', (rating, value) => {
+ expect(getCoverageRatingAverageValue(rating)).toBe(value);
+ });
+});
+
+describe('getDuplicationsRatingLabel', () => {
+ it('should fail', () => {
+ expect(() => {
+ getCoverageRatingLabel(-1);
+ }).toThrow();
+ });
+ it.each([
+ [1, '< 3%'],
+ [2, '3% - 5%'],
+ [3, '5% - 10%'],
+ [4, '10% - 20%'],
+ [5, '> 20%'],
+ ])('should return the correct label for %s', (rating, label) => {
+ expect(getDuplicationsRatingLabel(rating)).toBe(label);
+ });
+});
+
+describe('getDuplicationsRatingAverageValue', () => {
+ it.each([
+ [1, 1.5],
+ [2, 4],
+ [3, 7.5],
+ [4, 15],
+ [5, 30],
+ ])('should return the correct value', (rating, value) => {
+ expect(getDuplicationsRatingAverageValue(rating)).toBe(value);
+ });
+});
+
+describe('getSizeRatingLabel', () => {
+ it('should fail', () => {
+ expect(() => {
+ getCoverageRatingLabel(-1);
+ }).toThrow();
+ });
+ it.each([
+ [1, '< 1k'],
+ [2, '1k - 10k'],
+ [3, '10k - 100k'],
+ [4, '100k - 500k'],
+ [5, '> 500k'],
+ ])('should return the correct label for %s', (rating, label) => {
+ expect(getSizeRatingLabel(rating)).toBe(label);
+ });
+});
+
+describe('getSizeRatingAverageValue', () => {
+ it.each([
+ [1, 500],
+ [2, 5000],
+ [3, 50000],
+ [4, 250000],
+ [5, 750000],
+ ])('should return the correct value', (rating, value) => {
+ expect(getSizeRatingAverageValue(rating)).toBe(value);
+ });
+});
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import handleRequiredAuthentication from '../handleRequiredAuthentication';
import {
checkStatus,
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
const SCROLLING_DURATION = 100;
const SCROLLING_INTERVAL = 10;
const SCROLLING_STEPS = SCROLLING_DURATION / SCROLLING_INTERVAL;
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { ReactWrapper, ShallowWrapper } from 'enzyme';
export function mockEvent(overrides = {}) {
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+/*
+ * SonarQube
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
"test": "jest",
"format": "prettier --write --list-different \"{,!(build|node_modules)/**/}*.{ts,tsx,css}\"",
"format-check": "prettier --list-different \"{,!(build|node_modules)/**/}*.{ts,tsx,css}\"",
- "license-check": "node scripts/license-check",
"lint": "eslint --ext ts,tsx --quiet \"{,!(build|node_modules)/**/}*.{ts,tsx}\"",
"lint-report": "eslint --ext ts,tsx -f json -o build/eslint-report.json \"{,!(build|node_modules)/**/}*.{ts,tsx}\"",
"ts-check": "tsc --noEmit",
- "validate": "yarn ts-check && yarn license-check && yarn lint && yarn format-check && yarn test",
- "validate-ci": "yarn lint-report && yarn license-check && yarn format-check && yarn test --coverage"
+ "validate": "yarn ts-check && yarn lint && yarn format-check && yarn test",
+ "validate-ci": "yarn lint-report && yarn test --coverage",
+ "check-ci": "yarn ts-check && yarn format-check"
},
"engines": {
"node": ">=10.15.3",
+++ /dev/null
-const fs = require('fs');
-const diff = require('diff');
-const globby = require('globby');
-
-const GLOBS = ['**/*.ts', '**/*.tsx', '!node_modules/**/*', '!build/**/*'];
-
-let header;
-
-return readFile('./HEADER')
- .then(h => {
- header = h;
- })
- .then(() => globby(GLOBS))
- .then(readFilesFromPaths)
- .then(checkFiles)
- .then(errors => {
- if (errors) {
- console.error(errors, 'files have an invalid license header');
- process.exit(1);
- } else {
- console.log('✓ All files have valid license headers');
- }
- })
- .catch(e => {
- console.error(e);
- process.exit(1);
- });
-
-function checkFiles(files) {
- return files.reduce((errors, { path, text }) => {
- if (text.slice(0, header.length) !== header) {
- console.error('❌ ', path);
- console.error(
- diff.createPatch(path, header + '\n', text.slice(0, header.length) + '\n', '', '')
- );
- return errors + 1;
- }
- return errors;
- }, 0);
-}
-
-function readFilesFromPaths(paths) {
- return Promise.all(paths.map(path => readFile(path).then(text => ({ path, text }))));
-}
-
-function readFile(path) {
- return new Promise((resolve, reject) => {
- fs.readFile(path, { encoding: 'utf-8' }, (err, text) => {
- if (err) {
- reject(err);
- } else {
- resolve(text);
- }
- });
- });
-}
"rootDir": "./",
"baseUrl": "."
},
- "include": ["components", "helpers", "types.d.ts"],
- "exclude": ["**/*-test.*"]
+ "include": ["components", "helpers", "types.d.ts"]
}
def webappDir = "${buildDir}/webapp"
+yarn.configure {
+ dependsOn tasks.getByPath(':server:sonar-ui-common:yarn_run')
+}
+
yarn_run {
['config', 'public', 'scripts', 'src', '../sonar-docs/src'].each {
inputs.dir(it).withPathSensitivity(PathSensitivity.RELATIVE)
"rehype-slug": "3.0.0",
"remark-custom-blocks": "2.5.1",
"remark-rehype": "6.0.0",
- "sonar-ui-common": "1.0.33",
+ "sonar-ui-common": "../sonar-ui-common/build/dist",
"unist-util-visit": "2.0.2",
"valid-url": "1.0.9",
"whatwg-fetch": "3.0.0"
uuid "^3.4.0"
websocket-driver "^0.7.4"
-sonar-ui-common@1.0.33:
+sonar-ui-common@../sonar-ui-common/build/dist:
version "1.0.33"
- resolved "https://repox.jfrog.io/repox/api/npm/npm/sonar-ui-common/-/sonar-ui-common-1.0.33.tgz#8eb6f40b1ab81b802a8eb92fd549598432e9dc26"
- integrity sha1-jrb0Cxq4G4Aqjrkv1UlZhDLp3CY=
dependencies:
"@types/react-select" "1.2.6"
classnames "2.2.6"
include 'server:sonar-webserver-webapi'
include 'server:sonar-webserver-ws'
include 'server:sonar-alm-client'
+include 'server:sonar-ui-common'
include 'sonar-application'
include 'sonar-check-api'