@@ -651,6 +651,10 @@ subprojects { | |||
// 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" |
@@ -55,6 +55,10 @@ task extractAnalyzerDocFiles { | |||
} | |||
} | |||
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 ] |
@@ -23,7 +23,7 @@ | |||
"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": { |
@@ -13691,10 +13691,8 @@ sockjs@0.3.19: | |||
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" |
@@ -1,19 +0,0 @@ | |||
/* | |||
* 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. | |||
*/ |
@@ -0,0 +1,66 @@ | |||
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 |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
@@ -205,6 +205,7 @@ export default class AdvancedTimeline extends React.PureComponent<Props, State> | |||
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; |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
@@ -174,9 +174,7 @@ export default class ZoomTimeLine extends React.PureComponent<Props, State> { | |||
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) => { |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
@@ -36,11 +36,18 @@ jest.mock('d3-scale', () => { | |||
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', () => { | |||
@@ -144,6 +151,98 @@ it('should update tootlips when selected date changes', () => { | |||
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 | |||
@@ -154,6 +253,7 @@ function shallowRender(props?: Partial<AdvancedTimeline['props']>) { | |||
{ | |||
name: 'test-1', | |||
type: 'test-type-1', | |||
translatedName: '', | |||
data: [ | |||
{ | |||
x: new Date('2019-10-01'), | |||
@@ -168,6 +268,7 @@ function shallowRender(props?: Partial<AdvancedTimeline['props']>) { | |||
{ | |||
name: 'test-2', | |||
type: 'test-type-2', | |||
translatedName: '', | |||
data: [ | |||
{ | |||
x: new Date('2019-10-03'), | |||
@@ -183,10 +284,11 @@ function shallowRender(props?: Partial<AdvancedTimeline['props']>) { | |||
); | |||
} | |||
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 }], | |||
}; | |||
} |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
@@ -17,7 +17,7 @@ | |||
* 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'; | |||
@@ -41,6 +41,11 @@ const series = [ | |||
}, | |||
]; | |||
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); | |||
@@ -67,6 +72,29 @@ it('should render areas under the graph lines', () => { | |||
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 |
@@ -0,0 +1,5 @@ | |||
// Jest Snapshot v1, https://goo.gl/fbAQLP | |||
exports[`should render correctly: no height 1`] = `<div />`; | |||
exports[`should render correctly: no width 1`] = `<div />`; |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
@@ -17,7 +17,6 @@ | |||
* 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; |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
@@ -17,7 +17,6 @@ | |||
* 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; |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
@@ -17,7 +17,6 @@ | |||
* 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; |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
@@ -42,7 +42,7 @@ function mountRender(overrides: Partial<BoxedTabsProps<string>> = {}) { | |||
return mount(dom(overrides)); | |||
} | |||
function dom(overrides) { | |||
function dom<K>(overrides: Partial<BoxedTabsProps<K>>) { | |||
return ( | |||
<BoxedTabs | |||
className="boxed-tabs" |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Sonar UI Common | |||
* Copyright (C) 2019-2020 SonarSource SA | |||
* SonarQube | |||
* Copyright (C) 2009-2021 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or |