feat(statsPage): dataset descriptor

parent 800b4d4f
......@@ -4,6 +4,7 @@ import { makeStyles } from "@material-ui/styles";
import { withPaddedPaper } from "./shared";
import SqlInterface from "../stats/RequestSQLHandler";
import DatasetSelector from "../stats/DatasetSelector";
import DatasetDescriptor from "../stats/DatasetDescriptor";
import {
availableDatasets,
changeDataset,
......@@ -37,6 +38,8 @@ function PageStats() {
value={currentDatasetName}
/>
</div>
<DatasetDescriptor columns={getDatasetColumns(currentDatasetName)} />
<div className={classes.requestInterface}>
<SqlInterface />
</div>
......
import React from "react";
import PropTypes from "prop-types";
import Typography from "@material-ui/core/Typography";
/**
* Component to display information about the dataset
*/
function DatasetDescriptor({ columns }) {
return (
<>
<Typography variant="body1">
Description des colonnes du jeu de données
</Typography>
{columns.map(({ name, description }) => (
<Typography variant="body2" key={name}>
<b>{name}</b>{description}
</Typography>
))}
</>
);
}
DatasetDescriptor.propTypes = {
columns: PropTypes.arrayOf(
PropTypes.shape({
name: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
})
).isRequired,
};
export default DatasetDescriptor;
......@@ -16,12 +16,39 @@ export const availableDatasets = [
{
name: "daily_connections",
label: "Nombre de connexions",
columns: [{ name: "", description: "" }],
columns: [
{ name: "date", description: "Date de la statistique" },
{
name: "nb_connections",
description: "Nombre de connexions journalières",
},
],
},
{
name: "daily_exchange_contributions",
label: "Nombre de contributions",
columns: [{ name: "", description: "" }],
columns: [
{ name: "date", description: "Date de la statistique" },
{ name: "university", description: "Université concernée" },
{
name: "major",
description: "Branche (ou TC / HUTECH) de l'étudiant lors de l'échange",
},
{ name: "minor", description: "Filière de l'étudiant lors de l'échange" },
{
name: "exchange_semester",
description: "Semestre aucour duquel l'échange a été effectué",
},
{
name: "type",
description:
"Type de contribution (avis sur l'échange ou avis sur les cours)",
},
{
name: "nb_contributions",
description: "Nombre de contributions journalières correspondant",
},
],
},
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment