diff options
Diffstat (limited to 'server/sonar-web/src/main/js')
21 files changed, 43 insertions, 26 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/app.js b/server/sonar-web/src/main/js/apps/background-tasks/app.js index 268ca65e336..9830bc967f0 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/app.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/app.js @@ -1,7 +1,8 @@ import React from 'react'; +import ReactDOM from 'react-dom'; import Main from './main'; window.sonarqube.appStarted.then(options => { let el = document.querySelector(options.el); - React.render(<Main options={options}/>, el); + ReactDOM.render(<Main options={options}/>, el); }); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/search.js b/server/sonar-web/src/main/js/apps/background-tasks/search.js index acd864f1b33..f2d70c15cd7 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/search.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/search.js @@ -44,8 +44,8 @@ export default React.createClass({ onDateChange(newDate) { if (newDate === DATE.CUSTOM) { - let minDateRaw = React.findDOMNode(this.refs.minDate).value, - maxDateRaw = React.findDOMNode(this.refs.maxDate).value, + let minDateRaw = this.refs.minDate.value, + maxDateRaw = this.refs.maxDate.value, minDate = moment(minDateRaw, DATE_FORMAT, true), maxDate = moment(maxDateRaw, DATE_FORMAT, true); this.props.onDateChange(newDate, @@ -68,8 +68,8 @@ export default React.createClass({ onSelect: this.onDateInputChange }; if ($.fn.datepicker) { - $(React.findDOMNode(this.refs.minDate)).datepicker(opts); - $(React.findDOMNode(this.refs.maxDate)).datepicker(opts); + $(this.refs.minDate).datepicker(opts); + $(this.refs.maxDate).datepicker(opts); } }, @@ -92,7 +92,7 @@ export default React.createClass({ }, onSearch() { - let searchInput = React.findDOMNode(this.refs.searchInput), + let searchInput = this.refs.searchInput, query = searchInput.value; this.props.onSearch(query); }, diff --git a/server/sonar-web/src/main/js/apps/global-permissions/app.js b/server/sonar-web/src/main/js/apps/global-permissions/app.js index f010e11b6e0..49a34472e74 100644 --- a/server/sonar-web/src/main/js/apps/global-permissions/app.js +++ b/server/sonar-web/src/main/js/apps/global-permissions/app.js @@ -1,8 +1,9 @@ import React from 'react'; +import ReactDOM from 'react-dom'; import Main from './main'; import '../../helpers/handlebars-helpers'; window.sonarqube.appStarted.then(options => { var el = document.querySelector(options.el); - React.render(<Main/>, el); + ReactDOM.render(<Main/>, el); }); diff --git a/server/sonar-web/src/main/js/apps/overview/app.js b/server/sonar-web/src/main/js/apps/overview/app.js index 29fabe96cd3..f2912244670 100644 --- a/server/sonar-web/src/main/js/apps/overview/app.js +++ b/server/sonar-web/src/main/js/apps/overview/app.js @@ -1,6 +1,7 @@ import $ from 'jquery'; import _ from 'underscore'; import React from 'react'; +import ReactDOM from 'react-dom'; import { Overview } from './main'; class App { @@ -9,7 +10,7 @@ class App { _.extend(opts.component, options.component); $('html').toggleClass('dashboard-page', opts.component.hasSnapshot); let el = document.querySelector(opts.el); - React.render(<Overview {...opts}/>, el); + ReactDOM.render(<Overview {...opts}/>, el); } } diff --git a/server/sonar-web/src/main/js/apps/overview/domain/timeline.js b/server/sonar-web/src/main/js/apps/overview/domain/timeline.js index baa63d6016c..cef1012c012 100644 --- a/server/sonar-web/src/main/js/apps/overview/domain/timeline.js +++ b/server/sonar-web/src/main/js/apps/overview/domain/timeline.js @@ -62,7 +62,7 @@ export class DomainTimeline extends React.Component { } handleMetricChange () { - let metric = React.findDOMNode(this.refs.metricSelect).value; + let metric = this.refs.metricSelect.value; this.setState({ currentMetric: metric }, this.requestTimeMachineData); } diff --git a/server/sonar-web/src/main/js/apps/permission-templates/app.js b/server/sonar-web/src/main/js/apps/permission-templates/app.js index aec705a28d6..e8c443eb4e9 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/app.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/app.js @@ -1,8 +1,9 @@ import React from 'react'; +import ReactDOM from 'react-dom'; import Main from './main'; import '../../helpers/handlebars-helpers'; window.sonarqube.appStarted.then(options => { var el = document.querySelector(options.el); - React.render(<Main topQualifiers={options.rootQualifiers}/>, el); + ReactDOM.render(<Main topQualifiers={options.rootQualifiers}/>, el); }); diff --git a/server/sonar-web/src/main/js/apps/permission-templates/permission-template.js b/server/sonar-web/src/main/js/apps/permission-templates/permission-template.js index a4814d570c0..b821c7cc9a6 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/permission-template.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/permission-template.js @@ -69,6 +69,7 @@ export default React.createClass({ return ( <td key={p.key}> <table> + <tbody> <tr> <td className="spacer-right">Users</td> <td className="spacer-left bordered-left">{p.usersCount}</td> @@ -85,6 +86,7 @@ export default React.createClass({ data-toggle="tooltip" href="#"></a> </td> </tr> + </tbody> </table> </td> ); diff --git a/server/sonar-web/src/main/js/apps/project-permissions/app.js b/server/sonar-web/src/main/js/apps/project-permissions/app.js index 1c6f5645fc6..299c94f9bb7 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/app.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/app.js @@ -1,5 +1,6 @@ import $ from 'jquery'; import React from 'react'; +import ReactDOM from 'react-dom'; import Main from './main'; import '../../helpers/handlebars-helpers'; @@ -10,6 +11,6 @@ function requestPermissionTemplates () { window.sonarqube.appStarted.then(options => { requestPermissionTemplates().done(r => { var el = document.querySelector(options.el); - React.render(<Main permissionTemplates={r.permissionTemplates} componentId={options.componentId}/>, el); + ReactDOM.render(<Main permissionTemplates={r.permissionTemplates} componentId={options.componentId}/>, el); }); }); diff --git a/server/sonar-web/src/main/js/apps/project-permissions/project.js b/server/sonar-web/src/main/js/apps/project-permissions/project.js index 57b87b71cbd..ce1b9dae58c 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/project.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/project.js @@ -46,6 +46,7 @@ export default React.createClass({ return ( <td key={p.key}> <table> + <tbody> <tr> <td className="spacer-right">Users</td> <td className="spacer-left bordered-left">{p.usersCount}</td> @@ -62,6 +63,7 @@ export default React.createClass({ data-toggle="tooltip" href="#"></a> </td> </tr> + </tbody> </table> </td> ); diff --git a/server/sonar-web/src/main/js/apps/project-permissions/search.js b/server/sonar-web/src/main/js/apps/project-permissions/search.js index dfc243f8636..d50bf8255fd 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/search.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/search.js @@ -16,7 +16,7 @@ export default React.createClass({ }, search() { - let q = React.findDOMNode(this.refs.input).value; + let q = this.refs.input.value; this.props.search(q); }, diff --git a/server/sonar-web/src/main/js/apps/projects/app.js b/server/sonar-web/src/main/js/apps/projects/app.js index 917d7342adc..627a8a9b9cd 100644 --- a/server/sonar-web/src/main/js/apps/projects/app.js +++ b/server/sonar-web/src/main/js/apps/projects/app.js @@ -1,4 +1,5 @@ import React from 'react'; +import ReactDOM from 'react-dom'; import Main from './main'; import {getCurrentUser} from '../../api/users'; import '../../helpers/handlebars-helpers'; @@ -8,7 +9,7 @@ window.sonarqube.appStarted.then(options => { let el = document.querySelector(options.el), hasProvisionPermission = user.permissions.global.indexOf('provisioning') !== -1, topLevelQualifiers = options.rootQualifiers; - React.render(<Main hasProvisionPermission={hasProvisionPermission} + ReactDOM.render(<Main hasProvisionPermission={hasProvisionPermission} topLevelQualifiers={topLevelQualifiers}/>, el); }); }); diff --git a/server/sonar-web/src/main/js/apps/projects/search.js b/server/sonar-web/src/main/js/apps/projects/search.js index 5c5668af1e5..a5cebad2a63 100644 --- a/server/sonar-web/src/main/js/apps/projects/search.js +++ b/server/sonar-web/src/main/js/apps/projects/search.js @@ -16,7 +16,7 @@ export default React.createClass({ }, search() { - let q = React.findDOMNode(this.refs.input).value; + let q = this.refs.input.value; this.props.onSearch(q); }, @@ -86,6 +86,7 @@ export default React.createClass({ return ( <div className="panel panel-vertical bordered-bottom spacer-bottom"> <table className="data"> + <tbody> <tr> <td className="thin text-middle"> {this.renderCheckbox()} @@ -110,6 +111,7 @@ export default React.createClass({ </button> </td> </tr> + </tbody> </table> {this.renderGhostsDescription()} </div> diff --git a/server/sonar-web/src/main/js/apps/system/app.js b/server/sonar-web/src/main/js/apps/system/app.js index b4b9a61c4a6..201edde4270 100644 --- a/server/sonar-web/src/main/js/apps/system/app.js +++ b/server/sonar-web/src/main/js/apps/system/app.js @@ -1,9 +1,10 @@ import React from 'react'; +import ReactDOM from 'react-dom'; import Main from './main'; window.sonarqube.appStarted.then(options => { var el = document.querySelector(options.el); - React.render(<Main/>, el); + ReactDOM.render(<Main/>, el); }); diff --git a/server/sonar-web/src/main/js/apps/system/item-log-level.js b/server/sonar-web/src/main/js/apps/system/item-log-level.js index 3e924a2781e..2ca73615e1b 100644 --- a/server/sonar-web/src/main/js/apps/system/item-log-level.js +++ b/server/sonar-web/src/main/js/apps/system/item-log-level.js @@ -9,7 +9,7 @@ export default React.createClass({ }, onChange() { - let newValue = React.findDOMNode(this.refs.select).value; + let newValue = this.refs.select.value; setLogLevel(newValue).then(() => { this.setState({ level: newValue }); }); diff --git a/server/sonar-web/src/main/js/apps/system/item-object.js b/server/sonar-web/src/main/js/apps/system/item-object.js index 15583def4bb..4260abc60c3 100644 --- a/server/sonar-web/src/main/js/apps/system/item-object.js +++ b/server/sonar-web/src/main/js/apps/system/item-object.js @@ -9,6 +9,6 @@ export default React.createClass({ <td><ItemValue value={this.props.value[key]}/></td> </tr>; }); - return <table className="data">{rows}</table>; + return <table className="data"><tbody>{rows}</tbody></table>; } }); diff --git a/server/sonar-web/src/main/js/components/charts/mixins/resize-mixin.js b/server/sonar-web/src/main/js/components/charts/mixins/resize-mixin.js index 206cb90f355..ebd7360fe07 100644 --- a/server/sonar-web/src/main/js/components/charts/mixins/resize-mixin.js +++ b/server/sonar-web/src/main/js/components/charts/mixins/resize-mixin.js @@ -1,4 +1,5 @@ import React from 'react'; +import ReactDOM from 'react-dom'; export const ResizeMixin = { componentDidMount () { @@ -15,7 +16,7 @@ export const ResizeMixin = { }, handleResize () { - let boundingClientRect = React.findDOMNode(this).parentNode.getBoundingClientRect(); + let boundingClientRect = ReactDOM.findDOMNode(this).parentNode.getBoundingClientRect(); let newWidth = this.props.width || boundingClientRect.width; let newHeight = this.props.height || boundingClientRect.height; this.setState({ width: newWidth, height: newHeight }); diff --git a/server/sonar-web/src/main/js/components/charts/mixins/tooltips-mixin.js b/server/sonar-web/src/main/js/components/charts/mixins/tooltips-mixin.js index 1fcfc6add89..240edee02c5 100644 --- a/server/sonar-web/src/main/js/components/charts/mixins/tooltips-mixin.js +++ b/server/sonar-web/src/main/js/components/charts/mixins/tooltips-mixin.js @@ -1,5 +1,6 @@ import $ from 'jquery'; import React from 'react'; +import ReactDOM from 'react-dom'; export const TooltipsMixin = { componentDidMount () { @@ -12,7 +13,7 @@ export const TooltipsMixin = { initTooltips () { if ($.fn.tooltip) { - $('[data-toggle="tooltip"]', React.findDOMNode(this)) + $('[data-toggle="tooltip"]', ReactDOM.findDOMNode(this)) .tooltip({ container: 'body', placement: 'bottom', html: true }); } } diff --git a/server/sonar-web/src/main/js/components/select-list/controls.jsx b/server/sonar-web/src/main/js/components/select-list/controls.jsx index e351fb01229..3165c9d5cca 100644 --- a/server/sonar-web/src/main/js/components/select-list/controls.jsx +++ b/server/sonar-web/src/main/js/components/select-list/controls.jsx @@ -8,7 +8,7 @@ export default React.createClass({ }, search() { - let query = React.findDOMNode(this.refs.search).value; + let query = this.refs.search.value; this.props.search(query); }, diff --git a/server/sonar-web/src/main/js/main/nav/app.js b/server/sonar-web/src/main/js/main/nav/app.js index 93b54d6a3cd..14576f59cdd 100644 --- a/server/sonar-web/src/main/js/main/nav/app.js +++ b/server/sonar-web/src/main/js/main/nav/app.js @@ -1,4 +1,5 @@ import React from 'react'; +import ReactDOM from 'react-dom'; import GlobalNav from './global/global-nav'; import ComponentNav from './component/component-nav'; import SettingsNav from './settings/settings-nav'; @@ -36,7 +37,7 @@ export default class App { return getGlobalNavigation().then(r => { const el = document.getElementById('global-navigation'); if (el) { - React.render(<GlobalNav {...options} {...r}/>, el); + ReactDOM.render(<GlobalNav {...options} {...r}/>, el); } return r; }); @@ -46,7 +47,7 @@ export default class App { return getComponentNavigation(options.componentKey).then(r => { const el = document.getElementById('context-navigation'); if (el) { - React.render(<ComponentNav component={r} conf={r.configuration || {}}/>, el); + ReactDOM.render(<ComponentNav component={r} conf={r.configuration || {}}/>, el); } return r; }); @@ -56,7 +57,7 @@ export default class App { return getSettingsNavigation().then(r => { const el = document.getElementById('context-navigation'); if (el) { - React.render(<SettingsNav {...options}/>, el); + ReactDOM.render(<SettingsNav {...options}/>, el); } return r; }); diff --git a/server/sonar-web/src/main/js/main/nav/component/component-nav.js b/server/sonar-web/src/main/js/main/nav/component/component-nav.js index f4c6ee1c976..9b1140f1834 100644 --- a/server/sonar-web/src/main/js/main/nav/component/component-nav.js +++ b/server/sonar-web/src/main/js/main/nav/component/component-nav.js @@ -1,6 +1,7 @@ import $ from 'jquery'; import _ from 'underscore'; import React from 'react'; +import ReactDOM from 'react-dom'; import {STATUSES} from '../../../apps/background-tasks/constants'; import {getTasksForComponent} from '../../../api/ce'; import ComponentNavFavorite from './component-nav-favorite'; @@ -33,7 +34,7 @@ export default React.createClass({ }, initTooltips() { - $('[data-toggle="tooltip"]', React.findDOMNode(this)).tooltip({ + $('[data-toggle="tooltip"]', ReactDOM.findDOMNode(this)).tooltip({ container: 'body', placement: 'bottom', delay: { show: 0, hide: 1000 }, diff --git a/server/sonar-web/src/main/js/main/nav/global/global-nav-search.js b/server/sonar-web/src/main/js/main/nav/global/global-nav-search.js index f717bf37122..6e09db56906 100644 --- a/server/sonar-web/src/main/js/main/nav/global/global-nav-search.js +++ b/server/sonar-web/src/main/js/main/nav/global/global-nav-search.js @@ -41,7 +41,7 @@ export default React.createClass({ }, renderSearchView() { - let searchContainer = React.findDOMNode(this.refs.container); + let searchContainer = this.refs.container; this.searchView = new SearchView({ model: new Backbone.Model(this.props), hide: this.closeSearch @@ -65,7 +65,7 @@ export default React.createClass({ }, onClickOutside(e) { - if (!contains(React.findDOMNode(this.refs.dropdown), e.target)) { + if (!contains(this.refs.dropdown, e.target)) { this.closeSearch(); } }, |