From e95a67f43e74ef6c8e4aab88e1ae43a1cd74fbf5 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 26 Apr 2016 14:57:47 +0200 Subject: improve tooltips on web api page --- .../src/main/js/apps/web-api/components/Action.js | 37 +++++++------ .../js/apps/web-api/components/DeprecatedBadge.js | 3 +- .../js/apps/web-api/components/InternalBadge.js | 3 +- .../src/main/js/apps/web-api/components/Menu.js | 39 +++++++------- .../src/main/js/apps/web-api/components/Search.js | 61 +++++++++++++--------- 5 files changed, 82 insertions(+), 61 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Action.js b/server/sonar-web/src/main/js/apps/web-api/components/Action.js index 7e9c41cbc43..5f8b5967589 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Action.js +++ b/server/sonar-web/src/main/js/apps/web-api/components/Action.js @@ -25,6 +25,7 @@ import Params from './Params'; import ResponseExample from './ResponseExample'; import DeprecatedBadge from './DeprecatedBadge'; import InternalBadge from './InternalBadge'; +import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin'; export default class Action extends React.Component { state = { @@ -52,31 +53,33 @@ export default class Action extends React.Component { return (
-
- + +
+ -

- {verb} {actionKey} -

+

+ {verb} {actionKey} +

- {action.internal && ( - + {action.internal && ( + - )} + )} - {action.since && ( - since {action.since} - )} + {action.since && ( + since {action.since} + )} - {action.deprecatedSince && ( - + {action.deprecatedSince && ( + - )} -
+ )} +
+
+ title={translate('api_documentation.deprecation_tooltip')} + data-toggle="tooltip"> {label} ); diff --git a/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.js b/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.js index cfb87e6c841..013af802b04 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.js +++ b/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.js @@ -25,7 +25,8 @@ export default function InternalBadge () { return ( + title={translate('api_documentation.internal_tooltip')} + data-toggle="tooltip"> internal ); diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Menu.js b/server/sonar-web/src/main/js/apps/web-api/components/Menu.js index 09cf1727297..ba2938ca171 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Menu.js +++ b/server/sonar-web/src/main/js/apps/web-api/components/Menu.js @@ -22,6 +22,7 @@ import { Link } from 'react-router'; import classNames from 'classnames'; import InternalBadge from './InternalBadge'; +import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin'; import { getActionKey } from '../utils'; export default function Menu ({ domains, showInternal, showOnlyDeprecated, searchQuery, splat }) { @@ -44,24 +45,26 @@ export default function Menu ({ domains, showInternal, showOnlyDeprecated, searc return (
-
- {filteredDomains.map(domain => ( - -

- {domain.path} - {domain.internal && ( - - )} -

-

- {domain.description} -

- - ))} -
+ +
+ {filteredDomains.map(domain => ( + +

+ {domain.path} + {domain.internal && ( + + )} +

+

+ {domain.description} +

+ + ))} +
+
); } diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Search.js b/server/sonar-web/src/main/js/apps/web-api/components/Search.js index b62c572a635..ca3ae5e2c4a 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Search.js +++ b/server/sonar-web/src/main/js/apps/web-api/components/Search.js @@ -21,6 +21,7 @@ import _ from 'underscore'; import React from 'react'; import Checkbox from '../../../components/shared/checkbox'; +import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin'; import { translate } from '../../../helpers/l10n'; export default class Search extends React.Component { @@ -56,31 +57,43 @@ export default class Search extends React.Component { onChange={this.handleSearch.bind(this)}/>
-
- - {' '} - - Show Internal API - -
+ +
+ + {' '} + + Show Internal API + + +
+
-
- - {' '} - - Show Only Deprecated API - -
+ +
+ + {' '} + + Show Only Deprecated API + + +
+
); } -- cgit v1.2.3