Skip to content

Commit 8c592b0

Browse files
authored
Merge pull request #558 from CodeForPhilly/492-update-admin-tab-ui
492: update admin tab UI
2 parents 768c993 + 99e6241 commit 8c592b0

File tree

1 file changed

+48
-44
lines changed

1 file changed

+48
-44
lines changed

src/client/src/pages/Admin.js

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -154,42 +154,46 @@ export default function Admin(props) {
154154

155155
<Grid container item spacing={5} direction="row" style={{padding: 20}}>
156156
<Grid container item direction="column" spacing={3} sm={6}>
157-
<Grid item>
158-
<Typography variant="h5">Latest Files</Typography>
159-
</Grid>
160-
<Grid item>
161-
{_.isEmpty(fileListHtml) !== true &&
162-
<TableContainer component={Paper}>
163-
<Table aria-label="simple table">
164-
<TableHead>
165-
<TableRow>
166-
<TableCell><b>File Type</b></TableCell>
167-
<TableCell><b>Last Updated</b></TableCell>
168-
</TableRow>
169-
</TableHead>
170-
<TableBody>
171-
{_.map(fileListHtml, (file, index) => {
172-
const fileName = file.split("-")[0];
173-
let fileDate = file.split("-").slice(1).join().split(".")[0];
174-
let fileDateOnlyNumbers = fileDate.replaceAll(",", "");
175-
let fileDateFormatted = moment(fileDateOnlyNumbers, "YYYYMMDDhmmss").local().format("MMMM Do YYYY, h:mm:ss a");
176-
177-
return (
178-
<TableRow key={index}>
179-
<TableCell>{fileName}</TableCell>
180-
<TableCell>{fileDateFormatted}</TableCell>
157+
{_.isEmpty(fileListHtml) !== true &&
158+
<>
159+
<Grid item>
160+
<Typography variant="h5">Latest Files</Typography>
161+
</Grid>
162+
<Grid item>
163+
<TableContainer component={Paper}>
164+
<Table aria-label="simple table">
165+
<TableHead>
166+
<TableRow>
167+
<TableCell><b>File Type</b></TableCell>
168+
<TableCell><b>Last Updated</b></TableCell>
181169
</TableRow>
182-
)
183-
})
184-
}
185-
</TableBody>
186-
</Table>
187-
</TableContainer>}
188-
</Grid>
170+
</TableHead>
171+
<TableBody>
172+
{_.map(fileListHtml, (file, index) => {
173+
const fileName = file.split("-")[0];
174+
let fileDate = file.split("-").slice(1).join().split(".")[0];
175+
let fileDateOnlyNumbers = fileDate.replaceAll(",", "");
176+
let fileDateFormatted = moment(fileDateOnlyNumbers, "YYYYMMDDhmmss").local().format("MMMM Do YYYY, h:mm:ss a");
177+
178+
return (
179+
<TableRow key={index}>
180+
<TableCell>{fileName}</TableCell>
181+
<TableCell>{fileDateFormatted}</TableCell>
182+
</TableRow>
183+
)
184+
})
185+
}
186+
</TableBody>
187+
</Table>
188+
</TableContainer>
189+
</Grid>
190+
</>
191+
}
189192
<Grid item>
190193
<Paper>
191194
<CardContent>
192195
<Typography variant="h5">Upload Files</Typography>
196+
<Typography variant="caption">Note: This upload feature now only accepts Volgistics data files. Other data is uploaded automatically.</Typography>
193197
<form onSubmit={handleUpload}>
194198
<input type="file" id="fileItemsID"
195199
value={filesInput}
@@ -205,6 +209,19 @@ export default function Admin(props) {
205209
</Grid>
206210
</Grid>
207211
<Grid container item direction="column" spacing={3} sm={6}>
212+
<Grid item>
213+
<Paper style={{ padding: 5 }}>
214+
<CardContent>
215+
<Typography variant="h5" styles={{paddingBottom: 5}}>Run New Analysis</Typography>
216+
<form onSubmit={handleExecute}>
217+
<Button type="submit" variant="contained" color="primary"
218+
disabled={statistics === 'Running'}>
219+
Run Data Analysis
220+
</Button>
221+
</form>
222+
</CardContent>
223+
</Paper>
224+
</Grid>
208225
<Grid item>
209226
<Typography variant="h5">Last Match Analysis</Typography>
210227
</Grid>
@@ -237,19 +254,6 @@ export default function Admin(props) {
237254
</TableContainer>
238255
}
239256
</Grid>
240-
<Grid item>
241-
<Paper style={{padding: 5, marginTop: 10}}>
242-
<CardContent>
243-
<Typography variant="h5" styles={{paddingBottom: 5}}>Run New Analysis</Typography>
244-
<form onSubmit={handleExecute}>
245-
<Button type="submit" variant="contained" color="primary"
246-
disabled={statistics === 'Running'}>
247-
Run Data Analysis
248-
</Button>
249-
</form>
250-
</CardContent>
251-
</Paper>
252-
</Grid>
253257

254258
</Grid>
255259
</Grid>

0 commit comments

Comments
 (0)