From f3425772870c017497d30bcc5115b8b3d62f9fb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Fri, 8 Jun 2018 08:39:30 +0200 Subject: [PATCH] SONAR-10287 Use browser tooltips for descriptive hints --- .../nav/component/ComponentNavBranch.tsx | 7 +- .../ComponentNavBranchesMenuItem.tsx | 25 ++-- .../ComponentNavBranch-test.tsx.snap | 42 ++---- ...ComponentNavBranchesMenuItem-test.tsx.snap | 133 ++++++++---------- .../components/TaskComponent.tsx | 11 +- .../__snapshots__/TaskComponent-test.tsx.snap | 26 ++-- .../components/ActivationFormModal.tsx | 7 +- .../components/RuleDetailsMeta.tsx | 1 + .../components/SimilarRulesFilter.tsx | 5 +- .../RuleDetailsMeta-test.tsx.snap | 1 + .../sidebar/ProjectOverviewFacet.js | 7 +- .../main/js/apps/overview/events/Event.tsx | 13 +- .../__snapshots__/Event-test.tsx.snap | 14 +- .../projectActivity/components/EventInner.js | 11 +- .../main/js/components/measure/Measure.tsx | 6 +- 15 files changed, 133 insertions(+), 176 deletions(-) diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx index 6a390a20932..8cba10a5dbc 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx @@ -35,7 +35,6 @@ import { translate } from '../../../../helpers/l10n'; import PlusCircleIcon from '../../../../components/icons-components/PlusCircleIcon'; import HelpTooltip from '../../../../components/controls/HelpTooltip'; import Toggler from '../../../../components/controls/Toggler'; -import Tooltip from '../../../../components/controls/Tooltip'; import DropdownIcon from '../../../../components/icons-components/DropdownIcon'; import { isSonarCloud } from '../../../../helpers/system'; @@ -184,9 +183,9 @@ export default class ComponentNavBranch extends React.PureComponent - - {displayName} - + + {displayName} + diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenuItem.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenuItem.tsx index 8788fe657c1..204014a567e 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenuItem.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenuItem.tsx @@ -32,7 +32,6 @@ import { } from '../../../../helpers/branches'; import { translate } from '../../../../helpers/l10n'; import { getBranchLikeUrl } from '../../../../helpers/urls'; -import Tooltip from '../../../../components/controls/Tooltip'; export interface Props { branchLike: BranchLike; @@ -58,18 +57,18 @@ export default function ComponentNavBranchesMenuItem({ branchLike, ...props }: P active: props.selected })} to={getBranchLikeUrl(props.component.key, branchLike)}> - -
- - {displayName} - {isMainBranch(branchLike) && ( -
{translate('branches.main_branch')}
- )} -
-
+
+ + {displayName} + {isMainBranch(branchLike) && ( +
{translate('branches.main_branch')}
+ )} +
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranch-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranch-test.tsx.snap index 637e7d69a8e..72ce3a7917c 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranch-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranch-test.tsx.snap @@ -50,16 +50,12 @@ exports[`renders main branch 1`] = ` } className="little-spacer-right" /> - - - master - - + master + @@ -140,16 +136,12 @@ exports[`renders pull request 1`] = ` } className="little-spacer-right" /> - - - 1234 – Feature PR - - + 1234 – Feature PR + @@ -251,16 +243,12 @@ exports[`renders short-living branch 1`] = ` } className="little-spacer-right" /> - - - foo - - + foo + diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenuItem-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenuItem-test.tsx.snap index 463a43a173f..b4c9f37a5d3 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenuItem-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenuItem-test.tsx.snap @@ -18,31 +18,26 @@ exports[`renders main branch 1`] = ` } } > - + + master
- - master -
- branches.main_branch -
+ branches.main_branch
-
+
@@ -80,34 +75,29 @@ exports[`renders short-living branch 1`] = ` } } > - -
- - foo -
-
+ } + className="little-spacer-right big-spacer-left" + /> + foo +
@@ -153,35 +143,30 @@ exports[`renders short-living orhpan branch 1`] = ` } } > - -
- - foo -
-
+ } + className="little-spacer-right" + /> + foo +
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx index 3a4c6d80fe1..c3afacc324a 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx @@ -32,7 +32,6 @@ import { import ShortLivingBranchIcon from '../../../components/icons-components/ShortLivingBranchIcon'; import LongLivingBranchIcon from '../../../components/icons-components/LongLivingBranchIcon'; import PullRequestIcon from '../../../components/icons-components/PullRequestIcon'; -import Tooltip from '../../../components/controls/Tooltip'; interface Props { task: Task; @@ -76,12 +75,10 @@ export default function TaskComponent({ task }: Props) { )} {task.pullRequest && ( - - - / - {task.pullRequest} - - + + / + {task.pullRequest} + )} )} diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskComponent-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskComponent-test.tsx.snap index d1f54e342f5..88328a93b61 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskComponent-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskComponent-test.tsx.snap @@ -163,23 +163,21 @@ exports[`renders correctly for branches and pullrequest 3`] = ` } > foo - + - - / - - pr-89 + } + > + / - + pr-89 + (
- + {param.type === 'TEXT' ? (