From 99ffcad9488047226eb21cf5acc20c695f9735df Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 28 Sep 2015 15:31:37 +0200 Subject: [PATCH] SONAR-5770 apply feedback --- .../apps/nav/component/component-nav-meta.jsx | 20 +++++++++++++++---- .../js/apps/nav/component/component-nav.jsx | 7 ++++++- .../sonar-web/src/main/less/init/links.less | 3 +++ .../resources/org/sonar/l10n/core.properties | 3 +++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/nav/component/component-nav-meta.jsx b/server/sonar-web/src/main/js/apps/nav/component/component-nav-meta.jsx index eb64c48a64c..45061352e56 100644 --- a/server/sonar-web/src/main/js/apps/nav/component/component-nav-meta.jsx +++ b/server/sonar-web/src/main/js/apps/nav/component/component-nav-meta.jsx @@ -3,23 +3,35 @@ import PendingIcon from '../../../components/shared/pending-icon'; export default React.createClass({ render() { - let metaList = []; + let metaList = [], + // FIXME check right permission + canSeeBackgroundTasks = this.props.conf.showSettings, + backgroundTasksUrl = `${baseUrl}/project/background_tasks?id=${encodeURIComponent(this.props.component.key)}`; if (this.props.isInProgress) { + let tooltip = canSeeBackgroundTasks ? + window.tp('component_navigation.status.in_progress.admin', backgroundTasksUrl) : + window.t('component_navigation.status.in_progress'); metaList.push( -
  • +
  • {window.t('background_task.status.IN_PROGRESS')}
  • ); } else if (this.props.isPending) { + let tooltip = canSeeBackgroundTasks ? + window.tp('component_navigation.status.pending.admin', backgroundTasksUrl) : + window.t('component_navigation.status.pending'); metaList.push( -
  • +
  • {window.t('background_task.status.PENDING')}
  • ); } else if (this.props.isFailed) { + let tooltip = canSeeBackgroundTasks ? + window.tp('component_navigation.status.failed.admin', backgroundTasksUrl) : + window.t('component_navigation.status.failed'); metaList.push( -
  • +
  • {window.t('background_task.status.FAILED')}
  • ); diff --git a/server/sonar-web/src/main/js/apps/nav/component/component-nav.jsx b/server/sonar-web/src/main/js/apps/nav/component/component-nav.jsx index ce2b4da804d..917d54a6899 100644 --- a/server/sonar-web/src/main/js/apps/nav/component/component-nav.jsx +++ b/server/sonar-web/src/main/js/apps/nav/component/component-nav.jsx @@ -39,7 +39,12 @@ export default React.createClass({ }, initTooltips() { - $('[data-toggle="tooltip"]', React.findDOMNode(this)).tooltip({ container: 'body', placement: 'bottom' }); + $('[data-toggle="tooltip"]', React.findDOMNode(this)).tooltip({ + container: 'body', + placement: 'bottom', + delay: { show: 0, hide: 1000 }, + html: true + }); }, render() { diff --git a/server/sonar-web/src/main/less/init/links.less b/server/sonar-web/src/main/less/init/links.less index 9cca0ba5d35..83e89658c35 100644 --- a/server/sonar-web/src/main/less/init/links.less +++ b/server/sonar-web/src/main/less/init/links.less @@ -27,6 +27,9 @@ a { } +.tooltip a { color: @lightBlue; } + + // Misc .link-no-underline { border-bottom: none; } diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index a8fed1ceb92..82e2eabf235 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -3045,8 +3045,11 @@ update_center.status.DEPS_REQUIRE_SYSTEM_UPGRADE=Some of dependencies requires s # #------------------------------------------------------------------------------ component_navigation.status.failed=The last analysis has failed. +component_navigation.status.failed.admin=The last analysis has failed.
    More details available on the Background Tasks page. component_navigation.status.pending=There is a pending analysis. +component_navigation.status.pending.admin=There is a pending analysis.
    More details available on the Background Tasks page. component_navigation.status.in_progress=The analysis is in progress. +component_navigation.status.in_progress.admin=The analysis is in progress.
    More details available on the Background Tasks page. background_task.status.PENDING=Pending background_task.status.IN_PROGRESS=In Progress -- 2.39.5