aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-10-23 09:46:53 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-10-23 13:41:52 +0200
commitddb6f1e13ff2cde359672c1df474c5b6e6f137da (patch)
treeac8b974eac326c70444caae8c298a0c4544aa72b
parent95f0b3565ceba9e5b3a5b30b69fd10df4663b984 (diff)
downloadsonarqube-ddb6f1e13ff2cde359672c1df474c5b6e6f137da.tar.gz
sonarqube-ddb6f1e13ff2cde359672c1df474c5b6e6f137da.zip
SONAR-9702 cut long branch name in header
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx4
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranch-test.tsx.snap24
2 files changed, 25 insertions, 3 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 334fdfb5e1b..e3a27248da2 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
@@ -215,7 +215,9 @@ export default class ComponentNavBranch extends React.PureComponent<Props, State
})}>
<a className="link-base-color link-no-underline" href="#" onClick={this.handleClick}>
<BranchIcon branch={currentBranch} className="little-spacer-right" />
- {currentBranch.name}
+ <Tooltip overlay={currentBranch.name} mouseEnterDelay={1}>
+ <span className="text-limited text-top">{currentBranch.name}</span>
+ </Tooltip>
<i className="icon-dropdown little-spacer-left" />
</a>
{this.renderDropdown()}
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 38c20e78b97..baa03cf6636 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
@@ -18,7 +18,17 @@ exports[`renders main branch 1`] = `
}
className="little-spacer-right"
/>
- master
+ <Tooltip
+ mouseEnterDelay={1}
+ overlay="master"
+ placement="bottom"
+ >
+ <span
+ className="text-limited text-top"
+ >
+ master
+ </span>
+ </Tooltip>
<i
className="icon-dropdown little-spacer-left"
/>
@@ -92,7 +102,17 @@ exports[`renders short-living branch 1`] = `
}
className="little-spacer-right"
/>
- foo
+ <Tooltip
+ mouseEnterDelay={1}
+ overlay="foo"
+ placement="bottom"
+ >
+ <span
+ className="text-limited text-top"
+ >
+ foo
+ </span>
+ </Tooltip>
<i
className="icon-dropdown little-spacer-left"
/>