@conorheffron/ironoc-frontend 7.5.1 → 7.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/NotFound.js +16 -20
- package/src/components/RepoIssues.js +172 -145
package/package.json
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Container } from 'reactstrap';
|
|
3
3
|
import '.././App.css';
|
|
4
4
|
import AppNavbar from '.././AppNavbar';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</Container>
|
|
22
|
-
</div>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
6
|
+
function NotFound({
|
|
7
|
+
title = "404 - Page Not Found",
|
|
8
|
+
message = "Sorry, the page you are looking for could not be found."
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<div className="App">
|
|
12
|
+
<AppNavbar />
|
|
13
|
+
<Container>
|
|
14
|
+
<header className="App-header">
|
|
15
|
+
<h1>{title}</h1>
|
|
16
|
+
<p id="my-intro">{message}</p>
|
|
17
|
+
</header>
|
|
18
|
+
</Container>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
export default NotFound;
|
|
@@ -10,168 +10,195 @@ import {
|
|
|
10
10
|
} from 'material-react-table';
|
|
11
11
|
import { darken, lighten, useTheme } from '@mui/material';
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const issueTags = [
|
|
14
|
+
'enhancement',
|
|
15
|
+
'bug',
|
|
16
|
+
'java',
|
|
17
|
+
'java-be',
|
|
18
|
+
'javascript',
|
|
19
|
+
'release',
|
|
20
|
+
'ui',
|
|
21
|
+
'frontend',
|
|
22
|
+
'infra',
|
|
23
|
+
'dependencies',
|
|
24
|
+
'python',
|
|
25
|
+
'python-code',
|
|
26
|
+
];
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const body = await response.json();
|
|
27
|
-
setRepoIssueList(body);
|
|
28
|
-
}
|
|
29
|
-
setIsLoading(false);
|
|
30
|
-
};
|
|
31
|
-
fetchIssues();
|
|
32
|
-
}, [id, repo]);
|
|
28
|
+
const RepoIssues = () => {
|
|
29
|
+
const params = useParams();
|
|
30
|
+
const navigate = useNavigate();
|
|
31
|
+
const { id = '', repo = '' } = params;
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
const [repoIssueList, setRepoIssueList] = useState([]);
|
|
34
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
35
|
+
const [value, setValue] = useState('');
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
navigate(0);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
const fetchIssues = async () => {
|
|
39
|
+
if (id && repo) {
|
|
40
|
+
const response = await fetch(`/api/get-repo-issue/${id}/${repo}/`);
|
|
41
|
+
const body = await response.json();
|
|
42
|
+
setRepoIssueList(body);
|
|
43
|
+
}
|
|
44
|
+
setIsLoading(false);
|
|
46
45
|
};
|
|
46
|
+
fetchIssues();
|
|
47
|
+
}, [id, repo]);
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
const handleChange = (event) => setValue(event.target.value);
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
const onSubmit = (event) => {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
navigate(`/issues/${id}/${value}`, {
|
|
54
|
+
replace: true,
|
|
55
|
+
state: {
|
|
56
|
+
id: id,
|
|
57
|
+
repo: value,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
navigate(0);
|
|
61
|
+
};
|
|
51
62
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
header: 'State',
|
|
70
|
-
filterVariant: 'multi-select',
|
|
71
|
-
size: 40,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
accessorKey: 'labels',
|
|
75
|
-
header: 'Labels',
|
|
76
|
-
filterVariant: 'multi-select',
|
|
77
|
-
filterSelectOptions: issueTags,
|
|
78
|
-
Cell: ({ cell }) => <b>{cell.getValue().join(', ')}</b>,
|
|
79
|
-
size: 100,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
accessorKey: 'title',
|
|
83
|
-
header: 'Title',
|
|
84
|
-
size: 150,
|
|
85
|
-
Cell: ({ cell }) => <b>{cell.getValue()}</b>,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
accessorKey: 'body',
|
|
89
|
-
header: 'Description',
|
|
90
|
-
size: 200,
|
|
63
|
+
const projectLink = `/projects/${id}/`;
|
|
64
|
+
|
|
65
|
+
// MaterialReactTable columns
|
|
66
|
+
const columns = useMemo(
|
|
67
|
+
() => [
|
|
68
|
+
{
|
|
69
|
+
accessorKey: 'number',
|
|
70
|
+
header: 'Issue No.',
|
|
71
|
+
Cell: ({ cell }) => {
|
|
72
|
+
const issueLink = `https://github.com/${id}/${repo}/issues/${cell.getValue()}/`;
|
|
73
|
+
return (
|
|
74
|
+
<a href={issueLink} target="_blank" rel="noreferrer">
|
|
75
|
+
<b>
|
|
76
|
+
<i>{cell.getValue()}</i>
|
|
77
|
+
</b>
|
|
78
|
+
</a>
|
|
79
|
+
);
|
|
91
80
|
},
|
|
92
|
-
|
|
81
|
+
size: 40,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
accessorKey: 'state',
|
|
85
|
+
header: 'State',
|
|
86
|
+
filterVariant: 'multi-select',
|
|
87
|
+
size: 40,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
accessorKey: 'labels',
|
|
91
|
+
header: 'Labels',
|
|
92
|
+
filterVariant: 'multi-select',
|
|
93
|
+
filterSelectOptions: issueTags,
|
|
94
|
+
Cell: ({ cell }) => <b>{cell.getValue().join(', ')}</b>,
|
|
95
|
+
size: 100,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
accessorKey: 'title',
|
|
99
|
+
header: 'Title',
|
|
100
|
+
size: 150,
|
|
101
|
+
Cell: ({ cell }) => <b>{cell.getValue()}</b>,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
accessorKey: 'body',
|
|
105
|
+
header: 'Description',
|
|
106
|
+
size: 200,
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
[id, repo]
|
|
110
|
+
);
|
|
93
111
|
|
|
94
|
-
|
|
112
|
+
const theme = useTheme();
|
|
95
113
|
|
|
96
|
-
|
|
97
|
-
|
|
114
|
+
//light or dark green
|
|
115
|
+
const baseBackgroundColor =
|
|
98
116
|
theme.palette.mode === 'dark'
|
|
99
117
|
? 'rgba(3, 44, 43, 1)'
|
|
100
118
|
: 'rgba(244, 255, 233, 1)';
|
|
101
119
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
baseBackgroundColor: baseBackgroundColor,
|
|
136
|
-
draggingBorderColor: theme.palette.secondary.main,
|
|
137
|
-
}),
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
if (isLoading) {
|
|
141
|
-
return (
|
|
142
|
-
<div className="App">
|
|
143
|
-
<AppNavbar />
|
|
144
|
-
<Container>
|
|
145
|
-
<br /><br /><br />
|
|
146
|
-
<LoadingSpinner />
|
|
147
|
-
</Container>
|
|
148
|
-
</div>
|
|
149
|
-
);
|
|
150
|
-
}
|
|
120
|
+
const table = useMaterialReactTable({
|
|
121
|
+
columns,
|
|
122
|
+
data: repoIssueList,
|
|
123
|
+
enableFacetedValues: true,
|
|
124
|
+
enableStickyHeader: true,
|
|
125
|
+
initialState: { showColumnFilters: true },
|
|
126
|
+
muiTablePaperProps: {
|
|
127
|
+
elevation: 0,
|
|
128
|
+
sx: {
|
|
129
|
+
borderRadius: '0',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
muiTableBodyProps: {
|
|
133
|
+
sx: (theme) => ({
|
|
134
|
+
'& tr:nth-of-type(odd):not([data-selected="true"]):not([data-pinned="true"]) > td': {
|
|
135
|
+
backgroundColor: darken(baseBackgroundColor, 0.1),
|
|
136
|
+
},
|
|
137
|
+
'& tr:nth-of-type(odd):not([data-selected="true"]):not([data-pinned="true"]):hover > td': {
|
|
138
|
+
backgroundColor: darken(baseBackgroundColor, 0.2),
|
|
139
|
+
},
|
|
140
|
+
'& tr:nth-of-type(even):not([data-selected="true"]):not([data-pinned="true"]) > td': {
|
|
141
|
+
backgroundColor: lighten(baseBackgroundColor, 0.1),
|
|
142
|
+
},
|
|
143
|
+
'& tr:nth-of-type(even):not([data-selected="true"]):not([data-pinned="true"]):hover > td': {
|
|
144
|
+
backgroundColor: darken(baseBackgroundColor, 0.2),
|
|
145
|
+
},
|
|
146
|
+
}),
|
|
147
|
+
},
|
|
148
|
+
mrtTheme: (theme) => ({
|
|
149
|
+
baseBackgroundColor: baseBackgroundColor,
|
|
150
|
+
draggingBorderColor: theme.palette.secondary.main,
|
|
151
|
+
}),
|
|
152
|
+
});
|
|
151
153
|
|
|
154
|
+
if (isLoading) {
|
|
152
155
|
return (
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
type="text"
|
|
163
|
-
value={value}
|
|
164
|
-
onChange={handleChange}
|
|
165
|
-
/>
|
|
166
|
-
<Button color="primary" variant="outline-secondary" id="button-addon2" onClick={onSubmit}>Search Issues</Button>
|
|
167
|
-
</InputGroup>
|
|
168
|
-
<h3 className="table-headers">
|
|
169
|
-
Issues for project <b>{repo}</b> and account <a href={projectLink}><b>{id}</b></a>
|
|
170
|
-
</h3>
|
|
171
|
-
<MaterialReactTable table={table} />
|
|
172
|
-
</Container>
|
|
173
|
-
</div>
|
|
156
|
+
<div className="App">
|
|
157
|
+
<AppNavbar />
|
|
158
|
+
<Container>
|
|
159
|
+
<br />
|
|
160
|
+
<br />
|
|
161
|
+
<br />
|
|
162
|
+
<LoadingSpinner />
|
|
163
|
+
</Container>
|
|
164
|
+
</div>
|
|
174
165
|
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<div>
|
|
170
|
+
<AppNavbar />
|
|
171
|
+
<br />
|
|
172
|
+
<br />
|
|
173
|
+
<Container fluid>
|
|
174
|
+
<br />
|
|
175
|
+
<InputGroup className="mb-3">
|
|
176
|
+
<Form.Control
|
|
177
|
+
placeholder="Enter Project Name... Example: ironoc-db"
|
|
178
|
+
aria-label="Enter Project Name..."
|
|
179
|
+
aria-describedby="basic-addon2"
|
|
180
|
+
type="text"
|
|
181
|
+
value={value}
|
|
182
|
+
onChange={handleChange}
|
|
183
|
+
/>
|
|
184
|
+
<Button
|
|
185
|
+
variant="outline-secondary"
|
|
186
|
+
id="button-addon2"
|
|
187
|
+
onClick={onSubmit}
|
|
188
|
+
>
|
|
189
|
+
Search Issues
|
|
190
|
+
</Button>
|
|
191
|
+
</InputGroup>
|
|
192
|
+
<h3 className="table-headers">
|
|
193
|
+
Issues for project <b>{repo}</b> and account{' '}
|
|
194
|
+
<a href={projectLink}>
|
|
195
|
+
<b>{id}</b>
|
|
196
|
+
</a>
|
|
197
|
+
</h3>
|
|
198
|
+
<MaterialReactTable table={table} />
|
|
199
|
+
</Container>
|
|
200
|
+
</div>
|
|
201
|
+
);
|
|
175
202
|
};
|
|
176
203
|
|
|
177
204
|
export default RepoIssues;
|