Skip to content

Commit

Permalink
Merge pull request #123 from luox-app/zain_bugs
Browse files Browse the repository at this point in the history
Fixing various bugs
  • Loading branch information
spitschan authored Nov 6, 2023
2 parents 4410061 + 38acc06 commit 63b657b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 24 deletions.
26 changes: 13 additions & 13 deletions src/javascript/components/Report.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ import "bootstrap/js/dist/alert";
const Report = () => {
const { id } = useParams();

const [rows, radianceOrIrradiance, measurementLabels] = urlToRows(id);
const [selectedRows, radianceOrIrradiance, measurementLabels] = urlToRows(id);

const sampleCount = rows[0].length - 1;
const selectedRowsSampleCount = selectedRows[0].length - 1;

const [isLoaded, setLoaded] = useState(true);
const [refHAB, setRefHAB] = useState(null);

const powerMode = sampleCount < 6;
const powerMode = selectedRowsSampleCount < 6;

return (
<div className="row">
<div className="col">
<div className="row mt-50 text-center">
<div className="col px-5">
<div
className="mt-3 alert alert-warning alert-dismissible fade show"
className="mt-5 text-center alert alert-warning alert-dismissible fade show"
role="alert"
>
The reproduced spectrum has been compressed and then decompressed, so
Expand All @@ -37,7 +37,7 @@ const Report = () => {
</button>
</div>

<h2 className="my-3">Light Exposure Report</h2>
<h2 className="my-3 mt-5">Light Exposure Report</h2>

<p>
This report meets the{" "}
Expand All @@ -51,16 +51,16 @@ const Report = () => {
{powerMode && (
<Chart
radianceOrIrradiance={radianceOrIrradiance}
rows={rows}
sampleCount={sampleCount}
selectedRows={selectedRows}
selectedRowsSampleCount={selectedRowsSampleCount}
measurementLabels={measurementLabels}
/>
)}
<h2 className="my-3">Stimulus specification tables</h2>

<CalculationTable
rows={rows}
sampleCount={sampleCount}
selectedRows={selectedRows}
selectedRowsSampleCount={selectedRowsSampleCount}
radianceOrIrradiance={radianceOrIrradiance}
measurementLabels={measurementLabels}
isLoaded={isLoaded}
Expand All @@ -72,8 +72,8 @@ const Report = () => {
<h2 className="my-3">Full spectral power distribution</h2>

<SpectraTable
rows={rows}
sampleCount={sampleCount}
selectedRows={selectedRows}
selectedRowsSampleCount={selectedRowsSampleCount}
radianceOrIrradiance={radianceOrIrradiance}
measurementLabels={measurementLabels}
/>
Expand Down
25 changes: 14 additions & 11 deletions src/javascript/components/Upload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,20 @@ const Upload = () => {
setLoaded={setLoaded}
setModalView={setModalView}
/>

<ManageCSV
rows={rows}
sampleCount={sampleCount}
setSelectedRows={setSelectedRows}
setSelectedRowsSampleCount={setSelectedRowsSampleCount}
measurementLabels={measurementLabels}
setMeasurementLabels={setMeasurementLabels}
modalView={modalView}
setModalView={setModalView}
/>
{modalView ? (
<ManageCSV
rows={rows}
sampleCount={sampleCount}
setSelectedRows={setSelectedRows}
setSelectedRowsSampleCount={setSelectedRowsSampleCount}
measurementLabels={measurementLabels}
setMeasurementLabels={setMeasurementLabels}
modalView={modalView}
setModalView={setModalView}
/>
) : (
<br />
)}

<Results
selectedRows={selectedRows}
Expand Down
2 changes: 2 additions & 0 deletions src/javascript/components/UploadForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ const UploadForm = ({
}
setLoaded(true);
setSampleCount(sampleCount);
setModalView(true);
} else {
setRows([]);
setSampleCount(0);
Expand All @@ -291,6 +292,7 @@ const UploadForm = ({
areaScale,
absoluteOrRelative,
relativePowers,
setModalView,
]);

return (
Expand Down
4 changes: 4 additions & 0 deletions src/stylesheets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@
.modal-lg {
--bs-modal-width: 70%;
}

.mt-50 {
margin-top: 50px !important;
}
@media screen and (max-width: 996px) {
.upload-div, .container {
max-width: 95% !important;
Expand Down

0 comments on commit 63b657b

Please sign in to comment.