Skip to content

Commit 1514f40

Browse files
authored
Merge pull request finos#36 from Finsemble/49663-tooltips
tooltip
2 parents a8677a0 + baa41a0 commit 1514f40

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

toolbox/fdc3-workbench/src/components/Workbench/AppChannelListeners.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const AppChannelListeners = observer(() => {
5656
return (
5757
<AccordionList
5858
title="App Channels"
59+
icon="Any context already in the channel will NOT be received automatically"
5960
noItemsText="No App Channel Listeners"
6061
listItems={contextListeners}
6162
onDelete={handleDeleteListener}

toolbox/fdc3-workbench/src/components/Workbench/ContextListeners.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const ContextListeners = observer(() => {
5656
return (
5757
<AccordionList
5858
title="System Channels"
59+
icon="Any context already in the channel will be received automatically"
5960
noItemsText="No System Channels Listeners"
6061
listItems={contextListeners}
6162
onDelete={handleDeleteListener}

toolbox/fdc3-workbench/src/components/Workbench/Workbench.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React, { useState } from "react";
22
import { observer } from "mobx-react";
33
import { createStyles, makeStyles, Theme } from "@material-ui/core/styles";
4+
import { Tooltip } from "@material-ui/core";
5+
import InfoIcon from '@material-ui/icons/Info';
46
import { Tabs, Tab } from "@material-ui/core";
57
import { TabPanel } from "../common/TabPanel";
68
import { ContextListeners } from "./ContextListeners";
@@ -10,6 +12,11 @@ import { SystemLog } from "./SystemLog";
1012

1113
const useStyles = makeStyles((theme: Theme) =>
1214
createStyles({
15+
'@global': {
16+
".MuiTab-wrapper": {
17+
flexDirection: "row !important"
18+
}
19+
},
1320
root: {
1421
flexGrow: 1,
1522
},
@@ -33,6 +40,11 @@ const useStyles = makeStyles((theme: Theme) =>
3340
borderBottomWidth: "1px",
3441
minHeight: "28px",
3542
},
43+
icon: {
44+
marginBottom: "3px !important",
45+
fontSize: "15px",
46+
marginRight: "3px"
47+
},
3648
})
3749
);
3850

@@ -64,7 +76,13 @@ export const Workbench = observer(() => {
6476
}}
6577
className={classes.tabs}
6678
>
67-
<Tab label="Listeners" {...a11yProps(0)} />
79+
<Tab label="Listeners" {...a11yProps(0)} style={{display:'flex',alignItems:'center'}} icon={
80+
<Tooltip
81+
title="Context received will be displayed here, but you will not receive your own messages back"
82+
aria-label="Context received will be displayed here, but you will not receive your own messages back" >
83+
<InfoIcon className={classes.icon} />
84+
</Tooltip>}
85+
/>
6886
<Tab label="System Log" {...a11yProps(1)} />
6987
</Tabs>
7088

toolbox/fdc3-workbench/src/components/common/AccordionContent.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import React from "react";
22
import { createStyles, makeStyles, Theme } from "@material-ui/core/styles";
33
import { Accordion, AccordionDetails, AccordionSummary, Typography } from "@material-ui/core";
44
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
5+
import { Tooltip } from "@material-ui/core";
6+
import InfoIcon from '@material-ui/icons/Info';
57

68
export interface AccordionContentProps {
79
title: string;
810
children: React.ReactNode;
11+
icon?: string;
912
}
1013

1114
const useStyles = makeStyles((theme: Theme) =>
@@ -49,10 +52,15 @@ const useStyles = makeStyles((theme: Theme) =>
4952
expand_icon: {
5053
color: "#0086bf",
5154
},
55+
icon: {
56+
marginBottom: "-1px !important",
57+
fontSize: "15px",
58+
marginLeft: "5px"
59+
}
5260
})
5361
);
5462

55-
export const AccordionContent: React.FC<AccordionContentProps> = ({ title, children }: AccordionContentProps) => {
63+
export const AccordionContent: React.FC<AccordionContentProps> = ({ icon, title, children }: AccordionContentProps) => {
5664
const classes = useStyles();
5765

5866
return (
@@ -66,6 +74,9 @@ export const AccordionContent: React.FC<AccordionContentProps> = ({ title, child
6674
>
6775
<Typography variant="h5" className={classes.accordionTitle}>
6876
{title}
77+
{icon && <Tooltip title={icon} aria-label={icon}>
78+
<InfoIcon className={classes.icon}/>
79+
</Tooltip>}
6980
</Typography>
7081
</AccordionSummary>
7182

toolbox/fdc3-workbench/src/components/common/AccordionList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface AccordionListItem {
1212

1313
export interface AccordionListProps {
1414
title: string;
15+
icon?: string;
1516
listItems: AccordionListItem[];
1617
noItemsText: string;
1718
onDelete?: (id: string) => void;
@@ -38,6 +39,7 @@ const useStyles = makeStyles((theme: Theme) =>
3839

3940
export const AccordionList: React.FC<AccordionListProps> = ({
4041
title,
42+
icon,
4143
listItems,
4244
noItemsText,
4345
onDelete,
@@ -51,7 +53,7 @@ export const AccordionList: React.FC<AccordionListProps> = ({
5153
};
5254

5355
return (
54-
<AccordionContent title={title}>
56+
<AccordionContent title={title} icon={icon}>
5557
{!listItems.length && <Typography variant="body1">{noItemsText}</Typography>}
5658
{!!listItems.length && (
5759
<List className={classes.list}>

0 commit comments

Comments
 (0)