Skip to content

Commit 682ebf9

Browse files
committed
Remove the show observation switch.
1 parent fd5b2a1 commit 682ebf9

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

web/src/components/SchemaGraphDialog.tsx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export default function SchemaGraphDialog (props: Props) {
1515
const theme = useTheme();
1616
const styles = useStyles();
1717
const [selectedSources, setSelectedSources] = useState<string[]>([]);
18-
const [hideObservations, setHideObservations] = useState(true);
1918

2019
const handleSourceClick = (source: string) => {
2120
if (selectedSources.indexOf(source) === -1) {
@@ -37,16 +36,13 @@ export default function SchemaGraphDialog (props: Props) {
3736
<div className={styles.schemaGraphExplorer}>
3837
<SchemaGraphExplorer
3938
backgroundColor={theme.palette.background.default}
40-
sources={selectedSources}
41-
hideObservations={hideObservations} />
39+
sources={selectedSources} />
4240
</div>
4341
<div className={styles.leftControl}>
4442
<div className={styles.leftControlChild}>
4543
<SourcesList
4644
sources={props.sources.sort()}
4745
selected={selectedSources}
48-
showObservation={!hideObservations}
49-
onShowObservationsClick={() => setHideObservations(!hideObservations)}
5046
className={styles.sourcesList}
5147
onSourceClick={handleSourceClick} />
5248
</div>
@@ -119,23 +115,17 @@ const useStyles = makeStyles(theme => ({
119115
interface SourcesListProps {
120116
sources: string[];
121117
selected: string[];
122-
showObservation: boolean;
123118

124119
className?: string;
125120

126121
onSourceClick: (source: string) => void;
127-
onShowObservationsClick: () => void;
128122
}
129123

130124
function SourcesList(props: SourcesListProps) {
131125
const handleToggle = (source: string) => {
132126
return () => props.onSourceClick(source);
133127
}
134128

135-
const handleShowObservationsToggle = () => {
136-
props.onShowObservationsClick();
137-
}
138-
139129
const items = props.sources.map((s, i) => {
140130
return (
141131
<ListItem key={`item-${i}`} dense={true} onClick={handleToggle(s)}>
@@ -156,20 +146,6 @@ function SourcesList(props: SourcesListProps) {
156146

157147
return (
158148
<List className={props.className}>
159-
<ListItem dense={true} onClick={handleShowObservationsToggle}>
160-
<ListItemIcon>
161-
<Switch
162-
size="small"
163-
color="default"
164-
edge="start"
165-
checked={props.showObservation}
166-
tabIndex={-1}
167-
disableRipple
168-
inputProps={{ 'aria-labelledby': `show-source-observations-item` }}
169-
/>
170-
</ListItemIcon>
171-
<ListItemText id={`show-source-observations-item`} primary={"Show observations"} />
172-
</ListItem>
173149
{items}
174150
</List >
175151
)

web/src/components/SchemaGraphExplorer.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import D3Graph from "./D3Graph";
55
export interface Props {
66
sources: string[];
77

8-
hideObservations: boolean;
98
backgroundColor: string;
109
}
1110

@@ -25,12 +24,10 @@ export default function SchemaGraphExplorer (props: Props) {
2524
const [graph, ,] = useSchemaGraph(props.sources);
2625

2726
const nodes = graph ? graph.vertices
28-
.filter(v => !props.hideObservations || v !== "source")
2927
.map(v => ({ id: v, label: v, } as D3Node))
3028
: [];
3129

3230
const links = graph ? graph.edges
33-
.filter(e => !props.hideObservations || e.relation_type !== "observed")
3431
.map(e => ({
3532
id: `${e.from_type}-${e.relation_type}-${e.to_type}`,
3633
source: e.from_type,

0 commit comments

Comments
 (0)