From 85502116158b0cefc5a09040d183e361e3e9f711 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Thu, 18 Jun 2020 10:35:55 +0200 Subject: [PATCH 1/4] fix tooltip multiline view --- scm-ui/ui-components/src/Tooltip.tsx | 2 +- .../src/__snapshots__/storyshots.test.ts.snap | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scm-ui/ui-components/src/Tooltip.tsx b/scm-ui/ui-components/src/Tooltip.tsx index 79f5c9f855..b358c6382f 100644 --- a/scm-ui/ui-components/src/Tooltip.tsx +++ b/scm-ui/ui-components/src/Tooltip.tsx @@ -38,7 +38,7 @@ class Tooltip extends React.Component { render() { const { className, message, location, children } = this.props; - const multiline = message.length > 60 ? "has-tooltip-multiline" : ""; + const multiline = message.length > 60 ? "is-multiline" : ""; return ( {children} diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index 4ab1158583..79430a7441 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -17281,7 +17281,7 @@ exports[`Storyshots Diff File Controls 1`] = ` className="control" > Date: Thu, 18 Jun 2020 10:42:16 +0200 Subject: [PATCH 2/4] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5034293255..e9b2d9a843 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed active state of sub navigation items, which are using activeWhenMatch ([#1199](https://github.com/scm-manager/scm-manager/pull/1199)) - Handles repositories in custom directories correctly in migration from 1.x ([#1201](https://github.com/scm-manager/scm-manager/pull/1201)) - Usage of short git commit ids in changeset urls ([#1200](https://github.com/scm-manager/scm-manager/pull/1200)) +- Fixes linebreaks in multiline tooltip ([#1207](https://github.com/scm-manager/scm-manager/pull/1207)) ## [2.0.0] - 2020-06-04 ### Added From d2346278f1926424143caacb2873887e7481029e Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Fri, 19 Jun 2020 11:43:04 +0200 Subject: [PATCH 3/4] added some tooltip stories to test multiline --- scm-ui/ui-components/src/Tooltip.stories.tsx | 44 ++++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/scm-ui/ui-components/src/Tooltip.stories.tsx b/scm-ui/ui-components/src/Tooltip.stories.tsx index f6f4cbad5b..13cfb93228 100644 --- a/scm-ui/ui-components/src/Tooltip.stories.tsx +++ b/scm-ui/ui-components/src/Tooltip.stories.tsx @@ -32,24 +32,38 @@ import Button from "./buttons/Button"; const Wrapper = styled.div` margin: 2rem; - max-width: 400px; + width: 100%; `; const Spacing = styled.div` padding: 2em 6em; + width: 50%; + margin: 0 auto; `; const positions = ["right", "top", "left", "bottom"]; const message = "Heart of Gold"; +const mutltiline = `Characters: + +- Arthur Dent +- Ford Prefect +- Zaphod Beeblebrox +- Marvin the Paranoid Android +- Trillian +- Slartibartfast`; + +const shortMultiline = `* a +* b +* c`; + const RoutingDecorator = (story: () => ReactNode) => {story()}; storiesOf("Tooltip", module) .addDecorator(RoutingDecorator) - .addDecorator(storyFn => {storyFn()}) .add("Default", () => ( -
+ {positions.map(position => ( @@ -57,5 +71,27 @@ storiesOf("Tooltip", module) ))} -
+ + )) + .add("Multiline", () => ( + + {positions.map(position => ( + + +
+ right -
- -
+ + +
+
+ - - + top - -
-
+ + +
+
+ - - + left - -
-
+ + +
+
+ - - + bottom - -
+ + +
+ + +`; + +exports[`Storyshots Tooltip Multiline 1`] = ` +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+`; + +exports[`Storyshots Tooltip Short Multiline 1`] = ` +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
`;