Skip to content

Commit 5d731aa

Browse files
committed
Merge
2 parents 57f5bd2 + 80350df commit 5d731aa

File tree

6 files changed

+118
-5
lines changed

6 files changed

+118
-5
lines changed

backend/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ if (dev) {
7171
installExtension(REACT_DEVELOPER_TOOLS);
7272
});
7373
}
74-
7574
// Invoke createWindow to create browser windows after Electron has been initialized.
7675
app.on('ready', createWindow);
7776

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from 'react';
2+
import styled from 'styled-components';
3+
import {
4+
IconButton,
5+
ListItemSecondaryAction,
6+
Checkbox,
7+
Tooltip,
8+
} from '@material-ui/core';
9+
import CloseIcon from '@material-ui/icons/Close';
10+
import {
11+
SidebarListItem,
12+
StyledListItemText,
13+
textColor,
14+
} from '../../style-variables';
15+
import { QueryData } from '../../types';
16+
17+
const QueryText = styled(StyledListItemText)`
18+
& .MuiListItemText-secondary {
19+
color: ${textColor};
20+
}
21+
`;
22+
23+
const CompareCheck = styled(Checkbox)`
24+
color: ${textColor};
25+
`;
26+
27+
interface QueryDbnameProps {
28+
query: QueryData;
29+
isSelected: boolean;
30+
select: () => void;
31+
setComparison: (evt: React.ChangeEvent<HTMLInputElement>) => void;
32+
isCompared: boolean;
33+
deleteThisQuery: () => void;
34+
}
35+
36+
const QueryDbname = ({
37+
query,
38+
select,
39+
isSelected,
40+
setComparison,
41+
isCompared,
42+
deleteThisQuery,
43+
}: QueryDbnameProps) => (
44+
<SidebarListItem button $customSelected={isSelected} onClick={select}>
45+
<QueryText primary={query.db} />
46+
<ListItemSecondaryAction>
47+
<Tooltip title="View in Comparison">
48+
<CompareCheck onChange={setComparison} checked={isCompared} />
49+
</Tooltip>
50+
<Tooltip title="Forget Query">
51+
<IconButton edge="end" onClick={deleteThisQuery}>
52+
<CloseIcon />
53+
</IconButton>
54+
</Tooltip>
55+
</ListItemSecondaryAction>
56+
</SidebarListItem>
57+
);
58+
59+
export default QueryDbname;

frontend/components/sidebar/QueryEntry.tsx

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,25 @@ import {
1515
StyledListItemText,
1616
textColor,
1717
} from '../../style-variables';
18+
<<<<<<< HEAD
1819
import { QueryData, AppState } from '../../types';
20+
=======
21+
import { QueryData } from '../../types';
22+
import QueryDbname from './QueryDbname';
23+
import { deleteQuery, setCompare, key as queryKey } from '../../lib/queries';
24+
/******************* ACCORDION ***********************/
25+
import Accordion from '@mui/material/Accordion';
26+
import AccordionSummary from '@mui/material/AccordionSummary';
27+
import AccordionDetails from '@mui/material/AccordionDetails';
28+
import Typography from '@mui/material/Typography';
29+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
30+
>>>>>>> 80350dfe29619646ea4267ae79a66dd51b08a9e5
1931

2032
const QueryText = styled(StyledListItemText)`
2133
& .MuiListItemText-secondary {
2234
color: ${textColor};
2335
}
2436
`;
25-
2637
const CompareCheck = styled(Checkbox)`
2738
color: ${textColor};
2839
`;
@@ -47,10 +58,38 @@ const QueryEntry = ({
4758
saveThisQuery,
4859
}: QueryEntryProps) => (
4960
<SidebarListItem button $customSelected={isSelected} onClick={select}>
50-
<QueryText primary={query.label} secondary={query.db} />
61+
{/* <QueryText primary={query.label} /> */}
62+
5163
<ListItemSecondaryAction>
52-
<Tooltip title="View in Comparison">
53-
<CompareCheck onChange={setComparison} checked={isCompared} />
64+
<Tooltip title="drop down">
65+
{/* <CompareCheck onChange={setComparison} checked={isCompared} /> */}
66+
<div>
67+
<Accordion>
68+
<AccordionSummary
69+
expandIcon={<ExpandMoreIcon />}
70+
aria-controls="panel1a-content"
71+
id="panel1a-header"
72+
>
73+
<Typography>
74+
<QueryText primary={query.label} />
75+
</Typography>
76+
</AccordionSummary>
77+
<AccordionDetails>
78+
<Typography>
79+
{/* //if statement here */}
80+
<QueryDbname
81+
query={query}
82+
isSelected={isSelected}
83+
select={select}
84+
setComparison={setComparison}
85+
isCompared={isCompared}
86+
deleteThisQuery={deleteThisQuery}
87+
/>
88+
test
89+
</Typography>
90+
</AccordionDetails>
91+
</Accordion>
92+
</div>
5493
</Tooltip>
5594
<Tooltip title="Save Query">
5695
<IconButton onClick={saveThisQuery}>

nut

12.9 MB
Binary file not shown.

nut.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
syntax_version: "7"
2+
docker_image: calbertts/node-gtk
3+
enable_gui: true
4+
container_working_directory: /app
5+
work_in_project_folder_as: /app
6+
volumes:
7+
main:
8+
host_path: .
9+
container_path: /app
10+
macros:
11+
run:
12+
actions:
13+
- npm install
14+
- npm start

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@material-ui/icons": "^4.11.2",
3636
"@material-ui/lab": "^4.0.0-alpha.57",
3737
"@mui/icons-material": "^5.4.2",
38+
"@mui/material": "^5.4.3",
3839
"@mui/styled-engine": "^5.4.2",
3940
"@skidding/react-codemirror": "^1.0.2",
4041
"@types/react-router-dom": "^5.1.5",
@@ -55,6 +56,7 @@
5556
"pg": "^8.3.2",
5657
"react": "^17.0.1",
5758
"react-bootstrap": "^1.3.0",
59+
"react-bootstrap-accordion": "^1.0.0",
5860
"react-chartjs-2": "^2.11.1",
5961
"react-codemirror": "^1.0.0",
6062
"react-dom": "^17.0.1",

0 commit comments

Comments
 (0)