Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zain bugs #123

Merged
merged 3 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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