diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-12-09 10:32:03 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-12-09 14:28:10 +0100 |
commit | 26cbc7cbdd8c1b32ad5797b8060d4c954396bb92 (patch) | |
tree | 17656eb8a0e4c2107c35f15357801c5f8fc6e80d /server/sonar-web/src/main/js | |
parent | 86d66a1175b362e1b465f8ae06a8c709949da6e2 (diff) | |
download | sonarqube-26cbc7cbdd8c1b32ad5797b8060d4c954396bb92.tar.gz sonarqube-26cbc7cbdd8c1b32ad5797b8060d4c954396bb92.zip |
remove $ and _ dependecies in ComponentNav
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r-- | server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js index 689f4fc760f..c56eaa49078 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js @@ -17,17 +17,15 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -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 './ComponentNavFavorite'; import ComponentNavBreadcrumbs from './ComponentNavBreadcrumbs'; import ComponentNavMeta from './ComponentNavMeta'; import ComponentNavMenu from './ComponentNavMenu'; import RecentHistory from './RecentHistory'; +import { TooltipsContainer } from '../../../../components/mixins/tooltips-mixin'; +import { getTasksForComponent } from '../../../../api/ce'; +import { STATUSES } from '../../../../apps/background-tasks/constants'; import './ComponentNav.css'; export default React.createClass({ @@ -39,29 +37,21 @@ export default React.createClass({ loadStatus() { getTasksForComponent(this.props.component.id).then(r => { this.setState({ - isPending: !!_.findWhere(r.queue, { status: STATUSES.PENDING }), - isInProgress: !!_.findWhere(r.queue, { status: STATUSES.IN_PROGRESS }), + isPending: r.queue.some(task => task.status === STATUSES.PENDING), + isInProgress: r.queue.some(task => task.status === STATUSES.IN_PROGRESS), isFailed: r.current && r.current.status === STATUSES.FAILED - }, this.initTooltips); + }); }); }, populateRecentHistory() { - const qualifier = _.last(this.props.component.breadcrumbs).qualifier; + const { breadcrumbs } = this.props.component; + const { qualifier } = breadcrumbs[breadcrumbs.length - 1]; if (['TRK', 'VW', 'DEV'].indexOf(qualifier) !== -1) { RecentHistory.add(this.props.component.key, this.props.component.name, qualifier.toLowerCase()); } }, - initTooltips() { - $('[data-toggle="tooltip"]', ReactDOM.findDOMNode(this)).tooltip({ - container: 'body', - placement: 'bottom', - delay: { show: 0, hide: 2000 }, - html: true - }); - }, - render() { return ( <nav className="navbar navbar-context page-container" id="context-navigation"> @@ -74,11 +64,13 @@ export default React.createClass({ <ComponentNavBreadcrumbs breadcrumbs={this.props.component.breadcrumbs}/> - <ComponentNavMeta - {...this.props} - {...this.state} - version={this.props.component.version} - snapshotDate={this.props.component.snapshotDate}/> + <TooltipsContainer options={{ delay: { show: 0, hide: 2000 } }}> + <ComponentNavMeta + {...this.props} + {...this.state} + version={this.props.component.version} + snapshotDate={this.props.component.snapshotDate}/> + </TooltipsContainer> <ComponentNavMenu component={this.props.component} |