diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fc627f6f7..63c5aee55c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.3.0] - 2020-07-23 +## Unreleased +### Changed +- Help tooltips are now mutliline by default ([#1271](https://github.com/scm-manager/scm-manager/pull/1271)) +### Fixed +- Fixed unecessary horizontal scrollbar in modal dialogs ([#1271](https://github.com/scm-manager/scm-manager/pull/1271)) + +## [2.3.0] - 2020-07-23 ### Added - Add branch link provider to access branch links in plugins ([#1243](https://github.com/scm-manager/scm-manager/pull/1243)) - Add key value input field component ([#1246](https://github.com/scm-manager/scm-manager/pull/1246)) diff --git a/scm-ui/ui-components/src/Help.stories.tsx b/scm-ui/ui-components/src/Help.stories.tsx new file mode 100644 index 0000000000..6be7d02654 --- /dev/null +++ b/scm-ui/ui-components/src/Help.stories.tsx @@ -0,0 +1,58 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import styled from "styled-components"; +import * as React from "react"; +import { storiesOf } from "@storybook/react"; +import Help from "./Help"; + +const Wrapper = styled.div` + margin: 5rem; +`; + +const Spacing = styled.div` + margin-top: 1rem; +`; + +const longContent = + "Cleverness nuclear genuine static irresponsibility invited President Zaphod\n" + + "Beeblebrox hyperspace ship. Another custard through computer-generated universe\n" + + "shapes field strong disaster parties Russell’s ancestors infinite colour\n" + + "imaginative generator sweep."; + +storiesOf("Help", module) + .addDecorator(storyFn => {storyFn()}) + .add("Default", () => ) + .add("Multiline", () => ( + <> + + + + + + + + + + )); diff --git a/scm-ui/ui-components/src/Help.tsx b/scm-ui/ui-components/src/Help.tsx index 3bb250f3f0..f49b49f1ca 100644 --- a/scm-ui/ui-components/src/Help.tsx +++ b/scm-ui/ui-components/src/Help.tsx @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React from "react"; +import React, { FC } from "react"; import classNames from "classnames"; import styled from "styled-components"; import Tooltip from "./Tooltip"; @@ -29,6 +29,7 @@ import HelpIcon from "./HelpIcon"; type Props = { message: string; + multiline?: boolean; className?: string; }; @@ -37,13 +38,17 @@ const HelpTooltip = styled(Tooltip)` padding-left: 3px; `; -export default class Help extends React.Component { - render() { - const { message, className } = this.props; - return ( - - - - ); - } -} +const Help: FC = ({ message, multiline, className }) => ( + + + +); + +Help.defaultProps = { + multiline: true +}; + +export default Help; 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 58725b1514..92c6869962 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -38549,6 +38549,65 @@ exports[`Storyshots Forms|Checkbox Disabled 1`] = ` `; +exports[`Storyshots Forms|Checkbox With HelpText 1`] = ` +
+
+
+ +
+
+
+
+ +
+
+
+`; + exports[`Storyshots Forms|DropDown Default 1`] = `
`; +exports[`Storyshots Forms|Radio With HelpText 1`] = ` +
+ + +
+`; + exports[`Storyshots Forms|Textarea OnCancel 1`] = `
`; +exports[`Storyshots Help Default 1`] = ` +
+ + + +
+`; + +exports[`Storyshots Help Multiline 1`] = ` +
+
+ + + + +
+
+ + + + +
+
+`; + exports[`Storyshots Icon Colors 1`] = `
`; +exports[`Storyshots Modal|Modal Closeable 1`] = ` +
+
+
+
+

+ Hitchhiker Modal +

+
+
+

+ Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows + hostess’s really oblong Infinite Improbability thing into the starship against which behavior accordance.with + Kakrafoon humanoid undergarment ship powered by GPP-guided bowl of petunias nothing was frequently away incredibly + ordinary mob. +

+
+
+
+`; + exports[`Storyshots Modal|Modal Default 1`] = `

- Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows hostess’s really oblong Infinite Improbability thing into the starship against which behavior accordance.with Kakrafoon humanoid undergarment ship powered by GPP-guided bowl of petunias nothing was frequently away incredibly ordinary mob. + Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows + hostess’s really oblong Infinite Improbability thing into the starship against which behavior accordance.with + Kakrafoon humanoid undergarment ship powered by GPP-guided bowl of petunias nothing was frequently away incredibly + ordinary mob. +

+ +
+
+`; + +exports[`Storyshots Modal|Modal Long content 1`] = ` +
+
+
+
+

+ Hitchhiker Modal +

+
+
+

+ Marvin +

+

+ The Paranoid Android +

+
+
+ + The following content comes from the awesome + + + Hitchhikers Wiki + +
+
+
+ Marvin +
+
+

+ Marvin, more fully known as Marvin the Paranoid Android, is an incredibly brilliant but overwhelmingly depressed robot manufactured by the Sirius Cybernetics Corporation and unwilling servant to the crew of the Heart of Gold. +

+
+
+

+ Physical Appearance +

+

+ In the novels, Marvin is described thusly: "...though it was beautifully constructed and polished it looked somehow as if the various parts of its more or less humanoid body didn't quite fit properly. In fact, they fit perfectly well, but something in its bearing suggested that they might have fitted better." +

+

+ On the radio show, there's no physical description of Marvin, though his voice is digitally altered to sound more robotic, and any scene that focuses on him is accompanied by sounds of mechanical clanking and hissing. +

+

+ In the TV series, Marvin is built in the style of a 1950's robot similar to Robbie the Robot from Forbidden Planet or Twiki from Buck Rogers. His body is blocky and angular, with a pair of clamp-claw hands, shuffling feet and a squarish head with a dour face. +

+

+ In the movie, Marvin is a short, stout robot built of smooth, white plastic. His arms are much longer than his legs, and his head is a massive sphere with only a pair of triangle eyes for a face. His large head and simian-like proportions give Marvin a perpetual slouch, adding to his melancholy personality. At the start of the film his eyes glow, but at the end he is shot but unharmed, leaving a hole in his head and dimming his eyes. This is probably the most depressing and unacceptable manifestation of Marvin ever conceived, and thus paradoxically the most accurate. +

+
+
+
+

+ Personality +

+

+ Marvin the robot has a prototype version of the Genuine People Personality (GPP) software from SCC, allowing him sentience and the ability to feel emotions and develop a personality. He's also incredibly smart, having a "brain the size of a planet" capable of computing extremely complex mathematics, as well as solving difficult problems and operating high-tech devices. +

+

+ However, despite being so smart, Marvin is typically made to perform menial tasks and labour such as escorting people, opening doors, picking up pieces of paper, and other tasks well beneath his skills. Even extremely hard tasks, such as computing for the vast Krikkit robot army, are trivial for Marvin. All this leaves him extremely bored, frustrated, and overwhelmingly depressed. Because of this, all modern GPP-capable machines, such as Eddie the computer and the Heart of Gold's automatic doors, are programmed to be extremely cheerful and happy, much to Marvin's disgust. +

+

+ Marvin hates everyone and everything he comes into contact with, having no respect for anybody and will criticise and insult others at any opportunity, or otherwise rant and complain for hours on end about his own problems, such as the terrible pain he suffers in all the diodes down his left side. His contempt for everyone is often justified, as almost every person he comes across, even those who consider him a friend, (such as Arthur and Trillian, who treat him more kindly than Ford and Zaphod) treat Marvin as an expendable servant, even sending him to his death more than once (such as when Zaphod ordered Marvin to fight the gigantic, heavy-duty Frogstar Scout Robot Class D so he could escape). Being a robot, he still does what he's told (he won't enjoy it, nor will he let you forget it, but he'll do it anyway), though he'd much rather sulk in a corner by himself. +

+

+ Several times in the series Marvin ends up alone and isolated for extremely long periods of time, sometimes spanning millions of years, either by sheer bad luck (such as the explosion that propelled everyone but Marvin to Milliways in the far-off future) or because his unpleasantly depressing personality drives them away or, in more than one case, makes them commit suicide. In his spare time (which he has a lot of), Marvin will attempt to occupy himself by composing songs and writing poetry. Of course, none of them are particularly cheerful, or even that good. +

+
+
+
+
+`; + +exports[`Storyshots Modal|Modal With form elements 1`] = ` +
+
+
+
+

+ Hitchhiker Modal +

+
+
+
+ + +
+
+

+ Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows + hostess’s really oblong Infinite Improbability thing into the starship against which behavior accordance.with + Kakrafoon humanoid undergarment ship powered by GPP-guided bowl of petunias nothing was frequently away incredibly + ordinary mob. +

+
+
+ +
+