Skip to content

Commit ead66e2

Browse files
committed
fix lint issues
1 parent 906401d commit ead66e2

21 files changed

+803
-817
lines changed

toolbox/fdc3-workbench/eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export default [
5858
ecmaFeatures: {
5959
jsx: true,
6060
},
61-
tsconfigRootDir: './src',
6261
},
6362
},
6463

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export const ChannelField = observer(
119119
).reverse();
120120

121121
const getOptionLabel = (option: ListenerOptionType | string) =>
122-
typeof option === 'string' ? option : option.type ?? option.title ?? '';
122+
typeof option === 'string' ? option : (option.type ?? option.title ?? '');
123123

124124
const handleAddContextListener = (channelId: string) => {
125125
let foundChannel = currentChannelList.find((currentChannel: any) => currentChannel.id === channelId);
@@ -336,7 +336,12 @@ export const ChannelField = observer(
336336
</Link>
337337
</Grid>
338338
</Grid>
339-
<Button variant="contained" color="secondary" onClick={() => handleRemoveOrDisconnect(channel)} sx={styles.secondMargin}>
339+
<Button
340+
variant="contained"
341+
color="secondary"
342+
onClick={() => handleRemoveOrDisconnect(channel)}
343+
sx={styles.secondMargin}
344+
>
340345
{isPrivateChannel ? 'Disconnect' : 'Discard Channel'}
341346
</Button>
342347
<div style={styles.border}></div>

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

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,7 @@ export const Channels = observer(({ handleTabChange }: { handleTabChange: any })
122122
<Grid item xs={12}>
123123
<Typography variant="h5">Current channel</Typography>
124124
</Grid>
125-
<Grid
126-
container
127-
direction="row"
128-
justifyContent="space-between"
129-
sx={{ ...styles.controls, ...styles.rightAlign }}
130-
>
125+
<Grid container direction="row" justifyContent="space-between" sx={{ ...styles.controls, ...styles.rightAlign }}>
131126
<Grid item sx={styles.dropDown}>
132127
<Typography variant="body1">{channelStore.currentUserChannel?.id ?? 'None'}</Typography>
133128
</Grid>
@@ -174,12 +169,7 @@ export const Channels = observer(({ handleTabChange }: { handleTabChange: any })
174169
<Typography variant="h5">Join user channels</Typography>
175170
</Grid>
176171

177-
<Grid
178-
container
179-
direction="row"
180-
justifyContent="space-between"
181-
sx={{ ...styles.controls, ...styles.rightAlign }}
182-
>
172+
<Grid container direction="row" justifyContent="space-between" sx={{ ...styles.controls, ...styles.rightAlign }}>
183173
<Grid item sx={styles.dropDown}>
184174
<FormControl variant="outlined" sx={styles.channelsSelect} size="small" error={isError}>
185175
<InputLabel id="channel">Channel</InputLabel>
@@ -254,12 +244,7 @@ export const Channels = observer(({ handleTabChange }: { handleTabChange: any })
254244
<Typography variant="h5">Broadcast context</Typography>
255245
</Grid>
256246

257-
<Grid
258-
container
259-
direction="row"
260-
justifyContent="space-between"
261-
sx={{ ...styles.controls, ...styles.rightAlign }}
262-
>
247+
<Grid container direction="row" justifyContent="space-between" sx={{ ...styles.controls, ...styles.rightAlign }}>
263248
<Grid item sx={styles.dropDown}>
264249
<ContextTemplates handleTabChange={handleTabChange} contextStateSetter={setBroadcastContext} />
265250
</Grid>

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,7 @@ export const ContextLinking = observer(() => {
143143
<Typography variant="h5">Add context listener</Typography>
144144
</Grid>
145145

146-
<Grid
147-
container
148-
direction="row"
149-
justifyContent="space-between"
150-
sx={{ ...styles.controls, ...styles.rightAlign }}
151-
>
146+
<Grid container direction="row" justifyContent="space-between" sx={{ ...styles.controls, ...styles.rightAlign }}>
152147
<Grid item sx={styles.contextListenerName}>
153148
<Autocomplete
154149
id="context-listener"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ export const ContextTemplates = observer(
134134
filterOptions={filterOptions}
135135
options={contextsOptions}
136136
getOptionLabel={getOptionLabel}
137-
renderOption={(props: HTMLAttributes<HTMLLIElement>, option: OptionType) => <li {...props}>{option.title}</li>}
137+
renderOption={(props: HTMLAttributes<HTMLLIElement>, option: OptionType) => (
138+
<li {...props}>{option.title}</li>
139+
)}
138140
renderInput={params => (
139141
<TemplateTextField
140142
label="CONTEXT "

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

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,65 @@
33
* Copyright FINOS FDC3 contributors - see NOTICE file
44
*/
55

6-
import React from "react";
7-
import { observer } from "mobx-react";
8-
import appChannelStore from "../../store/AppChannelStore";
9-
import { AccordionList, AccordionListItem } from "../common/AccordionList";
10-
import { TextField } from "@mui/material";
11-
import { ReceivedField } from "./ReceivedField";
6+
import React from 'react';
7+
import { observer } from 'mobx-react';
8+
import appChannelStore from '../../store/AppChannelStore';
9+
import { AccordionList, AccordionListItem } from '../common/AccordionList';
10+
import { TextField } from '@mui/material';
11+
import { ReceivedField } from './ReceivedField';
1212

1313
const classes = {
14-
textField: {
15-
mt: 2,
16-
width: "100%",
17-
},
18-
input: {
19-
fontSize: "14px",
20-
},
14+
textField: {
15+
mt: 2,
16+
width: '100%',
17+
},
18+
input: {
19+
fontSize: '14px',
20+
},
2121
} as const;
2222

2323
export const AppChannelListeners = observer(() => {
24-
let contextListeners: AccordionListItem[] = [];
24+
let contextListeners: AccordionListItem[] = [];
2525

26-
appChannelStore.channelListeners.forEach(({ id, channelId, type, lastReceivedContext, metaData }) => {
27-
const receivedContextListenerValue = lastReceivedContext ? JSON.stringify(lastReceivedContext, undefined, 4) : "";
28-
const contextField = (
29-
<div>
30-
<TextField
31-
disabled
32-
label={"LAST RECEIVED CONTEXT"}
33-
sx={classes.textField}
34-
InputLabelProps={{
35-
shrink: true,
36-
}}
37-
contentEditable={false}
38-
fullWidth
39-
multiline
40-
variant="outlined"
41-
size="small"
42-
value={receivedContextListenerValue}
43-
InputProps={{
44-
sx: classes.input,
45-
}}
46-
/>
47-
{window.fdc3Version === "2.0" && <ReceivedField metaData={metaData} />}
48-
</div>
49-
);
26+
appChannelStore.channelListeners.forEach(({ id, channelId, type, lastReceivedContext, metaData }) => {
27+
const receivedContextListenerValue = lastReceivedContext ? JSON.stringify(lastReceivedContext, undefined, 4) : '';
28+
const contextField = (
29+
<div>
30+
<TextField
31+
disabled
32+
label={'LAST RECEIVED CONTEXT'}
33+
sx={classes.textField}
34+
InputLabelProps={{
35+
shrink: true,
36+
}}
37+
contentEditable={false}
38+
fullWidth
39+
multiline
40+
variant="outlined"
41+
size="small"
42+
value={receivedContextListenerValue}
43+
InputProps={{
44+
sx: classes.input,
45+
}}
46+
/>
47+
{window.fdc3Version === '2.0' && <ReceivedField metaData={metaData} />}
48+
</div>
49+
);
5050

51-
contextListeners.push({ id, textPrimary: `${channelId}: ${type}`, afterEachElement: contextField });
52-
});
51+
contextListeners.push({ id, textPrimary: `${channelId}: ${type}`, afterEachElement: contextField });
52+
});
5353

54-
const handleDeleteListener = (id: string) => {
55-
appChannelStore.removeContextListener(id);
56-
};
54+
const handleDeleteListener = (id: string) => {
55+
appChannelStore.removeContextListener(id);
56+
};
5757

58-
return (
59-
<AccordionList
60-
title="App Channels"
61-
icon="Any context already in the channel will NOT be received automatically"
62-
noItemsText="No App Channel Listeners"
63-
listItems={contextListeners}
64-
onDelete={handleDeleteListener}
65-
/>
66-
);
58+
return (
59+
<AccordionList
60+
title="App Channels"
61+
icon="Any context already in the channel will NOT be received automatically"
62+
noItemsText="No App Channel Listeners"
63+
listItems={contextListeners}
64+
onDelete={handleDeleteListener}
65+
/>
66+
);
6767
});

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

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,66 @@
33
* Copyright FINOS FDC3 contributors - see NOTICE file
44
*/
55

6-
import React from "react";
7-
import { observer } from "mobx-react";
8-
import contextStore from "../../store/ContextStore";
9-
import { AccordionList, AccordionListItem } from "../common/AccordionList";
10-
import { TextField } from "@mui/material";
11-
import { ReceivedField } from "./ReceivedField";
6+
import React from 'react';
7+
import { observer } from 'mobx-react';
8+
import contextStore from '../../store/ContextStore';
9+
import { AccordionList, AccordionListItem } from '../common/AccordionList';
10+
import { TextField } from '@mui/material';
11+
import { ReceivedField } from './ReceivedField';
1212

1313
const classes = {
14-
textField: {
15-
mt: 2,
16-
width: "100%",
17-
},
18-
input: {
19-
fontSize: "14px",
20-
},
14+
textField: {
15+
mt: 2,
16+
width: '100%',
17+
},
18+
input: {
19+
fontSize: '14px',
20+
},
2121
} as const;
2222

2323
export const ContextListeners = observer(() => {
24-
const contextListeners: AccordionListItem[] = contextStore.contextListeners.map(
25-
({ id, type, lastReceivedContext, metaData }) => {
26-
const receivedContextListenerValue = lastReceivedContext ? JSON.stringify(lastReceivedContext, undefined, 4) : "";
24+
const contextListeners: AccordionListItem[] = contextStore.contextListeners.map(
25+
({ id, type, lastReceivedContext, metaData }) => {
26+
const receivedContextListenerValue = lastReceivedContext ? JSON.stringify(lastReceivedContext, undefined, 4) : '';
2727

28-
const contextField = (
29-
<div>
30-
<TextField
31-
disabled
32-
label={"LAST RECEIVED CONTEXT"}
33-
sx={classes.textField}
34-
InputLabelProps={{
35-
shrink: true,
36-
}}
37-
contentEditable={false}
38-
fullWidth
39-
multiline
40-
variant="outlined"
41-
size="small"
42-
value={receivedContextListenerValue}
43-
InputProps={{
44-
sx: classes.input,
45-
}}
46-
/>
47-
{window.fdc3Version === "2.0" && <ReceivedField metaData={metaData} />}
48-
</div>
49-
);
28+
const contextField = (
29+
<div>
30+
<TextField
31+
disabled
32+
label={'LAST RECEIVED CONTEXT'}
33+
sx={classes.textField}
34+
InputLabelProps={{
35+
shrink: true,
36+
}}
37+
contentEditable={false}
38+
fullWidth
39+
multiline
40+
variant="outlined"
41+
size="small"
42+
value={receivedContextListenerValue}
43+
InputProps={{
44+
sx: classes.input,
45+
}}
46+
/>
47+
{window.fdc3Version === '2.0' && <ReceivedField metaData={metaData} />}
48+
</div>
49+
);
5050

51-
return { id, textPrimary: `${type}`, afterEachElement: contextField };
52-
}
53-
);
51+
return { id, textPrimary: `${type}`, afterEachElement: contextField };
52+
}
53+
);
5454

55-
const handleDeleteListener = (id: string) => {
56-
contextStore.removeContextListener(id);
57-
};
55+
const handleDeleteListener = (id: string) => {
56+
contextStore.removeContextListener(id);
57+
};
5858

59-
return (
60-
<AccordionList
61-
title="User Channels"
62-
icon="Any context already in the channel will be received automatically"
63-
noItemsText="No User Channel Listeners"
64-
listItems={contextListeners}
65-
onDelete={handleDeleteListener}
66-
/>
67-
);
59+
return (
60+
<AccordionList
61+
title="User Channels"
62+
icon="Any context already in the channel will be received automatically"
63+
noItemsText="No User Channel Listeners"
64+
listItems={contextListeners}
65+
onDelete={handleDeleteListener}
66+
/>
67+
);
6868
});

0 commit comments

Comments
 (0)