Skip to content

Commit aa088ec

Browse files
committed
Merge remote-tracking branch 'origin/develop' into fix/uriPatternEditor-CMEM-6461
2 parents 6c442d0 + 30b2b70 commit aa088ec

7 files changed

Lines changed: 69 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
88

99
### Added
1010

11+
- Added custom icon for "Concatenate to file" operator (CMEM-6476).
1112
- `<ContentGroup />` component
1213
- Manage display of a grouped content section.
1314
- Add info, actions and context annotations by using its properties.
@@ -23,6 +24,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
2324
- `<NodeContent />`
2425
- `resizeDirections` to specifiy the axis that can be used to resize the node
2526
- `resizeMaxDimensions` to add maximum values for resizing height/width
27+
- `<CardActions />`
28+
- `noWrap` property to display them without wrapping its children on multiple lines
29+
- `<SimpleDialog />`
30+
- `actionsProps` property to forward `CardActions` properties, e.g. `noWrap`
31+
- `<MenutItem />`
32+
- `tooltip` property to dislay tooltip on menu item label
2633

2734
### Fixed
2835

src/components/Card/CardActions.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ export interface CardActionsProps extends React.HTMLAttributes<HTMLDivElement> {
88
* Mainly used for cards used as modals (dialogs).
99
*/
1010
inverseDirection?: boolean;
11+
/**
12+
* Set footer to display its children on only one line.
13+
*/
14+
noWrap?: boolean;
1115
}
1216

1317
/**
@@ -18,6 +22,7 @@ export const CardActions = ({
1822
children,
1923
className = "",
2024
inverseDirection = false,
25+
noWrap = false,
2126
...otherProps
2227
}: CardActionsProps) => {
2328
return (
@@ -26,6 +31,7 @@ export const CardActions = ({
2631
className={
2732
`${eccgui}-card__actions` +
2833
(inverseDirection ? ` ${eccgui}-card__actions--inversedirection` : "") +
34+
(noWrap ? ` ${eccgui}-card__actions--nowrap` : "") +
2935
(className ? " " + className : "")
3036
}
3137
>

src/components/Card/card.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ $eccgui-size-card-spacing: $eccgui-size-typo-base !default;
236236
flex-direction: row-reverse;
237237
}
238238

239+
.#{$eccgui}-card__actions--nowrap {
240+
flex-wrap: nowrap;
241+
}
242+
239243
.#{$eccgui}-card__actions__aux {
240244
display: flex;
241245
flex-flow: row wrap;
@@ -272,4 +276,15 @@ $eccgui-size-card-spacing: $eccgui-size-typo-base !default;
272276
.#{$eccgui}-card__actions--inversedirection > & {
273277
justify-content: flex-start;
274278
}
279+
280+
.#{$eccgui}-card__actions--nowrap > & {
281+
flex-shrink: 5;
282+
flex-wrap: nowrap;
283+
min-width: 0;
284+
285+
& > * {
286+
flex-shrink: 10;
287+
min-width: 0;
288+
}
289+
}
275290
}

src/components/Dialog/SimpleDialog.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
55
import IconButton from "../Icon/IconButton";
66
import { TestableComponent } from "../interfaces";
77

8-
import { Card, CardActions, CardContent, CardHeader, CardOptions, CardTitle } from "./../Card";
8+
import { Card, CardActions, CardActionsProps, CardContent, CardHeader, CardOptions, CardTitle } from "./../Card";
99
import Divider from "./../Separation/Divider";
1010
import Modal, { ModalProps } from "./Modal";
1111

@@ -45,6 +45,8 @@ export interface SimpleDialogProps extends ModalProps, TestableComponent {
4545
showFullScreenToggler?: boolean;
4646
/** Starts the modal in full screen mode. The show full screen toggler will be automatically enabled. */
4747
startInFullScreenMode?: boolean;
48+
/** Forward properties to the actions footer component. */
49+
actionsProps?: Omit<CardActionsProps, "inverseDirection">;
4850
}
4951

5052
/**
@@ -66,6 +68,7 @@ export const SimpleDialog = ({
6668
showFullScreenToggler = false,
6769
startInFullScreenMode = false,
6870
size,
71+
actionsProps,
6972
...otherProps
7073
}: SimpleDialogProps) => {
7174
const [displayFullscreen, setDisplayFullscreen] = React.useState<boolean>(startInFullScreenMode);
@@ -112,7 +115,11 @@ export const SimpleDialog = ({
112115
<CardContent className={`${eccgui}-dialog__notifications`}>{notifications}</CardContent>
113116
)}
114117
{actions && (
115-
<CardActions inverseDirection className={intentClassName}>
118+
<CardActions
119+
{...actionsProps}
120+
inverseDirection
121+
className={`${actionsProps?.className ?? ""} ${intentClassName}`}
122+
>
116123
{actions}
117124
</CardActions>
118125
)}

src/components/Icon/canonicalIconNames.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const canonicalIcons = {
1919
"artefact-commit": icons.Commit,
2020
"artefact-task-deleteprojectfiles": icons.TrashCan,
2121
"artefact-task-downloadfile": icons.CloudDownload,
22+
"artefact-task-concatenatetofile": icons.DocumentExport,
2223
"artefact-dataset-csv": icons.Csv,
2324
"artefact-dataset-eccencadataplatform": icons.DataVis_1,
2425
"artefact-dataset-excel": icons.Xls,

src/components/Menu/MenuItem.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { openInNewTab } from "../../common/utils/openInNewTab";
55
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
66
import { ValidIconName } from "../Icon/canonicalIconNames";
77
import Icon from "../Icon/Icon";
8+
import Tooltip from "../Tooltip/Tooltip";
89

910
import { TestIconProps } from "./../Icon/TestIcon";
1011

@@ -15,16 +16,41 @@ export interface MenuItemProps
1516
* If set the icon is diplayed on the left side of the menu item.
1617
*/
1718
icon?: ValidIconName | string[] | React.ReactElement<TestIconProps>;
19+
/**
20+
* Submenu.
21+
*/
1822
children?: React.ReactNode;
23+
/**
24+
* Tooltip, but only added to the label, not to the full menu item.
25+
*/
26+
tooltip?: string | JSX.Element;
1927
}
2028

2129
/**
2230
* Single item, used as child inside `Menu`.
2331
*/
24-
export const MenuItem = ({ children, className = "", icon, onClick, href, ...restProps }: MenuItemProps) => {
32+
export const MenuItem = ({
33+
children,
34+
className = "",
35+
icon,
36+
onClick,
37+
href,
38+
text,
39+
tooltip,
40+
...restProps
41+
}: MenuItemProps) => {
2542
return (
2643
<BlueprintMenuItem
2744
{...restProps}
45+
text={
46+
tooltip ? (
47+
<Tooltip content={tooltip} fill>
48+
{text}
49+
</Tooltip>
50+
) : (
51+
text
52+
)
53+
}
2854
href={href}
2955
onClick={(e: React.MouseEvent<HTMLElement>) =>
3056
openInNewTab(e as React.MouseEvent<HTMLAnchorElement>, onClick, href)

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11218,10 +11218,10 @@ range-parser@^1.2.1:
1121811218
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
1121911219
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
1122011220

11221-
re-resizable@^6.10.1:
11222-
version "6.10.1"
11223-
resolved "https://registry.yarnpkg.com/re-resizable/-/re-resizable-6.10.1.tgz#d062ca50bbc4ec7ae940f756cba36479e9015bc5"
11224-
integrity sha512-m33nSWRH57UZLmep5M/LatkZ2NRqimVD/bOOpvymw5Zf33+eTSEixsUugscOZzAtK0/nx+OSuOf8VbKJx/4ptw==
11221+
re-resizable@^6.10.3:
11222+
version "6.11.2"
11223+
resolved "https://registry.yarnpkg.com/re-resizable/-/re-resizable-6.11.2.tgz#2e8f7119ca3881d5b5aea0ffa014a80e5c1252b3"
11224+
integrity sha512-2xI2P3OHs5qw7K0Ud1aLILK6MQxW50TcO+DetD9eIV58j84TqYeHoZcL9H4GXFXXIh7afhH8mv5iUCXII7OW7A==
1122511225

1122611226
react-app-polyfill@^3.0.0:
1122711227
version "3.0.0"

0 commit comments

Comments
 (0)